Problematic Modbustcp Device


ledbelly2142

Recommended Posts

I have a ModbusTCP device that appears to stop responding at 6:13am every day... but its not consistent. I have the device set up to run from a script to get channel data every 300 seconds. This device is a gateway and I have several sequences running separately to gather channel data.

Can my multiple sequences cause a problem?

When monitoring the comms channel for this device, the last line that appears is a good Rx line, then nothing.

The general symptom error in the command line is a ModbusTCP port locks and timeouts.

The device will accept multiple simultaneous connections.

I have increased the time for this device to 1 sec in an attempt to reduce timeouts.

To fix this, I restart DF. I can set the system to restart every day... but that is not an option I would like to rely on.

What else can I check?

Link to comment
Share on other sites

  • 2 weeks later...

Got good feedback from the vendor, recommended Device.xxxx.InitComm() similar to your recommendation. They are going the extra mile to help, very good support.

It happens every day around the same time, windows update is off, no antivirus. The gateway is doing something, not DF.

Is it wise to set up a sequence that would reinitiate a device every 300 or so seconds? I don't think it would take up too much resources.

I have a cheap Moxa gateway that times out as well. When a device times out, DF will not reinitiate unless I write a sequence or alarm. Is there a good way to monitor a device(s) for timeouts, then automatically reinitiate them?

I think timeout and portlocks are indiscriminate in the console, so I would need to reinitiate all my devices to make sure all the connections are up... not sure if that is too risky thing--if part of the network were down (which has happened during a power outage) a sequence like this would be continually reinitiating all devices. Which "may" cause a problem with simultaneous connections.

I appreciate your help

Link to comment
Share on other sites

Does it matter if the channel timing is run by a sequence?

If my channel groups are run by sequences, with timing set to "0", will the while statement still work?

while(1)

if (systime() - channel.time[] > 320)

device.mydevice.initComm()

delay(30)

endif

delay(30)

endwhile

If not, I could pull one channels (in the channel group) back into main and set the timing (I am doing this now because I know it works).

Link to comment
Share on other sites

It doesn't matter as long as "channel" in your sequence refers to an actual channel that you are filling with values (which it would if you are doing channel.readGroup()). The channel can't be called "channel" because that's a reserved word. Also you want [0] not []: myChannel.time[0]

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.