Posts: 411
Threads: 103
Joined: Oct 2016
Reputation:
9
Hello
I'm looking for documentation of luamodbus library but I can't find any.
I've found these functions are implemented:
Code:
close
connect
open
readinputregisters
readregisters
readregisters
readregistervalue
rtu
setdebug
setresponsetimeout
setslave
tcp
writeregisters
Anything else?
LM5Lp, firmware: 2018.08.22 and 2021.12.15, FlashSYS v2, ARMv7 Processor rev 5 (v7l), kernel 4.4.151 and 4.4.259
Posts: 7758
Threads: 42
Joined: Jun 2015
Reputation:
447
What functions do you need? Most cases are handled by profiles so direct ModBus access is not needed.
Posts: 411
Threads: 103
Joined: Oct 2016
Reputation:
9
I need to implement functions:
0x01 read control switch status - ???
0x02 read input status - ??? - Is it readinputregisters?
0x03 read register value - This can be readregistervalue but I'm not sure
0x05 write control switch value - ???
0x06 write register value - Maybe it is writeregisters?
The device is a cooler from China. I'm afraid I can't use profiles because this device is 'unique' in many ways. One of them is it returns the same packet in case the command was successful. And I've to read the packet and set feedback object according to this. Another problem is I have to process commands step by step and misuse can damage the device. I know it can be done by calling of GA but I see it too dangerous.
Unfortunately I don't know if I'm allowed to publish the specification I've got co I can't post it here.
LM5Lp, firmware: 2018.08.22 and 2021.12.15, FlashSYS v2, ARMv7 Processor rev 5 (v7l), kernel 4.4.151 and 4.4.259
Posts: 7758
Threads: 42
Joined: Jun 2015
Reputation:
447
If the device does not fully conform to ModBus protocol then you might need to directly access RS485 port via serial library.
Posts: 411
Threads: 103
Joined: Oct 2016
Reputation:
9
At least CRC calculator would be helpful. It has to be implemented in luamodbus. Does it have a public interface?
Or more general question. Is there some kind of 'reflection' available in Lua in case you don't have source codes for included library?
I tried log(require('luamodbus'))
log (require('luamodbus').rtu())
but with no success.
LM5Lp, firmware: 2018.08.22 and 2021.12.15, FlashSYS v2, ARMv7 Processor rev 5 (v7l), kernel 4.4.151 and 4.4.259
Posts: 411
Threads: 103
Joined: Oct 2016
Reputation:
9
Perfect, thank you!
LM5Lp, firmware: 2018.08.22 and 2021.12.15, FlashSYS v2, ARMv7 Processor rev 5 (v7l), kernel 4.4.151 and 4.4.259