Date/time retrieve string – call 43, Time retrieve string – call 45 – Rockwell Automation 1771-DB Basic Module User Manual - Series A User Manual

Page 106

Advertising
background image

Operating Functions

Chapter 5

5–69

CALL 43 returns the current date and time as a string. PUSH the number
of the string to receive the date/time (dd/mmm/yy HH:MM:SS). You must
allocate a minimum of 18 characters for the string. This requires you to set
the maximum length for all strings to at least 18 characters.

Example:

u10 STRING 100,20

u20 PUSH 1: CALL 43: REM put date/time in string 1

u30 PRINT $(1)

u40 END

CALL 44 returns the current date on the argument stack as three numbers.
There is no input argument to this routine and three variables are returned.
The date is POPed in day, month and year order.

Example:

u10 REM DATE RETRIEVE – NUMERIC EXAMPLE

u20 CALL 44: REM INVOKE THE UTILITY ROUTINE

u30 POP D,M1,Y : REM GET THE DATA FROM THE 30 STACK

u40 PRINT “CURRENT DATE IS”, Y,M1,D

u50 END

uRUN

CURRENT DATE IS 84 12 25

READY

CALL 45 returns the current time in a string (HH:MM:SS). PUSH the
number of the string to receive the time. You must allocate a minimum of 8
characters for the string.

Example:

u10 STRING 100,20

u20 PUSH 1, CALL 45: REM put time in string 1

u30 PRINT $(1)

u40 END

5.9.4
Date/Time Retrieve String –
CALL 43

5.9.5
Date Retrieve Numeric (Day,
Month, Year) – CALL 44 (2)

5.9.6
Time Retrieve String –
CALL 45

Advertising