TwinCat - EL6001 Serial Communication

  • fscotto-ch

    fscotto-ch - 2019-03-20

    Hi All,
    I am new to TwinCat and PLC programming and I am working towards integrating it in my current project. I am using a CX5120 and I want to use an EL6001 module to send string commands to a peristaltic pump through an RS232 connector. I have been through a series of tutorials and example files but I have been unable to establish any communication with the device. I hope this forum will help me shed some light on the matter.
    I have linked the in/out Data22B to the EL6001 Inputs/Outputs but both the write and receive string commands give no results although I have no errors warnings. Is there a specific setup of the EL6001 module that needs to be executed? Or can you please send any suggestion? Thanks in advance.

    Here is the VAR list:

       (* I/O variables for a EL6001 terminal*)
       stIn_EL6001 AT %I*    : EL6inData22B; (* linked to the EL6001 Inputs/Status*)
       stOut_EL6001 AT %Q*    : EL6outData22B;(* linked to the EL6001 Outputs/Ctrl *)
       (* background communication with the EL6001 terminal *)
       fbEL6001Ctrl       : SerialLineControl;
        bEL6001CtrlError   : BOOL;
        eEL6001CtrlErrorID : ComError_t;
       clearBuffer : ClearComBuffer;
       writeValue : SendString;
       readValue : ReceiveString;
       sReceivedString : STRING;

    And the program:

    writeValue(SendString := '1H$R' , TXbuffer := GVL.TxBufferEL);
    readValue(ReceivedString := sReceivedString, RXbuffer := GVL.RxBufferEL);
    IF writeValue.Error = 0 THEN
       (* background communication with the EL6001 terminal *)
       Mode:= SERIALLINEMODE_EL6_22B, 
       pComIn:= ADR(stIn_EL6001), 
       pComOut:= ADR(stOut_EL6001), 
       SizeComIn:= SIZEOF(stIn_EL6001), 
       Error=> bEL6001CtrlError, 
       ErrorID=> eEL6001CtrlErrorID, 
       TxBuffer:= GVL.TxBufferEL, 
       RxBuffer:= GVL.RxBufferEL );

    IMG: Capture.PNG

  • wollvieh

    wollvieh - 2019-03-30

    Do you call the background Communication in a fast Task Sa described in the Beckhoff Dokumentation?
    And what about Hardware Handshaking RTS, CTS,


Log in to post a comment.