Part 1: Reception of data

(* receive data from CM574 –> DONE=TRUE -> new data available *)
bNewRecData := FALSE; (* reset new receive data *)
fbRecCM574_1( EN := TRUE, SLOT := cbySlotCM574_1, CH := cbyChannelCM574_1_1,
  DATA := ADR(abyRecDataCM574_1_1) );  
IF fbRecCM574_1.DONE THEN (* new receive *)
  IF NOT fbRecCM574_1.ERR THEN (* with error ? *)
    bRecErr := FALSE; (* receive OK *)
    bNewRecData := TRUE; (* new data received *)
  ELSE  
    bRecErr := TRUE; (* save receive error *)
    wRecErno := fbRecCM574_1.ERNO; (* save receive error number *)
  END_IF; (* ERR *)  
END_IF; (* Rec DONE *)