<?xml version="1.0" encoding="utf-8"?>
<feed xml:lang="en" xmlns="http://www.w3.org/2005/Atom"><title>Recent posts to Serial Communication - EL 6001 in TwinCAT</title><link href="https://forge.codesys.com/forge/talk/CODESYS-V2/thread/289fa15d46/" rel="alternate"/><link href="https://forge.codesys.com/forge/talk/CODESYS-V2/thread/289fa15d46/feed.atom" rel="self"/><id>https://forge.codesys.com/forge/talk/CODESYS-V2/thread/289fa15d46/</id><updated>2020-02-27T21:48:21.564000Z</updated><subtitle>Recent posts to Serial Communication - EL 6001 in TwinCAT</subtitle><entry><title>Serial Communication - EL 6001 in TwinCAT</title><link href="https://forge.codesys.com/forge/talk/Codesys%2520V2.3/thread/289fa15d46/?limit=25#f199" rel="alternate"/><published>2020-02-27T21:48:21.564000Z</published><updated>2020-02-27T21:48:21.564000Z</updated><author><name>sampatheee</name><uri>https://forge.codesys.com/u/sampatheee/</uri></author><id>https://forge.codesys.comfcd6bc0f6f57ca003f89a2b14d0815a0ca9a5fa2</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;For ur refernce i am attaching u my program.&lt;/p&gt;
&lt;p&gt;LaserOnTrigg(Clk:=HMI.TL1_LaserOnRq);&lt;/p&gt;
&lt;p&gt;IF LaserOnTrigg.Q   THEN&lt;br/&gt;
Sensor.TRILAS1LaserOnSet:=TRUE;&lt;br/&gt;
END_IF;&lt;/p&gt;
&lt;p&gt;IF Sensor.TRILAS1LaserOnSet  AND NOT TRILAS1Cmd4B_LASERON.Msg4BComm.SERIAL_INTERFACE.xCOM_PORT_IS_OPEN THEN&lt;br/&gt;
    OpenCOMPort4B:=TRUE;&lt;br/&gt;
    StartDataTransmit4B := FALSE;&lt;br/&gt;
    TRILAS1Cmd4B_LASERON(&lt;br/&gt;
                                    StartTransmit:=StartDataTransmit4B,&lt;br/&gt;
                                    OpenCOMPort:=OpenCOMPort4B,&lt;br/&gt;
                                    DeviceAddress:=HMI.TL1_DeviceAddress,&lt;br/&gt;
                                    COMAddressInData:=COM1AddressInData,&lt;br/&gt;
                                    COMAddressOutData:=COM1AddressOutData&lt;br/&gt;
                                    );&lt;br/&gt;
ELSIF Sensor.TRILAS1LaserOnSet  AND  TRILAS1Cmd4B_LASERON.Msg4BComm.SERIAL_INTERFACE.xCOM_PORT_IS_OPEN THEN&lt;br/&gt;
    StartDataTransmit4B:=TRUE;&lt;br/&gt;
    TRILAS1Cmd4B_LASERON(&lt;br/&gt;
                                    StartTransmit:=StartDataTransmit4B,&lt;br/&gt;
                                    OpenCOMPort:=OpenCOMPort4B,&lt;br/&gt;
                                    DeviceAddress:=HMI.TL1_DeviceAddress,&lt;br/&gt;
                                    COMAddressInData:=COM1AddressInData,&lt;br/&gt;
                                    COMAddressOutData:=COM1AddressOutData&lt;br/&gt;
                                    );&lt;br/&gt;
    IF TRILAS1Cmd4B_LASERON.StartTransmit = FALSE THEN&lt;br/&gt;
        StartDataTransmit4B:=FALSE;&lt;br/&gt;
        Sensor.TRILAS1LaserOnSet := FALSE;&lt;br/&gt;
    END_IF;&lt;br/&gt;
ELSIF NOT Sensor.TRILAS1LaserOnSet   AND  TRILAS1Cmd4B_LASERON.Msg4BComm.SERIAL_INTERFACE.xCOM_PORT_IS_OPEN THEN&lt;br/&gt;
    OpenCOMPort4B:=FALSE;&lt;br/&gt;
    StartDataTransmit4B:=FALSE;&lt;br/&gt;
    TRILAS1Cmd4B_LASERON(&lt;br/&gt;
                                    StartTransmit:=StartDataTransmit4B,&lt;br/&gt;
                                    OpenCOMPort:=OpenCOMPort4B,&lt;br/&gt;
                                    DeviceAddress:=HMI.TL1_DeviceAddress,&lt;br/&gt;
                                    COMAddressInData:=COM1AddressInData,&lt;br/&gt;
                                    COMAddressOutData:=COM1AddressOutData&lt;br/&gt;
                                    );&lt;br/&gt;
