24.09.2017, 04:41 (This post was last modified: 24.09.2017, 05:07 by buuuudzik.)
I will check how can I improve the topology, but unfortunately I wasn't the starter of modbus network and so because everything was working properly I wasn't searching for a bad topology. This is my first project with modbus. Thanks for your help, all of you
But last question(from my curiosity):
Is it has matter that first slave from master has an address 1 and second 2 etc. or not?
26.09.2017, 14:20 (This post was last modified: 26.09.2017, 14:24 by buuuudzik.)
I've changed the connection to serial and also I've tried connect terminators 120ohm on the start and at the end of the bus and still there are a lot of timeouts. Now I've connected this only energy meter to the RS-485-2 (very short distance ~5m) and I am trying read values from it via resident script but also there are a lot of timeouts How can I change timeout of every request on resident script?
This is what I am using now for testing:
Code:
1234567891011121314151617181920
require('luamodbus')
mb = luamodbus.rtu()
mb:open('/dev/RS485-2', 9600, 'N', 8, 1, 'H')
mb:connect()
mb:setslave(4)
-- L1 - N-- read 32-bit floating point value from input register nr 123, use word swapres, err = mb:readinputregistervalue(0, "float32", "w")
log(res, err)
-- L2 - Nres, err = mb:readinputregistervalue(2, "float32", "w")
log(res, err)
-- L3 - Nres, err = mb:readinputregistervalue(4, "float32", "w")
log(res, err)
mb:close()
(26.09.2017, 14:20)buuuudzik Wrote: I've changed the connection to serial and also I've tried connect terminators 120ohm on the start and at the end of the bus and still there are a lot of timeouts. Now I've connected this only energy meter to the RS-485-2 (very short distance ~5m) and I am trying read values from it via resident script but also there are a lot of timeouts How can I change timeout of every request on resident script?
This is what I am using now for testing:
Code:
1234567891011121314151617181920
require('luamodbus')
mb = luamodbus.rtu()
mb:open('/dev/RS485-2', 9600, 'N', 8, 1, 'H')
mb:connect()
mb:setslave(4)
-- L1 - N-- read 32-bit floating point value from input register nr 123, use word swapres, err = mb:readinputregistervalue(0, "float32", "w")
log(res, err)
-- L2 - Nres, err = mb:readinputregistervalue(2, "float32", "w")
log(res, err)
-- L3 - Nres, err = mb:readinputregistervalue(4, "float32", "w")
log(res, err)
mb:close()
Hi
What happen when you read only 1 registry?
What kind of cable do you use?
Which LM is it?
BR
26.09.2017, 14:54 (This post was last modified: 26.09.2017, 14:56 by buuuudzik.)
For such script there are also from time to time timeouts:
Code:
123456789101112
require('luamodbus')
mb = luamodbus.rtu()
mb:open('/dev/RS485-2', 9600, 'N', 8, 1, 'H')
mb:connect()
mb:setslave(4)
-- L1 - N-- read 32-bit floating point value from input register nr 123, use word swapres, err = mb:readinputregistervalue(0, "float32", "w")
log(res, err)
mb:close()
I am using KNX cable A-red, B-black.
This is LM4, but other Modbus-RTU devices are working correctly. I am thinking that this is probably an issue of energy meter or its modbus part is little unique.
If other modbus devices works correctly then for sure issue is with this meter. In the past I had similar issue with some Chines fancoil. It was not answering 100% but as long I was getting every second value I ignored it.
27.09.2017, 06:17 (This post was last modified: 27.09.2017, 06:18 by buuuudzik.)
I've optimized communication with this meter and now script is trying max 7 times read the register. Min. time to read all registers(or spending 7 times to try) i 7s and maximum 16s. Today I will try contact with the manufacturer.
27.09.2017, 10:56 (This post was last modified: 27.09.2017, 11:43 by buuuudzik.)
I've talked with some technic guy from F&F and he asked me if I can check this issue via Modbus Pool and some RS485 converter.
And when I've tried this in Modbus Pool Software via very cheap(~4$) chinese converter everything works great. Below screenshots:
How can I mount the usb-RS485 converter to LM LB? This is ch340 converter. Below data from System log after plug the device:
usb 1-1.3: Product: USB2.0-Serial
usb 1-1.3: New USB device strings: Mfr=0, Product=2, SerialNumber=0
usb 1-1.3: New USB device found, idVendor=1a86, idProduct=7523
usb 1-1.3: new full-speed USB device number 8 using ehci-pci
27.09.2017, 13:53 (This post was last modified: 27.09.2017, 14:25 by buuuudzik.)
1) I've tried also with switching on Modbus mapper, and after this, reading all of this registers takes only 4 seconds so I see that other RS-485 inputs are connected with themselves.
2) When I switched on the Modbus mapper then still reading the registers via script takes 3-5 seconds. It is enough, but if there would be a possibility to go down to 1 second it would be great from the learning point What I can improve in below script? (When I am changing timeout the interval is still the same)
(02.10.2017, 06:38)admin Wrote: CH340 is not currently supported by LB, but support can be added in next FW release.
Please add this device because it is an alternative for ftdi chip and not everytime in datasheet there is the information what kind of chip is used. Thanks Admin