Closed cicci44 closed 2 years ago
Hi, I tested with ModRSSim2 (modbus slave simulator) and I can't reproduce the problem, I think that is a problem with the hardware (slave) that you are using. (https://user-images.githubusercontent.com/48684550/90986053-6289e400-e580-11ea-9b2a-eb58ed98060b.PNG)
(https://user-images.githubusercontent.com/48684550/90986049-57cf4f00-e580-11ea-9b0a-22cdd6a33d0e.PNG)
ok. thanks for the hint, im not familiar with modbus tcp but will build simple test script soon to see if the hardware can handle two queries after each other from diffrent place in the register. The same hardware but older revision used modbus RTU and the test code seems to loop out queries after each other and when all is done, it publish the result, might just be so simple with this..
Maybe a feature to implantate if its true đ
this code below works. It seems that hardware-side does not like to read all data in one sweep. After consulted around it seems to be common issue of some hardware manufacturers.. as i understand, i cant read over a "black hole" in the register.
Is it possible to add a feature to add multiple queries in next update? that would be great to try. đ
#!/usr/bin/env python
# -*- coding: utf-8 -*-
```from pyModbusTCP.client import ModbusClient
import time
SERVER_HOST = "192.168.1.10"
SERVER_PORT = 502
c = ModbusClient()
# modbus server IP och port
c.host(SERVER_HOST)
c.port(SERVER_PORT)
while True:
# etablera eller Äteretablera förbindelse..
#connect or reconnect...
if not c.is_open():
if not c.open():
print("unable to connect to "+SERVER_HOST+":"+str(SERVER_PORT))
print ("connect or reconnecting..")
#if function is available....
# om funktion tillgÀnglig, lÀs register..
if c.is_open():
# start at address 0 and read to 13, store in query1
# Börja pÄ address 0 och lÀs 13st.. lagra det i query1
query1 = c.read_input_registers(0, 13)
time.sleep(2)
# lÀs ytterlig och lagra det i query2
# read som more and store it in query2
query2 = c.read_input_registers(22, 10)
# if success display registers
if query2:
print ("query1")
print ("reg ad #0 to 13: "+str(query1))
print ("query2")
print ("reg ad #22 to 32: "+str(query2))
# sleep 2s before next polling
#vÀnta..
time.sleep(2)
Hi, I understand...can you try my last committed code and tell me if will work? Thanks
Hi, I understand...can you try my last committed code and tell me if will work? Thanks
testing the last committed code, it seems to work đ
however, seems to be another issue after 1-2min, but will make a new issue of that (not sure yet if the error is a issue) EDIT:Tried add/remove register, the modbustcp stop, gets readings again and works around 1minutes,30seconds until error code starts over. I think polling might be too close to each other.
how many modbus Tags have you configured? If you change the polling interval DEVICE_POLLING_INTERVAL in 'server/runtime/devices/device.js' (for example to 5 seconds) what happens?
how many modbus Tags have you configured? If you change the polling interval DEVICE_POLLING_INTERVAL in 'server/runtime/devices/device.js' (for example to 5 seconds) what happens?
i got for the moment eight modbus tags but the error still there, tried raise to 10sec.
Hi,
I send you a 'modbus/index.js' file where I improved the error description and increment to 10 seconds the client request timeout client.setTimeout(10000);
Hi, I send you a 'modbus/index.js' file where I improved the error description and increment to 10 seconds the client request timeout
client.setTimeout(10000);
"Timed out", tried raise deviceCloseTimeout in rundime/devices.devices.js to 5sec, didnt work.
I suspect the problem is that the Promise.all function is too fast for the Device. what happens if you configure only one tag, (so that only one query is made per poll interval?
I suspect the problem is that the Promise.all function is too fast for the Device. what happens if you configure only one tag, (so that only one query is made per poll interval?
this was the settings this was the result however i just remember i made a change in FUXA/server/main.js back for a while when i had issues with connection to the GUI, that cannot make the issue?.
I send you a test to see how the used 'modbus-serial' library and your hardware works with a simple query. modbus-serial_test.zip
npm install npm start
I send you a test to see how the used 'modbus-serial' library and your hardware works with a simple query. modbus-serial_test.zip
npm install npm start
seems ok for the moment but i needed to change 192.168.1.155 (raspberry address) to 192.168.1.153 (ftx), will let it run for a while and see if something happens
Hi, maybe the problem is in the wait for the response of the device before continuing. I send you a new 'modbus/index.js' file where I changed the polling function:
this.polling = async function () { readVarsfnc.push(await _readMemory(...
Hi, maybe the problem is in the wait for the response of the device before continuing. I send you a new 'modbus/index.js' file where I changed the polling function:
this.polling = async function () { readVarsfnc.push(await _readMemory(...
this is the result now
Can you tell me which hardware (device) are you trying to communicate and witch nodejs version have you installed in Raspberry?
Can you tell me which hardware (device) are you trying to communicate and witch nodejs version have you installed in Raspberry?
im trying communicate with Heru 100 T EC with node v12.16.2, just saw theres a firmware update on the ftx, going to test upgrade firmware to see if Coms get more stable.. https://fsp.ostberg.com/products/4397/heru-100-t-ec/?region=en&lang=en
I update the library and the handling of modbus. going to close this as resolved. let me know if you have any issues.
device CPU look like this, readings are fine: but if i add 300025, int16.. i get no reading but this: however.. if i disable device CPU, and make a copy called TEST i get values like this:
im not sure if im doing wrong or if theres a hardware related issue... second picture
how can i make a second query to get the next serie of data if the query is too long?