Modbus slave TCP sample code, setting Modbus ID?

Anyone use the ModbusSlaveTCP.L5X for CompactLogix? I have it installed and cannot seem to set the Modbus (Instrument) ID. I'm expecting to set an integer to a 1 in the configuration, but see this 82 character array with a couple of hex(?) characters in it.

modbusID.jpg
 
I am not familiar with CompactLogix so please forgive me if I am talking nonsense, but it has been my experience that the ID is not relevant for Modbus TCP. It has use in serial modbus communication, where multiple modbus slaves can be "listening" on the same serial connection. Think RS485 which is not a point to point protocol: there can be multiple devices on a single RS485 bus. In such cases the modbus master must make clear for which client a call is intended, hence the ID in the modbus protocol.

No such need on Modbus TCP: the IP address already takes care of getting the message across to the slave.
 
I seem to have a more basic problem with talking Ethernet Modbus (default port 502) to this CompactLogix L35E controller.

The L35E controller seems to accept a connection on port 44818, but the PLC software is looking for incoming messages on port 502 (can't see where to change that, but I would like to keep it at 502).

I have done this before with a newer L33 controller and it talked Modbus fine on port 502. I guess this is a limitation of the older L35E (?)
 
In TCP connections, the server has the listening port (usually 502 for Modbus TCP) and the client connects using a high port number (always => 1024) that usually changes with each new connection.
The one that matters is the server port because it is the one that the clients connect to.
 

Similar Topics

Hi everyone, I recently organized and released two Modbus debugging tools that I maintain personally, and I would like to share them here for...
0
Replies
312
Views
Hello everyone, My name is Sam, and I am currently working on a project involving two Beckhoff CX9020-0115 PLCs. Both PLCs are equipped with a...
0
Replies
725
Views
Using a Schneider M172P. I have a Modbus RTU master configured on RS485-2 (because only -2 can be a master), and a Modbus/TCP server configured on...
1
Replies
839
Views
Our manufacturing floor has several machines with PLCs which are not connected to our network. Instead, the ethernet port of the PLC is connected...
9
Replies
3,568
Views
I don't do Modbus often, but have enough that this should be easy. I have a handful of addresses I need to read from a Modbus TCP device and I'm...
8
Replies
2,067
Views
Top