Moog Animatics SmartMotor™ Developer's Guide,Rev. L
Page 102 of 909
used to direct the adapter to be in transmit or receive mode according to the motor’s
communication activity, and I/O 6 will no longer be used as an I/O communications port.
M-style motors are supplied with RS-485 on COM 0; D-style motors require an adapter for
RS-485 on COM 0, but they have built-in RS-485 available on COM 1.
CCHN(type,channel)
Close a communications channel
Use the CCHN command to close a communications port when desired.
NOTE: If you are unable to communicate with the SmartMotor, you may be able to
recover communications using the Communication Lockup Wizard, which is on the
SMI software Communication menu. For details, see the SMI software online help,
which is accessed by pressing the F1 key or selecting Help from the SMI software
main menu.
BAUDrate, BAUD(channel)=formula
Set BAUD rate (RS-232 and RS-485)
The BAUD command sets the speed or baud rate of the specified serial channel. To do this,
use:
l
BAUDrate: sets the baud rate of the main channel
l
BAUD(channel)=formula: sets the baud rate of the specified serial channel
where rate and formula are the desired baud rate, and (channel) is 0 or 1 for channel 0 or
channel 1, respectively. Valid values for rate and formula are: 2400, 4800, 9600, 19200,
38400, 57600, or 115200. For additional motor-specific details, see Product-Specific Table on
page 298.
PRINT(), PRINT1()
Print to RS-232 or AniLink channel
A variety of data formats can exist within the parentheses of the PRINT() command.
l
A text string is marked as such by enclosing it between double quotation marks.
l
Variables can be placed between the parentheses as well as two variables separated by
one operator.
l
To send out a specific byte value, prefix the value with the # sign and represent the
value with as many as three decimal digits ranging from 0 to 255.
l
Multiple types of data can be sent in a single PRINT() statement by separating the
entries with commas.
NOTE: Do not use spaces outside of text strings because the SmartMotor
uses spaces, carriage returns and line feeds as delimiters.
The following are all valid print statements that transmit data through the main RS-232
channel:
PRINT("Hello World") 'text
PRINT(a*b) 'exp.
PRINT(#32) 'data
PRINT("A",a,a*b,#13) 'all
Part 1: Programming: CCHN(type,channel)