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

PI calculation add text after numeric tag Options · View
lespoils
#1 Posted : Thursday, March 31, 2011 7:39:36 PM
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 !
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.
Burnikell1
#2 Posted : Friday, April 01, 2011 10:36:30 AM
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


RJK Solutions
#3 Posted : Sunday, April 03, 2011 2:43:56 AM
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
lespoils
#4 Posted : Tuesday, April 19, 2011 2:22:52 PM
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
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.