IsGood Method (PIValue object)


The IsGood method is used to evaluate a PIValue object to determine if the data contained in the PIValue.Value property represents valid data or some error state.  When IsGood returns FALSE, it is indicating that the PIValue.Value property does not contain valid data. 

For a numeric or string tag, the IsGood method is not critical, as any PIValue from such a point that contains a DigitalState object is considered bad data.  For a digital tag, typical values come from the DigitalSet assigned to the PIPoint in its configuration - not the system digital state set and appear as DigitalState objects.  Bad data is represented by states from the system digital state set also appearing as DigitalState objects.  The IsGood method is helpful in distinguishing between these similar values. 

When data is retrieved from the server, the retrieval methods are able to mark the data as good or bad as appropriate because these methods are aware of the relevant PIPoint. However PIValue objects may be created independently without reference to a particular PIPoint.  In this case the IsGood method returns FALSE for the following scenarios:


If PIValue contains a DigitalState object

PI2 Servers: states with codes in the range 244-256 are errors

PI3 Servers: states from the system set are errors

If PIValue does not contains a DigitalState object but the value is a Variant of the following types:




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


PI2 systems have only a single state set with a large set of states.  Individual points identify a range within this set as their state set.  The range of states from 244 through 256 are reserved as error states on PI2 systems so any PIValue from a PI2 system with a digital state in this range is considered a "bad" value.


Enabling Operational Intelligence