Rockwell Automation 57C610 Enhanced Basic Language, AutoMax User Manual
Page 69

6Ć29
port A and then closes the port. If USERNAME$ is blank, KYBD.BAS
prompts the user to enter his name. DISPLAY.BAS displays the
message Hello World" and the user name if USERNAME$ is not
blank. Because KYBD.BAS closes the port after setting the port
characteristics, any task in the Processor can access (read from or
write to) the port without using a logical device number with the
INPUT, PRINT, GET or PUT statements.
{KYBD.BAS task}
100 COMMON USERNAME$
:
900 USERNAME$ = "
:
1000
OPEN PORTA" AS FILE #1, SETUP=(0800H,
9600) \ CLOSE #1
:
2000
IF USERNAME$ = " THEN
PRINT ; CLRSCR$(2); CURPOS$( 10,10);
Please enter your name ;
INPUT USERNAME$
END_IF
2100
DELAY 10 TICKS \ GOTO 2000
:
32767
END
{DISPLAY.BAS}
100
COMMON USERNAME$
:
900
USERNAME$ = "
:
2000
IF USERNAME$ <> " THEN
PRINT ; CURPOS$(20,10); Hello World, my
name is ; USERNAME$;
DELAY 5 SECONDS \ USERNAME$ = "
END_IF
2100
DELAY 10 TICKS \ GOTO 2000
:
32767
END