The information in this manual has been checked carefully and is believed to be accurate; however, Opto 22 assumes no
responsibility for possible inaccuracies or omissions. Specifications are subject to change without notice.
Opto 22 warrants all of its products to be free from defects in material or workmanship for 30 months from the
manufacturing date code. This warranty is limited to the original cost of the unit only and does not cover installation, labor,
or any other contingent costs. Opto 22 I/O modules and solid-state relays with date codes of 1/96 or newer are guaranteed
for life. This lifetime warranty excludes reed relay, SNAP serial communication modules, SNAP PID modules, and modules
that contain mechanical contacts or switches. Opto 22 does not warrant any product, components, or parts not
manufactured by Opto 22; for these items, the warranty from the original manufacturer applies. These products include,
but are not limited to, OptoTerminal-G70, OptoTerminal-G75, and Sony Ericsson GT-48; see the product data sheet for
specific warranty information. Refer to Opto 22 form number 1042 for complete warranty information.
Wired+Wireless controllers and brains are licensed under one or more of the following patents: U.S. Patent No(s). 5282222,
RE37802, 6963617; Canadian Patent No. 2064975; European Patent No. 1142245; French Patent No. 1142245; British Patent
No. 1142245; Japanese Patent No. 2002535925A; German Patent No. 60011224.
ActiveX, JScript, Microsoft, MS-DOS, VBScript, Visual Basic, Visual C++, Windows, and Windows Vista are either registered
trademarks or trademarks of Microsoft Corporation in the United States and other countries. Linux is a registered
trademark of Linus Torvalds. Unicenter is a registered trademark of Computer Associates International, Inc. ARCNET is a
registered trademark of Datapoint Corporation. Modbus is a registered trademark of Schneider Electric, licensed to the
Modbus Organization, Inc. Wiegand is a registered trademark of Sensor Engineering Corporation. Nokia, Nokia M2M
Platform, Nokia M2M Gateway Software, and Nokia 31 GSM Connectivity Terminal are trademarks or registered trademarks
of Nokia Corporation. Sony is a trademark of Sony Corporation. Ericsson is a trademark of Telefonaktiebolaget LM Ericsson.
CompactLogix, MicroLogix, SLC, and RSLogix are trademarks of Rockwell Automation. Allen-Bradley and ControlLogix are a
registered trademarks of Rockwell Automation. CIP and EtherNet/IP are trademarks of ODVA.
groov includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit. (http://www.openssl.org)
All other brand or product names are trademarks or registered trademarks of their respective companies or organizations.
The easy-to-use SNAP PAC Motion Control
Subsystem provides an integrated hardware
and software toolset for controlling
multi-axis stepper motors. The subsystem
consists of:
•SNAP Motion Control host
communication modules
(SNAP-SCM-MCH16)
•SNAP Motion Control breakout boards
(SNAP-SCM-BB4)
•OptoMotion command set.
The SNAP-SCM-MCH16 motion control
host module is a serial communication module that links up to four SNAP-SCM-BB4 motion control
breakout boards with a SNAP PAC I/O unit. When mounted on an I/O unit and connected to a
breakout board, a single SNAP-SCM-MCH16 module allows a SNAP PAC controller running a PAC
Control™ programming strategy to control up to 16 stepper motors. The module snaps into an
Opto 22 SNAP PAC mounting rack right beside digital and analog modules. LED indicators are
provided to indicate Transmit and Receive on each port.
1: OverviewChapter 1
Each SNAP-SCM-BB4 breakout board is equipped with a MagellanTM processor chip set that
outputs pulse and direction signals for up to four stepper motor systems. You can daisy-chain up to
four breakout boards connected to a single module. The module’s external connector provides lines
to power one breakout board; additional boards require a separate power source. The
SNAP-SCM-BB4 breakout board is designed to be mounted using a DIN-rail system. For additional
information on using the MagellanTM Motion Processor, see version 1.x of the MagellanTM Motion Processor User’s Guide available on the web at www.pmdcorp.com.
The OptoMotion commands supports many of the Magellan
commands are entered in a PAC Control strategy as text strings using the Transmit String and
Receive commands or the TransmitReceiveString command in OptoScript. The OptoMotion
commands give you the ability to define and acquire motion process data such as position, velocity,
acceleration, breakpoints, interrupts, and time intervals. In addition, you can execute motion-related
actions such as smooth stops, stepping, and position adjustments.
SNAP PAC Motion Control User’s Guide 1
TM
Motion Processor commands. These
1
Page 6
ABOUT THIS GUIDE
Software
SNAP PAC controllers use Opto 22’s PAC Pro j e c t Microsoft
software for programming, human-machine-interface (HMI) development, and OPC connectivity.
Two versions of PAC Project are available:
•PAC Project Basic includes PAC Control for developing control programs, PAC Display™ for
creating operator interfaces, and PAC Manager™ configuration software.
•PAC Project Professional adds expanded versions of PAC Control and PAC Display plus
OptoOPCServer™ software for exchanging data with OPC 2.0-compliant client software
applications.
For more information, see the PAC Project Data Sheet.
®
Windows®-compatible automation
Software Availability
PAC Project Basic is included with SNAP PAC controllers and is a free download from the Opto 22
website. PAC Project Professional is available for purchase on a CD with both Acrobat PDF format
and printed documentation.
To get PAC Project Professional immediately, you can buy and download the software from the
Opto 22 website at www.opto22.com; the CD and printed documentation will be shipped to you.
You can also separately purchase PAC Control Professional, PAC Display Professional, and
OptoOPCServer as needed. For additional information, see the PAC Project data sheet, Opto 22
form 1699.
Compatibility
SNAP-SCM-MCH16 motion modules are designed to work with SNAP PAC mounting racks. For
information on using older SNAP racks, see form 1688, SNAP PAC System Migration Tech Note.
About this Guide
This guide shows you how to install and use the SNAP PAC Motion Control Subsystem. This guide
assumes that you know how to create a strategy in PAC Control, and how to use motion control
technology. If you are not familiar with these subjects, we strongly suggest you consult
commercially available resources to learn about them before attempting to install or use the SNAP
PAC Motion Control Subsystem.
The following sections are included in this user’s guide:
Chapter 1, “Overview”—Information about the guide and how to reach Opto 22 Product
Support.
Chapter 2, “Specifications”—Specifications of the SNAP-SCM-MCH16 module and
SNAP-SCM-BB4 breakout board.
Chapter 3, “Hardware Quick Start”—Quick-start steps to get SNAP PAC Motion Control
Subsystem up and running quickly.
Chapter 4, “Commands Quick Start”—How to use the OptoMotion library of motion commands,
which you can use within PAC Control strategies.
2
SNAP PAC Motion Control User’s Guide
Page 7
CHAPTER 1: OVERVIEW
NOTE: Email messages and phone
calls to Opto 22 Product Support
are grouped together and
answered in the order received.
Chapter 5, “Command Reference”—A list of the motion control commands by group, and a
detailed explanation of each command listed in alphabetical order.
Appendix A, “SNAP-SCM-MCH16 Conversion Formulas”—Provides a table for converting
Counts/Cycle used by some of the motion commands.
Related Documentation
See the following documents for additional information.
For this informationSee this guideForm #
Designing flowchart-based control programs for the
system
Configuring I/O points and system functionsPAC Manager User’s Guide1704
Installing and using SNAP PAC brains and I/O units. SNAP PAC Brains User’s Guide1690
Installing and using Opto 22's SNAP PAC R-series of
programmable automation controllers
PAC Control User’s Guide1700
PAC Control Command Reference1701
SNAP PAC R-Series Controllers User's
Guide
1595
For Help
If you have problems installing or using SNAP PAC Motion Control Subsystem, first check this guide
and the Troubleshooting section of the user’s guide for your Opto 22 hardware. If you cannot find
the help you need in the guides or on the Opto 22 website, contact Opto 22 Product Support.
Phone:800-TEK-OPTO (800-835-6786)
951-695-3080
(Hours are Monday through Friday,
7 a.m. to 5 p.m. Pacific Time)
Fax:951-695-3017
Email:support@opto22.com
Opto 22 website:www.opto22.com
SNAP PAC Motion Control User’s Guide
3
3
Page 8
FOR HELP
4
SNAP PAC Motion Control User’s Guide
Page 9
2: SpecificationsChapter 2
Specifications
This chapter provides specifications of the SNAP-SCM-MCH16 module and SNAP-SCM-BB4 breakout
board.
RS-422/485 Serial Cable ...........................................10
Calculating Power Requirements.........................10
Module Specifications
Baud rates115,200
ParityEven
Data bits8 only
Logic supply voltage5.0 to 5.2 VDC
1
Logic supply current
Number of ports per module1
Maximum number of modules per rack
Maximum cable length, multi-drop1,000 feet at 115,200 Baud
I/O processor (brain or on-the-rack
controller) compatibility
Operating temperature-20 to 70 °C
Storage temperature-30 to 85 °C
Torque, hold-down screws4 in-lb (0.45 N-m)
Torque, connector screws5.26 in-lb (0.6 N-m)
Agency Approvals
Warranty30 months
1. Each breakout board is powered by a separate power supply.
2. Breakout board uses power from the module.
250 mA
2
500 mA
1
8
SNAP-PAC-R1, SNAP-PAC-R2,
SNAP-PAC-EB1, or SNAP-PAC-EB2
UL, CE, RoHS, DFARS
SNAP PAC Motion Control User’s Guide 5
5
Page 10
MODULE SPECIFICATIONS
OFFON
Pull up
Termination
Pull down
Tx+
Tx-
Vcc
Pullup
Rx+
Te rm
Rx-
Pulldown
Vcc
Pullup
Te rm
Pulldown
Power supply
Tx
Status
Rx
Module Bias and Termination
Module LEDs
Transmit and receive LEDs are provided as shown in
the diagram at right.
LEDIndicates
1Power Supply Fault
2Tx
3Status
4Rx
Power Supply Fault indicates a fault on the internal power supply of the module (too much draw).
This will happen if more than one breakout board is connected without additional power supplies,
or there is a short in the system.
Tx: transmitting data
Status: shows module status. This LED blinks twice when the kernel is started.
Rx: receiving data
6
SNAP PAC Motion Control User’s Guide
Page 11
Breakout Board Specifications
CHAPTER 2: SPECIFICATIONS
Power Requirements
Operating Temperature-20 to 70 °C
Relative Humidity95%, non-condensing
Agency Approvals
Warranty30 months
8.0 to 32.0 VDC @ 250mA
5.00 to 5.20 VDC @ 500mA
UL, DFARS
Breakout Board LEDs
There are LED indicators for power and serial, and there are four sets of LEDs for the axis connections,
one for each axis.
Axis LEDs
Power and
Serial LEDs
Power and Serial LEDs
The power and serial LEDs indicate
the following:
Axis LEDs
There is one set of LED indicators for
each axis that indicates the following:
TX
+3.3V
Serial
RX
+5V
Power
Pulse
Encoder
+Limit
–Limit
SNAP PAC Motion Control User’s Guide
7
7
Page 12
J2: Serial Connector
PinDescription
1ToHost+
2ToHost-
3GND
4FromHost+
5FromHost-
6Chassis GND
7VMod
8VMod
9GND
10GND
J2
J15
J3
J3 (and J6, J9, & J12): Encoder Signal Inputs
PinDescription
1QuadA+
2QuadA-
3GND
4QuadB+
5QuadB-
6Index+
7Index-
8GND
9Home+
10Home-
J4 (and J7, J10, & J13): Stepper Motor Outputs
PinDescription
1Pulse+
2Pulse-
3GND
4Direction+
5Direction-
6AtRest+
7AtRest-
8GND
9AxisOut+
10AxisOut-
J4
J5
J5 (and J8, J11, & J14): Stepper Motor Inputs
PinDescription
1PosLimit
2GND
3NegLimit
4GND
5AxisIn
6GND
J15: Auxiliary Power Input
PinDescription
1Aux +5Vin
2Aux +8-24Vin
3GND
4Chassis GND
Axis 0
Pin 1
Pin 1Pin 1
Pin 1
BREAKOUT BOARD SPECIFICATIONS
Breakout Board Connector Pins
8
SNAP PAC Motion Control User’s Guide
Page 13
Breakout Board Switches
SW1–SW8: Signal Selection for Encoder Inputs
PositionDescription
SW1 (and SW3, SW5, & SW7)
1 & 2QuadA
3 & 4QuadB
SW2 (and SW4, SW6, & SW8)
1 & 2Index
3 & 4Home
SW2
SW1
12341234
Differential
S3 (and S5, S4, & S6): Enable/Disable Axis
PositionEnable/Disable
UpDisable
MiddleEnable
DownEnable
S7: Bias & Termination, Voltage Select, Breakout Board Address
S1 & S2: Pull-up Resistors
Switch Axis Description
S1: J5 & J8 470 Ohm
Pull Up Resistors
10PosLimit
20NegLimit
30 AxisIn
41PosLimit
51NegLimit
61 AxisIn
S2: J11 & J14 Pull Ups
12PosLimit
22NegLimit
32 AxisIn
43PosLimit
53NegLimit
63 AxisIn
S3
Axis 0Axis 1Axis 2Axis 3
SW2SW1
All up=Non-differential
All down=Differential
6
5
4321
ON
Enable
SW4SW3SW6SW5SW8SW7
S5
S4S6S1S2S7
6
5
4321
ON
ON
ON
* Set both switches to
ON for VMod, or both to
OFF for Aux +8-24Vin.
See also,“If Pull-Up Resistors
Are Not Used” on page 10.
SwitchDescription
1ToHost Termination
2FromHost Termination
3
VMod/Aux +8-24Vin
Select*
4
5ADDR0
6ADDR1
SwitchDescription
1ToHost Termination
2FromHost Termination
3
VMod/Aux +8-24Vin
Select*
4
5ADDR0
6ADDR1
Use switches 5 and 6 to
set the address as follows:
Switch 5
(ADDR0)
Switch 6
(ADDR1)
Address
OFFOFF0
ONOFF1
OFFON2
ONON3
CHAPTER 2: SPECIFICATIONS
SNAP PAC Motion Control User’s Guide
9
9
Page 14
RS-422/485 SERIAL CABLE
+5v
470
J5, J8,
J11, J14
Limit LED
+5v
SNAP-SCM-BB4
Chipset
Ω
Equivalent Circuit
SNAP-SCM-MCH16SNAP-SCM-BB4
DescriptionPinPinDescription
GND1, 23, 9, 10GND
TX+34FROM HOST+
TX-45FROM HOST-
RX+51TO HOST+
RX-62TO HOST-
VMOD*7, 87, 8VMOD*
* VMOD can only power one SNAP-SCM-BB4
If Pull-Up Resistors Are Not Used
If pull-up resistors are not used, the inputs shown on page 9 (see “S1 & S2: Pull-up Resistors” ) will be
floating and could cause unexpected behavior if not driven by an external source.
If driven to +5v, the Limit inputs will be asserted. If driven to GND, the Limit inputs will be
de-asserted. See circuit below. If you wish to invert this logic, see the SetSignalSense command. If
you wish to disable the limit inputs, see the SetLimitSwitchMode command on page 93.
RS-422/485 Serial Cable
Use the following schematic to build the RS-422/485 cable that connects the module to the
breakout board. The connectors (Opto part numbers 6346 and R80088) are provided in the motion
control kit.
Calculating Power Requirements
When you assemble a SNAP rack that includes a SNAP-SCM-MCH16, you need to calculate the
10
power requirements to make sure that the rack’s power supply is adequate for the combined current
needed by the brain or controller and all the I/O modules. For more information and power
requirements worksheets, see the SNAP I/O Wiring Guide (form 1403) as well as the wiring
appendices in the brain or controller’s user’s guide.
SNAP PAC Motion Control User’s Guide
Page 15
3: Hardware Quick StartChapter 3
Hardware Quick Start
This chapter describes how to set up the Motion Control Subsystem hardware.
In This Chapter
What You Will Need............................................below
Setting Up the SNAP-SCM-MCH16 Module....12
Configuring the Breakout Board...........................15
To set up the Motion Control Subsystem you need the following things:
•SNAP-SCM-MCH16 motion module
•SNAP-SCM-BB4 motion control breakout board
•RS-422/485 serial cable (see
•PC running Opto 22 PAC Project software version 8.0 or newer
•SNAP PAC rack-mounted controller or brain with firmware version 8.0 or newer.
NOTE: The I/O unit must be part of a system using PAC Control on a SNAP PAC controller.
•A SNAP PAC rack
NOTE: Assemble the hardware according to the directions that came with it. For help with wiring, see
product data sheets, which are available on our website at www.opto22.com.
•Power supply
•Stepper motor
“RS-422/485 Serial Cable” on page 10)
SNAP PAC Motion Control User’s Guide 11
11
Page 16
SETTING UP THE SNAP-SCM-MCH16 MODULE
OFFON
position 0
Retention bar
Module connectors
Setting Up the SNAP-SCM-MCH16 Module
The SNAP-SCM-MCH16 module snaps into place in the row of connectors on any SNAP PAC rack.
Each module connector has a number.
1.Set the termination and bias for the SNAP-SCM-MCH16 as follows:
2.Place the rack so that the module connector numbers are right-side up, with zero on the left.
3.With the power off, position the SNAP-SCM-MCH16 module over the module connector in
position 0, aligning the small slot at the base of the module with the retention bar on the rack.
The module can be placed in any position on the rack. This example shows the module in
position 0.
12
SNAP PAC Motion Control User’s Guide
Page 17
4.With the module correctly aligned over the
connector, push on the module to snap it into
place.
When positioning modules next to each other,
be sure to align the male and female module
keys (shown in the detailed view in the
illustration at right) before snapping a module
into position.
Modules snap securely into place and require a
special tool (provided) to remove them. To
remove a module, see page 14.
5. As shown in the photo at right, use
standard 4-40 x 1/4 truss-head Phillips
hold-down screws to secure both sides of each
module.
CAUTION: Do not over-tighten screws.
6.Make sure the rack is wired to receive 5.0 to 5.2
VDC @ 4A. Leave the power supply off at this
time. For more information on power
requirements, see , the SNAP I/O Racks Data
Sheet.
CHAPTER 3: HARDWARE QUICK START
SNAP PAC Motion Control User’s Guide
13
13
Page 18
SETTING UP THE SNAP-SCM-MCH16 MODULE
Removing a Module
1.If the module is held in place with
screws, remove them.
2.Holding the SNAP module tool
(provided) as shown in the
illu stration at right, inser t it into the
notch at the base of the module.
3.Squeeze the module tool against
the module to open the release
latch, and pull straight up on the
module to remove it.
14
SNAP PAC Motion Control User’s Guide
Page 19
Configuring the Breakout Board
SW1
SW2
12 3412 34
Differential:
all down
SW1
SW2
12 3412 34
Non-Differential:
all up
Enabled
S3 (and S5)
For breakout board layout information, see “Breakout Board Specifications” on page 7.
1.Decide which of the following example strategies you want to use. For the Electronic Gearing
Example you will need to attach a stepper motor (described below) to Axis 0 and Axis 1. For all
other example strategies you only need a stepper motor on axis 0.
–Electronic Gearing Example
–S-Curve Contouring Example
–Trapezoidal Contouring Example
–Velocity Contouring Example
For more information, see “Using the Example Strategies” on page 24.
2.(Optional) If you have an encoder, set the Signal Selection switches for Axis 0 (SW1 and SW2) as
shown below for your encoder type. If you are using the Electronic Gearing example strategy,
also set the switches for Axis 1 (SW3 and SW4). For help locating the switches on the board, see
“Breakout Board Switches” on page 9.
If your encoder outputs differential signals, make sure they are in the Differential Signals
position: all down.
CHAPTER 3: HARDWARE QUICK START
If your encoder outputs non-differential signals, make sure they are in the Non-Differential
Signals position: all up.
3.Enable Axis 0 by setting S3 to the Enabled position. If you
are using the Electronic Gearing example strategy (see
page 24), enable Axis 1 too by setting S5 to the Enabled
position.
SNAP PAC Motion Control User’s Guide
15
15
Page 20
CONFIGURING THE BREAKOUT BOARD
6
5
4321
ON
S7
DirectionGNDPulse
J4
4.Set the SNAP-SCM-BB4 address and termination on S7 as
shown at right.
5.Connect the SNAP-SCM-MCH16 to the SNAP-SCM-BB4
with the RS-422/485 serial cable (see
“RS-422/485 Serial Cable” on page 10).
6.Connect your stepper motors to the SNAP-SCM-BB4. Minimum connections are Pulse,
Direction, and GND. Make sure you have a power supply for the stepper motor. To locate the
connector pins on the board, see “Breakout Board Connector Pins” on page 8.
7.(Optional) If you have an encoder, see “Breakout Board Connector Pins” on page 8 to locate and
connect the connector pins.
8.If the controller or brain on the rack already has an IP address, skip to “Checking the Firmware
Version of the Controller or Brain” on page 19. If not (as indicated by the STAT LED on controller
16
SNAP PAC Motion Control User’s Guide
or brain blinking orange), assign an IP address by following the steps in the next section.
Page 21
CHAPTER 3: HARDWARE QUICK START
Assigning an IP Address to the Controller or Brain
The following instructions for assigning an IP address are provided here in simplified form for your
convenience. For detailed instructions on assigning an IP address, please see form 1704, the PAC
Manager User’s Guide.
Before you begin, please note the following:
•All SNAP Ethernet-based controllers and brains must be assigned a unique, static IP address. If
the network you’re using has a Dynamic Host Configuration Protocol (DHCP) server, either
assign a static IP address before connecting the device to the network (preferred), or disable
the server. (These servers may respond to BootP requests and assign a dynamic address.)
CAUTION: To make sure the controller or I/O unit is not on a network with a DHCP server, we
recommend you use a crossover cable with a direct connection to assign IP addresses.
•If you are adding an I/O segment to an existing Ethernet network, your network administrator
must provide static IP addresses and subnet masks for the I/O units. If you are creating an
independent, dedicated Ethernet network just for I/O, you can choose your own addresses.
•You will need to know the device’s MAC address. The MAC address is printed on a label on the
side of the device.
•BootP broadcasts cannot get through a firewall in the PC where PAC Manager is running. Make
sure any firewall in the computer (such as the built-in firewall in Windows XP) is disabled before
you try to assign IP addresses. Firewalls in a router should not be a problem.
To assign an IP address:
1.Connect the device (controller or brain) using ETHERNET 1. (Only Ethernet 1 sends a BootP
request.)
NOTE: As stated in the CAUTION above, we recommend you use a crossover cable with a direct
connection to assign IP addresses.
2.Choose Start > Programs > Opto 22 > PAC Pro jec t > PAC Manager.
3.Choose Tools > Assign IP Address.
In the dialog that opens you should see the device’s MAC address. Addresses of other Opto 22
Ethernet-based devices without IP addresses might appear as well.
4.Turn on the controller.
5.Double-click the MAC address of the device to open the Mapping dialog box.
CAUTION: PAC Manager lists ALL Opto 22 devices sending BootP or DHCP broadcasts. Assign IP
addresses only to the ones you know are yours!
SNAP PAC Motion Control User’s Guide
17
17
Page 22
CONFIGURING THE BREAKOUT BOARD
6.Enter an IP Address and Subnet Mask compatible with your network.
WARNING!Each device on your network, including computers, routers, controllers, brains, and so on,
must have a unique IP address. Failure to assign unique IP addresses may cause catastrophic network
or hardware failures. If you don’t know which IP addresses are safe to use, check with your system
administrator.
7.When the IP address, subnet mask, and other fields are correct, click OK.
The new IP address information appears in the upper list in the dialog box, and the device’s
status changes to Mapped. The address information also appears in the lower list to show that
this device has been mapped to this address.
8.With the device still highlighted, click Assign.
The address is saved to flash memory, and the status changes to Static IP.
9.To verify that the IP address has been successfully assigned, highlight the device in the upper
list and click Test.
A DOS window opens and the IP address is automatically contacted using the PING program.
You should see a reply similar to the following:
18
If you don’t see a reply, make sure the subnet mask you’ve assigned matches the subnet mask
on your PC.
10. For future reference, write the IP address next to the MAC address on the white sticker provided
on the device, then close the DOS window.
SNAP PAC Motion Control User’s Guide
Page 23
CHAPTER 3: HARDWARE QUICK START
Firmware version
11. Click Close to exit.
Next you will check to make sure the controller or brain is running firmware version 8.0 or newer.
Checking the Firmware Version of the Controller or Brain
3.In the IP Address field, type the IP address of the SNAP-PAC-R controller or brain, and then click
Status Read.
If you don’t have firmware version 8.0 or newer, new firmware can be downloaded from our
website, www.opto22.com. For information on how to load new firmware, see Chapter 6 of the PAC Manager User’s Guide, form 1704.
SNAP PAC Motion Control User’s Guide
19
19
Page 24
COMPONENT CONNECTION SCHEMATIC
Motion host module
SNAP-SCM-MCH16
RS-422/485
serial link
(included)
Optional encoder
Amplifier/
driver
J4 Motor
J3 Encoder
J5 Inputs:
- Positive limit
- Negative limit
- General purpose axis input
Breakout board
SNAP-SCM-BB4
Stepper motor
Component Connection Schematic
The following schematic shows a basic connection of one module to one breakout board, and
includes an optional encoder.
20
SNAP PAC Motion Control User’s Guide
Page 25
Connecting Multiple Breakout Boards
PC running PAC
Control
Controller
SNAP-SCM-MCH16
Motion Module
SNAP-SCM-BB4
breakout boards
(up to 4 per module)
Stepper motors (Up to 4
per breakout board)
Ethernet network
Serial RS-422/485
External power supplies are
required for additional
breakout boards.
You can daisy-chain up to four breakout boards as shown here. The first breakout board in the chain
receives power from the motion module, while each additional breakout board requires its own
external power supply. The boards are connected with serial RS-422/485 cables. You can connect up
to four stepper motors per breakout board. Also see the schematic on the next page.
A PC is used to develop and maintain a PAC Control strategy. The strategy is downloaded to the
controller where it runs independently of the PC.
CHAPTER 3: HARDWARE QUICK START
SNAP PAC Motion Control User’s Guide
21
21
Page 26
CONNECTING MULTIPLE BREAKOUT BOARDS
SNAP-SCM-BB4Next SNAP-SCM-BB4
DescriptionPinPinDescription
TO HOST+11TO HOST+
TO HOST-22TO HOST-
GND33GND
FROM HOST+44FROM HOST+
FROM HOST-55FROM HOST-
Daisy-Chained Breakout Boards Schematic
Use the following schematic to daisy-chain SNAP-SCM-BB4 breakout boards.
22
SNAP PAC Motion Control User’s Guide
Page 27
4: Commands Quick StartChapter 4
Commands Quick Start
This chapter gets you started using the OptoMotion library of motion commands, which you can
use within PAC Control strategies.
The OptoMotion commands support many of the MagellanTM Motion Processor commands, giving
you the ability to define and acquire motion process data such as position, velocity, acceleration,
breakpoints, interrupts, and time intervals. In addition, you can execute motion-related actions such
as smooth stops, stepping, and position adjustments.
Commands are sent to the SNAP-SCM-MCH16 motion module via PAC Control. The
SNAP-SCM-MCH16 motion module acts as a communication link between Opto 22 controllers and
the SNAP-SCM-BB4 breakout board. Using a PAC Control strategy, you open a TCP Communication
Handle to the module. Then you use Transmit/Receive in an OptoScript block to send to the module
native English text commands used by the motion processor. The module converts the text strings
to binary commands, which it then passes to the motion processor on the breakout board to control
the motion of a stepper motor.
You can also use standard PAC Control blocks to enter the motion control commands. However, this
typically takes several blocks in a strategy, so it is usually better to use OptoScript. For detailed
descriptions of the available commands, see the commands starting on page 38.
Using the Example Strategies
Four example strategies are available on the Opto 22 website, www.opto22.com. Click here, or else
navigate to the Downloads section and search for “Motion_Control_Example_Strategies.zip”.
The ZIP file contains the following example strategies:
•Electronic Gearing Example: causes axis 0 and axis 1 to rotate for 10 seconds and then stop
for 10 seconds.
•S-Curve Contouring Example: turns the motor a quarter turn every 10 seconds. This example
uses the S-curve profiling mode.
•Trapezoidal Contouring Example: Turns the motor a quarter turn every 10 seconds. This
example uses the Trapezoidal profiling mode.
•Velocity Contouring Example: Turns axis 0 on for 10 seconds then off for 10 seconds.
You can use the example strategies as a starting point for creating your own control strategies. In
particular, take a look at the OptoScript blocks, Axis Setup and Axis 0 Move for each example. The
Axis Setup block initializes the SNAP-SCM-BB4 and the Axis 0 Move block makes axis 0 move.
If you don’t have PAC Control you can download it from our website, www.opto22.com. For the
Electronic Gearing Example you need a stepper motor attached to axis 0 and axis 1. For all other
example strategies you only need a stepper motor on axis 0.
To use an example strategy:
1.Unzip the examples from the CD provided to a directory on your local hard drive, and then
open one of the strategies.
2.With an example strategy open in Configure mode or Online mode, double-click the Control
Engines folder on the Strategy Tree and add the control engine as described in Chapter 5 of the
PAC Control User’s Guide, form 1700.
In the Control Engine dialog box, you only need to enter a descriptive Control Engine Name
and the Primary IP address, which is the address of the controller. In the Configure Control
Engines dialog box, make sure to select the control engine and click Set Active.
24
SNAP PAC Motion Control User’s Guide
Page 29
CHAPTER 4: COMMANDS QUICK START
3.Close the dialog boxes for adding a control engine.
4.Choose Mode > Debug.
The strategy is downloaded to the controller.
5.Click Run Strategy , then attend to any dialog boxes that might appear.
At this point your stepper motor should be spinning.
How To Structure a Motion Control Strategy in PAC Control
A motion control strategy in PAC Control should have the following structure:
1: Open a communication handle (page 29)
2: Reset each axis (page 29)
3: Configure parameters (page 30)
4: Enable each axis (page 31)
5: Close the communication handle (page 32)
Also see, “Entering Commands in OptoScript” on page 32 and “Response Format” on page 33.
1: Open a communication handle
Before anything else, open a communication handle in your PAC Control strategy using the Open
Outgoing Communication command.
For example, the comm handle used in this example is
Open Outgoing Communication
Communication Handle comMotionModule
Put Result in comMotionModule_status
For more information on using communication handles, see form 1700, the PAC Contro l User’s
Guide.
comMotionModule.
2: Reset the axes
To start configuration, it’s a good idea to reset all four axes (0–3).
In an OptoScript block use the PAC Control command Transmit/Receive to the send the motion
control Reset command.
For example, to reset the axes for board 0, enter the following code using your own com handle and
response string variable:
Status = TransmitReceiveString(">Reset,0", ComHandleVariable,
RespStringVariable)
Also see, “Entering Commands in OptoScript” on page 32
For more information on using the Transmit/Receive command, see form 1701, the PAC Control
Command Reference.
NOTE: It’s not necessary to reset with every move.
SNAP PAC Motion Control User’s Guide
25
25
Page 30
HOW TO STRUCTURE A MOTION CONTROL STRATEGY IN PAC CONTROL
3: Configure parameters
Next you’ll want to configure all of the parameters.
In the following example, the parameters are borrowed from the S-Curve Contouring example
included with the motion control example strategies (see “Using the Example Strategies” on
page 24). Only 8 of the parameters are set. The rest have been commented out with //.
For many applications it’s important to be able to move your device to the home position. To do this,
send the SetBreakPointValue and SetBreakPoint commands to enable a breakpoint at home. Then
send the device position to a value past the home point. This allows you to rely on the home inputs
and the breakpoints to stop the device.
CHAPTER 4: COMMANDS QUICK START
NOTE: A lways make s ure to loa d the breakpoint comparison value (SetBreakPointValue command) before
setting a new breakpoint condition (SetBreakPoint command). Failure to do so will likely result in
unexpected behavior.
For a multi-axis system, multiple homes can be done simultaneously by setting up all of the axes
individually and then using the MultiUpdate command instead of the Update command used
above.
// Set Positions to a value just past home for axis 0.
To move a set distance, set a variable such as “X_MOVE_COUNT” with an integer. In the following
example code taken from a strategy for a module test bed, 12,000 is the number of steps from one
module to the next on an X-Y table.
sPosition0= ">SetPosition,0,";
nPosition0 = X_MOVE_COUNT ; //12000 is the
distance(Steps) between the modules.
The actual move happens when the >Update,0 command is executed.
CHAPTER 4: COMMANDS QUICK START
Using a Smooth Start and Smooth Stop
The SetStopMode command and the breakpoint commands (such as SetBreakPoint) all have
SmoothStop or AbruptStop options.
Set the starting acceleration with the SetAcceleration command. For example,
>SetAcceleration,0,3,FF.
SNAP PAC Motion Control User’s Guide
29
29
Page 34
HOST I/O ERRORS
Host I/O Errors
The motion processor performs a number of checks on the commands sent to it. These checks
improve the safety of the motion system by eliminating incorrect command data values. All such
checks associated with host I/O commands are referred to as host I/O errors. To determine the error’s
cause, use the command GetHostIOError. This command also clears both the error code and the I/O
error bit in the I/O status read word.
The following I/O error codes may be returned by the GetHostIOError command.
Code (hex)IndicationCause
00No errorNo error condition
01 Magellan reset Default value of error code on reset or power-up.
02 Invalid instruction
03 Invalid axis
04 Invalid parameter
05Trace running
06Reserved --
07Block bound exceeded
08Trace zero
09
0ACommunication Timeout
Bad checksum (Serial port
only)
Instruction is not valid in the current context, or an illegal
instruction code has been detected.
The axis number contained in the upper bits of the instruction word is not supported by this motion processor.
The parameter value sent to the motion processor was out
of its acceptable range.
An instruction was issued that would change the state of the
tracing mechanism while the trace is running. Instructions
which can return this error are SetTraceVariable, SetTraceMode & SetTracePeriod
1. The value sent by SetBufferLength or SetBufferStart
would create a memory block which extends beyond the
allowed limits of 400h - 7FFFFFFFh.
2. Either SetBufferReadIndex or SetBufferWriteIndex sent
an index value greater than or equal to the block length.
SetTraceStart Immediate was issued, but the length of the
trace buffer is currently set to zero.
The checksum complied and returned by Magellan does not
match the checksum which was sent by the host.
1. Make sure your communication handle is pointing to the
SNAP-SCM-MCH16.
2. Check the SNAP-SCM-BB4 address, switch S7. Each
motion command has an “Axis” parameter that corresponds
to a SNAP-SCM-BB4 address.
3. Check the physical link between the SNAP-SCM-MCH16
and SNAP-SCM-BB4.
.
30
0BNegative velocity
0CS-curve change
0DLimit event pending A limit switch event has occurred.
0EMove into limit
SNAP PAC Motion Control User’s Guide
An attempt was made to set a negative velocity without the
axis being in velocity contouring profile mode.
The axis is currently executing an S-curve profile move and
an attempt was made to change the profile parameters. This
is not permitted.
An attempt was made to execute a move without first clearing the limit bit(s) in the event status register.
Page 35
How To Use the Command Details
Also see, “Entering Commands in OptoScript” on page 32 and “Response Format” on page 33.
For each command in Chapter 5, the instruction mnemonic is shown in the command heading at
the left. Certain parameters and other data written to the motion processor are buffered. That is,
they are not acted upon until the next Update or MultiUpdate command is executed. These
parameters are identified by the word buffered in the command heading at the right.
The details for each command are as follows:
CHAPTER 4: COMMANDS QUICK START
Syntax
Arguments
Data Structure
The instruction mnemonic and its required arguments are shown with all arguments separated by
commas.
Encoded-field arguments are packed into a single 16-bit data word. The Name of the argument is
that shown in the generic syntax.
Instance is the mnemonic used to represent the data value. Encoding is the value assigned to the
field for that instance.
For numeric arguments, the parameter Value, the Type (signed or unsigned integer) and Range of
acceptable values are given. Numeric arguments may require one or two data words. For 32-bit
arguments, the high-order part is transmitted first.
You must specify the location of the stepper for each command. The number of the stepper motor
identifies one of four SNAP-SCM-BB4 breakout boards as follows:
Stepper Motor LocationBreakout Board Address
0 to 30
4 to 71
8 to B2
C to F3
This is a graphic representation of the 16-bit words transmitted in the packet: the instruction, which
is identified by its name, followed by 1, 2, or 3 data words. Bit numbers are shown directly below
each word. For each field in a word, only the high and low bits are shown. For 32-bit numeric data,
the high-order bits are numbered from 16 to 31, the low-order bits from 0 to 15.
Argument names are shown in their respective words or fields.
For data words, the direction of transfer-read or write-is shown at the left of the word's diagram.
Description
Restrictions
OptoScript
Example
See Also
Unused bits are shaded. All unused bits must be 0 in data words and instructions sent (written) to
the motion processor.
Describes what the instruction does and any special information relating to the instruction.
Describes the circumstances in which the instruction is not valid, that is, when it should not be
issued. For example, velocity, acceleration, deceleration, and jerk parameters may not be issued
while an S-curve profile is being executed.
The syntax of the text string entered within the TransmitReceiveString OptoScript command, which
is sent to the motion module for conversion to the corresponding PMD C-Motion command for
implementation by the motion control processor.
Refers to related instructions.
SNAP PAC Motion Control User’s Guide
31
31
Page 36
ENTERING COMMANDS IN OPTOSCRIPT
Status = TransmitReceiveString(">SetAcceleration,4,0,3E", ComHandleVariable, RespStringVariable)
PAC Control commandMotion control commandCommunication HandlePut Result in
AxisData
P1 P2
Quotation mark
Quotation mark
> symbol
Command name
IP address of
the controller
Port
22500 - 22531
even only
For more information on
communication handles, see
Chapter 10 in the PAC Co ntr ol
User’s Guide.
Motion control command:
If the status byte returns a 00, the command is
successful. Any other response indicates an error.
See “Response Format” on page 33.
Communication Handle:
Put Result in:
tcp: 127.0.0.1:22500
">SetAcceleration, 4,0,3E"
RespStringVariable
Entering Commands in OptoScript
A motion control command is entered as a text string in OptoScript using the TransmitReceiveString
command, which is the same as Transmit/Receive String in standard PAC Control. This command
sends the motion control command to the processor and then waits for a response. For more
information on the Transmit/Receive String command, see the PAC Control Command Reference,
form 1701. For information on motion control strategy examples available on the Opto 22 website,
see “Using the Example Strategies” on page 24.
To enter a motion control command, use the > symbol at the beginning of the command and
enclose the command in double quotes, as shown in the following example:
Syntax:
TransmitReceiveString(“>Command”, Communication Handle, Put Result in)
For the PAC Control command use TransmitReceiveString. Note that the Put Result in parameter is
for the response from the motion control command. The following examples show the
SetAcceleration and Get Acceleration commands. Quotation marks are used here because these are
string literals rather than string variables.
Example 1: SetAcceleration.
32
SNAP PAC Motion Control User’s Guide
Page 37
Example 2: Get Acceleration.
Axis
Quotation markQuotation mark
> symbol
Command name
IP address of
the controller
Port
22500 - 22531
even only
For more information on
communication handles, see
Chapter 10 in the PA C Co nt ro l
User’s Guide.
Motion control command:
Communication Handle:
Put Result in:
tcp: 127.0.0.1:22500
If the status byte returns a 00, the command is
successful. Any other response indicates an error.
See “Response Format,” below.
RespStringVariable
">GetAcceleration, 4"
>Status,P1,P2,P3
> symbol
16-bit returned data encoded as a hex string. Depending
on the command, includes 0, 1, 2, or 3 parameters.
Status: If successful, 00
If not successful, a code from the Host I/O Errors list.
CHAPTER 4: COMMANDS QUICK START
Response Format
Command responses are in the following format:
Returned packet examples:
Successful command:
>00,0123,4567,89AB
Not successful: >04
SNAP PAC Motion Control User’s Guide
33
33
Page 38
RESPONSE FORMAT
34
SNAP PAC Motion Control User’s Guide
Page 39
5: Command ReferenceChapter 5
Command Reference
This command reference provides a list of the motion control commands by group, and a detailed
explanation of each command listed in alphabetical order.
For an explanation on how to use the information included for each command, page 31.
In This Chapter
Commands by Group ................................................36
Commands in Alphabetical Order.......................38
SNAP PAC Motion Control User’s Guide 35
35
Page 40
COMMANDS BY GROUP
Commands by Group
The following Magellan™ Motion Processor commands are supported in PAC Control using
OptoScript.
CommandsDescription
Breakpoints and Interrupts
ClearInterruptReset interrupt line.
GetInterruptAxisGet the axes with pending interrupts.
The position specified as the parameter to AdjustActualPosition is summed with the actual position
register (encoder position) for the specified axis. This has the effect of adding or subtracting an offset
to the current actual position. At the same time, the commanded position is replaced by the new
actual position value minus the position error. This prevents a servo “bump” when the new axis
position is established. The destination position (see “SetPosition, GetPosition” on page 96) is also
modified by this amount so that no trajectory motion will occur when the update instruction is
issued. In effect, this instruction establishes a new reference position from which subsequent
positions can be calculated. It is commonly used to set a known reference position after a homing
procedure. The position error is also zeroed.
AdjustActualPosition takes effect immediately, it is not buffered.
ClearInterrupt resets the HostInterrupt signal to its inactive state. If interrupts are still pending, the
HostInterrupt line will return to its active state within one chip cycle. Refer to Set/GetSampleTime for
information on chip cycle timing (page 99). It is used after an interrupt has been recognized and
processed by the host. This command does not affect the event status register. The ResetEventStatus
command should be issued prior to the ClearInterrupt command to clear the condition which
generated the interrupt. The ClearInterrupt command has no effect if it is executed when no
interrupts are pending.
ClearPositionError sets the profile's commanded position equal to the actual position (encoder
input), thereby clearing the position error for the specified axis. This command can be used when
the axis is at rest, or when it is moving.
ClearPositionError is a buffered command. The new value set will not take effect until the next
Update or MultiUpdate instruction.
This command should not be sent while the chip is executing a move using the S-curve profile
mode.
See “SetAcceleration, GetAcceleration” on page 68.
SNAP PAC Motion Control User’s Guide
41
41
Page 46
COMMANDS IN ALPHABETICAL ORDER
GetActivityStatus
Syntax
Arguments
Returned Data
Data Structure
Description
GetActivityStatus, axis, P1
TypeRangeBoard Address
axisunsigned 8 bits0 to 30
4 to 71
8 to B2
C to F3
NameType
statusunsigned 32 bitssee below
GetActivityStatus
First data word
P1 readposition (high-order part)
160
GetActivityStatus reads the 16-bit activity status register for the specified axis. Each of the bits in this
register continuously indicate the state of the motion processor without any action on the part of
the host. There is no direct way to set or clear the state of these bits, since they are controlled by the
motion processor.
The following table shows the encoding of the data returned by this command
NameBitsDescription
reserved6Not used; may be 0 or 1.
reserved0Not used; may be 0 or 1.
At maximum velocity1
Tracking2Set to 1 when the axis is within the tracking window.
Current profile mode3-5Contains trajectory mode encoded as follows:
Axis settled7Set to 1 when the axis is settled.
Motor on/off8Set to 1 when motor mode is on, 0 when off.
Position capture9
In-motion10Set to 1 when the trajectory generator is executing a profile.
In positive limit11Set to 1 when the positive limit switch is active.
In negative limit12Set to 1 when the negative limit switch is active.
Set to 1 when the trajectory is at maximum velocity. This bit is determined by the trajectory generator, not the actual encoder velocity.
bit 5
0
0
0
0
Set to 1 when a value has been captured by the high speed position
capture hardware but has not yet been read.
When the profile mode is S-curve, it contains the profile segment
Profile segment13-15
number 1-7 while profile is in motion, and contains a value of 0 when
the profile is at rest. This field is undefined when using the Trapezoidal and Velocity Contouring profile modes.
See “SetActualPosition, GetActualPosition” on page 69.
GetActualPositionUnits
See “SetActualPositionUnits, GetActualPositionUnits” on page 70.
SNAP PAC Motion Control User’s Guide
43
43
Page 48
COMMANDS IN ALPHABETICAL ORDER
GetActualVelocity
Syntax
Arguments
Returned Data
Data Structure
Description
GetActualVelocity, axis
TypeRangeBoard Address
axisunsigned 8 bits0 to 30
4 to 71
8 to B2
C to F3
NameTypeRangeScalingUnits
velocitysigned 32 bits-231 to 231-1
GetActualVelocity
First data word
P1 readactual velocity (high-order part)
3116
Second data word
P2 readactual velocity (low-order part)
150
1/2
16
counts/cycle
2
GetActualVelocity reads the value of the velocity for the specified axis. The actual velocity is derived
by subtracting the actual position during the previous chip cycle from the actual position for this
chip cycle. The result of this subtraction will always be integer because position is always integer. As
a result the value returned by GetActualVelocity will always be a multiple of 65,536 since this
represents a value of one in the 16.16 number format. The low word is always zero.
This value is the result of the last encoder input, so it will be accurate to within one cycle.
Scaling example: If a value of 1,703,936 is retrieved by the GetActualVelocity command (high word:
01Ah, low word: 0h) this corresponds to a velocity of 1,703,936/65,536 or 26 counts/cycle. See
“SNAP-SCM-MCH16 Conversion Formulas” on page 111.
Restrictions
OptoScript
Example
See Also
44
SNAP PAC Motion Control User’s Guide
The actual velocity is derived by subtracting the actual position during the previous chip cycle from
the actual position for this chip cycle. The result of this subtraction will always be integer because
position is always integer. As a result the value returned by GetActualVelocity will always be a
multiple of 65,536 since this represents a value of one in the 16.16 number format. The low word is
always zero.
See “SetAutoStopMode, GetAutoStopMode” on page 71.
GetAxisMode
See “SetAxisMode, GetAxisMode” on page 72.
GetAxisOutSource
See “SetAxisOutSource, GetAxisOutSource” on page 73.
CHAPTER 5: COMMAND REFERENCE
GetBreakPoint
See “SetBreakPoint, GetBreakPoint” on page 75.
GetBreakPointValue
See “SetBreakPointValue, GetBreakPointValue” on page 77.
GetBufferLength
See “SetBufferLength, GetBufferLength” on page 79.
SNAP PAC Motion Control User’s Guide
45
45
Page 50
COMMANDS IN ALPHABETICAL ORDER
GetBufferReadIndex
See “SetBufferReadIndex, GetBufferReadIndex” on page 80.
GetBufferStart
See “SetBufferStart, GetBufferStart” on page 81.
GetBufferWriteIndex
See “SetBufferWriteIndex, GetBufferWriteIndex” on page 82.
GetCaptureSource
See “SetCaptureSource, GetCaptureSource” on page 83.
46
SNAP PAC Motion Control User’s Guide
Page 51
GetCaptureValue
CHAPTER 5: COMMAND REFERENCE
Syntax
Arguments
Data Structure
Description
OptoScript
Example
GetCaptureValue, axis
TypeRangeBoard Address
axisunsigned 8 bits0 to 30
4 to 71
8 to B2
C to F3
NameTypeRangeScalingUnits
captured position signed 32 bits-231 to 231-1unitycounts
microsteps
GetCaptureValue
First data word
P1 readcaptured position (high-order part)
3116
Second data word
P2 readcaptured position (low-order part)
150
GetCaptureValue returns the contents of the position capture register for the specified axis. This
command also resets bit 9 of the activity status register; thus allowing another capture to occur.
If actual position units is set to steps, the returned position will be in units of steps.
GetCommandedAcceleration returns the commanded acceleration value for the specified axis.
Commanded acceleration is the instantaneous acceleration value output by the trajectory
generator.
Scaling example: If a value of 114,688 is retrieved using this command then this corresponds to
114,688/ 65,536 = 1.750 counts/cycle2 acceleration value. See “SNAP-SCM-MCH16 Conversion
GetCommandedPosition returns the commanded position for the specified axis. Commanded
position is the instantaneous position value output by the trajectory generator.
GetCommandedVelocity returns the commanded velocity value for the specified axis. Commanded
velocity is the instantaneous velocity value output by the trajectory generator.
Scaling example: If a value of -1,234,567 is retrieved using this command (FFEDh in high word,
2979h in low word) then this corresponds to -1,234,567/65,536 = -18.8380 counts/cycle velocity
value. See “SNAP-SCM-MCH16 Conversion Formulas” on page 111.
See “SetDeceleration, GetDeceleration” on page 84.
GetEncoderModulus
See “SetEncoderModulus, GetEncoderModulus” on page 85.
GetEncoderSource
See “SetEncoderSource, GetEncoderSource” on page 86.
CHAPTER 5: COMMAND REFERENCE
GetEncoderToStepRatio
See “SetEncoderToStepRatio, GetEncoderToStepRatio” on page 87.
SNAP PAC Motion Control User’s Guide
51
51
Page 56
COMMANDS IN ALPHABETICAL ORDER
GetEventStatus
Syntax
Arguments
Returned Data
Data Structure
Description
GetEventStatus, axis
TypeRangeBoard Address
axisunsigned 8 bits0 to 30
4 to 71
8 to B2
C to F3
NameType
statusunsigned 16 bitssee below
GetEventStatus
P1 read
15 14 13 12 11 10876543210
Data
GetEventStatus reads the event register for the specified axis. All of the bits in this status word are set
by the motion processor and cleared by the host. To clear these bits, use the ResetEventStatus
command. The following table shows the encoding of the data returned by this command.
NameBit(s)Description
Motion complete0
Set to 1 when motion has completed. SetMotionCompleteMode determines if
this bit is based on the trajectory generator position or the encoder position.
OptoScript
Example
See Also
Wrap-around1
Breakpoint 12Set to 1 when breakpoint 1 has been triggered.
Capture received3Set to 1 when a position capture has occurred.
Motion error4Set to 1 when a motion error has occurred.
In positive limit5Set to 1 when the axis has entered a positive limit switch.
In negative limit6Set to 1 when the axis has entered a negative limit switch.
Instruction error7Set to 1 when an instruction error has occurred.
reserved 8 - 108 - 10Not used; may be 0 or 1.
Commutation error11Set to 1 when a commutation error has occurred.
reserved 12 - 1312 - 13Not used; may be 0 or 1.
Breakpoint 214Set to 1 when breakpoint 2 has been triggered.
GetHostIOError returns the code for the last host I/O error, and then resets the error to zero.
Generally, this command is issued only after the instruction error bit in the event status register
indicates there was an I/O error. It also resets the HostIOError bit in the I/O status read word to zero.
GetInterruptAxis returns a field which identifies all axes on the breakout board with pending
interrupts. Axis numbers are assigned to the low-order four bits of the returned word; bits
corresponding to interrupting axes are set to 1. If there are no pending interrupts, the returned word
is 0. If any axis has a pending interrupt, the HostInterrupt signal will be in an active state.
See “SetInterruptMask, GetInterruptMask” on page 91.
GetJerk
See “SetJerk, GetJerk” on page 92.
GetLimitSwitchMode
See “SetLimitSwitchMode, GetLimitSwitchMode” on page 93.
GetMotionCompleteMode
See “SetMotionCompleteMode, GetMotionCompleteMode” on page 94.
GetMotorMode
See “SetMotorMode, GetMotorMode” on page 95.
GetPosition
See “SetPosition, GetPosition” on page 96.
56
SNAP PAC Motion Control User’s Guide
Page 61
GetPositionError
CHAPTER 5: COMMAND REFERENCE
Syntax
Arguments
Returned Data
Data Structure
Description
GetPositionError, axis
TypeRangeBoard Address
axisunsigned 8 bits0 to 30
4 to 71
8 to B2
C to F3
NameTypeRangeScalingUnits
velocitysigned 32 bits-231 to 231-1unitycounts
microsteps
GetPositionError
First data word
P1 readposition error (high-order part)
3116
Second data word
P2 readposition error (low-order part)
150
GetPositionError returns the position error of the specified axis. The error is the difference between
the actual position (encoder position) and the commanded position (instantaneous output of the
trajectory generator). When used with the motor type set to microstepping, or pulse and direction,
the error is defined as the difference between the encoder position (represented in steps), and the
commanded position (instantaneous output of the trajectory generator).
See “SetPositionErrorLimit, GetPositionErrorLimit” on page 97.
GetProfileMode
See “SetProfileMode, GetProfileMode” on page 98.
SNAP PAC Motion Control User’s Guide
57
57
Page 62
COMMANDS IN ALPHABETICAL ORDER
GetSampleTime
See “SetSampleTime, GetSampleTime” on page 99.
GetSettleTime
See “SetSettleTime, GetSettleTime” on page 100.
GetSettleWindow
See “SetSettleWindow, GetSettleWindow” on page 101.
GetSignalSense
See “SetSignalSense, GetSignalSense” on page 102.
58
SNAP PAC Motion Control User’s Guide
Page 63
GetSignalStatus
CHAPTER 5: COMMAND REFERENCE
Syntax
Arguments
Returned Data
Data Structure
Description
GetSignalStatus, axis
TypeRangeBoard Address
axisunsigned 8 bits0 to 30
4 to 71
8 to B2
C to F3
NameType
see belowunsigned 16 bits
GetSignalStatus
First data word
P1 readstatus
150
GetSignalStatus returns the contents of the signal status register for the specified axis. The signal
status register contains the value of the various hardware signals connected to each axis of the
motion processor. The value read is combined with the signal sense register (see “SetSignalSense,
GetSignalSense” on page 102) and then returned to the user. For each bit in the Signal Sense register
that is set to 1, the corresponding bit in the GetSignalStatus command will be inverted. Therefore, a
low signal will be read as 1, and a high signal will be read as a 0. Conversely, for each bit in the signal
sense register that is set to 0, the corresponding bit in the GetSignalStatus command is not inverted.
Therefore, a low signal will be read as 0, and a high signal will be read as a 1.
OptoScript
Example
All of the bits in the GetSignalStatus command are inputs, except for AxisOut. The value read for this
bit is equal to the value output by the axis out mechanism. See “SetAxisOutSource,
GetAxisOutSource” on page 73 for more details. The bit definitions are as follows:
MultiUpdate causes an Update to occur on all axes whose corresponding bit is set to 1 in the mask
argument. After this command is executed, and for those axes which are selected using the mask, all
buffered data parameters are copied into the corresponding run-time registers. The following table
shows the buffered commands and variables which are made active as a result of the Update
command.
TypeCommand
GeneralClearPositionError
Acceleration
Deceleration
GearRatio
Trajectory
Servo
MotorMotorCommand
Jerk
Position
ProfileMode
StopMode
Vel ocity
DerivativeTime
IntegrationLimit
Kaff
Kd
Ki
Kp
Kvff
The NoOperation command has no effect on the motion processor.
SNAP PAC Motion Control User’s Guide
63
63
Page 68
COMMANDS IN ALPHABETICAL ORDER
ReadBuffer
Syntax
Arguments
Returned Data
Data Structure
Description
ReadBuffer, axis, P1
TypeRangeBoard Address
axisunsigned 8 bits0 to 30
4 to 71
8 to B2
C to F3
NameTypeRange
bufferIDunsigned 16 bits-0 to 31
NameTypeRange
datasigned 32 bits-231 to 231-1
ReadBuffer
P1 write
15
P1 readdata (high-order part)
31
P2 readdata (high-order part)
15
First data word
0bufferID
Second data word
Third data word
5
4
0
16
0
ReadBuffer returns the 32-bit contents of the location pointed to by the read buffer index in the
specified buffer. After the contents have been read, the read index is incremented by 1; if the result is
equal to the buffer length (set by SetBufferLength), the index is reset to 0. The read index is
automatically changed at the completion of a trace when in rolling trace mode.
Reset restores the motion processor to its initial condition, setting all motion processor variables to
their default values.
Variable NameDefault Value Variable Name Default Value
StartVelocity 0LimitSwitchMode 1
Acceleration 0 MotionCompleteMode 0
ActualPosition 0 MotorBias 0
ActualPositionUnits 0 MotorCommand 0
AutoStopMode 1 MotorLimit 32767
AuxilliaryEncoderSource 0 MotorMode 1
AxisMode 1 OutputMode-
AxisOutSource 0 PhaseAngle 0
BiQuadCoefficients 0 PhaseCorrectionMode -
Breakpoint 1 0 PhaseCounts -
Breakpoint 2 0 PhaseCounts 1
BreakpointValue 1 0 PhaseInitializeMode 0
BreakpointValue 2 0 PhaseInitializeTime 0
BufferLength 0 PhaseOffset 65535
BufferReadIndex 0 PhasePrescaleMode 0
BufferStart 0 Position 0
BufferWriteIndex 0 PositionErrorLimit 65535
CaptureSource 0 ProfileMode 0
CommutationMode-PWMFrequency (kHz)-
Deceleration 0 SampleTime see notes
DerivativeTime 1SettleTime 0
EncoderModulus 0 SettleWindow 0
EncoderSource3SPIMode-
EncoderToStepRatio 00010001h StepRange1*
EventStatus 1 StepRange see notes
GearMaster 0 StopMode 0
GearRatio 0 SynchronizationMode 0
GetSignalStatus800 (hex)TraceMode 0
IntegrationLimit 0 TracePeriod 1
InterruptMask 0 TraceStart 0
Jerk 0 TraceStop 0
Kaff 0 TraceVariable 1 0
SNAP PAC Motion Control User’s Guide
65
65
Page 70
COMMANDS IN ALPHABETICAL ORDER
Variable NameDefault Value Variable Name Default Value
Kd 0 TraceVariable 2 0
Ki 0 TraceVariable 3 0
Kout 65535 TraceVariable 4 0
Kp 0 TrackingWindow 0
Kvff 0Velocity 0
*The SNAP-SCM-BB4 has a maximum step range of 100kHz which cannot changed.
Notes:
•All axes supported by the motion processor are enabled at reset.
•See “SetSampleTime, GetSampleTime” on page 99 for information regarding the default
sample time.
•The typical time before the device is ready for communication after a Reset is 20ms.
•The Reset command “axis” parameter selects the board to reset. Axes 0x00-0x03 will reset
board 0. Axes 0x04-0x07 will reset board 1. Axes 0x08-0x0B will reset board 2. Axes 0x0C-0x0F
will reset board 3. No motion command directly addresses a SNAP-SCM-BB4 by board address.
Instead the board address is determined by which axis the command is sent to. See the
following examples.
Wrap-Around0002h
Breakpoint 10004h
Capture Received 0008h
Motion Error0010h
In positive limit0020h
In negative limit0040h
Instruction error0080h
Commutation error 0800h
Breakpoint 24000h
none
ResetEventStatus
Data
P1 writemask
150
Description
OptoScript
Example
See Also
ResetEventStatus clears (sets to 0), for the specified axis, each bit in the event status register that has
a value of 0 in the mask sent with this command. All other event status register bits (bits which have
a mask value of 1) are unaffected.
SetAcceleration loads the maximum acceleration buffer register for the specified axis. This
command is used with the Trapezoidal, Velocity Contouring, and S-curve profiling modes.
GetAcceleration reads the maximum acceleration buffer register.
Scaling example: To load a value of 1.750 counts/cycle
2
multiply by 65,536 (giving 114,688) and load
the resultant number as a 32-bit number, giving 0001 in the high word and C000h in the low word.
See “SNAP-SCM-MCH16 Conversion Formulas” on page 111.
Values returned by GetAcceleration must correspondingly be divided by 65,536 to convert to units
of counts/cycle
2
or steps/cycle2. See “SNAP-SCM-MCH16 Conversion Formulas” on page 111.
SetAcceleration may not be issued while an axis is in motion with the S-curve profile.
SetAcceleration is not valid in Electronic Gearing profile mode.
SetAcceleration is a buffered command. The value set using this command will not take effect until
the next Update or MultiUpdate instruction.
SetActualPosition loads the position register (encoder position) for the specified axis. At the same
time, the commanded position is replaced by the loaded value minus the position error. This
prevents a servo “bump” when the new axis position is established. The destination position (see
“SetPosition, GetPosition” on page 96) is also modified by this amount so that no trajectory motion
will occur when the update instruction is issued. In effect, this instruction establishes a new
reference position from which subsequent positions can be calculated. It is commonly used to set a
known reference position after a homing procedure.
For axes configured as Pulse & Direction or Microstepping motor types, ActualPositionUnits
determines if the position is specified and returned in units of counts or steps. Additionally, for these
motor types, the position error is zeroed when the SetActualPosition command is sent.
SetActualPosition takes effect immediately, it is not buffered. GetActualPosition reads the contents
of the encoder's actual position register. This value will be accurate to within one cycle (as
determined by Set/GetSampleTime).
SetActualPositionUnits determines the units used by the Set/GetActualPosition,
AdjustActualPosition and GetCaptureValue for the specified axis. When set to Counts, position units
are in encoder counts. When set to Steps, position units are in steps. The step position is calculated
using the ratio as set by the SetEncoderToStepRatio command.
GetActualPositionUnits returns the position units for the specified axis.
SetAutoStopMode determines the behavior of the specified axis when a motion error occurs. When
auto stop is enabled (SetAutoStopMode Enable), the axis goes into open-loop mode when a motion
error occurs. When Auto-Stop is disabled (SetAutoStopMode Disable), the axis is not affected by a
motion error.
Restrictions
OptoScript
Example
See Also
GetAutoStopMode returns the state of the Auto-Stop mode.
When the encoder source is set to none (SetEncoderSource None), setting the auto stop mode to
Enable will not stop motion in the event that the position error limit is exceeded.
SetAxisMode enables (On) or disables (Off ) the specified axis. A disabled axis will not respond to
profile or other motion commands.
GetAxisMode returns the mode of the specified axis.
Restrictions
OptoScript
Example
72
SNAP PAC Motion Control User’s Guide
Disabled axes do not provide encoder feedback. If it is desired that an axis provide encoder feedback
even though no profiling or servo control is to be used, the axis must be left enabled.
NOTE: The source axis must be on the same SNAP-SCM-BB4 as the axis argument.
NameTypeRangeBoard Address
sourceAxis unsigned 8 bits0 to 30
NameInstanceEncoding
bitsee below0 to 15
register Disabled0
EventStatus1
ActivityStatus2
SignalStatus3
SetAxisMode
P1 write
15
0registerbitsource axis
4 to 71
8 to B2
C to F3
12
11
Data
8
7
4
3
0
Description
GetAxisMode
P1 read
15
0registerbitsource axis
12
11
Data
8
7
4
3
0
SetAxisOutSource maps the specified bit of the specified status register of axis to the AxisOut pin for
the specified axis. The state of the AxisOut pin will thereafter track the state of bit. If register is absent
(encoding of 0), bit is ignored, and the specified AxisOut pin is, in effect, turned off (inactive). When
the AxisOutSource is set to disabled, the AxisOut signal can be set high or low using SetSignalSense
bit 10.
GetAxisOutSource returns the mapping of the AxisOut pin of axis.
The following table shows the corresponding value for combinations of bit andregister.
bitevent status registeractivity status registersignal status register
0Motion completePhasing initializedEncoder A
1Wrap-aroundAt maximum velocityEncoder B
2Breakpoint 1TrackingEncoder index
SNAP PAC Motion Control User’s Guide
73
73
Page 78
COMMANDS IN ALPHABETICAL ORDER
bitevent status registeractivity status registersignal status register
SetBreakPoint establishes a breakpoint for the specified axis to be triggered by a condition or event
on sourceAxis, which may be the same as or different from axis. Up to two concurrent breakpoints
can be set for each axis, each of which may have its own breakpoint type and comparison value. The
breakpointID field specifies which breakpoint the SetBreakPoint and GetBreakPoint commands will
address.
The six Position breakpoints and the Time breakpoint are threshold-triggered; the breakpoint occurs
when the indicated value reaches or crosses a threshold. The Status breakpoints are level-triggered;
the breakpoint occurs when a specific bit or combination of bits in the indicated status register
changes state. Thresholds and bit specifications are both set by the SetBreakPointValue instruction.
action determines what the motion processor does when the breakpoint occurs, as follows:
ActionResultant command sequence
NoneNo action
UpdateUpdate axis
AbruptStopThe profile executes an abrupt stop
SmoothStopThe profile executes a smooth stop
MotorOffSetMotorMode axis, Off
GetBreakPoint returns the trigger, action, and axis for the specified breakpoint (0 or 1) of the
indicated axis. When a breakpoint occurs, the trigger value will be reset to none. The
CommandedPositionCrossed and the ActualPositionCrossed triggers are converted to one of the
Position trigger types 1-4; depending on the current position when the command is issued.
Restrictions
OptoScript
Example
See Also
Always load the breakpoint comparison value (SetBreakPointValue command) before setting a new
breakpoint condition (SetBreakPoint command). Failure to do so will likely result in unexpected
behavior.
SetBreakPointValue sets the breakpoint comparison value for the specified axis. For the position and
time breakpoints, this is a threshold comparison value.
The value parameter is interpreted according to the trigger condition for the selected breakpoint;
see “SetBreakPoint, GetBreakPoint” on page 75. The data format for each trigger condition is as
follows:
Breakpoint TriggerValue TypeRangeUnits
31
GreaterOrEqualCommandedPosition signed 32-bit
-2
to 2
31
-1
counts
SNAP PAC Motion Control User’s Guide
77
77
Page 82
COMMANDS IN ALPHABETICAL ORDER
Breakpoint TriggerValue TypeRangeUnits
LesserOrEqualCommandedPositionsigned 32-bit
GreaterOrEqualActualPositionsigned 32-bit
LesserOrEqualActualPositionsigned 32-bit
CommandedPositionCrossedsigned 32-bit
ActualPositionCrossedsigned 32-bit
-2
-2
-2
-2
-2
31
31
31
31
31
to 2
to 2
to 2
to 2
to 2
31
31
31
31
31
-1
-1
-1
-1
-1
counts
counts
counts
counts
counts
Restrictions
Timeunsigned 32-bit
EventStatus2 word mask - boolean status values
ActivityStatus2 word mask - boolean status values
SignalStatus2 word mask - boolean status values
0to 231-1
cycles
For level-triggered breakpoints, the high-order part of value is the selection mask, and the low-order
word is the sense mask. For each selection bit that is set to 1, the corresponding bit of the specified
status register is conditioned to cause a breakpoint when it changes state. The sense-mask bit
determines which state causes the break. If it is 1, the corresponding status-register bit will cause a
break when it is set to 1. If it is 0, the status-register bit will cause a break when it is set to 0.
For example assume it is desired that the breakpoint type will be set to EventStatus and that a
breakpoint should be recognized whenever the motion complete bit (bit 0 of event status register)
is set to 1, or the commutation error bit (bit 11 of event status register) is set to 0. In this situation the
high and low words for value would be high word: 0x801 (hex) and low word: 1.
GetBreakPointValue returns the breakpoint value for the specified breakpointID.
Two completely separate breakpoints are supported, each of which may have its own breakpoint
type and comparison value. The breakpointID field specifies which breakpoint the
SetBreakPointValue and GetBreakPointValue commands will address.
Always load the breakpoint comparison value (SetBreakPointValue command) before setting a new
breakpoint condition (SetBreakPoint command). Failure to do so will likely result in unexpected
behavior.
bufferIDunsigned 16 bits0 to 31unity-
indexunsigned 32 bits0 to bufferunitydouble words
SetBufferReadIndex
P1 write
15
P2 write length (high-order part)
31
P3 write length (low-order part)
15
4 to 71
8 to B2
C to F3
length - 1
First data word
0bufferID
Second data word
Third data word
5
40
16
0
Description
Restrictions
OptoScript
Example
See Also
GetBufferReadIndex
P1 write
15
P1 readlength (high-order part)
31
P2 readlength (low-order part)
15
First data word
0bufferID
Second data word
Third data word
5
40
16
0
SetBufferReadIndex sets the address of the read index for the specified bufferID.
GetBufferReadIndex returns the current read index for the specified bufferID.
If the read index is set to an address beyond the length of the buffer, the command will not be
executed and will return host I/O error code 7, buffer bound exceeded.
SetCaptureSource determines which of two encoder signals, Index or Home, is used to trigger the
high-speed capture of the actual axis position for the specified axis.
GetCaptureSource returns the capture signal source for the selected axis.
SetDeceleration loads the maximum deceleration buffer register for the specified axis.
GetDeceleration returns the value of the maximum deceleration buffer.
Scaling example: To load a value of 1.750 counts/cycle2 multiply by 65,536 (giving 114,688) and
load the resultant number as a 32-bit number, giving 0001 in the high word and C000h in the low
word. Retrieved numbers (GetDeceleration) must correspondingly be divided by 65,536 to convert
to units of counts/cycle
2
or steps/cycle2 . See “SNAP-SCM-MCH16 Conversion Formulas” on
page 111.
This is a buffered command. The new value set will not take effect until the next Update or
MultiUpdate instruction is entered.
These commands are used with the Trapezoidal and Velocity Contouring profile modes. They are not
used with the Electronic Gearing or S-curve profile mode.
NOTE: If deceleration is set to zero, then the value specified for acceleration (SetAcceleration) will
automatically be used to set the magnitude of deceleration.
SetEncoderModulus sets the parallel word range for the specified axis when parallel-word feedback
is used. Modulus determines the range of the connected device. For multi-turn systems, this value is
used to determine when a position wrap condition has occurred. The value provided should be one
half of the actual range of the axis. For example if the parallel-word input is used with a linear
potentiometer connected to an external A/D (Analog to Digital converter) which has 12 bits of
resolution, then the total range is 4,096 and a value of 2,048 should be loaded with this command.
GetEncoderModulus returns the encoder modulus.
A value for encoder modulus is only required when the encoder source is set to parallel.
SetEncoderSource sets the type of feedback (Incremental, None, or Loopback) for the specified axis.
When incremental is selected the motion processor expects A and B quadrature signals to be input
at the quad A/B axis inputs. When Loopback is selected, the step output is internally fed back into
the quad counters. This allows for position capture of the step position when a physical encoder is
not present.
OptoScript
Example
86
GetEncoderSource returns the code for the current type of feedback.
SetEncoderToStepRatio sets the ratio of the number of encoder counts to the number of output
steps per motor rotation used by the motion processor to convert encoder counts into steps. Counts
is the number of encoder counts per full rotation of the motor. Steps is the number of steps output
by the motion processor per full rotation of the motor. Since this command sets a ratio, the
parameters do not have to be for a full rotation as long as they correctly represent the encoder
count to step ratio.
GetEncoderToStepRatio returns the ratio of the number of encoder counts to the number of output
steps per motor rotation.
NOTE: The master axis must be on the same SNAP-SCM-BB4 as the axis argument.
NameTypeRange
masterAxis unsigned 8 bits0
1
2
3
NameInstanceEncoding
sourceActual0
Commanded1
SetGearMaster
P1 write
15
0sourcemasterAxis
Data
9
87
0
Description
OptoScript
Example
See Also
GetGearMaster
P1 read
15
0sourcemasterAxis
Data
9
87
0
SetGearMaster establishes the slave (axis) and master (masterAxis) axes for the electronic-gearing
profile, and sets the source, Actual or Commanded, of the master axis position data to be used.
The masterAxis determines the axis that will drive the slave axis. Both the slave and the master axes
must be enabled (SetAxisMode command). The source determines whether the master axis'
commanded position as determined by the trajectory generator will be used to drive the slave axis,
or whether the master axis' encoder position will be used to drive the slave.
GetGearMaster returns the value for the geared axes and position source.
SetGearRatio sets the ratio between the master and slave axes for the electronic gearing profile for
the current axis. Positive ratios cause the slave to move in the same direction as the master, negative
ratios in the opposite direction. The specified ratio has a unity scaling of 65,536.
GetGearRatio returns the gear ratio set for the specified slave axis.
Scaling examples:
Ratio ValueResultant Ratio
-32,768.5 negative slave counts for each positive master count
1,000,00015.259 positive slave counts for each positive master count
123 .0018positive slave counts for each positive master count
This is a buffered command. The new value set will not take effect until the next Update or
MultiUpdate instruction is entered.
Wrap-around0002h
Breakpoint 10004h
Capture received0008h
Motion error0010h
In positive limit0020h
In negative limit0040h
Instruction error0080h
Commutation error0800h
Breakpoint 24000h
SetInterruptMask
Data
P1 writemask
15
GetInterruptMask
Data
P1 readmask
15
0
0
Description
OptoScript
Example
See Also
SetInterruptMask determines which bits in the event status register of the specified axis will cause a
host interrupt. For each interrupt mask bit that is set to 1, the corresponding event status register bit
will cause an interrupt when that status register bit goes active (is set to 1). Interrupt mask bits set to
0 will not generate interrupts.
GetInterruptMask returns the mask for the specified axis.
Example: The interrupt mask value 28h will generate an interrupt when either the “in positive limit”
bit or the “capture received” bit of the event status register goes active (set to 1).
SetJerk loads the jerk register in the parameter buffer for the specified axis.
GetJerk reads the contents of the Jerk register.
Scaling example: To load a jerk value (rate of change of acceleration) of 0.012345 counts/cycle3 (or
steps/cycle3) multiply by 232 or 4,294,967,296. In this example this gives a value to load of
53,021,371 (decimal) which corresponds to a high word of 0329h and a low word of 0ABBh when
loading each word in hexadecimal. See “SNAP-SCM-MCH16 Conversion Formulas” on page 111.
SetJerk is a buffered command. The value set using this command will not take effect until the next
Update or MultiUpdate instruction.
This command is used only with the S-curve profile mode. It is not used with the trapezoidal,
velocity contouring, or electronic gear profile modes.
SetLimitSwitchMode enables (On) or disables (Off) limit-switch sensing for the specified axis. When
the mode is enabled, the axis will cause the corresponding limit-switch bits in the event status
register and activity status register to be set when it enters either the positive or negative limit
switches and the axis will be brought to an abrupt stop. When it is disabled, the status bits are not
set, and the axis is not stopped, regardless of whether or not the axis is in a limit switch.
GetLimitSwitchMode returns the value for the state of the limit-sensing mode.
SetMotionCompleteMode establishes the source for the comparison which determines the motion
complete status for the specified axis. When set to commanded mode the motion is considered
complete when the profile velocity reaches zero and no further motion will occur without an
additional host command. This mode is unaffected by the actual encoder location.
When set to actual mode the motion complete bit will be set when the above condition is true, and
when the actual encoder position has been within the settle window (SetSettleWindow command)
for the number of cycles specified by the SetSettleTime command. The settle timer is started at zero
at the end of the trajectory profile motion, so at a minimum a delay of SettleTime cycles will occur
after the trajectory profile motion is complete.
OptoScript
Example
See Also
94
GetMotionCompleteMode returns the value for the motion-complete mode.
SetMotorMode determines the mode of motor operation. When set to On, several events take place.
For step motor and microstepping axes, the trajectory generator controls the motor output. For all
motor types, when the encoder source (Set/GetEncoderSource) is set to incremental or parallel, the
position error is cleared; equivalent to a ClearPositionError command.
When the motor mode is set to Off, the axis is in open-loop mode, and is controlled by commands
placed directly into the motor output register by the host. Setting the motor mode to Off also resets
the trajectory generator, bringing any active motion to an abrupt stop. In addition, the maximum
velocity (Set/GetVelocity) is set to zero. On axes configured for step motor and microstepping motor
types, the step generator is switched off when the motor mode is set to Off. The following table
shows the motor output source for each motor type and mode.