Polybench® Reference
Defines a text box that displays variable parameter values from other objects

Variable Viewer

Overview

Use the Variable Viewer to display texts or values that come from other objects in the project. The text of value to display is specified with an Address ($...$) and may be mixed with fixed text.

Properties

Find more information about changing properties here: "Properties Viewer"

Addresses and Text
type: Address, starts with '$' sign (see "Address - how to address objects and variable parameters")
The Address of the variable parameter that should be displayed in the viewer, or any text that contains addresses of variables.

You may type or paste the address, or you may press the small button on the right to open the Address Constructor ("Address Constructor")

BackgroundColor
type: Known color name
The background color of the text panel

This property uses the Color Repository. For more information about the use of colors in a project, refer to "Color Repository"

TextColor
type: Known color name
The text color

This property uses the Color Repository. For more information about the use of colors in a project, refer to "Color Repository"

BlinkColor
type: Known color name
The alternate color of the background if the viewer is in blinking mode.

This property uses the Color Repository. For more information about the use of colors in a project, refer to "Color Repository"

Font
type: Known text font name
The font of the text (select from the Font repository).

This property uses the Font Repository. For more information about the use of text fonts in a project, refer to "Font Repository"

TextAlignment
type: Select from the list
Select an alignment from the list where the text should be drawn within the borders
Select one of those presets:
TopLeft
TopCenter
TopRight
MiddleLeft
MiddleCenter
MiddleRight
BottomLeft
BottomCenter
BottomRight


Rotation
type: Integer value
Rotation of the text in degrees. Only the values 0, 90, 180 or 270 can be used.

Other values than the 90° steps will be rounded to the closest angle mentioned above.

Size
type: Size containing width and height
The size of the user interface of this object (width, height).


Coordinates
type: Coordinate
The location of the user interface of this object in (x,y) coordinates, relative to the object it is on top of.


Caption
type: Word or phrase
The name of the object in the project. This name must not contain '.', '$' nor '@' characters.

For more information about the rules and usage of the Caption property, please refer to "Caption property - background and usage".

Documentation
type: See description
Optional documentation of this object. If this object is an operator, the Documentation text is displayed below the operator symbol.

Variable Parameters

Find more information about Variable Parameters here: "Variable Parameters"

BackgroundColor
type: See description
The background color of the text panel


TextColor
type: See description
The text color

Functions

Find more information about Functions here: "Operator Functions"

Blink
Starts blinking the viewer's background, using the BlinkColor

BlinkOff
Lets blinking the viewer's background stop

Details

After adding a Variable Viewer to your project, the viewer states '[Click to specify the variable or text]'. In the properties of the viewer, you can specify an address of a Variable Parameter in another object or operator. The address must start with a $-sign. The Variable Viewer will immediately show the contents of the parameters that has been addressed. If the value of the parameter that is addessed changes, the changed value is immediately shown in the Variable Viewer.

Alternatively you may type any fixed text that contains one or more variables. In that case, the variables must be enclosed by $-signs. For example:

$Designer.K1.Value will display the value of a constant called 'K1', if such a constant exists on the Design page.
The value of K1 is $Designer.K1.Value$. will display the fixed text 'The value of K1 is' and then the value of the constant.
The current time is $hour$:$minute$:$second$ displays the current time, which is updates every second.

If an address is not correct, its value will be replaced by question marks '??????'. If the address does not exist, its value will be replaced by 'xxxxxx'. The same is displayed if the address refers to something that cannot be displayed as text, for example an object, or a list.
There are also global variables, for more information see "Free Global and Namespace Variables".

To draw the attention of the end-user, you may call the Blink function, using a FUNCTION action. After calling the Blink function, the Variable Viewer starts blinking using the Blink color, until the BlinkOff function is called.

The Variable Viewer only displays single value variables. If you want to display list type variables (the other of two kinds of variables), then please use the List Viewer ("List Viewer").

One example of the use of the Variable Viewer is shown in the following figure.