Welcome to our new forum
All users of the legacy CODESYS Forums, please create a new account at account.codesys.com. But make sure to use the same E-Mail address as in the old Forum. Then your posts will be matched.
Close
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:
VAR  (*I/OvariablesforaEL6001terminal*)  stIn_EL6001AT%I*  :EL6inData22B;(*linkedtotheEL6001Inputs/Status*)  stOut_EL6001AT%Q*  :EL6outData22B;(*linkedtotheEL6001Outputs/Ctrl*)    (*backgroundcommunicationwiththeEL6001terminal*)  fbEL6001Ctrl    :SerialLineControl;  bEL6001CtrlError  :BOOL;  eEL6001CtrlErrorID:ComError_t;    clearBuffer:ClearComBuffer;  writeValue:SendString;  readValue:ReceiveString;  sReceivedString:STRING;    END_VAR
And the program:
writeValue(SendString:='1H$R',TXbuffer:=GVL.TxBufferEL);readValue(ReceivedString:=sReceivedString,RXbuffer:=GVL.RxBufferEL);IFwriteValue.Error=0THEN  (*backgroundcommunicationwiththeEL6001terminal*)  fbEL6001Ctrl(  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);END_IF
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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:
And the program:
Do you call the background Communication in a fast Task Sa described in the Beckhoff Dokumentation?
And what about Hardware Handshaking RTS, CTS,