YetAnotherForum
Welcome Guest Search | Active Topics | Log In | Register

IPIData2 Summaries2 Options · View
jay10298
#1 Posted : Tuesday, December 20, 2011 6:24:42 AM
Rank: Member
Groups: Member

Joined: 3/24/2009
Posts: 20
Location: Saudi Arabia
Dear PI Users;

I have an array of "PIValues" that uses the method "Summaries2" to retrieve the daily maximum values for each month. The values are retrieve correctly but the timestamp is always set to 12:00 AM for each day. Below is my code;

for (int x = 1; x <= xunit; x++)
{
ipidata[x - 1] = (PISDK.IPIData2)_aliasList[x].DataSource.Data;
results[x - 1] = ipidata[x - 1].Summaries2(date1, date2, "24h", PISDK.ArchiveSummariesTypeConstants.asMaximum,
PISDK.CalculationBasisConstants.cbTimeWeighted, null);

foreach (PISDKCommon.NamedValue NV in results[x - 1])
{
pival_dx[x - 1] = (PISDK.PIValues)NV.Value;
}
}

if i display the time for each values, it always return 12:00 am, what am i doing wrong? How do i retrieve the correct timestamp?

Regards,

Jayson
Sponsor  
 

OSIsoft vCampus is a subscription-based, online offering that consists of providing everything people need to develop applications on the PI System.
We invite you to take a "tour" of the OSIsoft Virtual Campus - also feel free to consult the FAQ  or contact OSIsoft vCampus for more details.
jay10298
#2 Posted : Tuesday, December 20, 2011 9:07:31 AM
Rank: Member
Groups: Member

Joined: 3/24/2009
Posts: 20
Location: Saudi Arabia
Solved my problem, i use the .ValueAttributes instead of the .TimeStamp.LocalDate, below is the code.


object i = "TimeOfMaxVal";
PISDKCommon.NamedValue mt;
PITimeServer.PITime maxtime;
mt = pival_dx[z - 1][y].ValueAttributes.get_Item(ref i) ;
maxtime = (PITimeServer.PITime)mt.Value;

regards,

Jayson
Users browsing this topic
Guest
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.