About Modbus TCP

Topics about the Hardware of Revolution Pi
Post Reply
Julian
Posts: 13
Joined: 28 Jun 2019, 09:41
Answers: 0

About Modbus TCP

Post by Julian »

We can see that it is possible to do Modbus RTU master as the RevPi Connect has the on-board RS485 port, but we are not sure how we can then map the Modbus RTU data to the Ethernet/IP gateway module.

Do you have any information on how to map data addressing between on-board Modbus RTU RS485 port and the Ethernet/IP gateway? (or other gateway such as PROFINET).



---

EtherNet/IP is the protocol supported by Allen-Bradley PLC’s and also some other PLC manufacturers, it is not the standard TCP/IP protocol supported by standard Ethernet ports and regular devices. From what I can tell the onboard Ethernet ports on the RevPi support EtherNet/IP protocol.

We need to read data from the Modbus RTU slave into the RevPi acting as Modbus RTU master. Then we need to read data from the RevPi which is acting as EtherNet/IP Adapter (slave) into the external PLC which is acting as EtherNet/IP Scanner (master).

Some more info here about difference between EtherNet/IP and regular TCP/IP communications

https://www.rtautomation.com/technologies/ethernetip/



Now for example, we want to read 3 values from the Modbus RTU slave and map them across to the EtherNet/IP gateway module so that it can be read by the external Allen-Bradley PLC using EtherNet/IP protocol.


Power Meter
Modbus RTU
Slave Node 1 RevPi
EtherNet/IP Gateway
Adapter / Slave
Description Address Address
Power HR40001 DATA_OUT.WORD[0]
Current HR40002 DATA_OUT.WORD[1]
Frequency HR40003 DATA_OUT.WORD[2]
Pic1.png
Pic1.png (13.48 KiB) Viewed 5206 times
User avatar
dirk
KUNBUS
Posts: 1942
Joined: 15 Dec 2016, 13:19
Answers: 4

Re: About Modbus TCP

Post by dirk »

Hallo Julian, ich bin mir nicht sicher, ob die Überschrift zum Thema passt, denn Du verwendest doch Modbus-RTU, oder?
Du benötigst ein Programm auf dem RevPi, welches Daten vom Produzenten zum Konsumenten überträgt.
Also Modbus RTU zu Ethernet/IP Slave. Du machst Deine PiCtory Konfiguration und dadurch kennst Du die Variablen von ModbusRTU Master und EtherNet/IP Slave.
Als Applikation kannst Du z.B. ein Python Skript erstellen. Einige Beispiele findest Du hier im Forum:
Example Scripts
BitMirror
Kleiner Tipp mit der RevPiModIO Python Library geht das sehr einfach.
bbuchan8
Posts: 1
Joined: 12 Mar 2020, 12:12
Answers: 0

Re: About Modbus TCP

Post by bbuchan8 »

Hi Dirk,

Is it possible to use Node-Red to address the variables defined for the RevPi Modbus RTU master and EtherNet/IP Gateway slave once they have been defined in PiCtory? I was hoping we could use this to transfer the data between protocols.

Regards,

Brendan
User avatar
dirk
KUNBUS
Posts: 1942
Joined: 15 Dec 2016, 13:19
Answers: 4

Re: About Modbus TCP

Post by dirk »

Hi Brendan, yes you can access the data with the variables in the process image of your device. All you have to do is to make your PiCtory hardware configuration. Then you cann access the variables via node-red i.e. via the "exec"-node using the piTest tool. I.e. this command "piTest -q -1 -r Input_1".
thestumbler
Posts: 7
Joined: 10 Dec 2019, 00:41
Answers: 0

Re: About Modbus TCP

Post by thestumbler »

You can also use the C library Libmodbus for modbus tcp. We are doing this with the RevPi and have found the library to be very effective.
Post Reply