Welcome Guest ( Login | Register )



All times are UTC - 7 hours [ DST ]



Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: Associating an AnalogNumeric Object with Text Library
PostPosted: Thu Aug 06, 2015 5:09 am 

Joined: Thu Aug 06, 2015 4:51 am
Posts: 1

Offline
Hi there,
Is it possible to associate an AnalogNumeric object with text library? In my project, there is an AnalogNumeric object which displays actual temperature of the enviroment. If there is a sensor failure, it displays 31000 which does not make sense for the end user. Can this AnalogNumeric object display a text if its value is 31.000? If yes, does this text have to be in the text library?

Regards,
Burak


 Profile  
 
 Post subject: Re: Associating an AnalogNumeric Object with Text Library
PostPosted: Fri Aug 28, 2015 11:41 am 

Joined: Mon Jun 11, 2012 2:10 pm
Posts: 89

Offline
You can set the AnalogNumeric to display string and add an expression like the following:

Code:
( ((float)value) == 31000.0f ? "Error" : ((float)value).ToString("0.00"))


This expression displays the tag value with two decimal points if it is not equal to 31000, otherwise it displays Error. (For more information, see C# custom number formatting https://msdn.microsoft.com/en-us/library/0c899ak8%28v=vs.110%29.aspx.)

_________________
Adam M.
Controls Engineer
FlexEnergy


 Profile  
 
 Post subject: Re: Associating an AnalogNumeric Object with Text Library
PostPosted: Thu Sep 03, 2015 3:43 pm 

Joined: Sat Jul 04, 2015 6:13 am
Posts: 25

Offline
Or, if you have an alarm bit in the PLC, then set the visibility of the AnalogNumeric object to turn off with the alarm bit and show a text object instead.


 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC - 7 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron