Generic (not explicitly defined) commands with HMS-EN2SE-R

Hi,

I am deploying a new system consisting of an Allen-Bradley CompactLogix (L340ER), the HMS-EN2SE-R, and 10 identical Modbus RTU slave devices. The CompactLogix controller will write to and read from specific registers in each node using commands defined in the gateway.

But I would also like to have the ability to read or write to any register in any node from the CompactLogix controller, without having this command defined explicitly in the gateway device. The idea would be to specify the node, modbus command, and register in the controller and then trigger the transaction. I can’t see a specific way to do this. Is it possible?

Thanks,

Keith Brewster

Hello kbrewster,

This is doable but you will need to create a custom request in the modbus format. When setting it up you will set the register and node ID as data objects from the PLC.

Deryck

That is good news. Two follow up questions:

  1. Where is the transaction defined in the Configuration Manager? It seems that all transactions need to be defined under a node. But in doing this, doesn’t is specify the device address for the transaction? Or is the device address overridden by the inclusion of the node ID in the transaction data?

  2. Is there a tutorial or example of how to set up this type of transaction?

Thanks,

Keith

The node ID set is used when using the built in modbus commands, since you will be creating your own transaction this will not be used. You will need to create the transactions from the ground up and will need to have an understanding of the MODBUS protocol. I would recommend taking a look at http://www.simplymodbus.ca/FAQ.htm it breaks down each transactions. You will also need to make sure you are writing your PLC program to take into account how you are writing the node ID and registers.

We don’t have any tutorials or examples for something like this typically for modbus user would be using the built in commands. If you are interested we do offer services where we could develop a configuration for you or offer some 1:1 training to help set up a configuration.

I believe I understand the structure of Modbus packets. I will test it and see if I can get it to work.

I want to make sure I understand what you are saying. In the Configuration Manager, I understand that a pre-defined Modbus command is under a a Node with the address of the slave device. But a general Transaction must also go under a Node on the subnetwork, and this node also has a slave address. Are you saying that this node slave address is ignored for a general transaction? Or should this transaction be located under a Broadcaster node instead? In a Modbus packet the slave node address is the first byte in the packet.

Thanks,

Keith

Yes the node id will be ignored when creating your own transactions. You can see this as the Slave Address when you add a command. This is filled in based on the node the command is added to.

You should be able to edit a command deleting the lines that are prefilled and add data objects as needed in their place.

Deryck

Got it working. Thanks!

1 Like

Awesome! Always good to hear a things are working!