Call 43 – retrieve date/ time string, Call 44 – retrieve date numeric, Purpose – Rockwell Automation 1746-BAS BASIC LANGUAGE User Manual

Page 126: Syntax, Example

Advertising
background image

Publication 1746-RM001A-US-P

10-4 Clock/Calendar Functions

CALL 43 – Retrieve Date/
Time String

Purpose

Use CALL 43 to return 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.

Syntax

PUSH [string number]
CALL 43

Example

>1

REM EXAMPLE PROGRAM

>10 STRING 100,20

>20 PUSH 1: CALL 43: REM PUT DATE/TIME IN STRING 1

>30 PRINT $(1)

>40 END

READY

>RUN

16-JUN-91 13:35:00

READY

>

CALL 44 – Retrieve Date
Numeric

Purpose

Use CALL 44 to return 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 POPped in day, month and year order.

Syntax

CALL 44
POP [day]
POP [month]
POP [year]

Advertising