Translating -13, Translating – Rockwell Automation 1747-PBASE BASIC Development Software Programming Manual User Manual

Page 85

Advertising
background image

Publication 1746-PM001A-US-P

Writing Programs Using the BASIC Development Language 6-13

14. Continue typing in the rest of the program as shown:

hit_any_key( )

{pause and wait for keystroke}

cls ( )

{$L loop1}

Print “Enter your Operator Number”

{pause and wait for input}

get_key (op)

{check for input of 49 or 50 which are ASCII decimal for

1 or 2 }

if op=49 then goto op1setup

if op=50 then goto op2setup

{print error and loop back for another entry}

cls ( )

print “Invalid Entry . . Operator number not recognized”

goto loop1

{$L op1setup}

get_time (d1,m1,y1)

{setup for operator #1}

goto acknowledge

{$L op2setup}

get_time (d2,m2,y2)

{setup for operator #2}

{$L acknowledge}

cls ( )

cursor_down(11)

print_time ( )

print “Operator #”,op-48.” acknowledged”

end

Translating

Since this example is written using the BASIC development language, it must be
translated to the BASIC Language prior to downloading to the module. Do this by
selecting Translate/Compile from the Other menu, and then selecting
1747-PBASE Translator. The program on the following page is the previous
program after it is translated.

Advertising