Associating an AnalogNumeric Object with Text Library

Discussion of application development using iX Developer, including but not limited to getting started, using the functions tab, properties, objects and installation.
Post Reply
BURAKUSLU
Posts: 1
Joined: Thu Aug 06, 2015 4:51 am

Associating an AnalogNumeric Object with Text Library

Post by BURAKUSLU »

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

AMitchneck
Posts: 137
Joined: Mon Jun 11, 2012 2:10 pm

Re: Associating an AnalogNumeric Object with Text Library

Post by AMitchneck »

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

Code: Select all

( ((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/librar ... 10%29.aspx.)
Adam M.
Controls Engineer
FlexEnergy

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

Re: Associating an AnalogNumeric Object with Text Library

Post by Transistor »

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.

Post Reply