ModeBus with serial interface
See original GitHub issueHello
This is not a bug but a question seeking help as I could not find them in documents.
I am trying to use this module to connect to a battery that supports Modbus and read data. Using the software that came with battery is working so my connections and battery are working, but I am not able to configure the different parameters.
I am always getting timeout when trying simple getter as below
[{"id":"88deba32.459178","type":"tab","label":"Flow 1"},{"id":"7443f003.00d78","type":"modbus-getter","z":"88deba32.459178","name":"","showStatusActivities":true,"showErrors":true,"unitid":"38","dataType":"Coil","adr":"4096","quantity":"1","server":"e71eb878.ef5e08","useIOFile":false,"ioFile":"","useIOForPayload":false,"x":340,"y":80,"wires":[["ae00dbc8.95ef18"],[]]},{"id":"73612a54.d8e954","type":"inject","z":"88deba32.459178","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"x":140,"y":40,"wires":[["7443f003.00d78"]]},{"id":"ae00dbc8.95ef18","type":"debug","z":"88deba32.459178","name":"","active":true,"console":"false","complete":"true","x":530,"y":40,"wires":[]},{"id":"e71eb878.ef5e08","type":"modbus-client","z":"88deba32.459178","name":"battery1","clienttype":"serial","bufferCommands":true,"stateLogEnabled":true,"tcpHost":"127.0.0.1","tcpPort":"502","tcpType":"DEFAULT","serialPort":"COM3","serialType":"RTU","serialBaudrate":"9600","serialDatabits":"8","serialStopbits":"1","serialParity":"none","serialConnectionDelay":"100","unit_id":38,"commandDelay":10,"clientTimeout":1000,"reconnectTimeout":2000}]
From the document of the battery, I concluded the following
BMS code switch value range 0~15,The BMS communication base address 38,BMS communication address is sum of code switch value and communication base address. UnitId = 38
RegId for voltage is 0x1000 so I used Address 4096
and I used quantity 1.
Is my conclusion correct about the different settings, is their a definition of what is UnitId, Address, RegId
Thanks
contribModbus:core:client Client -> {"info":"queue read msg","message":{"value":1517841108577,"unitid":"38","fc":1,"address":"4096","quantity":"1","messageId":"5a786ad41c82fb1d1c27e4f0"},"state":"EMPTY","queueLength":1} Serial@COM3:9600bit/s default Unit-Id: 38 +1ms
contribModbus:getter {"topic":"7443f003.00d78","payload":{"value":1517841108577,"unitid":"38","fc":1,"address":"4096","quantity":"1","messageId":"5a786ad41c82fb1d1c27e4f0"},"_msgid":"d053c53f.5f1068","queueNumber":0,"queueUnit":38} +19ms
contribModbus:core:client Client -> {"state":"QUEUEING","message":"dequeue command serial","delay":10} Serial@COM3:9600bit/s default Unit-Id: 38 +15ms
contribModbus:core:client Client -> {"type":"queue check","unitid":38,"sendAllowed":true,"queueLength":1} Serial@COM3:9600bit/s default Unit-Id: 38 +0ms
contribModbus:core:client Client -> {"type":"serial sending and wait","unitid":38,"queueLength":0,"sendAllowedForNext":false,"delay":10} Serial@COM3:9600bit/s default Unit-Id: 38 +3ms
contribModbus:core:client Client -> {"info":"read msg","message":{"value":1517841108577,"unitid":"38","fc":1,"address":"4096","quantity":"1","messageId":"5a786ad41c82fb1d1c27e4f0"},"unitid":38,"timeout":1000,"state":"QUEUEING"} Serial@COM3:9600bit/s default Unit-Id: 38 +3ms
contribModbus:core:client Client -> {"info":"queue response activate sending","message":{"value":1517841108577,"unitid":"38","fc":1,"address":"4096","quantity":"1","messageId":"5a786ad41c82fb1d1c27e4f0"}} Serial@COM3:9600bit/s default Unit-Id: 38 +1s
contribModbus:core:client Client -> event: activate old: QUEUEING new: ACTIVATED Serial@COM3:9600bit/s default Unit-Id: 38 +3ms
contribModbus:core:client Client -> event: queue old: ACTIVATED new: QUEUEING Serial@COM3:9600bit/s default Unit-Id: 38 +4ms
contribModbus:core Remove Message In:<5a786ad41c82fb1d1c27e4f0> Out:<5a786ad41c82fb1d1c27e4f0> +2m
contribModbus:getter Timed out +1s
modbus-serial modbusErrorHandling:Timed out +15s
contribModbus:core:client Client -> {"state":"QUEUEING","message":"dequeue command serial","delay":10} Serial@COM3:9600bit/s default Unit-Id: 38 +12ms
contribModbus:core:client Client -> {"type":"queue check is not a unit","unitid":null} Serial@COM3:9600bit/s default Unit-Id: 38 +3ms
Issue Analytics
- State:
- Created 6 years ago
- Comments:13 (7 by maintainers)
Top GitHub Comments
Hi, all The battary software message is not pure modbus syntax, but does look like ascii modbus:
:
)My 2 cents are:
I will test that today when I reach office