Programming Example: Pendant Menu WAIT.EVENT , 0.1 END DETACH (1) Notes on Key Behaviors On the T20 pendant, all Green keys and Select Robot will still have their normal functionality when in a Custom Window (through PDNT.WRITE). All other keys will have their primary functionality disabled. These keys are intended to be read by the eV+ program through the PENDANT instruction. Monitoring the Pendant Speed Signal The speed that is sent from the pendant has a value from 1 to 100 depending on the currently displayed speed on the Pendant. An argument of -2 to the PENDANT( ) function returns this value to eV+.
The following example shows how to print the currently displayed Pendant speed to the monitor. ; Set the OK key to toggle KEYMODE 18 = 1 ; Display speed value until the OK key is pressed DO TYPE PENDANT(-2) WAIT UNTIL PENDANT(18) Reading the State of the Pendant It is good programming practice to check the state of the pendant before ATTACHing to it. The instruction: cur.state = PENDANT(-3) returns a value to be interpreted as follows: 1. Indicates that the pendant is in the Background state (not ATTACHed to an application program). 2. Indicates that an error is being displayed. 3. Indicates that the pendant is in the USER state (ATTACHed to an application program).
See the section Programming Example: Pendant Menu for a program example that checks the pendant state. Programming Example: Pendant Menu The following code implements a menu structure on the Omron Adept T20 pendant. The resulting screens are shown after the code sample. eV+Language User's Guide, v2.x, 18318-000 Rev A Page 183