LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Labview Modbus Interruption

Hi,

 

I am running into an issue with my modbus setuo. Basically it works for a minute and it gets interrupted and then I receive no data at all. Trying to figure out if its necessary to implement some sort of "timeout and reconnect" code into my current modbus code. 

 

Error:

−1967353903 The communication between the Modbus master and slave devices was interrupted. Check the connection status between the two devices.

 

Modbus TCP/IP:

Modbus Gateway (Serial to TCP) ---> Slave devices are daisy chained RS-485, have verfied all the parameters for modbus on each device.

 

My modbus code is in a timed loop which exceutes every ten seconds. I have no idea why it gets interrupted, checked the wiring and used third part MB poll softwares. Any help would be appreciated in helping me figuring out whats causing it to get interrupted. I know i can ping the gateway and poll the devices using the third party MB polling softwares.

 

Thanks

0 Kudos
Message 1 of 3
(1,626 Views)

A couple things pop out at first glance...

 

  1. Why are you using a Timed Loop?
    1. That's not the right way to take a measurement every 10 seconds
  2. You are creating a new TCP session with every iteration of your loop!
    1. Create a Modbus session
    2. Enter your acquisition loop
    3. Goto 2 until done
    4. Close the Modbus session

 

Also post your actual code NOT a picture of a code fragment. 

========================
=== Engineer Ambiguously ===
========================
0 Kudos
Message 2 of 3
(1,617 Views)

I thought the timed loop was executing every 10 seconds thus it would mean the modbus transmit would only execute every 10 seconds. I was trying to limit the amount of requests as it just bombards the gateway and takes down my comms, which i think is what is happening. I misunderstood the timed loop then, can you elaborate on the steps from your second point? Also attached is my VI.

 

Thanks,

 

Wally

0 Kudos
Message 3 of 3
(1,579 Views)