How To Set A Break To Modbus


dle

Recommended Posts

Hi all,

Is there a way to temporarily set a break to all MODBUS channels.

I'm still developing the GUI application and not connecting to a MODBUS device. The alert showing the modbus timeout is so annoying.

 

Thanks.

 

 

Link to comment
Share on other sites

Not super easily.  One option is to simply go into safe mode.  Another is to write a script to set the timing of all your channels to 0.  The best way to do this is to put all the channels with a particular timing into a single channel group, then you can do something like:

private string chanList = channel.listAll("modbusReadGroup")
for (private i = 0, i < numrows(chanList), i++)
   execute(chanlist[i] + ".timing = 0")
endfor
channel.restart()

Make another sequence that is pretty much identical but sets the timing to some other value, or just create a sequence function that takes the timing:

function changeTiming(string groupName, newTIming)

private string chanList = channel.listAll(groupName)
for (private i = 0, i < numrows(chanList), i++)
   execute(chanlist[i] + ".timing = " + newTiming)
endfor
channel.restart()

Hardcode groupName like I did in the first example if you don't need it as a parameter.

 

Link to comment
Share on other sites

  • 4 weeks later...

I want to disable the modbus channels if the PC id disconnected from a Modbus device.

 

If the function OnAlert() is call, it will check the StrAlert[0].

If the StrAlert[0] = "P-ModbusTCP0010:Timeout", it will temporarily set all the Modbus channels to timing = 0. to stop those Modbus channel from keep trying to polling data.

However, all other channels I would like to keep its current value. 

Link to comment
Share on other sites

Archived

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