Sign in to follow this  
Followers 0
Sector7

ML1400 UDP communication problems with different subnets

5 posts in this topic

Hi all, I am working on an application to send a UDP message from a AB MicroLogix 1400 to PC. I have been able to successfully write a UDP message using the MSG instruction to make use of the underlying socket interface. I can also receive a message over UDP. My problem is when I change the IP addresses of the PLC and PC, I no longer receive the messages. When the PLC is configured with an IP/subnet mask of 172.22.16.188/255.255.252.0 and the PC is configured with an IP/subnet mask of 172.22.16.189/255.255.252.0 all works well. When the PLC is configured with an IP/subnet mask of 192.168.1.6/255.255.255.0 and the PC is configured with an IP/subnet mask of 192.168.1.189/255.255.255.0 no messages are received. All indications from the ladder logic show the socket write was successful (no errors and the correct len in bytes written field of the receive address). I have a managed switch mirroring all ports to the port where the PC is connected. I am running Wireshark on the PC and do not see any indication that the messages are sent. I cannot see any ARPs requesting the MAC of the PC (192.168.1.189) and do not see the UDP message sent out. I can see the traffic to and from the PLC and HMI as well as the PLC and RS Logix. Does this make any sense to anyone? I have not changed any logic, just the IP addresses. The PLC seems to think the message was sent out. What might I be doing wrong? Thank you for any help anyone might have.

Share this post


Link to post
Share on other sites
What is the Default Gateway in each case ? Is it always set to 0.0.0.0 ? And maybe the most important question: Why use a UDP socket interface when the MicroLogix is equipped with a very commonly used TCP-transported protocol supported by dozens of commercial and a few open-source drivers ?

Share this post


Link to post
Share on other sites
The default gateway is 172.22.16.1 and 192.168.1.1 for the respective subnet. In neither case does the gateway actually exist. For my dev work, I have the system (PLC, HMI and PC) on a 5 port managed switch with no other devices. I chose UDP for simplicity. I have debated whether TCP would be better or not. The system will have 60 or so (starting out only one or two, but is planned to be plant wide) PLCs that will send a message to VC# program that I am writing. The VC# program will store the data in the message in a database. Once the VC# has written the data to the database, it will send a UDP message to the originating PLC saying the message has been read and it is ok to proceed. I chose UDP so I could have one common port for each device to write to and one port for the program to have to service (as opposed to one connection for each device). Do you think TCP would be better in this situation? While we are discussing the MicroLogix TCP/UDP abilities, I have found it rather cumbersome to program the messages in RS Logix. I am sending string data to the Host PC (VC# program). ex: "5, 1223, 100, 9AD453, 24" ==> device id, employee id, customer id, part number, quantity because the MicroLogix 1400 series A only allows Integer files to be used in the data transfer, I have to use home-made logic to copy the string data to an integer file and then byte swap the data. And of course there is the issue of copying the characters (bytes) to integers (words) and the fact the MicroLogix interprets the integers as signed only. So I wound up using longs to avoid overflows. Am I missing something simple, or is this the way you have to use the socket interface? I hope it is ok to ask another question in the same topic. If need be I can open another topic. Thank you for any advice or help.

Share this post


Link to post
Share on other sites
Sector7 can you please send me the configuration of the msg instruction i want also use UDP in my application thank you

Share this post


Link to post
Share on other sites
Hi All, Im also working on UDP using Studio5000 and AB 1769-L33ERM. I follow the manual of AB but still not able to make it work. I already created the User Defined Data Types (Socket Address,etc) for UDP communication. Im stuck at the first step - CREATE SOCKET. It always show different errors when I configure it. The process are: 1. Create Socket 2. Open Connection 3. Write My Only objective - just give commands to a third party device using AB PLC. I'm nearly giving up, If someone here can please share a .ACD file configuration on how the UDP for Allen Bradley PLC works - you are my savior! Edited by banyas

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0