User`s guide

Controlling the Pendant
The MCP responds to a number of control codes that affect the LCD panel (whether or not
the buttons are repeat buttons) and the LEDs associated with the pendant buttons. The
control codes are listed in the table Pendant Control Codes. The control codes are sent as
ASCII values using the WRITE instruction. The normal way to send control codes is to use
the $CHR() function to convert a control code to its ASCII value.
Control Codes for the LCD Panel
To clear the display and position the cursor in the middle of the top line, issue the instruction:
WRITE(mcp_lun) $CHR(12), $CHR(18), $CHR(20), /S
$CHR(12) clears the pendant and places the cursor at position 1 (see the figure Pendant LCD
Display). $CHR(18) indicates that the next value received should be interpreted as a cursor
location. $CHR(20) indicates the cursor should be placed at position 20. /S must be
appended to the WRITE instruction or a <CR-LF> will be sent. Notice that using control code
18 allows you to position the cursor without disturbing existing text.
The following code will place the text EXIT in the middle of the bottom line and set the text
blinking.
WRITE(mcp_lun) $CHR(18), $CHR(58), "EXIT", /S
WRITE(mcp_lun) $CHR(18), $CHR(58), $CHR(22), $CHR(4), /S
$CHR(22) tells the pendant to start a series of blinking positions starting at the current
cursor location and extending for the number of positions specified by the next control code
($CHR(4)). This code will cause any text in positions 58 - 61 to blink until an instruction is
sent to cancel the blinking. The following code line disables the blink positions:
WRITE(mcp_lun) $CHR(18), $CHR(58), $CHR(23), $CHR(4), /S
$CHR(23) tells the pendant to cancel a series of blinking positions starting at the current
cursor location and extending for the number of positions specified by the next control code
($CHR(4)).
Text can be made to blink as it is written to the display, regardless of the position the text is
in. The following code writes the text EXIT to the middle of the bottom line, starts the E
blinking, and then beeps the MCP:
WRITE(mcp_lun) $CHR(18), $CHR(58), $CHR(2), "E", /S
WRITE(mcp_lun) $CHR(3), "XIT", /S
WRITE(mcp_lun) $CHR(7), /S
$CHR(2) starts blink mode. Any characters sent to the MCP display will blink. Blink mode is
canceled by $CHR(3). $CHR(3) cancels blink mode for subsequent characters; it does not
Controlling the Pendant
(Undefined variable: Primary.Product_Name_V)Language User's Guide, version
17.x
Page 273