Program 20:

Figure 6-1 Example 3–Screen Menu Program

 

[SCREEN 1]

Name the main program

MS1,““

Clears keypad screen

MS3,“Select a Part”

Writes a Message

MS21,”Part A Part B Part C”

Writes a message above function keys

FK1,2,3,17,18

Wait for selected key press

GT(FKEY)

Jumps to prog# 1, #2, or #3 if F1,F2, or F3 is pressed Jumps to prog #17, or

 

#18 if the up or down arrow keys are pressed.

EN

End of Routine

Program 18:

 

[SCREEN 2]

MS21,“Part D Part E Part F” FK1,2,3,17,18 IF(FKEY)=17 GT[SCREEN 1] IF(FKEY)=18 GT[SCREEN 3] EB

GT(FKEY)

EN

Program 17:

Writes a message above F1, F2, F3.

Wait for selected key press

EB If Up arrow goto screen 1

If Down arrow goto screen 3 (FKEY)=(FKEY)+3 Add offset to FKEY variable to goto correct part subroutine.

Jumps to part D, E, F in program#4, 5, or 6

End of Routine

[SCREEN 3]

 

MS21,“Part G Part H Part J”

Writes a message above function keys.

FK1,2,3,17,18

Wait for selected key press

IF(FKEY)=17 GT[SCREEN 2] EB

If Up arrow goto screen 2

IF(FKEY)=18 GT[SCREEN 1] EB

If Down arrow goto screen 1

(FKEY)=(FKEY)+6

Add offset to FKEY variable to goto correct part subroutine

GT(FKEY)

Jumps to part G, H, J in program #7,8 or 9

EN

End of Routine

The programs to make Parts A, B, C, D, etc. are in program numbers 1–9. To continuously cycle through put a GT[SCREEN 1] at the end of each part program.

6-8 Keypad Programming

MN1854

Page 63
Image 63
Baldor mn1854 manual Example 3-Screen Menu Program