24
Rev. 1.0
0006302013
TSM24S/Q Hardware Manual
+86-400-820-9661
8.4 SCL Command Reference
The Serial Command Language (SCL) was developed to give users a simple way to control a
motor drive via a serial port. This eliminates the need for separate motion controllers or indexers
to supply Pulse and Direction signals to the drive. It also provides an easy way to interface to a
variety of other industrial devices such as PLCs and HMIs, which often have standard or optional
serial ports for communicating to other devices. Some examples of typical host devices might be:
•
A Windows based PC running MOONS’ software
•
An industrial PC running a custom or other proprietary software application
•
A PLC with an ASCII module/serial port for sending text strings
•
An HMI with a serial connection for sending text strings
SCL commands control the motion of the step motor, use of the inputs and outputs, and configure
aspects of the drive such as motor current and microstep resolution.
In SCL mode, the TSM24S/Q receives commands from the host, executing them immediately or
sending them to a command buffer and then executing them directly from the buffer. It cannot,
however, create a stored program for stand-alone operation. For that function, the TSM24Q is
needed.
The communications protocol of SCL is simple in that the host initiates all communication, with one
exception. The only time the drive will initiate communication is at power-up. At that time, the drive
will send an identifier to tell the software which drive is connected and what the firmware version
is.
There are two types of SCL commands: buffered and immediate. Buffered commands are loaded
into and then executed out of the drive’s command buffer. Buffered commands are executed
one at a time and in sequential order. The buffer can be filled with commands without the host
controller needing to wait for a specific command to execute before sending the next command.
Special buffer commands enable the buffer to be loaded and to pause for a desired time.
Immediate commands are not buffered, but are executed immediately, running in parallel with a
buffered command if necessary. Immediate commands are designed to access the drive at any
time and can be sent as often as needed. This allows a host controller to get information from the
drive at a high rate, most often for checking drive status or motor position.
The basic structure of a command packet from the host to the drive is always a text string followed
by a carriage return. The text string is composed of the command itself, followed by any required
parameters. A carriage return denotes the end of transmission to the drive.
The syntax of the command is
XXAB<cr>
where
XX
designates the command (always composed of 2 uppercase letters), and
A
and
B
define the possible parameters. These parameters can vary in length, can be letters or numbers,
and are often optional. Once a drive receives the
<cr>
(carriage return), it will determine whether
or not it understood the command-if it did, it will either execute or buffer the command. The drive
can also be programmed ahead of time to send a response as to whether or not it understood the
command as well as any error code.