beautypg.com

Call 43: retrieve date/ time string, Call 44: retrieve date numeric (day, month, year) – Rockwell Automation 1771-DB BASIC MODULE User Manual

Page 231

background image

Chapter
Call Routines 0–68

12

12 -41

Use CALL 43 to retrieve the current date and time as a string.

Input and Output Arguments

This routine has one input argument and no output arguments. The input
argument is the number of the string to receive the date/time (dd/mm/yy
and hh:mm:ss). You must use the STRING statement (see page 11 -37) to
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

number of string to receive date/time

CALL 43

Example

>10 STRING 100,18

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

>30 PRINT $(1)

>40 END

Use CALL 44 to retrieve the current date on the argument stack as three
numbers.

Input and Output Arguments

This routine has no input arguments and three output arguments.
The output arguments are the day, month and year in that order.

Syntax

CALL 44

POP

day

POP

month

POP

year

Example

>10 REM DATE RETRIEVE - NUMERIC EXAMPLE

>20 CALL 44 : REM INVOKE THE UTILITY ROUTINE

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

>40 PRINT “CURRENT DATE IS”, Y,M1,D

>50 END

>RUN

CURRENT DATE IS 84 12 25

CALL 43: Retrieve
Date/Time String

CALL 44: Retrieve Date
Numeric (Day, Month, Year)