String variable syntax

String embedded variables use this format:
/*LS:# Tag_name*/
The syntax is:
  • an opening escape sequence ‘/*’
  • followed by the letter 'L' (for Literal), which prevents a tag read for the variable. This is inserted into the syntax if the Literal string option is chosen in the String Variable dialog box.
  • followed by the letter 'S'
  • followed by a colon ':'
  • followed by a numeric length field; (if the check box
    Fixed number of characters
    is selected in the
    String Variable
    dialog box)
  • 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 closing escape sequence '*/'
    TIP:
    If the check boxes
    Fixed number of characters
    and
    Right-most characters
    are selected in the
    String Variable
    dialog box, the numeric field length will be a negative number.
    If the check boxes
    Fixed number of characters
    and
    Show * character if string is longer than field width
    are selected in the
    String Variable
    dialog box, the keyword SHOWSTAR will be added to the embedded variable string after the tag or parameter field.
For example, to display the current value of a string tag called
Blower_status
, with a fixed length of 20 characters, you would type this:
/*S:20 Blower_status*/
On the display during development, you would see as many '
s
' characters as specified in the variable, in this case, 20:
ssssssssssssssssssss
At runtime, you would see the value of the tag displayed as a string:
Functioning normally
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.
Provide Feedback
Have questions or feedback about this documentation? Please submit your feedback here.
Normal