wxz44428

AFAttribute.GetValue on PIDataReference point on previous time

Discussion created by wxz44428 on May 20, 2011
Latest reply on May 24, 2011 by hanyong

I am working with AFSDK 2.1.1.3624. I am calling from c#. I ran into an issue today, here is the situation:

 

I have an AFAttribute, that is of PI Point Data Reference. Suppose at March 1st, I configured it to point to PI point Tag1. Later, say today, 5/20,  I chanaged it to point to PI point Tag2. And, now I am asking its value, like, (psedo code);

 

                    AFTime tmpTime = new AFTime("5/20/2011");

 

                    tmpValue = tmpAttribute.GetValue(tmpTime);

 

It gives the today's value of PI Tag2. However, if I call the same code, but with a different date, say, March 2nd,

 

                    AFTime tmpTime = new AFTime("3/2/2011");

 

                    tmpValue = tmpAttribute.GetValue(tmpTime);

 

The value I got was PI Tag1's value on 3/2/2011, instead of Tag2's value on that date. I need to get the attribute's value (on any given time) based on current PI data reference configuration, which is Tag2. How to realize this ?

 

Thanks !

 

 

 

 

 

 

 

 

Outcomes