Part 3: Transmission of dataΒΆ

bSendDone := FALSE; (* reset send done *)
IF fbSendCM574_1.EN OR bNewSendData THEN (* send activ or new cycle ? *)
  fbSendCM574_1( EN := TRUE, SLOT := cbySlotCM574_1, CH := cbyChannelCM574_1_1,
    DATA := ADR(abySendDataCM574_1_1),  
    DATA_LEN := cdwMaxSend + 1); (* run send POU *)
  IF fbSendCM574_1.DONE THEN (* last send is now ready *)
    IF fbSendCM574_1.ERR THEN (* error in last SEND *)
      bSendErr := TRUE; (* save send error *)
      wSendErno := fbSendCM574_1.ERNO; (* save error number *)
    ELSE  
      bSendErr := FALSE; (* no error in last transmission *)
      bSendDone := TRUE; (* data successfully transmitted *)
    END_IF; (* ERR *)  
    fbSendCM574_1 (EN := FALSE); (* call with EN:=FALSE for new edge *)
  END_IF; (* DONE *)  
END_IF; (* EN *)