question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Modbus TCP - Unexpected issue

See original GitHub issue

Problem

  • unexpected behavior

Current behavior

I’m currently setting-up some Modbus Read nodes to read-out some values via Modbus TCP from differente devices. For one of the devices (Lennox HVAC machine - ReadLennox node below) no issues at all, but I can’t read out any values from our PLC (Wago - ReadPLC node below). However I can read out both devices with a Modbus Poll tool on my PC using the same addresses.

I’m getting following messages from the ReadPLC node: PortNotOpenError: Port Not Open FSM Reset On State {"value":"failed","actions":[],"changed":true}

Expected behavior

Seeing that I’m able to read both Modbus slaves from a poll tool, I should be able to read out both slaves from the Modbus Read, that doesn’t seem to be the case. Any tips on how to fix this?

Test flow

[ { "id": "8c891858.890aa8", "type": "tab", "label": "Flow 2", "disabled": false, "info": "" }, { "id": "a221a0b3.b2558", "type": "modbus-read", "z": "8c891858.890aa8", "name": "ReadLennox", "topic": "", "showStatusActivities": false, "logIOActivities": false, "showErrors": false, "unitid": "110", "dataType": "HoldingRegister", "adr": "37", "quantity": "7", "rate": "5", "rateUnit": "s", "delayOnStart": false, "startDelayTime": "", "server": "7b4f9c2f.b0b814", "useIOFile": false, "ioFile": "", "useIOForPayload": false, "x": 150, "y": 80, "wires": [ [], [] ] }, { "id": "273fcc14.078734", "type": "modbus-read", "z": "8c891858.890aa8", "name": "ReadPLC", "topic": "", "showStatusActivities": false, "logIOActivities": false, "showErrors": false, "unitid": "14", "dataType": "HoldingRegister", "adr": "0", "quantity": "1", "rate": "5", "rateUnit": "s", "delayOnStart": false, "startDelayTime": "", "server": "9fecc378.d3287", "useIOFile": false, "ioFile": "", "useIOForPayload": false, "x": 140, "y": 140, "wires": [ [], [] ] }, { "id": "7b4f9c2f.b0b814", "type": "modbus-client", "z": "", "name": "LennoxA", "clienttype": "tcp", "bufferCommands": true, "stateLogEnabled": false, "tcpHost": "192.168.30.110", "tcpPort": "502", "tcpType": "DEFAULT", "serialPort": "/dev/ttyUSB", "serialType": "RTU-BUFFERD", "serialBaudrate": "9600", "serialDatabits": "8", "serialStopbits": "1", "serialParity": "none", "serialConnectionDelay": "100", "unit_id": 110, "commandDelay": 1, "clientTimeout": 1000, "reconnectOnTimeout": true, "reconnectTimeout": 2000, "parallelUnitIdsAllowed": true }, { "id": "9fecc378.d3287", "type": "modbus-client", "z": "", "name": "PLC", "clienttype": "tcp", "bufferCommands": true, "stateLogEnabled": false, "tcpHost": "192.168.30.14", "tcpPort": "502", "tcpType": "DEFAULT", "serialPort": "/dev/ttyUSB", "serialType": "RTU-BUFFERD", "serialBaudrate": "9600", "serialDatabits": "8", "serialStopbits": "1", "serialParity": "none", "serialConnectionDelay": "100", "unit_id": 14, "commandDelay": 1, "clientTimeout": 1000, "reconnectOnTimeout": true, "reconnectTimeout": 2000, "parallelUnitIdsAllowed": true } ]

Your Environment

Using via a Docker container, installed via nodered/node-red. Installed node-red-contrib-modbus 5.2.0 via the Palette Manager.

  • Device

    • Docker 19.03.07
  • Description of the connecting Modbus system:

    • Wago 750 PFC200
  • node-red-contrib-modbus version: v5.2.0

  • Node: (min. 10.x) node --version = v10.19.0

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
schefa11commented, Mar 16, 2020

Was my fault due to missing knowledge… .I have a Node-Red Installation on my Windows PC. Running the debug-mode in command prompt requires the corresponding environment variable: SET DEBUG=contribModbus*

Same for powershell: $env:DEBUG = “contribModbus*”

0reactions
biancodecommented, Mar 28, 2020

Please, test v5.4.0 and reopen with new information if the problem is not fixed.

Read more comments on GitHub >

github_iconTop Results From Across the Web

python - Modbus TCP Client closes the connection because of ...
I have problems managing the connection on the server side. Meanwhile my implementation as Modbus over TCP as client works just fine. Implementation...
Read more >
Solved: DCE modbus communication problem
Dear sir, Recently I met some problem with DCE System version 7.4.3, please help me. 1. How the retry time in moniting modbus...
Read more >
Modbus TCP connection problem - PLCnext Community Forum
Hi everyone, I have a AXC F 2152 PLC and I try to use ModBus TCP library without success. My initial purpose is...
Read more >
Modbus connection problem - Bindings - openHAB Community
Hi, I have installed new 1.8.0 version, before I was using 1.8.0 snapshot. In my enviroment I have several binding including modbus TCP....
Read more >
Troubleshoot PI Adapter for Modbus TCP
DataTypeCode - The correct DataTypeCode number is referenced. An incorrect DataTypeCode number can cause unexpected values or out-of-range ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found