GetDisplayValue

(Function Library)

Description: Returns the value of an IO tag in a displayable format.
Returns: Text
Usage: Script or steady state.
Function Groups: Function Library
Related to: GetEquipmentColor| GetEquipmentLabel|GetParmPhrase|GetPhrase|GetPhraseID|Concat
Format: \FunctionLib.GetDisplayValue(TagObj)
Parameters:  
TagObj
The tag whose value is formatted and returned.
 
Comments:

GetDisplayValue is accessible in the Function Selector. It has one parameter, (TagObj), the tag whose value you want to display.

The function returns the tag's value in a displayable format.

Analog values will show the correct number of decimal places and comma separated thousands.

Digital and discrete values will show their text according to the configuration in its Display tab settings or Style Settings tag and, optionally, their Equipment Type.

Text boxes and some widgets do not use a Style Settings tag for formatting and will override the returned values settings with their own formatting.

Expression Example:

\FunctionLib.GetDisplayValue([<Context\Tag>]\Root)

This expression fetches the value of the Tag. It the value this Tag is 1 and its display settings are set to show one decimal place, it will return "1.0" as a displayable text.

To include text together with returned value, use the concat() function:

concat("Water Level ", 
\FunctionLib.GetDisplayValue([<Context\Tag>]\Root)
)

If "Tag" has the same value as before, this expression returns "Water Level 1.0".