Entry type: FAQ, Entry ID: 25158897, Entry date: 03/26/2007
(1)
Rate

What is the structure of the format instruction for displaying the contents of WinCC tag values at Runtime in the user text blocks of a message?

  • Entry
  • Associated product(s)

Instructions:
If the contents of process tags are to be displayed via process value blocks in user text blocks at Runtime, you need a special format instruction in the user text block. The format instruction defines the process value blocks as well as the position, data type and optional format parameters (number of digits, precision, alignment) for the display at Runtime.

The Alarm Logging editor provides a selection dialog - "Insert Process Value" - for configuring the message text so that you can conveniently create and insert the format instruction.


Fig. 01

In the "Output" area of this dialog is a display of the format string that will be inserted into the user text when you click on the "OK" button. An output field shows an example of how the process value will be displayed at Runtime. In this way you can see the effect of the format parameters selected already at the time of configuration.

Detailed information on this topic is available in the WinCC Online Help (up to V6.0) under:

  •  "Properties of a single message"

or in the WinCC Information System (as from V6.2) under:

  • "Working with WinCC > Setting up a message system > Configuring the message system > Working with single messages > How to specify the texts of a single message".
  • "Working with WinCC > Setting up a message system > Configuring the message system > Working with single messages > How to insert the process values in the user text blocks".

In some cases it might be useful or necessary to know the structure of the format instruction, because sometimes it is not possible or useful to use the "Insert Process Value" selection dialog.

  • The message is not configured in the "Alarm Logging" editor. You can edit messages with Microsoft Excel (e.g. Configuration Tool , Archive Configuration Tool, .csv file) or as part of chronological reporting in STEP 7. The "Insert Process Value" dialog is not available in such cases.
  • The format of existing messages is to be changed. If you use the "Insert Process Value" dialog for this, you must delete the existing format instruction manually, because the selection dialog always inserts a new format instruction. Under certain circumstances it is easier to edit the format instruction directly.
  • The format instruction is similar to the "printf" format instruction in the "C" programming language. However, the "Insert Process Value" selection dialog does not support all the output options. For example:
    • The format parameter lowercase "x" is always used by default for displaying hexadecimal number values. This causes the characters always to be displayed as lowercase with hexadecimal numbers. The format parameter uppercase "X" is used for displaying uppercase characters; it is not supported by the "Insert Process Value" selection dialog.
    • The format parameter "f" is always used for displaying floating-point values. The format parameters "g" and "e" are not supported by the "Insert Process Value" selection dialog.

Below is a description of the main parameters of the format instruction:

@<N>%[A][Y][.Z]<F>@

or

@<N><printf-Formatstring>@

Note:
The following description uses square and pointed brackets. These are used to describe the different parameters of the format instruction. They are not specified in the format string.

  • The parameters in square brackets "[]" are optional parameters that can also be omitted.
  • The parameters in pointed brackets "<>" are mandatory parameters that must be specified.
  • Part of the format instruction ("printf format string") is similar to the printf format instruction of the "C" programming language. Detailed information on this is available in the associated documentation, relevant literature and the Internet.
  • The description of the parameters contains (when available) the names of the input field, selection fields and selection options that are provided by the "Insert Process Value" dialog.
N "Process value block:" selection field
Number of the process value block that is to be incorporated in the user text block.
1..10 You can use the numbers of the process value blocks 1 to 10.
F "Type:" selection field
You must choose this parameter so that it matches the data type of the WinCC tag that is connected with the process-associated value.
s "Text:"
For process-associated values of the data types:
  • Text tag 8-bit font
  • Text tag 16-bit font

Note:
WinCC tags of the type "Text reference" are not possible as process-associated values.

d "Fixed Point Number (decimal)"
Process-associated value of the data type "Signed Integer":
  • Binary variable
  • Signed or unsigned 8-bit value
  • Signed or unsigned 16-bit value
  • Signed or unsigned 32-bit value

The display is decimal with sign.

o "Fixed Point Number (octal)"
Process-associated value of the data type "Signed Integer":
  • Binary variable
  • Unsigned 8-bit value
  • Unsigned 16-bit value
  • Unsigned 32-bit value

The display is octal.

x "Fixed Point Number (hexadecimal)"
Process-associated value of the data type "Signed Integer":
  • Binary variable
  • Unsigned 8-bit value
  • Unsigned 16-bit value
  • Unsigned 32-bit value

The display is hexadecimal, where lowercase characters are used for the display in the number value.

X No setting option in the "Insert Process Value" dialog
Like "x".
The display is hexadecimal, where uppercase characters are used for the display in the number value.
f "Floating Point Number"
Process-associated value of the type "Floating Point Number":
  • Floating point number 32-bit IEEE 754
  • Floating point number 64-bit IEEE 754

Unless otherwise defined the display is with 6 decimal places.

e No setting option in the "Insert Process Value" dialog
Process-associated value of the type "Floating Point Number":
  • Floating point number 32-bit IEEE 754
  • Floating point number 64-bit IEEE 754

The display is in exponential format.

Y "Number of digits:" input field
Total width (number of characters) of the display.

Note:
This value represents the total number of characters for displaying the value. Spaces, leading zeros and decimal separators (point) are included in this value.
Z "Precision:" input field
Number of decimal places
A "Align left" option field
Alignment.
If this specification is not used, the alignment is to the right.
+ align right
- align left
0 "Pad with 0" option field
If you use this parameter, the display is filled with zeros to the total width of the display (Parameter "Y").

The following figures show sample configurations of the different display formats and the associated display at Runtime.


Fig. 02


Fig. 03


Fig. 04

Error details
Detailed error description
Help us to improve Online Support.
The page requested cannot be displayed. Please contact the webmaster.
Contact to webmaster