← Strings and Text

Timestamp Message

medium

Turns the controller's date and time into an operator message with AM or PM.

What it teaches

GSV(WallClockTime,,LocalDateTime,…) fills seven DINTs: year, month, day, hour, minute, second and microsecond. A message needs each part as text with two digits, '08:06' and not '8:6', which looks right only until the first minute under 10. Pad each field to two digits, as the serial number was padded to four in Serial Number Text. On a 12-hour clock, hour 0 is 12 AM, hour 12 is 12 PM and hour 13 is 01 PM. CONCAT joins two texts at a time, so the message is built one part after another.

Parameters

TagDirectionTypeDefaultDescription
Ref_ClockInOutDINT[7]—Year, month, day, hour, minute, second, microsecond
Ref_MessageInOutSTRING—The message for the operator screen

Required behavior