It has probably been asked before, but I can't seem to find any proper thread or answer to this,
so I'll try again
Is it possible to add several RTU devices to LM5 and then bridge them to modbus TCP as well?
Making the LM5 a modbus rtu to tcp gateway.
I Have several meters connected to my LM5 over rtu, and would like to expose these to another device on my network.
I already have a template for my meters on my other PLC, so would be great if i could expose my modbus devices
with the same register addresses, so no work on the PLC template are necessary.
I have tried this script, but as far as I can see, this script needs to map all modbus registers through knx before exposing them to modbus TCP again.
Wouldn't that make the original modbus addressing shift, so that I need to create new profiles on my receiving PLC?
So the first mapping defined in the list of registers, eg GA 1/3/67, would be exposed on Modbus TCP as register 0 and so on.
-- list of register mapping, starting from 0
registers = { '1/3/67' }
-- list of register data types, element count must match registers table
regdt = { dt.float32 }
I was looking for a solution were i could poll the modbus RTU devices by their actual modbus ID, and same register for each ID.
For instance:
ID: Register: Desc:
151 3019 Voltage A-B for slave #151
152 3019 Voltage A-B for slave #152
153 3019 Voltage A-B for slave #153
22.05.2021, 11:27 (This post was last modified: 22.05.2021, 11:34 by Erwin van der Zwart.)
Just use a EGX150 for this task, that is why we created it (:
Connect your RTU to the Link150 and read the devices from LM over IP and you can read them from any other location as well.. No configuration and scripts needed just set the IP and RTU settings and done.
Thanks guys! I bought a EGX150, and waiting for it to arrive
Still interessted in a solution to send control commands to my NSX devices over RTU (trv00210).
Have you seen my PM Erwin? Seems like the script isn't working for me.
Did you unlock the locking pad on the IFM interface?
• protected by password where a password is required in the command
• protected by configuration: ◦ with the IFM interface, the remote control commands are enabled when the locking pad on the IFM interface is in the open position.
In sample below the used password is 0000 (ASCII 00 = 00110000 00110000 => 12336 in Decimal)
Code:
require('luamodbus')
mb = luamodbus.rtu()
mb:open('/dev/RS485', 19200, 'E', 8, 1, 'H')
mb:connect()
mb:setslave(1)
if event.getvalue() == true then
mb:writeregisters(7999, 904, 10, 4353,1,12336,12336,0,0,0,0,0,0,0,0,0,0,0,8019,8020,8021) -- Open command
else
mb:writeregisters(7999, 905, 10, 4353,1,12336,12336,0,0,0,0,0,0,0,0,0,0,0,8019,8020,8021) -- Close command
end
mb:close()
The IFM interface is in the unlocked position. I've just tried with your password 0000, as I don't think or know if there's been set any other user password on these devices.
Could that be changed og checked with some software tools?
(25.05.2021, 08:57)Erwin van der Zwart Wrote: Did you unlock the locking pad on the IFM interface?
• protected by password where a password is required in the command
• protected by configuration: ◦ with the IFM interface, the remote control commands are enabled when the locking pad on the IFM interface is in the open position.
In sample below the used password is 0000 (ASCII 00 = 00110000 00110000 => 12336 in Decimal)
Code:
require('luamodbus')
mb = luamodbus.rtu()
mb:open('/dev/RS485', 19200, 'E', 8, 1, 'H')
mb:connect()
mb:setslave(1)
if event.getvalue() == true then
mb:writeregisters(7999, 904, 10, 4353,1,12336,12336,0,0,0,0,0,0,0,0,0,0,0,8019,8020,8021) -- Open command
else
mb:writeregisters(7999, 905, 10, 4353,1,12336,12336,0,0,0,0,0,0,0,0,0,0,0,8019,8020,8021) -- Close command
end
mb:close()
Hi Erwin,
Since I can't fiqure out how to send an attachment in PM, i'll just try here.
yes, they skould be equiped with those. It goes some wiring inside the NSX breakers, and in the circuit diagram there's a circuit-breaker called Supply for NSX motors.
I've added a few more modbus registers to my profile, and I now try to read out the status registers 8020 and 8021.
I get the following response:
8020 = 905 ( command for close )
8021 = 775 ( error kode 7?, which means: Negative acknowledgment, The slave cannot perform the programming request sent by the master. )