TwinCAT Serial Communication beckhoff

Vijolica555

Member
Join Date
Apr 2018
Location
Germany
Posts
21
Hello guys!

If anybody has any experience with serial communication in TwinCAT with Beckhoffs PLCs, would be really helpful.

I Have:
- CX2020 PLC
- EL6021 Terminal
- Vibration sensor with requirements:
- RS485A and B cable connected to TxD+ and TxD-
- enabled half duplex
- 115200 baud, 1 stop bit 8 data bits, no parity

In that case I changed next parameters at EL6021 - > CoE:
- 80000:06 TRUE
- 4073 115200 Baud
- 8000:11 115200 Baud
- 8000:1B 115200 Baud
- 4075:01 TRUE

I made Fast Task because baud rate is high:
https://infosys.beckhoff.com/englis...ml/tc3_functions_6.htm&id=3549058403083650480

But my communication is not working when I send a test string I do not receive expected string..

Anyone has any idea what to do? What I am missing? What should be additionally done?

I also changed RS485A and B cables between TxD+ and - in case they are changed..
 
Hello,

Thank you I will check it.

I am using Tc2_SerialCom lib from where I use next FBs:
- SendString255
- ReceiveString255

And for Fast Task:
- SerialLineControl
- Comreset

With test string I mean test command which is configured in sensor and which should send me model of the sensor and LED at sensor should blink once.. When nothing is received LED is ON and not blinking.

In the link you send me I can see you were talking about other FBs and also had another lib.. Do you hink i need both? I have my inputs and outputs all connected: Status, Data in, Ctrl and Data out..
 
Sorry, I concluded by default that you're using Modbus RTU, now I see that you mentioned only RS-485 and not a protocol. Libraries that I refered to are used for Modbus RTU.

I haven't worked with FBs you mentioned, but first step would be to see what error are you getting in output variable Error of the FB SendString255. Here you can see possible error codes - https://infosys.beckhoff.com/englis.../9007200709779211.html&id=8620406013194343054.
 
Hello,

Thank you.#

In that case is used lib. GENIbus, I am using lib. SerialCom.. DO you know what is the difference?

I don't know.

I would say phone Beckhoff.

I've done some serial-communication but I used one of their programma's for this.

And:

a) Library TcUtilities.lib & COMlibV2.lib



BuBut I used a CP6666 and not an EL-card.
 
Hello Guys,

So I tried everything and missed mistake where I wrote <CR> command on prefix instead on suffix that comes in Receivestring255. If someone comes to the similar problem:)
 
Yes, I used RS-485 with a Beckhoff EtherCAT system. The EL6021 sounds familiar. You need the correct driver and license. From my old notes:
TS6360 is for TwinCAT 2
TF6360 is for TwinCAT 3
Initially, Beckhoff sent me the wrong one.

I was using EtherCAT just as a path, leveraging the existing cables to the remote location. I needed a Windows program from Tescom, running on our HMI PC, to communicate with their ER3000. The Beckhoff driver allowed it to appear as a COM port# in Windows. There was no PLC code involved. I could have avoided this by using a USB to RS-485 adapter, but I wanted to be clever. Your case may be different.
 

Similar Topics

Good morning everyone, This is my first post here. I am beginning my journey on PLC programming and still a really newbie, I want to write a...
Replies
0
Views
1,209
HI, I'm working with Beckhoff CX5020 series PLC and I'm using Serial ComLibV2 library for serial communication(RS422). The problem I have is I...
Replies
3
Views
3,801
Good morning all! ( at least fo he ones living around the GMT+1 area:P) Im having some problems with my program while using serial...
Replies
2
Views
2,258
Is it possible to change settings for an El6001 serial terminal when running the plc ? I know how to config the port manually in system...
Replies
0
Views
1,239
Sorry if this has been asked before, and apologies if this seems like a trivial issue, but I am new to Beckhoff and have been banging my head...
Replies
1
Views
60
Back
Top Bottom