CODESYS - the IEC 61131-3 automation software

Welcome to the official CODESYS Forum by 3S-Smart Software Solutions GmbH | A member of the CODESYS Group
Deutsche Version English version russian version 
It is currently Thu Feb 20, 2020 11:52 am

All times are UTC+01:00

Post new topic  Reply to topic  [ 2 posts ] 
Author Message
PostPosted: Wed Mar 20, 2019 2:05 pm 

Joined: Tue Mar 19, 2019 1:46 pm
Posts: 1
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 *)
   pComIn:= ADR(stIn_EL6001),
   pComOut:= ADR(stOut_EL6001),
   SizeComIn:= SIZEOF(stIn_EL6001),
   Error=> bEL6001CtrlError,
   ErrorID=> eEL6001CtrlErrorID,
   TxBuffer:= GVL.TxBufferEL,
   RxBuffer:= GVL.RxBufferEL );

You do not have the required permissions to view the files attached to this post.

PostPosted: Sat Mar 30, 2019 11:04 am 
User avatar

Joined: Sat Aug 08, 2015 10:01 am
Posts: 56
Do you call the background Communication in a fast Task Sa described in the Beckhoff Dokumentation?
And what about Hardware Handshaking RTS, CTS,

Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 2 posts ] 

All times are UTC+01:00

Who is online

Users browsing this forum: No registered users and 5 guests

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Limited