Call 45 – retrieve time string, Call 45 – retrieve time string -5, Example – Rockwell Automation 1746-BAS BASIC LANGUAGE User Manual

Page 127: Purpose, Syntax

Advertising
background image

Publication 1746-RM001A-US-P

Clock/Calendar Functions 10-5

Example

>1

REM EXAMPLE PROGRAM

>10 REM DATE RETRIEVE - NUMERIC EXAMPLE

>20 CALL 44 : REM INVOKE THE UTILITY ROUTINE

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

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

>50 END

READY

>RUN

CURRENT DATE IS

91

6

19

READY

>

CALL 45 – Retrieve Time
String

Purpose

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

Syntax

PUSH [string number]
CALL 45

Example

>1

REM EXAMPLE PROGRAM

>10 STRING 100,20

>20 PUSH 1 : CALL 45 : REM PUT TIME IN STRING 1

>30 PRINT $(1)

>40 END

READY

>RUN

06:40:49

READY

>

Advertising