P
ar
t
2: C
omman
d
s
Moog Animatics SmartMotor™ Developer's Guide, Rev. L
Page 459 of 909
GETCHR
Next Character from Communications Port 0
APPLICATION:
Communications control
DESCRIPTION:
Get the next character in channel 0 serial input buffer
EXECUTION:
Immediate
CONDITIONAL TO:
Requires that a character is in the buffer; communications chan-
nel 0 must be open in data mode
LIMITATIONS:
Maximum buffer length is 31 characters
READ/REPORT:
RGETCHR
WRITE:
Read only
LANGUAGE ACCESS:
Formulas and conditional testing
UNITS:
N/A
RANGE OF VALUES:
-1 to 255
TYPICAL VALUES:
-1 to 255
DEFAULT VALUE:
N/A
FIRMWARE VERSION:
5.x and later
COMBITRONIC:
N/A
DETAILED DESCRIPTION:
GETCHR (or GETCHR0) reads and removes the next available character in the channel 0 serial
receive buffer. It is recommended to check that LEN>0 before issuing the GETCHR command.
Otherwise, it is possible to read an empty receive buffer.
Alternatively, the value returned from GETCHR can be checked to see if it is -1. However, do
not use an ab[] register to store the value in this case, because the value -1 will be aliased
with the character 255. Instead use an aw[] or al[] register.
Normally, the SmartMotor™ interprets incoming characters on communications channel 0 as
commands. However, it is sometimes useful to prevent that from happening and write a
custom command interpreter. This is accomplished by reopening the input channel in data
mode with the OCHN command. For details see OCHN(...) on page 601.
CAUTION:
The OCHN command will cause the SmartMotor to ignore incoming
commands and can lock you out. Therefore, during development, prevent this
by using the RUN? command at the start of each program.
NOTE:
If you get locked out and are unable to communicate with the SmartMotor,
you may be able to recover communications using the SMI software's
Communication Lockup Wizard. For more details, see Communication Lockup
Wizard on page 30.
Part 2: Commands: GETCHR
Содержание SmartMotor
Страница 1: ...Developer s Guide Class 5 Later SmartMotor Technology with TM ...
Страница 909: ...PN SC80100003 002 Rev L ...