24.07.2018, 18:25 (This post was last modified: 24.07.2018, 18:26 by josep.)
Good afternoon
I have a Modbus calorie meter connected to the RS485-2 port of my LM5pL and I would like to know how I have to do it to read 32bit values in Modbus RTU using scripts, thank you very much.
THX.
Hello again, I try to communicate using this code, I can read something but I don't know if it's correct, thank you
(25.07.2018, 06:59)admin Wrote: You should really use a profile here
You have an issue with multiplier, there should be a dot separator instead of comma:
Code:
1
grp.update('32/2/1', res101*0.01)
There's an optional third argument for readregistervalue - word/byte swap. Default value is w. More info here: http://openrb.com/docs/modbus.htm
Code:
1
res103 = mb:readregistervalue(3, "uint32", "n")
In this case we need to use scripting instead of profile because we're already using profile for RS485-1 modbus communication with a different baud rate.
Appart from these issues, is the script ok?
Is it correct to use os.sleep into the script?
25.07.2018, 09:38 (This post was last modified: 25.07.2018, 09:39 by AEK.)
(25.07.2018, 08:52)David Wrote:
(25.07.2018, 06:59)admin Wrote: You should really use a profile here
You have an issue with multiplier, there should be a dot separator instead of comma:
Code:
1
grp.update('32/2/1', res101*0.01)
There's an optional third argument for readregistervalue - word/byte swap. Default value is w. More info here: http://openrb.com/docs/modbus.htm
Code:
1
res103 = mb:readregistervalue(3, "uint32", "n")
In this case we need to use scripting instead of profile because we're already using profile for RS485-1 modbus communication with a different baud rate.
Appart from these issues, is the script ok?
Is it correct to use os.sleep into the script?
Thank you very much for your responses. I have an LM5Lp so I have used the imx6 file (I understand that it is the processor that carries the lite power) once this is done I have rebooted the Logic Machine but everything remains the same, if I go to the Modbus option I only see one of the two ports of which the equipment has, any solution? Thank you very much.
Thank you very much for your responses. I have an LM5Lp so I have used the imx6 file (I understand that it is the processor that carries the lite power) once this is done I have rebooted the Logic Machine but everything remains the same, if I go to the Modbus option I only see one of the two ports of which the equipment has, any solution? Thank you very much.
go to system configuration - system - packages and check ghenom-scada-modbus version. it should be 20171103. if it's not press "green plus" button and install package.
25.07.2018, 11:38 (This post was last modified: 25.07.2018, 11:39 by josep.)
Hi,
thank you AEK, I clear a browser cache and now it works fine. Now I have a problem with some Modbus adresses, I make a Profile for a heat meter but It not read a LONG format, I define it with uint32 and I use the first of the two adresses number. For example to define Acumulated Head I used this:
you can't read any value, or get incorrect value? is there any errors in error log tab? maybe you need read swap option. as Admin said - try to use RTU read test button, it will help you to define correct params
I read some values correctly and the others not work, it value is 0 all the time, this values has defined as LONG and use two modubs adresses. The other problem is that sometimes Modbus have a Timeout problem and it apears in Error Log.