A character string that 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 must be identical. A character string can contain a maximum of one placeholder.
Character strings for output are listed in the Text variable property.
property. The associated variable is listed in theSee also
|
Printing a variable (integer data type) as a decimal number |
Code:
Property Text:
Property Text variable:
Output: |
|
Printing a variable (integer data type) as a binary number |
Code:
Property Text:
Property Text variable:
Output: |
|
Printing a variable (integer data type) as an unsigned octal number without a preceding zero |
Code:
Property Text:
Property Text variable:
Output: |
|
Printing a variable (integer data type with maximum 32 bits) as an unsigned hexadecimal number without a preceding "0x" |
Code:
Property Text:
Property Text variable:
Output: |
|
Output of a 64-bit variable (
Note: |
Code:
Property Text:
Property Text variable:
Output: |
|
Printing a variable (integer data type) as an unsigned decimal number |
Code:
Property Text:
Property Text variable:
Output: |
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: |
|
Printing a floating-point number ( |
Code:
Property Text:
Property Text variable:
Output: |
|
Code:
Property Text:
Property Text variable:
Output: |
If the output text in the element property Text variable, then the system time is printed; otherwise it is the value of the variable.
contains the placeholder "%t", then a date and/or time is printed. If a variable is not specified in the property
The names of the days and months are displayed in English by default. 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 and full names.
Time data types include LTIME
, TIME
, TIME_OF_DAY
, TOD
, DATE
, DATE_AND_TIME
, and DT
.
Date and time formats |
||
|
Years with century (4 digits) |
Code:
Property Text:
Property Text variable:
Output: |
|
Years without century (00-99) |
Code:
Property Text:
Property Text variable:
Output: |
|
Years without century (0-99) |
Code:
Property Text:
Property Text variable:
Output: |
|
Months as a full name |
Code:
Property Text:
Property Text variable:
Output: |
|
Months as an abbreviated name |
Code:
Property Text::
Property Text variable:
Output: |
|
Months as a number (01 – 12) |
Code:
Property Text::
Property Text variable:
Output: |
|
Months as a number (1 – 12) |
Code:
Property Text::
Property Text variable:
Output: |
|
Days of week as a number (1=Monday to 7=Sunday) |
Code:
Property Text::
Property Text variable:
Output: |
|
Days of week as a full name |
Code:
Property Text::
Property Text variable:
Output: |
|
Days of week as an abbreviated name |
Code:
Property Text::
Property Text variable:
Output: |
|
Days in month as a number (01 – 31) |
Code:
Property Text::
Property Text variable:
Output: |
|
Days in month as a number (1 – 31) |
Code:
Property Text::
Property Text variable:
Output: |
|
Days in year as a number (001-366) |
Code:
Property Text::
Property Text variable:
Output: |
|
Hours in 24-hour format (00-23) |
Code:
Property Text:
Property Text variable:
Output: |
|
Hours in 12-hour format (01-12) |
Code:
Property Text:
Property Text variable:
Output: |
|
Minutes with leading zeros (00-59) |
Code:
Property Text:
Property Text variable:
Output: |
|
Minutes without leading zeros (0-59) |
Code:
Property Text:
Property Text variable:
Output: |
|
Seconds with leading zeros (00-59) |
Code:
Property Text:
Property Text variable:
Output: |
|
Seconds without leading zeros (0-59) |
Code:
Property Text:
Property Text variable:
Output: |
|
Milliseconds without leading zeros (0-999) |
Code:
Property Text:
Property Text variable:
Output: |
|
For |
Code:
Property Text:
Property Text variable:
Output: Hint: Overflow is permitted in the greatest time unit of a definition. |
|
For |
|
|
If the value is a time < 12h, then A is printed; otherwise P is printed. |
Code:
Property Text:
Property Text variable:
Output: |
|
If the value is a time < 12h, then AM is printed; otherwise PM is printed. |
Code:
Property Text:
Property Text variable:
Output: |
|
If character strings should be printed that correspond to a format definition, then these must be represented in single straight quotation marks. |
|
The format definitions can be represented in a series. |
||
|
Printing the complete time |
Code:
Property Text:
Property Text variable:
Output: |
%t[yyyy-MM-dd dddd] |
Printing the date and day of the week |
Code:
Property Text:
Property Text variable:
Output: |