LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

[Modbus TCP/IP] server stops responding after some time

Solved!
Go to solution

Hello everyone,

 

We have a district heat substation (https://www.enerpipe.de/de/produkte/13627/uebergabestationen) from which we are trying to read some sensor values using Modbus. The Modbus communication module is from Schneid (https://schneid.at/product/schneid-cm08-tcp-steckkartenmodul/). Configuration on both sides is correct, so I think I don't have to change anything there.

 

The main problem that I am facing is LabVIEW stops reading the data after some time (I am not sure why but this seems to happen close to an hour after starting the VI). After that, it just starts writing 0 to the text file. We want to run the vi for ~7 hours (to simulate summer/winter day) and it is important to log all the values for this duration.

 

And this error is sometimes random. Like it stops reading after a few minutes but when I ping the IP the device responds. I tried to poll the values using QModMaster and I can read the registers in this way.

girish_jadhav_0-1598884912852.png

girish_jadhav_1-1598885148687.png

 

This is making harder for me to debug the error. I have tried increasing the timeout value, disabling the firewall, and reinitializing the Modbus Master when there is an error but have been unsuccessful in solving this. 

 

Some of the errors I got when running this VI:

 

Error 63 :

Create connection in TCP Master.lvclass:Initialize Master.vi->Modbus Master.lvclass:Initialize.vi->API Main.lvlib:Create TCP Master.vi->1. read_multiple_registers.vi

 

Error 56:

IP Data Unit.lvclass:Read ADU Packet.vi:5030001<APPEND>

<b>full call chain:</b>

     IP Data Unit.lvclass:Read ADU Packet.vi:5030001

     Modbus Master.lvclass:Read Holding Registers.vi:2420001

  1. read_multiple_registers.vi

Related post I made a few days ago: Post 

 

 

 

 

Download All
0 Kudos
Message 1 of 6
(4,199 Views)

The scan rate for QModMaster is 1000 ms, while your vi is reading data at full speed. Do you really need to get data so frequently? It's possible that the device cannot keep up. Put a reasonable wait in your loop.

Moreover, it's possible that opening another connection is not the right way to handle the error: you may only need to retry reading.

In any case, when re-initialising a connection, it's wise to close the previous one before opening a new one.

Paolo
-------------------
LV 7.1, 2011, 2017, 2019, 2021
0 Kudos
Message 2 of 6
(4,190 Views)

@pincpanter wrote:

The scan rate for QModMaster is 1000 ms, while your vi is reading data at full speed. Do you really need to get data so frequently? It's possible that the device cannot keep up. Put a reasonable wait in your loop.


I have tried it with wait in the while loop but I still get these errors. Even when reading the values using QModMaster with scan rate of 1000ms I get the error after some time and I have to close the connection and reconnect it for it to work.

 


@pincpanter wrote:

Moreover, it's possible that opening another connection is not the right way to handle the error: you may only need to retry reading.


How can I just retry to read the data without clearing these errors? Because the server refuses to respond after the error occurs. 

 

PS: When there is an error, the TX and RX terminal LEDs on the hardware stop blinking (I don't know if this helps)
 

 

 

0 Kudos
Message 3 of 6
(4,144 Views)
Solution
Accepted by topic author girish_jadhav

The problem seems to be hardware related. I don't think you can do much more than retry and/or close+reopen.

You may try to further split the reads. In principle this should change nothing apart slowing down the reading.

Another possibility is putting a small delay between reads.

Those are only attempts to cheat and force the device to behave more reliably. Sometimes we are forced to let the program act nonsensically to cope with some hardware limitations.

 

Paolo
-------------------
LV 7.1, 2011, 2017, 2019, 2021
0 Kudos
Message 4 of 6
(4,120 Views)

@pincpanter wrote:

The problem seems to be hardware related. I don't think you can do much more than retry and/or close+reopen.

You may try to further split the reads. In principle this should change nothing apart slowing down the reading.

Another possibility is putting a small delay between reads.

Those are only attempts to cheat and force the device to behave more reliably. Sometimes we are forced to let the program act nonsensically to cope with some hardware limitations.

 


Thanks for the input. Splitting the reads and adding small delay between reads helped. I did a test run and was able to log the data for three hours without any errors.

0 Kudos
Message 5 of 6
(4,089 Views)

Hi, i just saw your post and therefore i have some questions.

I also have the same district heating substation from Enerpipe (https://www.enerpipe.de/de/produkte/13627/uebergabestationen) that you mentioned.

 

I opened the housing where the electrical components are attached. On the photos you can see a card which might be the modbus communication card (see plugged in red network cable). This cable goes to a media converter that converts the signals to fibre cable. The fibre cable is part of the control network, where each household-station in our local heating network is interconnected with. It is used to control the heating grid from the central heating station by the operators.

 

I also want to get data of the substation, especially the data from the secondary side (house hydraulics side) to analyze and optimize it and later integrate into my smart home (visualisation).

 

Do you know how i could achieve it without disturbing the normal network traffic between the operator and my substation? Because i fear if i am playing around without enough knowledge, i might corrupt or crash the heating grid controls of the operators?

 

Next problem is, that i don't know which parameter/register are existing and which is the one i want so see, e.g. Target Flow temperature (Vorlauftemperatur Soll) of my floor heating circuit. 

 

Can you help me here with your experience?

0 Kudos
Message 6 of 6
(2,516 Views)