Updating Infodriver Values

<< Click to Display Table of Contents >>

Navigation:  Infodrivers >

Updating Infodriver Values

The simplest way to update the value of an infodriver slot is by calling the SetValue method of a BncsInfodriver object obtained by calling either AddManagedInfodriver/AddMonitoredInfodriver or GetInfodriver on the BncsFramework static.

 

In addition to the slot index and new value parameters, there are two additional parameters that determine how a change is processed.

 

ChangeSource indicates where the request to change the value is originating.  Normally, this would be left as the default (Device) to indicate that the change originated from the device being controlled.

 

PreApproved indicates whether the change has already been accepted by the driver.  Normally this should be left as the default value of true.  Setting this to false when updating a managed infodriver will cause the OnManagedInfodriverChange event to fire.

 

The BncsFramework static also provides a SetInfodriverValue method for directly updating the value of an infodriver slot without first obtaining a BncsInfodriver object.  Note that this method will work irrespective of whether the infodriver has been initialized or not - if it has not, the infodriver write message will be sent directly to the BNCS network.

 

It is worth noting that, where an infodriver slot is associated with a Parameter object, directly updating its value at the Infodriver level will be processed as a change to the parameter itself.