Control Logix UDP Data Transfer

whussain6

Member
Join Date
Oct 2013
Location
Newcastle
Posts
108
Hi,

I am trying to design Modbus UDP driver. I have already designed and tested Modbus TCP and RTU drivers. Now the requirement is to send the Modbus request using UDP/IP in addition to TCP/IP.

I have changed the Socket create message parameter 'Type' to 2 i.e. UDP (1 for TCP) but it does not seem to work. The socket is created and connected successfully , but my read/write messages not working. Write message showing no error but not sure where it is writing to? Read message showing error 0xff with extended error code 16#0046 which seem like if both read/write are triggered at the same time. It is definitely not the case as I have used not read/write enable to trigger the next message.

I am also not sure if I am testing it correctly. I have modbus simulator downloaded which I have used for Modbus TCP testing and works fine. Not sure if it allows Modbus RTU so I am open to test if using two EN2T modules in the same rack if some one please guide me how. Thanks
 
Logix Socket UDP Read does not work the same way as TCP Read on all modules (except EWEB):

TCP read is getting DN bit when Read buffer is empty, while UDP Read is getting error that should be handled.

Saying this, Modbus UDP is not something standard and common, so before you invest your time, take a look to make sure there is no TCP implementation on your server.

Also please take a look at new Logix Modbus TCP AOIs recently released in the Sample Code library - these are officially supported by Rockwell.
 
Hi Conn,
Thanks for reply.

My TCP AOI is actually based in the sample code provided by Rockwell.

I have tested TCP using Modbus Simulator downloaded on my PC on port 502.

I am now trying to add facility to select UDP or TCP mode. I assumed that just by changing the Type to 2 would work keeping everything else the same. Is it not just sending the same data over UDP rather than TCP?
 
I am very familiar with new AOI code as well as earlier version 1.02.

No, it will not work the way that you are expecting, there is no easy way to convert from TCP to UDP.

This is not about changing Type from 1 to 2 like you think.

First, you will not use "Connect" or "Accept" messages with UDP.
Then, "Read" difference between UDP and TCP that I have mentioned earlier, you will have to separate valid errors from "Empty buffer" error.

Also, TCP is a stream, and code assembles this stream, then parses the data.
UDP is a just a single packet. Every time it comes, it wipes the earlier data from the buffer.
So basically, you will have to re-write whole socket portion of the code that is 60% of the it...
 
Last edited:
So, it is recommended h that, in light of the COVID19 outbreak, that all TCP-based protocols be switched over to use UDP to cut down on handshaking. ;)
 

Similar Topics

I am having trouble with getting no control of my analog output signal. I am using the SCL function block to control my analog output. The logic...
Replies
11
Views
261
hi all, i have a plc i need to get info from for a site im working on: I have a 1764 Micro Logix 1500 LSP Series C (See Attached Image) im...
Replies
2
Views
383
I currently have a weird issue involving Ethernet IP communication between a ABB CI873 (EthernetIP Module) and a 1756-L83ES. The Layout is as...
Replies
8
Views
766
Possible for two processors in same rack to have separate motion groups across a single Kinetix Rack using a single EN3TR? One 6500/5700 rack, 8...
Replies
1
Views
428
Hi all! I am hoping to find some help understanding the ABB VFD Connection to my Rockwell PLC. I have set up the VFD parameters based on...
Replies
4
Views
678
Back
Top Bottom