Call 46 – retrieve time numeric, Call 47 – retrieve day of week string, Purpose – Rockwell Automation 1746-BAS BASIC LANGUAGE User Manual

Page 128: Syntax, Example

Advertising
background image

Publication 1746-RM001A-US-P

10-6 Clock/Calendar Functions

CALL 46 – Retrieve Time
Numeric

Purpose

Use CALL 46 to return the time of day in numeric form. Retrieve the time of day
in numeric form by executing CALL 46 and POPping the three variables off of the
argument stack on return. There are no input arguments. The time is POPped in
hour, minute, and second order.

Syntax

CALL 46
POP [hour]
POP [minute]
POP [second]

Example

>1

REM EXAMPLE PROGRAM

>10 REM TIME IN VARIABLES EXAMPLE : REM GET THE WALL CLOCK

TIME

>20 CALL 46

>30 POP H,M,S

>40 PRINT

“CURRENT TIME IS ”,H,M,S

>50 END

READY

>RUN

CURRENT TIME IS

6

43

7

READY

>

CALL 47 – Retrieve Day
of Week String

Purpose

Use CALL 47 to return the current day of week as a 3-character string. PUSH the
number of the string to receive the day of week. You must allocate a minimum of 3
characters per string. Strings returned are SUN, MON, TUE, WED, THU, FRI,
and SAT.

Syntax

PUSH [string number]
CALL 47

Example

>1

REM EXAMPLE PROGRAM

>10 STRING 100,20

Advertising