beautypg.com

Rockwell Automation GMLC Reference Manual User Manual

Page 460

background image

Publication GMLC-5.2 - November 1999

On Key Press

423

Checking for Any Key

Selecting Any Key, with If Key selected, causes program flow to branch
to the true node (at the top of the block) if any keystroke character has
been received by serial port B. If no character has been received, program
flow branches to the false node (at the bottom of the block). This selection
is useful for determining that a key has been pressed or a character
received before evaluating it.

Waiting for Any Key

Selecting Any Key, with Wait for Key selected, pauses the program until
any keystroke character has been received by the serial port B. This
selection is useful for waiting for a keystroke character to be received
before evaluating it.

Waiting or Checking for a Specific Key

The effect of selecting Specific Key from the Key Type menu depends
upon your Type selection (Wait for Key or If Key), as follows.

Checking for a Specific Key

Selecting Specific Key, with If Key selected, causes program flow to
branch to the true node (at the top of the block) only if the specific
character, entered in the data entry box, has been received by serial port
B. If any other character (or no character) has been received, program
flow branches to the false node (at the bottom of the block).

This selection is useful for interpreting a received keystroke character
before taking specific action. For example, the following example checks
for either a + or – character to be received and then moves an axis in the
appropriate direction.