A character string which is output in the visualization can include the placeholder
%
for a variable. At runtime, the placeholder is replaced by the actual value of the
variable in the defined format. The data type in the format definition and of the
variable have to be identical. A character string can contain a maximum of one placeholder.
Character strings for output are listed in the “Text” property. The assigned variable is listed in the “Text variable” property.
For the output of integers
|
Output of variable (integer data type) as decimal number |
Code: Property “Text”: Property “Text variable”: Output: |
|
Output of variable (integer data type) as binary number |
Code: Property “Text”: Property “Text variable”: Output: |
|
Output of variable (integer data type) as unsigned octal number without a preceding zero |
Code: Property “Text”: Property “Text variable”: Output: |
|
Output of variable (integer data type with max. 32 bits) as unsigned hexadecimal number without a preceding "0x" |
Code: Property “Text”: Property “Text variable”: Output: |
|
Output of 64-bit variable ( Note: |
Code: Property “Text”: Property “Text variable”: Output: |
|
Output of variable (integer data type) as unsigned decimal number |
Code: Property “Text”: Property “Text variable”: Output: |
For the output of floating-point numbers
Floating-point numbers have the data type REAL
or LREAL
.
|
In decimal form with decimal point in format 1.6 |
Code: Property “Text”: Property “Text variable”: Output: |
|
As decimal number in user-defined format
|
Code: Property “Text”: Property “Text variable”: Output: |
|
Output of floating-point number ( |
Code: Property “Text”: Property “Text variable”: Output: |
|
Code: Property “Text”: Property “Text variable”: Output: |
For the output of text
|
Output of single character in ASCII character set |
Code: Property “Text”: Property “Text variable”: Output: |
|
Output of character string |
Code: Property “Text”: Property “Text variable”: Output: |
For the output of the percent sign
|
Output of percent sign in character string |
Property “Text”: Output: |
Code: Property “Text”: Property “Text variable”: Output: |
For the output of the date and time
If the output text in the element “Text” property contains the placeholder "%t", then a date and/or time is output. If a variable is not specified in the “Text variable” property, then the system time is output; otherwise it is the value of the variable.
By default, the names of the days and months are displayed in English. If localized
texts are used, then the text list System
has to be supplemented. This text list is created automatically in the “POUs” view when the placeholder %t is used. The English terms have to be used as the ID
here. The localization can be done for both the abbreviated names and full names.
Time data types include LTIME
, TIME
, TIME_OF_DAY
, TOD
, DATE
, DATE_AND_TIME
, and DT
.
Compatibility Notice
Compatibility Notice
In order to get the usual display, in V3.5 SP17 and higher, as a rule three digits
are used for the output of fractions of a second (ms/µs/ns). Example: In %t[dd-HH:mm:ss:ms]
, ms
is specified with three digits for the milliseconds. For this purpose, the two-digit
ms number is prepended with a zero. If a two-digit output is desired (like before
V3.5 SP17), then a special compiler define has to be set in the compiler properties
of the application: VISU_MILLISEC_NOLEADING_ZERO
.
Date and time formats |
||
|
Year with century |
Code: Property “Text”: Property “Text variable”: Output: |
|
Year without century (00–99) |
Code: Property “Text”: Property “Text variable”: Output: |
|
Year without century (0–99) |
Code: Property “Text”: Property “Text variable”: Output: |
|
Month as full name |
Code: Property “Text”: Property “Text variable”: Output: |
|
Month as abbreviated name |
Code: Property “Text”:: Property “Text variable”: Output: |
|
Month as number (01–12) |
Code: Property “Text”:: Property “Text variable”: Output: |
|
Month as number (1–12) |
Code: Property “Text”:: Property “Text variable”: Output: |
|
Day of week as number (1=Monday – 7=Sunday) |
Code: Property “Text”:: Property “Text variable”: Output: |
|
Day of week as full name |
Code: Property “Text”:: Property “Text variable”: Output: |
|
Day of week as abbreviated name |
Code: Property “Text”:: Property “Text variable”: Output: |
|
Day of month as number (01–31) |
Code: Property “Text”:: Property “Text variable”: Output: |
|
Day of month as number (1–31) |
Code: Property “Text”:: Property “Text variable”: Output: |
|
Day of year as number (001–366) |
Code: Property “Text”:: Property “Text variable”: Output: |
|
Hour in 24-hour format (00–23) |
Code: Property “Text”: Property “Text variable”: Output: |
|
Hour in 12-hour format (01–12) |
Code: Property “Text”: Property “Text variable”: Output: |
|
Minutes with leading zero (00–59) |
Code: Property “Text”: Property “Text variable”: Output: |
|
Minutes without leading zero (0–59) |
Code: Property “Text”: Property “Text variable”: Output: |
|
Seconds with leading zero (00–59) |
Code: Property “Text”: Property “Text variable”: Output: |
|
Seconds without leading zero (0–59) |
Code: Property “Text”: Property “Text variable”: Output: |
|
Milliseconds without leading zero (0–999) |
Code: Property “Text”: Property “Text variable”: Output: |
|
Only for |
Code: Property “Text”: Property “Text variable”: Output: Hint: Overflow is permitted in the greatest time unit of a definition. |
|
Only for |
|
|
If the value is a time < 12h, then A is output; otherwise P is output. |
Code: Property “Text”: Property “Text variable”: Output: |
|
If the value is a time < 12h, then AM is output; otherwise PM is output. |
Code: Property “Text”: Property “Text variable”: Output: |
|
If character strings should be output which correspond to a format definition, then these have to be represented in single straight quotation marks. |
|
|
||
|
A number (<n>) which defines the number of decimal places of the time value follows the letters which define the time unit (<f>). As a result, the hours, minutes, and seconds (for TIME values) and also the microseconds and nanoseconds (for LTIME values) can be specified or displayed as values with decimal places. Note: Even if a decimal number is not desired for the input or display, at least the number "0" has to be specified to allow for fractional input. |
Examples of the formating
|
The format definitions can be represented in a series. |
||
|
Output of the time |
Code: Property “Text”: Property “Text variable”: Output: |
%t[yyyy-MM-dd dddd] |
Output of the date and day of the week |
Code: Property “Text”: Property “Text variable”: Output: |
See also