Allen Bradley Get Controller IP address programically? 5x70 and 5x80 controllers

theColonel26

Lifetime Supporting Member
Join Date
Feb 2014
Location
West Michigan
Posts
783
Is there a way to get the IP address of the controller programmatically? This would be for the 5x70 and 5x80 controller series.


Motivation:



I am creating a code library for our customers to communicate with EIP to our machines. I am trying to make it has idiot proof as possible. Each machine connecting to our PLC would use a different element in an array, this prevents collisions and allows me to track who requested what. The only problem with this is, it requires the Customer to not be stupid by having 2 different PLCs write in to the same array element.

So I thought what if I send the IP address of the customers PLCs in every request so that I can have some code on my end to detect if more than one machine is trying to write in to the same element.


P.S. I am using a Read/Write from the customer side so that I can keep my code as standard as possible.
 
Yes, via MSG. Get Single Attribute. Class f5, instance 1, attribute 5. It has been a long while since I've looked at this, but I think the first 4 bytes were the IP address, in the reverse order ([0] was the last octet).
 
Last edited:
I confirmed with a quick test on my 1756-L61 with a 1756-ENBT in Slot 6, so the Path is (1,6).

The result should be 22 bytes long, so make a target tag that's a SINT[22] or larger.

My module's configuration:

IP = 192.168.21.21
Subnet Mask = 255.255.255.0
Default Gateway = 192.168.21.1
Primary DNS = 192.168.21.1
Secondary DNS = 75.75.75.75

As Dustin recalled correctly, the octets are in 4-3-2-1 descending order in the array.

Class F5 is the TCP/IP object, so it will be the same for any A-B controller or Ethernet module. I'm not certain what the path to the onboard/integrated Ethernet "module" for a modern CompactLogix is; I'd like confirmation of that.

F5_1_5_Result.PNG
 
I think the question is answered, but in case it might be of interest to someone, here is the specification for instance attribute 5 of the TCP/IP Interface Object (Class ID 0xF5):

TCPIPObjectInstanceAttribute5.png
 

Similar Topics

The site I am working with has a site-wide DeltaV SCADA system. I am working on a package that all falls under a single ControlLogix controller...
Replies
1
Views
1,847
Hi, this is my very first thread. I am a PLC enthusiest and am setting up an AB compactlogix 1769-L35E controller with some relays at home to play...
Replies
14
Views
3,075
can we use Allen-Bradley 1756-L55 controller to communicate with MVI56-MCM Modbus communication module
Replies
4
Views
1,926
Hi im trying to connect my pico to my laptop but I cant configure the com port for usb. it works okay on a different laptop with the serial cable...
Replies
7
Views
2,036
Hello everyone, Our system is composed with a computer where a C++ homemade program is running. This application gets/sends data using a OPC...
Replies
10
Views
3,897
Back
Top Bottom