User`s guide
Programming Example: MCP Menu
The following code implements a menu structure on the MCP. (For a program example that
illustrates using the MCP to teach robot locations, see Teaching Locations With the MCP on
page 344.)
.PROGRAM mcp.main( )
; ABSTRACT: This program creates and monitors a menu structure on the
MCP.
;
; INPUT PARAMS: None
;
; OUTPUT PARAMS: None
;
; GLOBAL VARS: mcp MCP logical unit
;mcp.clr.scr_pendant control code, clear display & home cursor
;mcp.cur.pos_pendant control code, set cursor position
;mcp.off.led_pendant control code, turn off an LED
;mcp.blink.char_pendant control code, start blink position
;mcp.noblink.char_pendant control code, disable blink position
;mcp.beep_pendant control code, beep the pendant
;mcp.tab_pendant control code, tab to next soft button
;mcp.on.led_pendant control code, turn on an LED
AUTO button ;Number of the soft button pressed
AUTO quit ;Boolean indicating menu structure should be
exited
mcp = 1
quit = FALSE
mcp.clr.scr = 12
mcp.cur.pos = 18
mcp.off.led = 28
mcp.blink.char = 2
mcp.noblink.cha = 3
mcp.beep = 7
mcp.tab = 9
mcp.on.led = 31
; Check to see if the MCP is free
IF PENDANT(-3) <> 2 THEN
GOTO 100
END
; Attach to the MCP
ATTACH (mcp)
; Verify ATTACH was successful
IF IOSTAT(mcp) <> 1 THEN
Programming Example: MCP Menu
(Undefined variable: Primary.Product_Name_V)Language User's Guide, version
17.x
Page 279










