ProgLogConfuser

Programmatically Change IP address of Target Module

8 posts in this topic

I have a 2 CompactLogix PLCs running right now, communicating CIP Safety and Standard data over Ethernet I/P.  For reasons I can't explain right now, the IP address of the second one HAS TO change semi-randomly (the 1st PLC is static).  Setting the 2nd PLC's IP to static or assigning it a static DHCP address is the obvious solution, but for the purpose of this question, that cannot be done.

Is there a way to programmatically change its IP address on the 1st PLC's program?  (There is an HMI attached to the 1st PLC and adding a screen to enter in the new address would be trivial.)  The only bit I'm still missing is how do I change the IP address on the module in the 1st PLC so that it's pointed at the right IP address of the 2nd one when it changes.    I found instructions on how to use msg instructions, but that hasn't worked yet.  Any help would be appreciated.

Thanks!

Share this post


Link to post
Share on other sites

Are you using Producer/Consumer tags?  If so, you're officially screwed.  There's no documented way to change the I/O tree programmatically.  I suspect that Rockwell's Systems group can do so, as there is a GSV that yields an instance ID for selected I/O devices.  I've never found the CIP class number and attribute lists that would go with it, unfortunately.

If you are using messaging, you are in luck.  The MESSAGE data type that goes with a message instruction contains a binary encoding of the complete connection path.  It claims to be a STRING data type, but really is binary encoded.  IP addresses themselves are ASCII within the binary connection path.  That part can be replaced with string operations.  You'll have to take care to adjust the byte (length) just ahead of the IP address, and pad the ASCII to an even number of bytes (but don't include the pad in the length byte.  If you share your MESSAGE instruction's path "string" content, I can help you decode it for dynamic reconstruction.

Share this post


Link to post
Share on other sites

I just noticed you said CIP Safety data was in the link.  I think you are screwed.

Share this post


Link to post
Share on other sites

If you can limit the number of possible addresses for the 2nd PLC, you might get away with creating all of those instances in the 1st PLC's I/O tree, then programmatically inhibiting the ones you aren't using.  There's an SSV that can do that.

Share this post


Link to post
Share on other sites

Nothing against the OP but if this was possible I would expect Rockwell to close that hole asap

Edited by Michael Lloyd

Share this post


Link to post
Share on other sites

When I first read the question, I though it was about a Logix PLC changing its OWN IP address.  That is possible and fully documented (TCP/IP object class 0xF5, instance attribute #5) in the Ethernet/IP specification.

Changing an I/O tree target IP is the part that isn't possible.

Share this post


Link to post
Share on other sites

Sorry about that, I don't have notifications setup right and didn't see anyone had responded.

Yes, I am talking about programmatically changing I/O target IP.   I figured it's 'not possible' but thought I'd get a 2nd opinion.  Thanks!

 

Share this post


Link to post
Share on other sites

There is one possibility:

Rockwell lets you use hostnames instead of IP addresses in the I/O tree, as long as your network interface has addresses for DNS servers.  If you change the IP that goes with a given DNS name in your DNS infrastructure, you should be able to indirectly change the runtime target IP address.

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