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
Associating an AnalogNumeric Object with Text Library
-
- Posts: 137
- Joined: Mon Jun 11, 2012 2:10 pm
Re: Associating an AnalogNumeric Object with Text Library
You can set the AnalogNumeric to display string and add an expression like the following:
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/librar ... 10%29.aspx.)
Code: Select all
( ((float)value) == 31000.0f ? "Error" : ((float)value).ToString("0.00"))
Adam M.
Controls Engineer
FlexEnergy
Controls Engineer
FlexEnergy
-
- Posts: 25
- Joined: Sat Jul 04, 2015 6:13 am
Re: Associating an AnalogNumeric Object with Text Library
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.