Code Property (DigitalState object)



The Code property of a DigitalState contains a numeric index of the DigitalState within the StateSet collection to which it belongs. The Code may be used as an index to the Item property of the StateSet that contains the DigitalState.




The object placeholder is an object expression that evaluates to a DigitalState object.



The Code property is read-only. To change the Code of a DigitalState, the state needs to be repositioned within the StateSet. This can be done using StateSet.ReplaceStates. Changing a code in this way can cause problems when interpreting historic data that was stored prior to the change.

Enabling Operational Intelligence