END_IF;&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Serial Communication - EL 6001 in TwinCAT</title><link href="https://forge.codesys.com/forge/talk/Codesys%2520V2.3/thread/289fa15d46/?limit=25#9172" rel="alternate"/><published>2020-02-27T21:48:17.356000Z</published><updated>2020-02-27T21:48:17.356000Z</updated><author><name>sampatheee</name><uri>https://forge.codesys.com/u/sampatheee/</uri></author><id>https://forge.codesys.come69a3985810e54eca5f01712ea0cb1f4d916310a</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;ok i will try to do this way..&lt;/p&gt;
&lt;p&gt;if i want to change the hardware like now i am having 758-870 to 750- 841,is i need to change in software only library r anything else...&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Serial Communication - EL 6001 in TwinCAT</title><link href="https://forge.codesys.com/forge/talk/Codesys%2520V2.3/thread/289fa15d46/?limit=25#283d" rel="alternate"/><published>2020-02-27T21:48:15.857000Z</published><updated>2020-02-27T21:48:15.857000Z</updated><author><name>shooter</name><uri>https://forge.codesys.com/u/shooter/</uri></author><id>https://forge.codesys.com139ff32bed39483f8859340c4cf82fe32d91c9c0</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;it depends on the speed you are using, if you ask it every second then close comms every minute.to get rid of any mal bits.&lt;br/&gt;
no it is not needed to close down a rs232 port, i2c and lots of industrial busses you will need to stop, to give others a change to talk, but in rs232 there is only one conection.&lt;br/&gt;
just try it without closing as it will speed up the comms.&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Serial Communication - EL 6001 in TwinCAT</title><link href="https://forge.codesys.com/forge/talk/Codesys%2520V2.3/thread/289fa15d46/?limit=25#4efa" rel="alternate"/><published>2020-02-27T21:48:11.518000Z</published><updated>2020-02-27T21:48:11.518000Z</updated><author><name>sampatheee</name><uri>https://forge.codesys.com/u/sampatheee/</uri></author><id>https://forge.codesys.com723f5ec40fb32896a5a4ce961ed9691fb476eba8</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Dear All,&lt;/p&gt;
&lt;p&gt;I am new this forum &amp;amp; also new for Codesys...i am going ask a doubt in serial interface&lt;/p&gt;
&lt;p&gt;We are doing serial communication between Wago 750-851 and TRILAS (is a Sensor).in this i have doubt on like i am closing and opening the port after receving expected(bytes) message from sensor this is correct are not or always i have to keep open the port...Please if anybody knew answer help me...&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Serial Communication - EL 6001 in TwinCAT</title><link href="https://forge.codesys.com/forge/talk/Codesys%2520V2.3/thread/289fa15d46/?limit=25#fc66" rel="alternate"/><published>2020-02-27T21:48:10.009000Z</published><updated>2020-02-27T21:48:10.009000Z</updated><author><name>shooter</name><uri>https://forge.codesys.com/u/shooter/</uri></author><id>https://forge.codesys.comf9624e6dd5a4efe0c992471307a0266010b9b761</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;unknown type is meaning you have a variable not declared correct.&lt;br/&gt;
or the type is not in the datatypes list (could be coming from a library)&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Serial Communication - EL 6001 in TwinCAT</title><link href="https://forge.codesys.com/forge/talk/Codesys%2520V2.3/thread/289fa15d46/?limit=25#e6e9" rel="alternate"/><published>2020-02-27T21:48:08.506000Z</published><updated>2020-02-27T21:48:08.506000Z</updated><author><name>tech007</name><uri>https://forge.codesys.com/u/tech007/</uri></author><id>https://forge.codesys.combdf391f4733cd2cfcca5f05fe805c26fcc1cb87b</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Hello Friends,&lt;/p&gt;
&lt;p&gt;I am new to this forum. And I am new to field of programming of PLC as well. I used Allen Bradley before some years back and now, i have to use Beckhoff PLC for my research work.&lt;/p&gt;
&lt;p&gt;I like to read the data from external device for the temperature control. I like to read the data through RS 242 port in Beckhoff PLC. The sequence of this PLC (EK 1100 PLC driver,EL6001 Interface and KL 9010 End connector). As CPU,we are using Industrial PC from Beckhoff C69xx. We are using TwinCAT here with Ether CAT field bus.&lt;/p&gt;
&lt;p&gt;Can anybody help me to do programming with this ? Or guide me how to proccede with this task ?&lt;/p&gt;
&lt;p&gt;The programme is below. I can send and receive the sring but i can't read the temperature.I check the baudrate and other thing is all right. But still i can't read it.&lt;/p&gt;
&lt;p&gt;The code is mentioned below :&lt;/p&gt;
&lt;hr/&gt;
&lt;p&gt;Timer(IN:=TRUE, PT:=T#1s);&lt;br/&gt;
IF Timer.Q OR Send.Busy THEN&lt;/p&gt;
&lt;p&gt;(&lt;em&gt;Send( SendString:= '$02Hello World - $03',&lt;/em&gt;)&lt;br/&gt;
Send( SendString:= 'S1',&lt;br/&gt;
TXbuffer:= TxBuffer1, (&lt;em&gt; see global variables &lt;/em&gt;)&lt;br/&gt;
Busy=&amp;gt; SendBusy,&lt;br/&gt;
Error=&amp;gt; SendErrorID);&lt;/p&gt;
&lt;p&gt;Timer(IN:=FALSE); (&lt;em&gt; reset timer &lt;/em&gt;)&lt;br/&gt;
END_IF&lt;/p&gt;
&lt;p&gt;Receive(&lt;br/&gt;
(&lt;em&gt; Prefix:= '$02',&lt;br/&gt;
Suffix:= '$03',&lt;br/&gt;
Prefix:= '$N',&lt;br/&gt;
Suffix:= '$R',&lt;/em&gt;)&lt;br/&gt;
Prefix:= '$0F',&lt;br/&gt;
Suffix:= '$12',&lt;br/&gt;
Timeout:= T#1s,&lt;br/&gt;
ReceivedString:= ReceivedString,&lt;br/&gt;
RXbuffer:= RxBuffer1,&lt;br/&gt;
StringReceived=&amp;gt; StringReceived,&lt;br/&gt;
Busy=&amp;gt; ReceiveBusy,&lt;br/&gt;
Error=&amp;gt; ReceiveErrorID,&lt;br/&gt;
RxTimeout=&amp;gt; ReceiveTimeout );&lt;br/&gt;
IF StringReceived THEN&lt;br/&gt;
ReceiveCounter := ReceiveCounter + 1;&lt;br/&gt;
LastReceivedString := ReceivedString;&lt;br/&gt;
END_IF&lt;/p&gt;
&lt;p&gt;COMportControl(&lt;/p&gt;
&lt;p&gt;Mode:= SERIALLINEMODE_EL6_22B,&lt;br/&gt;
pComIn:= ADR(COMin_EL6001), (&lt;em&gt; I/O data; see global variables &lt;/em&gt;)&lt;br/&gt;
pComOut:= ADR(COMout_EL6001), (&lt;em&gt; I/O data; see global variables &lt;/em&gt;)&lt;br/&gt;
SizeComIn:= SIZEOF(COMin_EL6001), (&lt;em&gt; I/O data; see global variables &lt;/em&gt;)&lt;br/&gt;
TxBuffer:= TxBuffer2, (&lt;em&gt; Transmit buffer; see global variables &lt;/em&gt;)&lt;br/&gt;
RxBuffer:= RxBuffer2, (&lt;em&gt; Receive buffer; see global variables &lt;/em&gt;)&lt;br/&gt;
Error=&amp;gt; COMportControlError,&lt;br/&gt;
ErrorID=&amp;gt; COMportControlErrorID );&lt;/p&gt;
&lt;hr/&gt;
&lt;p&gt;Variables :&lt;/p&gt;
&lt;p&gt;RxBuffer2: ComBuffer; (&lt;em&gt; Receive data buffer; used with all receive function blocks &lt;/em&gt;)&lt;br/&gt;
TxBuffer2: ComBuffer; (&lt;em&gt; Transmit data buffer; used with all receive function blocks &lt;/em&gt;)&lt;br/&gt;
COMin_EL6001 AT %IB66 : KL6inData22B; (&lt;em&gt;Linked with EL6001TwinCAT System Manager &lt;/em&gt;)&lt;br/&gt;
COMout_EL6001 AT %QB66 : KL6outData22B;(&lt;em&gt;Linked with EL6001TwinCAT System Manager &lt;/em&gt;)&lt;/p&gt;
&lt;hr/&gt;
&lt;p&gt;I all configure 22 bytes of Input and Output from the EL6001 Module. I want to take daata types EL6inData22B and EL6outData22B respectively&lt;br/&gt;
but i am getting error that unknown type ??!!&lt;/p&gt;
&lt;p&gt;Help me out through this. It's quite urgent.&lt;/p&gt;
&lt;p&gt;Thanks in advance.&lt;/p&gt;
&lt;p&gt;Tech007&lt;/p&gt;&lt;/div&gt;</summary></entry></feed>