Modbus slave TCP sample code, setting Modbus ID?

MartyMaucher

Member
Join Date
May 2014
Location
Pensacola
Posts
91
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

Looking for some advice on a project. The controller is a BMEP584040. There is a RIO ring with several drops with Quantum I/O. On this ring...
Replies
12
Views
994
CR3000 HMI ModBus TCP/IP Master has gotten erratic after increasing block size to 24 at DA70A in Protocol 1. What should a practical guide be for...
Replies
2
Views
559
Well, probably have to take a road trip for this but I'm not understanding something more fundamental about Modbus TCP. I thought it can handle...
Replies
5
Views
1,519
Hi all, Sorry to seek help here as I am run out of idea. recently i need to use my PLC(Schneider M580-Unitypro) as Modbus TCP Master to read...
Replies
2
Views
4,383
I successfully got a Micro 820 (Slave) and Red Lion HMI (Master) to work together using Modbus TCP. But now I need to add an Automation Direct...
Replies
3
Views
2,659
Back
Top Bottom