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

Displaying Time from seconds Options · View
civatrix
#1 Posted : Friday, April 16, 2010 11:21:26 PM
Rank: Newbie
Groups: Member

Joined: 1/14/2010
Posts: 7
At the moment I'm collecting the amount of time a machine is running in seconds. Actually several machines but they each have there own tag. I now need to display this data in a process book but I would like to be able to give the user a nicely formatted HH:MM:SS display rather then just a large number of seconds. Short of creating three PE tags for each machine (one to store hours, one for min and one for seconds) I'm not sure how I would accomplish this. I'm hoping it can be easily reused too because this data might be going on multiple displays and more machines will be added. Thanks in advance.
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.
Michael
#2 Posted : Saturday, April 17, 2010 4:24:15 PM
Rank: Advanced Member
Groups: Member

Joined: 12/3/2009
Posts: 71
Location: Germany/Pennsylvania
Divide your value by 3600, take the integer part (INT) of this number, you have the hours. Take the fractional part of this division (FRAC) and continue in the same manner for the minutes and so on. Finally, concatenate everything using CONCAT.


Michael
civatrix
#3 Posted : Tuesday, April 20, 2010 2:47:50 PM
Rank: Newbie
Groups: Member

Joined: 1/14/2010
Posts: 7
Thanks a lot, that should work beautifully.
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.