Suffixes

Home  Back  Next

 

Using a suffix, a value can be displayed in a different format.

 

Suffixes

Syntax

Used for

Area

Data type

Variant Data Type

Comment

Date and Time in String Format

ISO

DT

1990-1-1-00:00:00.000 bis

2098-12-31-24:59:59.999*

STRING

VT_BSTR

The suffix DT is used to show the data saved in the PLC as a combined data type DATE_AND_TIME and is transfered as a string. The data type DATE_AND_TIME has 8 bytes (64 bits) in the PLC. The year, the month, the day, the hour, the minutes, the seconds and the milliseconds are included. Remember to use the correct separators (hyphen, colon and period)!

BCD

BCD

Byte

Word

DWord

QWord

Byte: 0 to 99

Word: 0 to 999

DWord: 0 to 9999999

QWord: 0 to 9999999999999999

VT_I1

VT_I2

VT_I4

VT_I8

VT_I1

VT_I2

VT_I4

VT_I8

With the BCD suffix, the data stored in the PLC is represented as an unsigned, binary-encoded value. For example, the decimal value “65535” will be represented as “9999”.

ASCII to Hex

KA

String

HEX: 0 to 9, A to F

STRING

VT_BSTR

With the KA suffix, the data stored in the PLC is represented as HEX characters.

Signed

KF

Byte

Word

DWord

QWord

Byte:  -128 to 127

Word: -32768 to 32767

DWord: -2147483648 to 2147483647

QWord −9.223.372.036.854.775.808 to 9.223.372.036.854.775.807        

CHAR

SHORT

LONG

LLONG

VT_I1

VT_I2

VT_I4

VT_I8

With the KF suffix, the data stored in the PLC is represented as a signed fixed point number.

S5-KG

KG

DWord

0.1469368E-38 to 0.1701412E39

Attention: The KG area in the PLC is larger than in the PC!

REAL

VT_R4

With the KG suffix, the data stored in the PLC is treated as a 4-byte floating point number.

S5-KT-Format

KT

Word

000.0 to 999.3

STRING

VT_BSTR

With the KT suffix, the data stored in the PLC is represented as a 2-byte time constant. The time base is included in addition to the time value. The value range is from 000.0 to 999.3

S5 Time

S5T

Word

0ms to 2h46m30

STRING

VT_BSTR

With the S5T suffix, the data stored in the PLC is represented as S5TIME (SIMATIC time). The S5TIME data type occupies one 16-bit word and is the product of the time value and the time interval (time base). The time duration is given in hours, minutes, seconds and milliseconds. The BCD number format is used for internal representation. The value range is from 0 ms to 2h46m30s. The smallest value is 10ms.

Date

D

Word

1990-01-01 bis

2168-12-31

STRING

VT_BSTR

The suffix D is used to show  the data saved on the PLC as data type DATE. The DATE data type occupies one word. The content corresponds to  the number of days since  01.01.1990. The representation contains the year, the day and the month, separated by a hyphen.September 1, 2006 is shown as 2006-01-09. The value range is from 0 (0 days since 01.01.1990: 1990-01-01) to 65378 (65378 days since 01.01.1990: 2168-12-31).

Rules for use of suffix D:

The years 1990 up to and including 2089 can be specified with 2 or 4 positions.The years starting with 2090 must be entered with 4 positions.
90 to 99 ==> 1990 to 1999
00 to 89 ==> 2000 to 2089
The months and days can be specified with either 1 or 2 positions.
Anything but numbers can be used as a separator (e.g., 89/09/17). Any number of separators can be used.

Time

T

DWord

-24d20h31m23s648ms

to

24d20h31m23s647ms

STRING

VT_BSTR

With the T suffix, the data stored in the PLC is represented as the TIME data type. The TIME data type occupies one double word (32 bits). The representation contains the days (d), hours (h), minutes (m), seconds (s) and milliseconds (ms). Milliseconds can be omitted.

The value range is from -2147483648 (-24d20h31m23s648ms) to 2147483647 (24d20h31m23s647ms)

Time of Day

TOD

DWord, DInt

0:0:0.0 to 23:59:59.999

STRING

VT_BSTR

The TOD suffix is used to show the data saved on the PLC as data type TIME_OF_DAY. The data type TIME_OF_DAY occupies one double word (32 bits). The representation contains the information for hours:minutes:seconds and .milliseconds. Milliseconds can be omitted.

The value range goes from 0:0:0.0 to 23:59:59.999.

TimeReal

TR

Word

0.01 to 9990.0

REAL

VT_R4

With the TR suffix, the data stored in the PLC is represented as the TIME REAL data type.

The value range is from 0.01 to 9990.0 (s)

Swap bytes

SWAP

String

Word, Int

DWord, DInt

QWord, QInt

Real, Double

Exchange high byte and low byte

original data type

 

original data type

High byte and low byte of the tags stored in the PLC are exchanged. Important for strings in Modbus PLCs.

Comment

_comment

all items

gives the comment of the item

STRING

VT_BSTR

Only for OPC DA returns the comment of the item. It is write protected.

* ms can be omitted.