Functions to Operate with Nodes

<< Click to Display Table of Contents >>

Navigation:  Multi-Protocol MasterOPC Server > Lua 5.1 Reference Manual > Function library > The SERVER Library >

Functions to Operate with Nodes

Functions to Operate with Nodes

mbul_mail server.SetNodeToOnOff

server.SetNodeToOnOff

Stops/runs poll of a node. For example, this function may be useful in communication redundancy when one communication channel must be on, and other, redundant one, must be off. The first argument to the function is the device's operation, true - the device polling starts, false - the device poll stops.

Example

val,q=server.ReadCurrentTag(); --get a tag value

if val==true then –if that value is "true"

server.SetNodeToOnOff(true); --run node poll

else

server.SetNodeToOnOff(false); --otherwise, stop node poll

end;

Also, the function may have a second argument - the path to the disconnected node (if the path is not specified, then the node to be turned off in which this script is executed)

server.SetNodeToOnOff(true,"Node1"); --run node poll