|
|
Rank: Newbie Groups: Member
Joined: 3/10/2011 Posts: 9 Location: sept-iles
|
Hi
i have a pi calculation done on the tonnage of a conveyor to calculate the number of hours to fill a bin. it's pretty simple, 1200 t / conveyor tons per hour.
the problem i have is when conveyor ton per hour is 0 i get calc failed and it overlaps on the label "hours" that is next to the normal value.
now here's what i tried:
if (conveyoer <= 0) then "conveyor has no load" else ((1200 / conveyor) + "hours")
but i get an expression error, without the + "hours" part it works.
any idea ?
thanks !
|
|
|
|
|
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.
|
|
|
Rank: Advanced Member Groups: Member
Joined: 7/23/2008 Posts: 38 Location: Cheshire, UK
|
Hi,
Obviously it doesnt like the use of the sting in an addition expression. If it works without this then perhaps hard code the word hours and add visibility to it dependant upon the result of the expression, this requires a bit of VBA but should be fairly easy to code up.
1)Create a label on the process book display 2)enable scrpting on it 3)Assign a sub such as refreshdata so that the routine is executed each time data is seen to update 4)Write a routine that gets the value in the expression tag 5)based on the value make the label either visible of invisible
Regards
|
|
|
Rank: Administration
 Groups: Administration
Joined: 6/20/2008 Posts: 617 Location: Cheshire, United Kingdom.
|
Change your PE to use the "Text" function... if ('conveyor' <= 0) then "conveyor has no load" else Text((1200 / 'conveyor'), " hours") Principal Consultant Real-Time Data Management @ Wipro Technologies
|
|
|
Rank: Newbie Groups: Member
Joined: 3/10/2011 Posts: 9 Location: sept-iles
|
Thanks, it worked using the String and concat function.
Concat(String('Tag',0.1), " Hours")
thanks a bunch for the help
|
|
|
|
Guest
|