richs04

State or Quality of an Analog point

Discussion created by richs04 on Aug 11, 2010
Latest reply on Aug 13, 2010 by cescamilla

I am trying to figure out what the State or Quality of a analog point.  I see the values in Digital States - SYSTEM (like Manual is 230) useing the managment tool but I need to get and set the state for all my points, both digital and analog.  Below is a C# sample of what I am doing.  I can get the data value but can't figure out the Quality of the data.

PointValues pvsSnaps;
pvsSnaps = lstData.get_Snapshot(out nvsErr);

foreach (PointValue ptValue in pvsSnaps)
{
   myValue = ptValue.PIValue;
   if (myValue.Value.GetType().IsCOMObject)
   {
        m_myDigState= (PISDK.DigitalState)myValue.Value;
        pival = (Single)m_myDigState.Code;
   }
   else
   {
       pival= (Single)myValue.Value;  <<<<  Have the value but need to check if good (0) or Manual (230)
   }
}

Outcomes