Numeric variable syntax

Numeric embedded variables use this format:
/*LN:# Tag_name Fill_character DP:#*/
The syntax is:
  • an opening escape sequence ‘/*’
  • followed by an optional letter L (for Literal), which prevents a tag read for the variable. This is inserted into the syntax if the
    Literal number
    option is chosen in the
    Numeric Variable
    dialog box.
  • followed by the letter 'N'
  • followed by a colon ':'
  • followed by a numeric length field
  • followed by a space character
  • followed by the tag name, tag placeholder (#1, #2, etc.)
    TIP:
    If you use tag placeholder in an embedded variable, do not include spaces in the tag address.
  • followed by a space character
  • followed by a word describing the left fill property
  • followed by a space character
  • followed by the letters ‘DP:’
  • followed by the number of decimal places
  • followed by a closing escape sequence '*/'
For example, to display the current value of an analog tag called Oven_temp, with 3 digits, two decimal places, and no fill character, you would type:
/*N:6 ven_temp NOFILL DP:2*/
On the display during development, you would see as many # characters as digits, with the decimal place as specified:
###.##
At runtime, you would see the value of the tag displayed in the format specified:
183.00
TIP:
Embedded variables are case sensitive, and must use the correct format and syntax to work. If you make a mistake, the variable will be treated as a piece of text. For this reason, it is better to use the
Insert Variable
button to open variable dialog box to avoid problems, rather than creating or editing embedded variables manually.
The maximum number of decimals that can be displayed is five. If a number contains more than five decimal places, the fifth will be rounded.
Provide Feedback
Have questions or feedback about this documentation? Please submit your feedback here.
Normal