Performax 4EX – SA
Advanced 4-Axis
Stepper Motion Controller
Standalone Version
Manual
PMX-4EX-SA Manual
page 1
Rev 3.02
COPYRIGHT © 2006 ARCUS,
ALL RIGHTS RESERVED
First edition, February 2007
ARCUS TECHNOLOGY copyrights this document. You may not reproduce or translate
into any language in any form and means any part of this publication without the written
permission from ARCUS.
ARCUS makes no representations or warranties regarding the content of this document.
We reserve the right to revise this document
any time without notice and obligation.
Revision History:
1.00 – 1st Revision
2.10 – 2nd Revision
3.00 – 3rd Revision
3.01 – 4th Revision
3.02 – 5th Revision
Firmware Compatibility:
†V161BL
†If your module’s firmware version number is less than the listed value, contact Arcus for the appropriate
documentation.
PMX-4EX-SA Manual
page 2
Rev 3.02
Table of Contents
1. Introduction __________________________________________________________ 7
Features _____________________________________________________________ 7
Applications _________________________________________________________ 7
Model Numbers ______________________________________________________ 8
Top Board Options ____________________________________________________ 8
2. Electrical Specifications ________________________________________________ 9
Controller Power Requirement ___________________________________________ 9
Driver Power Requirement † ____________________________________________ 9
Temperature Ratings † _________________________________________________ 9
Pulse, Dir, Enable Outputs ______________________________________________ 9
Digital Inputs ________________________________________________________ 9
Digital Outputs _______________________________________________________ 9
Alarm Input † ________________________________________________________ 9
3. Dimensions _________________________________________________________ 10
4. Connections_________________________________________________________ 11
2-pin Connector (5.08mm) _____________________________________________ 11
3-pin Connector (3.81mm) _____________________________________________ 11
DIO 10-Pin Connector (3.81mm) ________________________________________ 12
DIO 8-Pin Connector (3.81mm) _________________________________________ 13
Motion Inputs 14-Pin Connector (3.81mm) ________________________________ 13
Encoder Signals 8-Pin Connectors (3.81mm) _______________________________ 14
TBS Axis Signals 8-Pin Connectors (3.81mm) _____________________________ 15
† TB9 Axis Signals DB9 Connectors _____________________________________ 15
†TB9 2-pin Connector (5.08mm) ________________________________________ 16
PMX-4EX-SA Interface Circuit _________________________________________ 17
Pulse, Direction, and Enable Outputs _____________________________________ 18
Limit, Home, and Digital Inputs _________________________________________ 18
Digital Outputs ______________________________________________________ 19
Encoder Input Connection _____________________________________________ 20
5. Getting Started ______________________________________________________ 21
Typical Setup _______________________________________________________ 21
Windows GUI features ________________________________________________ 22
Selecting Communication & Program ____________________________________ 22
Main Control Screen __________________________________________________ 24
DXF Converter ______________________________________________________ 37
DXF Converter – Important Notes: ______________________________________ 42
Graphical Programmer ________________________________________________ 45
6. Motion Control Feature Overview _______________________________________ 55
Motion Profile _______________________________________________________ 55
Pulse Speed _________________________________________________________ 56
On-The-Fly Speed Change _____________________________________________ 56
Motor Status ________________________________________________________ 57
Individual/Linear Interpolation Moves ____________________________________ 58
Circular Interpolation Moves ___________________________________________ 58
Arc Interpolation Moves _______________________________________________ 59
PMX-4EX-SA Manual
page 3
Rev 3.02
Buffered Linear Interpolation Moves _____________________________________
On-The-Fly Target Position Change______________________________________
Homing ____________________________________________________________
MODE 0 : Home Input Only (High speed only)___________________________
MODE 1 : Limit Only _______________________________________________
MODE 2 : Home and Z-index ________________________________________
MODE 3 : Z-index only _____________________________________________
MODE 4 : Home Input Only (High speed and low speed) ___________________
Jogging ____________________________________________________________
Stopping ___________________________________________________________
Polarity ____________________________________________________________
Motor Position ______________________________________________________
Limits and Alarm ____________________________________________________
Latch Inputs ________________________________________________________
Digital Inputs/Outputs and Enable Outputs ________________________________
Sync Outputs ________________________________________________________
Analog Inputs _______________________________________________________
Joystick Control _____________________________________________________
StepNLoop Closed Loop Control ________________________________________
Device Number ______________________________________________________
Baud Rate Setting ____________________________________________________
Standalone Program Specification _______________________________________
Timer Register ______________________________________________________
Communication Time-out Feature (Watchdog) _____________________________
Storing to Flash ______________________________________________________
7. Communication – USB ________________________________________________
USB Communication API Functions _____________________________________
USB Communication Issues ____________________________________________
8. Communication – RS-485 (ASCII) ______________________________________
Communication Port Settings ___________________________________________
ASCII Protocol ______________________________________________________
9. ASCII Language Specification __________________________________________
Error Codes _________________________________________________________
10. Standalone Language Specification _____________________________________
; __________________________________________________________________
ABORT ____________________________________________________________
ABORT[axis] _______________________________________________________
ABS _______________________________________________________________
ACC ______________________________________________________________
ACC[axis] __________________________________________________________
AI[1-8] ____________________________________________________________
ARC ______________________________________________________________
CIR _______________________________________________________________
DEC_______________________________________________________________
DEC[axis] __________________________________________________________
DELAY ____________________________________________________________
PMX-4EX-SA Manual
page 4
60
61
61
61
62
62
63
63
64
64
64
64
65
65
66
68
69
69
71
74
74
74
75
76
76
77
77
78
79
79
79
80
86
87
87
87
87
87
88
88
88
89
89
89
90
90
Rev 3.02
DI ________________________________________________________________ 91
DI[1-8] ____________________________________________________________ 91
DO ________________________________________________________________ 91
DO[1-8] ____________________________________________________________ 92
E[axis] _____________________________________________________________ 92
ECLEAR[axis] ______________________________________________________ 92
ELSE ______________________________________________________________ 93
ELSEIF ____________________________________________________________ 93
END ______________________________________________________________ 94
ENDIF _____________________________________________________________ 94
ENDSUB___________________________________________________________ 94
ENDWHILE ________________________________________________________ 95
EO ________________________________________________________________ 95
EO[1-4] ____________________________________________________________ 95
GOSUB ____________________________________________________________ 96
HLHOME[axis][+ or -] ________________________________________________ 96
HOME[axis][+ or -] __________________________________________________ 96
HSPD _____________________________________________________________ 97
HSPD[axis] _________________________________________________________ 97
IF _________________________________________________________________ 98
INC _______________________________________________________________ 98
JOG[axis] __________________________________________________________ 98
JOYENA ___________________________________________________________ 99
JOYHS[axis] ________________________________________________________ 99
JOYDEL[axis] ______________________________________________________ 99
JOYNO[axis] _______________________________________________________ 99
JOYNI[axis] _______________________________________________________ 100
JOYPI[axis]________________________________________________________ 100
JOYPO[axis] _______________________________________________________ 100
LHOME[axis][+ or -] ________________________________________________ 100
LSPD _____________________________________________________________ 100
LSPD[axis] ________________________________________________________ 101
MST[axis] _________________________________________________________ 101
P[axis] ____________________________________________________________ 102
PRG ______________________________________________________________ 102
PS[axis] ___________________________________________________________ 102
SCV[axis] _________________________________________________________ 103
SL[axis] ___________________________________________________________ 103
SLS[axis]__________________________________________________________ 103
SR[0,3] ___________________________________________________________ 104
SSPD[axis] ________________________________________________________ 104
SSPDM[axis] ______________________________________________________ 104
STOP _____________________________________________________________ 105
STOP[axis] ________________________________________________________ 105
STORE ___________________________________________________________ 105
SUB ______________________________________________________________ 105
PMX-4EX-SA Manual
page 5
Rev 3.02
SYNCFG[axis] _____________________________________________________
SYNOFF[axis] _____________________________________________________
SYNON[axis] ______________________________________________________
SYNPOS[axis] _____________________________________________________
SYNSTAT[axis] ____________________________________________________
SYNTIME[axis] ____________________________________________________
TOC______________________________________________________________
TR _______________________________________________________________
U ________________________________________________________________
V[index] __________________________________________________________
WAIT[axis] ________________________________________________________
WHILE ___________________________________________________________
X ________________________________________________________________
Y ________________________________________________________________
Z ________________________________________________________________
ZHOME[axis][+ or -] ________________________________________________
ZOME[axis][+ or -] _________________________________________________
11. Example Standalone Programs ________________________________________
Standalone Example Program 1 – Single Thread ___________________________
Standalone Example Program 2 – Single Thread ___________________________
Standalone Example Program 3 – Single Thread ___________________________
Standalone Example Program 4 – Single Thread ___________________________
Standalone Example Program 5 – Single Thread ___________________________
Standalone Example Program 6 – Single Thread ___________________________
Standalone Example Program 7 – Multi Thread____________________________
Standalone Example Program 8 – Multi Thread____________________________
Appendix A: Speed Settings _____________________________________________
Acceleration/Deceleration Range _______________________________________
Acceleration/Deceleration Range – Positional Move ________________________
PMX-4EX-SA Manual
page 6
106
106
106
107
107
107
107
107
108
108
109
109
110
110
110
111
111
112
112
112
112
113
113
114
115
116
117
117
118
Rev 3.02
1. Introduction
PMX-4EX-SA is an advanced 4 axis stepper standalone programmable motion controller.
Communication to the PMX-4EX-SA can be established over USB or RS-485. It is
possible to download a standalone program to the device and have it run independent of a
host.
Features
PMX-4EX-SA
-
-
-
USB 2.0 communication
RS-485 ASCII communication
• 9600, 19200, 38400, 57600, 115200 bps
Standalone programmable
Maximum pulse output rate of 6M PPS
Trapezoidal or s-curve acceleration
On-the-fly speed change
XYZU linear coordinated motion
XY circular coordinated motion
XY arc coordinated motion
Continuous linear coordinated buffered move for XYZ axes for smooth move
control. Buffer size is 36.
A/B/Z differential encoder inputs [Max frequency of 5 MHz]
• StepNLoop closed loop control (position verification)
Pulse/Dir/Enable open collector outputs per axis
Opto-isolated I/O
• 8 x inputs [4 x high speed position capture latch input]
• 8 x outputs [4 x synchronous output]
• +Limit/-Limit/Home inputs per axis
Homing routines:
• Home input only (high speed)
• Home input only (high speed + low speed)
• Limit only
• Z-index encoder channel only
• Home input + Z index encoder channel
8 x 10-bit analog inputs
• Joystick control
Applications
- 3D CAD/CAM
- Engraving
- Laser cutting
- Dispensing
PMX-4EX-SA Manual
page 7
Rev 3.02
Model Numbers
PMX-4EX-SATop Board Type
TBS – Standard
TB9 – DB9s
SA – Stand-Alone
4EX – 4-axis enhanced controller
Top Board Options
The PMX-4EX-SA is available in two different top board configurations. The top board
should be selected depending on your interfacing needs.
Standard Top Board (PMX-4EX-SA-TBS)
Standard Top Board consisting of 3.81 mm headers for X/Y/Z/U pulse/dir/enable outputs
and alarm inputs.
DB9 Top Board (PMX-4EX-SA-TB9)
DB9 Top Board consisting of DB9 headers for X/Y/Z/U pulse/dir/enable outputs. The
DB9 headers on these top boards are pin-to-pin compatible with the Arcus series motor +
driver (DMX-A2-DRV).
Contacting Support
For technical support contact: support@arcus-technology.com.
Or, contact your local distributor for technical support.
PMX-4EX-SA Manual
page 8
Rev 3.02
2. Electrical Specifications
Controller Power Requirement
Regulated Voltage:
Current (Max):
+12 to +24 VDC
1.5A (Peak)
Driver Power Requirement †
Regulated Voltage:
Current (Max):
+12 to +48 VDC
3.0A (Peak)
† Applicable to TB9 top board option + DMX-A2-DRV driver combination only
Temperature Ratings †
Operating Temperature:
Storage Temperature:
† Based on component ratings
-20°C to +80°C
-55°C to +150°C
Pulse, Dir, Enable Outputs
Type:
Max sink voltage:
Max sink current:
Open-collector output
+24 VDC
40 mA
Digital Inputs
Type:
Voltage range:
Max foward current:
Opto-isolated inputs (NPN)
+12V to +24VDC
40 mA
Digital Outputs
Type:
Max voltage:
Max source current:
Opto-isolated outputs (PNP)
+12V to +24VDC
90 mA
Alarm Input †
Type:
Voltage range:
Max forward current:
† TB9 version is 5V TTL type
PMX-4EX-SA Manual
Opto-isolated inputs (NPN)
+12V to +24VDC
40 mA
page 9
Rev 3.02
3. Dimensions
Figure 3.0
Note: The image above is of PMX-4EX-SA-TBS. The dimensions of PMX-4EX-SATB9 are the same, with the exception of the top board connectors.
PMX-4EX-SA Manual
page 10
Rev 3.02
4. Connections
In order for PMX-4EX-SA to operate, it must be supplied with +12VDC to +24VDC.
Power pins as well as communication port pin outs are shown below.
Figure 4.0
2-pin Connector (5.08mm)
Pin #
1
2
In/Out
I
I
Name
G
V+
Description
Ground
Power Input +12 to +24 VDC
Table 4.0
Mating Connector Description:
Mating Connector Manufacturer:
Mating Connector Manufacturer Part:
2 pin 0.2” (5.08mm) connector
On-Shore
†EDZ950/2
† Other 5.08mm compatible connectors can be used.
3-pin Connector (3.81mm)
Pin #
1
2
2
In/Out
I
I/O
I/O
Name
G
485485+
Description
Ground
RS-485 minus signal
RS-485 plus signal
Table 4.1
Mating Connector Description:
Mating Connector Manufacturer:
Mating Connector Manufacturer Part:
3 pin 0.15” (3.81mm) connector
On-Shore
†EDZ1550/3
† Other 3.81 compatible connectors can be used.
PMX-4EX-SA Manual
page 11
Rev 3.01
1
2
Figure 4.1
10 pin Connector (2.0mm)
Pin #
1
2
3
4
5
6
7
8
9
10
In/Out
O
O
I
I
I
I
I
I
I
I
Name
+5V
GND
AI7
AI8
AI5
AI6
AI3
AI4
AI1
AI2
Description
+5V
Ground
Analog Input 7
Analog Input 8
Analog Input 5
Analog Input 6
Analog Input 3
Analog Input 4
Analog Input 1
Analog Input 2
Table 4.2
Mating Connector Description:
Mating Connector Manufacturer:
Mating Connector Manufacturer Part:
Female 10 pin 2mm dual row
HIROSE
DF11-10DS-2C (10 pin female connector)
DF11-2428SC (female socket pin)
Figure 4.2
DIO 10-Pin Connector (3.81mm)
Pin #
1
2
3
4
5
6
7
8
In/Out
I
I
I
I
I
I
I
I
Name
VS
VG
DI1
DI2
DI3
DI4
DI5
DI6
PMX-4EX-SA Manual
Description
Opto-Supply +12V to +24 VDC (for digital IO)
Opto-Ground (for digital IO)
Digital Input 1
Digital Input 2
Digital Input 3
Digital Input 4
Digital Input 5
Digital Input 6
page 12
Rev 3.01
9
10
I
I
DI7
DI8
Digital Input 7
Digital Input 8
Table 4.3
Mating Connector Description:
Mating Connector Manufacturer:
Mating Connector Manufacturer Part:
10 pin 0.15” (3.81mm) connector
On-Shore
†EDZ1550/10
† Other 3.81 compatible connectors can be used.
DIO 8-Pin Connector (3.81mm)
Pin #
1
2
3
4
5
6
7
8
In/Out
O
O
O
O
O
O
O
O
Name
DO1
DO2
DO3
DO4
DO5
DO6
DO7
DO8
Description
Digital Output 1
Digital Output 2
Digital Output 3
Digital Output 4
Digital Output 5
Digital Output 6
Digital Output 7
Digital Output 8
Table 4.4
Mating Connector Description:
Mating Connector Manufacturer:
Mating Connector Manufacturer Part:
8 pin 0.15” (3.81mm) connector
On-Shore
†EDZ1550/8
† Other 3.81 compatible connectors can be used.
Motion Inputs 14-Pin Connector (3.81mm)
Figure 4.3
Pin #
1
2
In/Out
I
I
Name
VG
VS
3
4
I
I
-LU
HU
PMX-4EX-SA Manual
Description
Ground
Opto-Supply Input +12 to +24 VDC (for limit and
home inputs)
-Limit [UAxis]
Home [U Axis]
page 13
Rev 3.01
5
6
7
8
9
10
11
12
13
14
I
I
I
I
I
I
I
I
I
I
+LU
-LZ
HZ
+LZ
-LY
HY
+LY
-LX
HX
+LX
+Limit [Uaxis]
-Limit [Z Axis]
Home [Z Axis]
+Limit [Z Axis]
-Limit [Y Axis]
Home [Y Axis]
+Limit [Y Axis]
-Limit [X Axis]
Home [X Axis]
+Limit [X Axis]
Table 4.5
Mating Connector Description:
Mating Connector Manufacturer:
Mating Connector Manufacturer Part:
14 pin 0.15” (3.81mm) connector
On-Shore
†EDZ1550/14
† Other 3.81 compatible connectors can be used.
Encoder Signals 8-Pin Connectors (3.81mm)
Figure 4.4
Pin #
1
2
3
4
5
6
7
8
In/Out
O
O
I
I
I
I
I
I
Name
G
+5V
/Z
Z
/B
B
/A
A
Description
Ground
+5V
/Z Index Encoder Input
Z Index Encoder Input
/B Channel Encoder Input
B Channel Encoder Input
/A Channel Encoder Input
A Channel Encoder Input
Table 4.6
Mating Connector Description:
Mating Connector Manufacturer:
Mating Connector Manufacturer Part:
8 pin 0.15” (3.81mm) connector
On-Shore
†EDZ1550/8
† Other 3.81 compatible connectors can be used.
PMX-4EX-SA Manual
page 14
Rev 3.01
TBS Axis Signals 8-Pin Connectors (3.81mm)
Figure 4.5
Pin #
1
2
3
4
5
6
7
8
In/Out
I
O
I
NC
NC
O
O
O
Name
G
+5V
Al
NC
NC
E
D
P
Description
Ground
+5V
Alarm
No Connection
No Connection
Enable
Direction
Pulse
Table 4.7
Mating Connector Description:
Mating Connector Manufacturer:
Mating Connector Manufacturer Part:
8 pin 0.15” (3.81mm) connector
On-Shore
†EDZ1550/8
† Other 3.81 compatible connectors can be used.
† TB9 Axis Signals DB9 Connectors
9
1
Figure 4.6
Pin #
1
2
3
4
5
6
7
8
9
In/Out
O
O
O
I
NC
O
O
NC
O
Name
V+
P
E
ALM
NC
G
D
NC
5V
Description
Driver Power
Pulse
Enable
Alarm Input (5V TTL)
Reserved. Do not make connection.
Driver Ground
Direction
Reserved. Do not make connection.
+5V
Table 4.8
PMX-4EX-SA Manual
page 15
Rev 3.01
† The pins on the DB9 headers can be connected directly to a DMX-A2-DRV module
(pin-to-pin compatible)
†TB9 2-pin Connector (5.08mm)
Pin #
1
2
In/Out
I
I
Name
G
V+
Description
Driver Ground
Driver Power
Table 4.9
Mating Connector Description:
Mating Connector Manufacturer:
Mating Connector Manufacturer Part:
2 pin 0.2” (5.08mm) connector
On-Shore
EDZ950/2
† Other 5.08mm compatible connectors can be used. There are two separate driver power
inputs. The right side is for axes X + Z. The left side is for axes Y + U.
PMX-4EX-SA Manual
page 16
Rev 3.01
PMX-4EX-SA Interface Circuit
Figure 4.7
PMX-4EX-SA Manual
page 17
Rev 3.01
Pulse, Direction, and Enable Outputs
Pulse/Dir/Enable outputs for both the standard and DB9 top boards are all open collector
outputs capable of sinking up to 40mA of current.
Figure 4.8
Example of Pulse/Dir/Enable connection to stepper driver with opto-isolated input is
shown below.
Figure 4.9
Limit, Home, and Digital Inputs
In order for these opto-isolated inputs and outputs to work properly, VS (opto-isolator
voltage supply) located on the side connector and VG (opto-isolator voltage ground) also
PMX-4EX-SA Manual
page 18
Rev 3.01
located on the side connector must be supplied. Range of VS is from +12VDC to
+24VDC.
Limit and home inputs require a separate opto-supply which can be found on the 3.8mm,
14-pin connector. If desired, these opto-supplies can be tied together.
Figure 4.10
To trigger the opto-isolated digital inputs, sink the digital input signal to the ground of the
corresponding opto-supply.
Note: Alarm input for TB9 version is 5V TTL type.
Digital Outputs
For the opto-isolated outputs, the digital output signal will source from VS when the
signal is turned on.
Figure 4.11
PMX-4EX-SA Manual
page 19
Rev 3.01
Encoder Input Connection
Both single-ended and differential quadrature encoder inputs are accepted.
When using single-ended encoders, use the /A, /B, and /Z inputs.
+5V supply and Ground signals are available to power the encoder. Make sure that the
total current usage is less than 200mA for the +5V.
The maximum encoder frequency is 5MHz.
PMX-4EX-SA Manual
page 20
Rev 3.01
5. Getting Started
Typical Setup
PC-Controlled
Figure 5.0
Stand-Alone Operation
Figure 5.1
PMX-4EX-SA Manual
page 21
Rev 3.01
Windows GUI features
PMX-4EX-SA comes with a Windows GUI program to test, program, compile,
download, and debug the controller. The following control types are available.
Program
Program & Control
DXF Converter
Graphical Converter
Description
Allows the user to test all the features interactively. Also provides
the interface for stand-alone programming
Allows the user to load a DXF file and convert it to motion
commands
Allows the user to create a stand-alone program graphically, instead
of writing text-based code
Table 5.0
Selecting Communication & Program
A
B
C
D
Figure 5.2
A. Click this button to start USB communication.
B. Set the serial settings for RS-485 including COM port, baud rate, and device
ID.
C. If communication port or the baud rate is not known, use these buttons to
search for the device.
D. Open communication with the PMX-4EX-SA module through RS-485.
Note: When connecting for the first time, we recommend that a search is done to find out
the COM port number where the PMX-4EX-SA is connected.
PMX-4EX-SA Manual
page 22
Rev 3.01
If the search fails, or you are unable to open a connection, check the following:
• Check power supply to PMX-4EX-SA. Allowable power is range is from
12VDC to 24VDC.
• Check communication wiring. Make sure that the 485+ from PMX-4EX-SA
is connected to 485+ of the master and 485- from PMX-4EX-SA is connected
to 485- of the master.
• Confirm that the device name is set correctly. Default factory device name
setting is “01”. If this name has been changed and stored to flash, enter the
new name.
This screen allows the user to choose between the three different program types. To use
a particular program, click on the corresponding button.
Figure 5.3
PMX-4EX-SA Manual
page 23
Rev 3.01
Main Control Screen
A
Q
P
O
K
G
N
B
M
H
L
C
D
E
F
I
J
Figure 5.4
PMX-4EX-SA Manual
page 24
Rev 3.01
A. Status
1
2
8
3
9
5
4
10
6
11
7
12
13
14
Figure 5.5
1. Current pulse position (X,Y,Z,U axes). If StepNLoop is enabled,
this shows the real-time target position.
2. Current encoder position (X,Y,Z,U axes)
3. Current speed (X,Y,Z,U axes) pulse/sec. If StepNLoop is enabled,
the speed is in encoder counts/sec, unless an interpolation move is in
process.
4. Motor status (X,Y,Z,U axes)
i. Idle – motor is not moving.
ii. Accel – motor is accelerating
iii. Const – motor is running in constant speed
iv. Decel – motor is decelerating
v. +LimError – plus limit error
vi. –LimError – minus limit error
5. StepNLoop status - valid only when StepNLoop is enabled and
displays current StepNLoop status by displaying one of the
following:
NA – StepLNoop is disabled
IDLE – motor is not moving
MOVING – target move is in progress
JOGGING – jog move is in progress
HOMING – homing is in progress
Z-HOMING – homing using Z-index channel in progress
ERR-STALL – StepNLoop has stalled.
ERR-LIM – plus/minus limit error
6. StepNLoop delta status
7. –Limit, + Limit, Home and Alarm input status (X,Y,Z,U axes)
8. Move mode status
i. ABS – absolute move
ii. INC – incremental move
9. Timer register status (counts down)
PMX-4EX-SA Manual
page 25
Rev 3.01
10. Clears any limit or StepNLoop error
11. Buffer move enable status
12. Buffer start: This is the current index of the buffer. Note that the
buffer is a 36 position ring buffer. (Used for buffer move mode only)
13. Buffer end: This is the current end of the buffer. Note that the buffer
is a 36 position ring buffer. (Used for buffer move mode only)
14. Provides the available empty positions of the buffer (Used for
buffer move mode only)
B. Control
3
2
4
1
5
22
6
21
7
20
8
9
10
16
19
18 17
15 14
13
12
11
Figure 5.6
1. Global High speed, low speed, and acceleration. To give each axis
individual speed parameters, enter HS[axis], LS[axis] and ACC[axis]
commands via the command line.
2. Select X/Y/Z/U axis to control.
3. Target Position (X,Y,Z,U axes)
4. Enable – motor power is turned on or off by clicking on these circles
(X,Y,Z,U axes)
5. Set absolute move mode
6. Set incremental move mode
7. RP - Reset pulse counter for the specified axis. Not allowed if
StepNLoop is enabled.
8. RE - Reset encoder counter for the specified axis.
9. SP - Set pulse counter for the specified axis.
10. SE - Set encoder counter for the specified axis.
PMX-4EX-SA Manual
page 26
Rev 3.01
11. ISTOP – the motion is immediately stopped without deceleration.
12. RSTOP – the motion is stopped with deceleration.
13. Z+/Z-: Home the axis using only encoder index channel.
14. H+/H-: Home the axis at high speed using only the home sensor.
15. Buffer move Tool – Clicking on this button will provide the user with
an interface to load buffer move commands to the PMX-4EX-SA.
a
f
b
g
c
d
e
Figure 5.7
a. Buffer Array List – Enter the desired list of buffer commands
here. Once the list is loaded, if the number of commands is
greater than 36 (max buffer size), the program will
automatically send the remaining commands to the PMX-4EXSA as spaces clears up in the buffer.
b. Buffer enable – Enable/Disable buffer move mode
c. Load Move Array – Once the buffer array list is created, click
here to load the array list to the program.
d. Start – Once the array has been loaded, click here to begin
sending the buffered commands to the PMX-4EX-SA. Note
that after the “START” button is clicked, the buffer commands
will not begin to be sent to the PMX-4EX-SA until the Buffer I
Move window is closed.
e. Abort – Stop sending buffer commands to the PMX-4EX-SA.
Also disables buffer move mode.
f. Open/Save/New – Allows users to save/open or create new
buffer array lists
g. I Accel – Enable/Disable buffered I move acceleration.
PMX-4EX-SA Manual
page 27
Rev 3.01
16. ZH+/ZH-: Home sensor and encoder index channel is used to home.
17. Arc/Circle Tool – Clicking on this button will provide the user with
an interface to perform Arc/Circle XY moves.
b
a
Figure 5.8
a. Perform Arc Move – Once the arc center/degree/move
direction parameters are set, clicking on this button will begin
the arc move.
b. Perform Circle Move – Once the circle center/move direction
parameters are set, clicking on this button will begin the circle
move.
Note that after an arc or circle move is started, the position/speed
values of the main control window will not begin to update until the
above window is closed.
18. JOG+/JOG-: jogs the motor in positive and negative direction.
19. HL+/HL-: Home the axis at high speed and low speed using only the
home sensor.
20. L+/L-: Home the axis using the limit sensor.
21. ABS: Perform absolute move. If more than one axis is selected, an
interpolated move will result.
22. DAT: Return to 0 position. If more than one axis is selected, an
interpolated move will result.
PMX-4EX-SA Manual
page 28
Rev 3.01
C. On-The-Fly-Speed Control
2
3
4
5
1
6
Figure 5.9
Select X/Y/Z/U axis.
Select destination speed of the axis.
Select the acceleration used during an on-the-fly speed change.
Select the SSPDM mode for the axis. See On-The-Fly Speed section
for details.
5. Set the SSPDM mode for the axis.
6. Set on-the-fly speed change. Acceleration will be taken from the
“Acc” field. Make sure that the SSPDM mode has been set before
issuing the on-the-fly speed operation.
1.
2.
3.
4.
D. On-The-Fly-Position Control
1
2
Figure 5.10
1. Set the new target position for the specified axis.
2. SP - Perform and on-the-fly position change.
E. Product Information
Figure 5.11
PMX-4EX-SA Manual
page 29
Rev 3.01
F. Sync Outputs
1
Figure 5.12
1. Sync output status for DO1-DO4.
i. OFF
ii. WAITING
iii. TRIGGERED
G. Digital Input/Output
1
2
Figure 5.13
1. Digital Input - DI1-DI8
2. Digital Outputs - DO1-DO8. To turn on/off a digital output, click on
the corresponding circle.
H. Analog Inputs
1
Figure 5.14
1. Analog input status of AI1-AI8. Units are in mV.
PMX-4EX-SA Manual
page 30
Rev 3.01
I. Program File Control
2
1
3
4
Figure 5.15
1.
2.
3.
4.
Open – Open standalone program
Save – Save standalone program
New – Clear the standalone program editor
View - View the compiled program
J. Standalone Program Editor
2
1
3
Figure 5.16
1. Text Program – Text box for writing and editing a standalone
program.
PMX-4EX-SA Manual
page 31
Rev 3.01
2. Opens a larger Program Editor window for easier programming.
3. Clear Code Space – Clear the code space on the PMX-4EX-SA.
K. Standalone Program Control
7
6
5
1
4
2
3
Figure 5.17
Run – Standalone program is run.
Stop – Program is stopped.
Pause – Program that is running can be paused.
Cont – Program that is paused can be continued
XThread - Open the Standalone Program Control for all standalone
programs.
6. Index – Current line of low-level code that is being executed.
7. Status of standalone program:
i. Idle – Program is not running.
ii. Running – Program is running.
iii. Paused – Program is paused.
iv. Error – Program is in an error state.
1.
2.
3.
4.
5.
L. Standalone Program Compile/Download/Upload
1
2
3
Figure 5.18
1. Compile – Compile the standalone program
PMX-4EX-SA Manual
page 32
Rev 3.01
2. Download – Download the compiled program
3. Upload – Upload the standalone program from the controller
M. Setup
4
5
6
1
7
2
3
9
8
10
Figure 5.19
1. Polarity/S-curve:
a. Set home/alarm/dir polarity for X/Y/Z/U axes. Note that limit
polarity is fixed either high/low for ALL axes.
b. Set s-curve enable/disable for each axes.
c. DOP - Set the digital output polarity
d. DIP - Set the digital input polarity
e. EOP - Set the enable output polarity
PMX-4EX-SA Manual
page 33
Rev 3.01
f. SA Err - Set the return jump line for standalone error handling
2. Set StepNLoop parameters
3. Set joystick parameters
4. Communication settings:
a. Set device name: [4EX00-4EX99]
b. Set baud rate (used for RS-485 communication)
5. Bootup Parameters
a. Auto Run - Click and perform store to flash to have the
specified standalone program run on boot-up
b. DOBOOT/EOBOOT - Set the digital and enable output
configuration status on boot-up.
6. Miscellaneous Settings:
a. IERR - Enable/disable the ignore limit/alarm error feature
b. IACC - Enable/disable I move acceleration (used with buffered
I commands)
c. EDEC - Enable/disable unique deceleration.
7. Set Sync output parameters (Note that sync output parameters are not
stored to flash memory)
8. Open/Save parameters to file.
9. Upload/Download parameters to and from RAM
10. Store parameters to flash memory
N. Terminal
1
2
3
4
PMX-4EX-SA Manual
page 34
Rev 3.01
Figure 5.20
1. Response Box – Displays sent command as well as corresponding
response
2. Device Name – Device name of the PMX-4EX-SA. In USB
communication mode, the field is fixed. In RS-485 communication
mode, this field can be modified so that the user can communicate
with a specific device.
3. Command line – ASCII command line
4. Save – Save the current contents of the Response Box to file
O. Latches
1
2
3
4
Figure 5.21
1. Enable Latch – Enable latch support for X/Y/Z/U axis
2. Latch Status:
a. ON: Latch has been triggered
b. OFF: Latch is disabled
c. WAITING: Latch is enabled and is waiting to be triggered.
3. Position – Latched position value. Note that this is reset to 0 each
time that the latch is enabled.
4. Encoder – Latched encoder value. Note that this is reset to 0 each
time that the latch is enabled.
PMX-4EX-SA Manual
page 35
Rev 3.01
P. Variable Status
1
2
3
Figure 5.22
5. Volatile Variables – Status of volatile variable V0-V49
6. Non-volatile Variables – Status of non-volatile variable V50-V99
7. Command line – Set variables using V[0-99]=[value] syntax
Q. About
Figure 5.23
Displays the current Software and Firmware versions.
PMX-4EX-SA Manual
page 36
Rev 3.01
DXF Converter
A
F
B
H
C
I
D
G
E
Figure 5.24
PMX-4EX-SA Manual
page 37
Rev 3.01
A. DXF Viewer
1
3
2
Figure 5.25
1. Displays the (X,Y) position of the mouse cursor within the DXF
viewer box
2. Preview of the DXF file. For DXF preview to appear, click on “Load
DXF File”
3. Z-axis cursor – Whenever the Z-axis is enabled, the cursor turns the
color red. Otherwise the cursor is the color white
B. Status
1
2
3
5
4
Figure 5.26
PMX-4EX-SA Manual
page 38
Rev 3.01
1. Current inch/mm position (X,Y axes).
2. Current speed (X,Y axes).
3. Motor status (X,Y axes)
i. Idle – motor is not moving.
ii. Accel – motor is accelerating
iii. Const – motor is running in constant speed
iv. Decel – motor is decelerating
v. +LimError – plus limit error
vi. –LimError – minus limit error
4. +Limit, -Limit, Home status
5. Enable status (X,Y axes). To enable/disable the axis, click on the
corresponding circle
C. Digital Input/Output
See Section G of “GUI: Program & Control”
D. Control
1
2
3
Figure 5.27
1. Home x-axis to the negative direction
2. Home y-axis to the negative direction
3. Abort all movement
E. DXF Action
1
2
3
Figure 5.28
PMX-4EX-SA Manual
page 39
Rev 3.01
1. Parameter Setup – Allows the user to setup the scaling of the DXF
conversion. Once the button is clicked, the following screen appears:
a
b
c
e
d
f
Figure 5.29
a. Length/Pulse Factor – Select relationship between number of
pulses and length of movement in terms of inch or millimeter.
b. Max Stroke Length – The largest allowable stroke length. This
will affect the scaling of the DXF viewer box
c. High Speed, Low Speed and Acceleration settings
d. Pen Up Routine – The routine when the XY axis is not in
position
e. Pen Down Routine – The routine when the XY axis is in
position
f. Save parameters and exit setup
2. Load DXF File – Once the button is clicked, the following screen
appears:
PMX-4EX-SA Manual
page 40
Rev 3.01
Figure 5.30
Select the desired DXF file and click “Open”. At this point, the selected
DXF file will be previewed in the DXF Viewer box.
3. Convert File - Convert the loaded DXF file into PMX-4EX-SA
compatible motion commands. The result will be loaded into the
Motion Conversion Program box.
Note: The conversion scaling and speed will depend on the parameters
set in the Parameter setup box.
F. Motion Conversion Program
Figure 5.31
View DXF file code once it is converted to Arcus Technology text-based
language. To populate this box, first select a DXF file by clicking on
“Load DXF File”, secondly click “Convert File”.
Note: This text box can be edited and compiled to customize your motion
program
PMX-4EX-SA Manual
page 41
Rev 3.01
G. Standalone Program Compile/Download/Upload/View
See Section L of “GUI: Program & Control”
H. Program File Control
See Section I of “GUI: Program & Control”
I. Program Control
See Section K of “GUI: Program & Control”
DXF Converter – Important Notes:
Creating a compatible DXF file:
Margins: Many times a DXF file may have extra text or margins describing the
project. These should be removed. The only elements in the DXF file should be
the picture that is desired to be drawn.
Radius Size: PMX-4EX-SA does not allow a radius larger than 134216773
pulses on arc or circular moves. To keep your radius moves smaller than
134,216,773, decrease the Length/Pulse Factor.
Picture positioning: A DXF file cannot contain an any or part of an image that is
not in quadrant I (i.e. all x,y positions of the DXF need to be positive). See figure
below:
Figure 5.32
Export Type: When exporting to DXF type, the DXF must be “AutoCad R12”.
Scaling the DXF Viewer Box:
Sometimes when loading a DXF file, the picture may seem too small. See below:
PMX-4EX-SA Manual
page 42
Rev 3.01
Figure 5.33
In this case, the window is zoomed out too much. To zoom in, increase the Max
Stroke Length parameter.
In the case where you do not see any picture or the picture is cut off, the window
is zoomed in too much. See below:
Figure 5.34
To zoom out, decrease the Max Stroke Length parameter.
When creating a DXF file, the scaling is maintained when you load it into the
DXF converter.
For example, you can see in below in Auto Cad drawing that the length and width
of the picture is about 100 x 100 (circled in red). In this case, the units are mm.
PMX-4EX-SA Manual
page 43
Rev 3.01
Figure 5.35
When loading the DXF, the Max Stroke Length should be set to 100 in order to
properly show the picture. See below:
Figure 5.36
Scaling your XY table:
The scaling of your XY table will depend on the Length/Pulse Factor.
PMX-4EX-SA Manual
page 44
Rev 3.01
Graphical Programmer
A
B
C
E
D
Figure 5.37
PMX-4EX-SA Manual
page 45
Rev 3.01
A. While Sequence Box
1
Figure 5.38
1. The following box contains the sequence that is executed in a
continuous while loop. To enter things into the while loop, first click
on an item in the Graphic Language List box and then move the cursor
directly under the last item of the sequence (see above).
Once this is done, a green line will appear. At this point, click on the
green line to expose the settable parameters.
PMX-4EX-SA Manual
page 46
Rev 3.01
B. Graphic Language List Box
2
6
3
1
4
7
5
8
9
12
13
14
10
11
Figure 5.39
1. Set Speed Object: Set global high speed, low speed and acceleration
settings. These speed settings will be used for all moves unless
otherwise specified.
Figure 5.40
PMX-4EX-SA Manual
page 47
Rev 3.01
2. Move Object: Perform absolute move commands on selected axes
a
b
c
Figure 5.41
a. Select 1-4 axes to move. If more than one axis is
selected, the move will be linear interpolated.
b. Check to use global speeds specified in the Set Speed
Object
c. If “Use Global Speed” is not checked, the move will
use the following local speed settings
3. Jog/Home Object: Perform a plus/minus jog or home move for a
single axis
a
d
b
c
Figure 5.42
a.
b.
c.
d.
PMX-4EX-SA Manual
Select this setting to be a jog or home move
Select the axis to jog
Select the direction of the move (i.e. “+” or “-“)
See Graphic Language List Box: Section 2b and 2c
page 48
Rev 3.01
4. Stop Object: Perform a ramp stop or immediate stop on 1 or all axes
a
b
Figure 5.43
a. If this move is a ramp stop, select 1 or all axes
b. If this moves is an immediate stop, select 1 or all axes
5. Wait Move Object: Wait until motion is done on a single axis until
continuing to execute
Figure 5.44
6. Delay Object: Wait a set amount of time before continuing to execute.
Units in milli-seconds.
Figure 5.45
PMX-4EX-SA Manual
page 49
Rev 3.01
7. Wait Input Object: Wait until a single input is on/off before
continuing to execute
a
b
Figure 5.46
a. Select the digital input
b. Make the condition on or off
8. Input Move Object: Perform a move depending on a single digital
f
input status
g
a
b
c
d
e
Figure 5.47
a.
b.
c.
d.
e.
f.
Select the digital input
Make the condition on or off
Select move type
Select axis
Enter target position if “Move” type is selected
Click to first stop the previous move before
processing this setting
g. See Graphic Language List Box: Section 2b and 2c
PMX-4EX-SA Manual
page 50
Rev 3.01
9. Digital Out Object: Set digital output status
a
b
c
Figure 5.48
a. Select output bit
b. Select on/off
c. To set entire 8-bit output status, click the “Value”
radio button and enter the 8-bit number in the field
10. Enable Out Object: Set enable output status for a single axis
a
b
Figure 5.49
a. Select output axis
b. Select on/off state
PMX-4EX-SA Manual
page 51
Rev 3.01
11. Custom: Write a custom program to insert into the sequence.
a
b
Figure 5.50
a. Description of program which will be displaying in
the While Sequence
b. Custom program text box. For details on
programming language, see “Standalone Language
Specification” section.
12. Delete: After clicking on this button. Clicking on any object in the
While Sequence box will delete it.
Figure 5.51
PMX-4EX-SA Manual
page 52
Rev 3.01
13. Circle Move: Create a circle interpolation move
c
a
b
Figure 5.52
a. Center of the circle
b. Draw circle in CW or CCW direction
c. See Graphic Language List Box: Section 2b and 2c
14. Arc Move: Create an arc interpolation move
a
d
b
c
Figure 5.53
a.
b.
c.
d.
Center of the arc
Degree of arc drawn
Draw arc in CW or CCW direction
Check to use global speeds specified in the Set Speed
Object
e. See Graphic Language List Box: Section 2b and 2c
PMX-4EX-SA Manual
page 53
Rev 3.01
C. Program File Box
See Section I of “GUI: Program & Control”
D. Program Control Box
See Section K of “GUI: Program & Control”
E. Standalone Program Compile/Download/View
See Section L of “Main Control Screen”
PMX-4EX-SA Manual
page 54
Rev 3.01
6. Motion Control Feature Overview
Important Note: All the commands described in this section are interactive commands
and are not analogous to stand-alone commands. Refer to the “Standalone Language
Specification” section for details regarding stand-alone commands.
Motion Profile
By default, the PMX-4EX-SA uses trapezoidal velocity profile. See Figure 6.0.
Figure 6.0
S-curve velocity profile can also be achieved by using the SCV[axis] command. See
Figure 6.1
Figure 6.1
High speed and low speed are in pps (pulses/second). Use HS[axis] and LS[axis] to
set/get individual high speed and low speed settings. To set/get the global high speed and
low speed values use the HS and LS commands.
Acceleration and deceleration time are in milliseconds and are symmetrical. Use the
ACC[axis] command to set/get individual acceleration/deceleration values. To set/get
the global acceleration value, use the ACC command.
Notes:
By default, moves by a single axis use global speed settings, unless individual high
speed, low speed and acceleration values for that axis are non-zero.
PMX-4EX-SA Manual
page 55
Rev 3.01
Example: To set the high-speed of the X-axis to 1500 pulses/second, and the Yaxis to 2000 pulses/second, issue the following speed setting commands:
HSX=1500
HSY=2000
LSX=300
LSY=300
ACCX=100
ACCY=100
‘ set high speed for x-axis only
‘ set high speed for y-axis only
‘ other parameters for the axis MUST be set as well for
‘ the controller to use the individual speed settings instead
‘ of the global speed settings
It is possible to have unique acceleration and deceleration times. In order to decelerate
using the value set in the DEC[axis] or DEC parameter, set EDEC to 1.
The minimum and maximum acceleration values depend on the high speed and low speed
settings. Refer to Table A.0 and Figure A.0 in Appendix A for details.
Pulse Speed
Current pulse rate can be read using the PS command. For units, see Table 6.0
Operation Mode
StepNLoop disabled
ALL interpolated moves
StepNLoop enabled and non-interpolated move
Speed Units
Pulse / sec
Pulse / sec
Encoder counts / sec
Table 6.0
This command returns the current speed of all axes. The PS return value has the
following format:
[Speed X]:[Speed Y]:[Speed Z]:[Speed U]
On-The-Fly Speed Change
On-the-fly speed change can be achieved with the SSPD[axis] command. In order to use
the SSPD[axis] command, s-curve velocity profile must be disabled.
SSPD Mode
The correct speed window must be selected in order to use the SSPD command. To
select a speed window, use the SSPDM[axis] command. Refer to Appendix A for
details.
During on-the-fly speed change operation, you must keep the initial and destination
speeds within the speed window.
For non on-the-fly speed change moves, set SSPDM[axis] to 0.
PMX-4EX-SA Manual
page 56
Rev 3.01
Motor Status
Motor status can be read anytime using MST command. Value of the motor status is
replied as an integer with following bit assignment:
Bit
0
1
2
3
4
5
6
7
8
9
10
11
Description
Motor in acceleration
Motor in deceleration
Motor running at constant speed
Alarm input status
Plus limit input switch status
Minus limit input switch status
Home input switch status
Plus limit error. This bit is latched when plus limit is hit
during motion. This error must be cleared using the CLR
command before issuing any subsequent move commands.
Minus limit error. This bit is latched when minus limit is
hit during motion. This error must be cleared using the
CLR command before issuing any subsequent move
commands.
Alarm error. This bit is latched when alarm is triggered
during motion. This error must be cleared using the CLR
command before issuing any subsequent move commands.
Reserved
TOC time-out status
Table 6.1
This command returns the motor status for all axes, as well as other information. The
MST return value has the following format:
[Motor Stat X]:
[Motor Stat Y]:
[Motor Stat Z]:
[Motor Stat U]:
[Buffer enabled]:
[Buffer start]:
[Buffer end]:
[Available Buffer]:
[Move mode]
Motor Stat [X/Y/Z/U] – Provide motor status of the axis
Buffer enabled – Buffer linear interpolated move status (0: off, 1: on)
Buffer start – The index of the current command in the buffer
Buffer end – The index of the last command in the buffer
Available Buffer – The amount of empty spaces in the buffer
Move mode – move mode (0: ABS, 1: INC)
PMX-4EX-SA Manual
page 57
Rev 3.01
Individual/Linear Interpolation Moves
For individual axis control use X, Y, Z and U command followed by the target position
value. A single move command can consist of up to 4 target positions (one for each
axis). If more than one axis is specified, the motion will be linearly interpolated.
Individual/Linear Move Examples:
[X1000]:
Move X-axis to position 1000.
[X1000 Y1000]:
Move X-axis to position 1000, Y-axis to position 1000
using linear interpolation.
[X1000 Y1000 Z100]:
Move X-axis to position 1000, Y-axis to position
1000, Z-axis to position 100 using linear interpolation.
[X1000 Y1000 Z100 U800]: Move X-axis to position 1000, Y-axis to position
1000, Z-axis to position 100, U-axis to position 800 using
linear interpolation.
[X1000 U800]:
Move X-axis to position 1000, U-axis to position 800 using linear
interpolation.
Individual/Linear Interpolation moves can be performed in two modes: incremental
mode. To set move modes, use the INC and ABS commands respectively.
Move Mode Examples:
[X1000] – INC mode:
The motor will move by 1000 from the current position.
[X1000] – ABS mode:
The motor will move to absolute position 1000.
Circular Interpolation Moves
PMX-4EX-SA supports circular interpolation moves using the CIRP and CIRN
commands. Circles are drawn using X,Y axes only.
CIRP[X]:[Y] – Draw circle in CW direction where [X][Y] signifies X,Y position of the
circle center.
CIRN[X]:[Y] – Draw circle in CCW direction where [X][Y] signifies X,Y position of the
circle center.
Note: The maximum allow radius is 134,216,773 pulses on arc or circular moves. All
arc or circular moves are interpreted as absolute moves.
PMX-4EX-SA Manual
page 58
Rev 3.01
A
B
Figure 6.3
Arc Interpolation Moves
PMX-4EX-SA supports arc interpolation moves using the ARCP and ARCN commands.
Arcs are drawn using X,Y axes only.
ARCP[X]:[Y]:[θA]:[θR] – Draw arc in CW direction where [X][Y] signifies X,Y
position of the circle center, θA signifies the absolute arc angle, and θR signifies the
relative arc angle.
ARCN[X]:[Y]:[θA]:[θR] – Draw arc in CCW direction where [X][Y] signifies X,Y
position of the circle center, θA signifies the absolute arc angle, and θR signifies the
relative arc angle.
Notes:
The maximum allow radius is 134,216,773 pulses on arc or circular moves. All arc or
circular moves are interpreted as absolute moves.
Angle values are whole number in thousandths. For example, 45 degrees is 45,000.
θA: The absolute angle standard is depicted in Figure 6.3. For example, to move to
position A in Figure 6.3, θA should always be 90,000 (90°). Likewise, to move to
position B in Figure 6.3, the absolute θA should always be 180,000 (180°). This is
independent of the starting position and move direction.
θR: The relative angle is calculated by finding the total degrees that the move will take.
Arc Move Examples
Example 1:
Arc start position:
PMX-4EX-SA Manual
(0,1000)
page 59
Rev 3.01
Arc start absolute angle:
Arc end position:
Move amount (degrees):
Move command:
Example 2:
Arc start position:
Arc start absolute angle:
Arc end position:
Move amount (degrees):
Move command:
90,000 (90°)
(1000,0) in CW direction
90,000 (90°)
ARCP0:0:180000:90000
(-1000,0)
0 (0°)
(0,1000) in CCW direction
270,000 (270°)
ARCN0:0:450000:270000
Figure 6.4
Buffered Linear Interpolation Moves
PMX-4EX-SA supports buffered linear coordinated motions for X, Y, and Z-axes using
the I command. Each move has its own constant speed setting.
Example: To move to location X, Y, Z to 1000, 2000, 3000 position with speed of
250 pps, use the following command - I1000:2000:3000:250.
Notes:
Manual Acceleration Control: When IACC=0, acceleration/deceleration must be done
manually. To control the acceleration or deceleration manually, gradually increase or
decrease the speed value for each interpolated move.
Automatic Acceleration Control: When IACC=1, acceleration/deceleration is processed
automatically. In this case, the speed acceleration profile will be automatically generated
between sequential buffered moves. The acceleration/deceleration value used for
automatic acceleration control is found in the global acceleration value (ACC).
PMX-4EX-SA Manual
page 60
Rev 3.01
Linear interpolation buffer move size is 36 points. To turn on and off buffer move, use
the BO and BF command respectively. When enabled, as soon as the first I command is
issued the motion will start.
Buffered moves apply only to X, Y and Z axes.
Buffered move operation cannot be used while StepNLoop is enabled.
For command information for buffer move status, see Motor Status section.
On-The-Fly Target Position Change
On-the-fly target position change can be achieved using the T[axis][value] command.
While the motor is moving, T[axis][value] will change the final destination of the motor.
If the motor has already passed the new target position, it will reverse direction once the
target position change command is issued.
Note: If a T command is sent while the controller is not performing a target move, the
command is not processed. Instead, an error response is returned.
Homing
Home search sequence involves moving the motor towards the home or limit switches
and then stopping when the relevant input is detected.
The PMX-4EX-SA has five different homing routines. Use the H command to perform
them.
H[axis][direction + or -][homing mode 0,1,2,3,4]
Four homing modes:
0 – Home Input Only (High speed only)
1 – Limit Input Only
2 – Home Input and Z-Index
3 – Z-Index Only
4 – Home Input Only (High speed and low speed)
MODE 0 : Home Input Only (High Speed Only)
Figure 6.5 shows the homing routine.
PMX-4EX-SA Manual
page 61
Rev 3.01
Figure 6.5
A. Starts the motor from low speed and accelerates to high speed.
B. As soon as the home input is triggered, the position counter is reset to zero and
the motor begins to decelerate to low speed. As the motor decelerates, the
position counter keeps counting with reference to the zero position.
C. Once low speed is reached, the motor stops. The position is non-zero.
MODE 1 : Limit Only
Figure 6.6 shows the homing routine.
Figure 6.6
A. Issuing a limit home command starts the motor from low speed and accelerates to
high speed.
B. The corresponding limit is triggered, the motor stops immediately and the position
is set to zero.
MODE 2 : Home and Z-index
Figure 6.7 shows the homing routine.
Figure 6.7
PMX-4EX-SA Manual
page 62
Rev 3.01
A. Issuing the command starts the motor from low speed and accelerates to high
speed.
B. As soon as the home input is triggered, the motor decelerates to low speed
C. Once low speed is reached, the motor begins to search for the z-index pulse.
D. Once the z-index pulse is found, the motor stops and the position is set to zero.
MODE 3 : Z-index only
Figure 6.8 shows the homing routine.
Figure 6.8
A. Issuing the command starts the motor at low speed.
B. Once the z-index pulse is found, the motor stops and the position is set to zero.
MODE 4 : Home Input Only (High Speed and Low Speed)
Figure 6.9 shows the homing routine.
Figure 6.9
A. Starts the motor from low speed and accelerates to high speed.
B. As soon as the home input is triggered, the position counter is reset to zero and
the motor decelerates to low speed.
PMX-4EX-SA Manual
page 63
Rev 3.01
C. Once low speed is reached, the motor reverses direction to search for the home
switch.
D. Once the home switch is reached, it will continue past the home switch until the
home switch is off.
E. The motor is now past the home input. The motor now moves back towards the
home switch at low speed.
F. The home input is triggered again, the position counter is reset to zero and the
motor stops immediately
Jogging
Use J command for jogging the motor. Use the following format:
J[axis][direction + or -]
Stopping
When the motor is moving, the ABORT[axis] command will immediately stop an
individual axis. Use the ABORT command to immediately stop ALL axes.
To employ deceleration on a stop, use the STOP[axis] to stop an individual axis. Use the
STOP command to stop ALL axes.
Note: If an interpolation operation is in process when a STOP[axis] or ABORT[axis]
command is entered, all axes involved in the interpolation operation will stop.
Polarity
Using the PO[axis] command to get and set polarity of the signal below. The format is
as an integer with the following bit assignment:
Bit
0
1
2
3
Description
Home
Alarm
Limit (X-axis limit input setting
controls limit switch polarity for all
axes)
Direction
Table 6.2
Motor Position
Motor positions can be read using the PP command which returns the pulse position of
all 4 axes. The return value has the following format:
[Pulse X]:[Pulse Y]:[Pulse Z]:[Pulse U]
PMX-4EX-SA Manual
page 64
Rev 3.01
Encoder positions can be read using PE command which returns the encoder position of
all 4 axes. Encoders are set to 4X reading. The return value has the following format:
[Encoder X]:[Encoder Y]:[Encoder Z]:[Encoder U]
To manually set/get the pulse position of an individual axis, use the P[axis] command.
Note that setting the pulse position is not allowed if StepNLoop is enabled.
To manually set/get the encoder position of an individual axis, use the E[axis] command.
Limits and Alarm
If positive limit switch is triggered while moving in positive direction, the motor will
immediately stop and the motor status bit for positive limit error is set. The same is for
the negative limit while moving in the negative direction.
If the alarm input for an axis is triggered during movement in either direction, the motor
will immediately stop and the motor status bit for alarm error is set.
Once the limit or alarm error is set, use the CLR[axis] command to clear the error.
The limit and alarm error states can be ignored by setting IERR=1. In this case, the
motor will still stop when the appropriate switch is triggered; however, it will not enter an
error state.
Latch Inputs
The PMX-4EX-SA module provides the following high speed position latch inputs.
These inputs perform high speed position capture of both pulse and encoder positions but
does not reset the pulse or encoder position counters.
See corresponding latch input for each axis below:
Axis
X
Y
Z
U
Synchronization
Output
DI4
DI6
DI5
DI8
Table 6.3
Note: When StepNLoop mode is enabled, the position value should be ignored.
Use the LT[Axis] command to enable and disable latch feature. To read the latch status,
use LT[Axis]S command.
PMX-4EX-SA Manual
page 65
Rev 3.01
Following are return value description for LT[Axis]S command:
Return
Value
0
1
2
Description
Latch off
Latch on and
waiting for
latch trigger
Latch
Triggered
Table 6.4
Once the latch is triggered, the triggered position can be retrieved using LT[Axis]P
(latched pulse position) and LT[Axis]E (latched encoder position) commands.
Digital Inputs/Outputs and Enable Outputs
PMX-4EX-SA module comes with 8 digital inputs and 8 digital outputs and 4 enable
outputs.
Inputs
Read digital input status using the DI command.
Digital input values can also be referenced one bit at a time by the DI[1-8] commands.
Note that the indexes are 1-based for the bit references (i.e. DI1 refers to bit 0, not bit 1)
Bit
Description
Bit-Wise
Command
0
Digital Input 1
Digital Input 2
Digital Input 3
Digital Input 4
Digital Input 5
Digital Input 6
Digital Input 7
Digital Input 8
DI1
DI2
DI3
DI4
DI5
DI6
DI7
DI8
1
2
3
4
5
6
7
Table 6.5
Digital Outputs
The digital output status can be controlled using the DO command. DO value must be
within the range of 0-255.
PMX-4EX-SA Manual
page 66
Rev 3.01
Digital output values can also be referenced one bit at a time by the DO[1-8] commands.
Note that the indexes are 1-based for the bit references (i.e. DO1 refers to bit 0, not bit 1)
Bit
Description
Bit-Wise
Command
0
Digital Output 1
Digital Output 2
Digital Output 3
Digital Output 4
Digital Output 5
Digital Output 6
Digital Output 7
Digital Output 8
DO1
DO2
DO3
DO4
DO5
DO6
DO7
DO8
1
2
3
4
5
6
7
Table 6.6
The initial state of the digital outputs can be defined by setting the DOBOOT register to
the desired initial digital output value. The value is stored to flash memory once the
STORE command is issued.
Enable Outputs
The enable output status can be controlled using the EO command. EO value must be
within the range of 0-15.
Enable output values can also be referenced one bit at a time by the EO[1-4] commands.
Note that the indexes are 1-based for the bit references (i.e. EO1 refers to bit 0, not bit 1)
Bit
0
1
2
3
Description
Enable Output 1
Enable Output 2
Enable Output 3
Enable Output 4
[X-axis]
[Y-axis]
[Z-axis]
[U-axis]
Bit-Wise
Command
EO1
EO2
EO3
EO4
Table 6.7
The initial state of the enable outputs can be defined by setting the EOBOOT register to
the desired initial enable output value. The value is stored to flash memory once the
STORE command is issued.
PMX-4EX-SA Manual
page 67
Rev 3.01
Sync Outputs
PMX-4EX-SA has synchronization digital outputs for each axis. The synchronization
signal output is triggered when the encoder position value meets the set condition. See
synchronization output for each axis below:
Axis
X
Y
Z
U
Synchronization
Output
DO1
DO2
DO3
DO4
Table 6.8
Note: While feature is enabled for an axis, the corresponding digital output cannot be
controlled by user.
Use SYN[axis]O to enable the synchronization output feature for an axis.
Use SYN[axis]F to disable the synchronization output feature for an axis.
Use SYN[axis]P to read and set the synchronization position value for an axis. (28-bit
signed number)
Use SYN[axis]C to set the synchronization condition.
1 – Turn the output on when the encoder position is EQUAL to sync position.
If the synchronization output is done during motion, the sync output pulse will
turn on only when the encoder position and sync position are equal.
2 – Turns output on when the encoder position is LESS than the sync position.
3 – Turns output on when the encoder position is GREATER than sync position.
Use SYN[axis]T to set the pulse width output time (ms). This parameter is only used if
the synchronization condition is set to 1. Note the maximum pulse width is 10 ms. If this
parameter is set to 0, the output pulse will depend on how long the encoder value is equal
to the sync position.
Use SYN[axis]S to read the synchronization output status for an axis
0 – Sync output feature is off
1 – Waiting for sync condition
2 – Sync condition occurred
PMX-4EX-SA Manual
page 68
Rev 3.01
Analog Inputs
8 x 10-bit analog inputs are available on PMX-4EX-SA. Use AI[1-8] command to read
the analog input value. Range is from 0-5000 mV.
Joystick Control
Joystick control is available on PMX-4EX-SA. When this mode is enabled, the pulse
speed and direction output can be controlled by corresponding analog input. See the axis
to analog input relationship in the table below:
Axis
X
Y
Z
U
Analog Input
AI1
AI2
AI3
AI4
Table 6.9
Maximum joystick speed is set using the JV1, JV2, JV3 and JV4 variables.
Maximum speed change (delta) is set using the JV5, JV6, JV7 and JV8 variables.
Maximum joystick value is set using the JMAX[axis] variable.
Minimum joystick value is set using the JMIN[axis] variable.
Tolerance of the zero joystick position, use JV9, JV10, JV11 and JV12 variables.
During joystick operation, analog input of JMIN[axis] mV to MID mV represents
negative joystick direction and analog input of MID mV to JMAX[axis] mV represents
positive joystick direction.
MID mV represents the zero joystick position. This value is calculated with the
following formula:
MID = ((JMAX[axis] – JMIN[axis]) / 2) + JMIN[axis]
Note: There is no command corresponding to MID. This is an internally calculated
value.
Joystick control also has soft limit controls. Limits are broken into: negative outer limit,
negative inner limit, positive inner limit and positive outer limit.
When moving in positive direction, as soon as the positive inner limit is crossed, the
speed is reduced. If the position reaches the positive outer limit, the joystick speed is set
to zero. Same goes for the negative direction and negative limits.
PMX-4EX-SA Manual
page 69
Rev 3.01
The behavior of the limits of the joystick control is explained by the following:
Figure 6.10
Summary of joystick control parameters
Parameter
JV1
JV2
JV3
JV4
JV5
JV6
JV7
JV8
JV9
JV10
JV11
JV12
JL1
JL2
JL3
JL4
JL5
JL6
JL7
JL8
JL9
JL10
JL11
JL12
JL13
JL14
JL15
JL16
JMAXX
PMX-4EX-SA Manual
Description
X-axis maximum joystick speed at 5000 mV and 0 mV
Y-axis maximum joystick speed at 5000 mV and 0 mV
Z-axis maximum joystick speed at 5000 mV and 0 mV
U-axis maximum joystick speed at 5000 mV and 0 mV
X-axis maximum speed change
Y-axis maximum speed change
Z-axis maximum speed change
U-axis maximum speed change
X-axis zero tolerance range for analog input
Y-axis zero tolerance range for analog input
Z-axis zero tolerance range for analog input
U-axis zero tolerance range for analog input
X-axis negative outer limit
X-axis negative inner limit
X-axis positive inner limit
X-axis positive outer limit
Y-axis negative outer limit
Y-axis negative inner limit
Y-axis positive inner limit
Y-axis positive outer limit
Z-axis negative outer limit
Z-axis negative inner limit
Z-axis positive inner limit
Z-axis positive outer limit
U-axis negative outer limit
U-axis negative inner limit
U-axis positive inner limit
U-axis positive outer limit
X-axis maximum mV
page 70
Rev 3.01
JMAXY
JMAXZ
JMAXU
JMINX
JMINY
JMINZ
JMINU
Y-axis maximum mV
Z-axis maximum mV
U-axis maximum mV
X-axis minimum mV
Y-axis minimum mV
Z-axis minimum mV
U-axis minimum mV
Table 6.10
To enable/disable joystick control for an axis, use the JE command. Joystick enable
parameter is a 4 bit value. For example, digital output value of 15 (1111 in binary or 0xF
in hex) means joystick feature is enabled on all axes.
Note: If joystick control is enabled, StepNLoop is automatically disabled.
Joystick Example (X-axis):
JMAXX = 4500 mV
JMINX = 100 mV
JMID = ((4500-100)/2 + 100) = 2300 mV
JV9 = 100
In this case, maximum speed in the negative direction would be achieved when AI1
reaches 100 mV, and maximum speed in the positive direction would be achieved when
AI1 reaches 4500 mV.
Since the zero tolerance (JV9) is set to 100, no motion will be performed if AI1 is
between 2400 mV to 2600 mV.
StepNLoop Closed Loop Control
PMX-4EX-SA features a closed-loop position verification algorithm called StepNLoop
(SNL). The algorithm requires the use of an incremental encoder.
SNL performs the following operations:
1) Position Verification: At the end of any targeted move, SNL will perform a
correction if the current error is greater than the tolerance value.
2) Delta Monitoring: The delta value is the difference between the actual and the
target position. When delta exceeds the error range value, the motor is
stopped and the SNL Status goes into an error state. Delta monitoring is
performed during moves – including homing and jogging. To read the delta
value, use the DX command.
See Table 6.11 for a list of the SNL control parameters.
PMX-4EX-SA Manual
page 71
Rev 3.01
SNL Parameter
StepNLoop Ratio
Description
†Ratio between motor pulses and encoder counts.
This ratio will depend on the motor type, microstepping, encoder resolution and decoding multiplier.
Value must be in the range [0.001 , 999.999].
Maximum error between target and actual position that
Tolerance
is considered “In Position”. In this case, no correction
is performed. Units are in encoder counts.
Maximum error between target and actual position that
is not considered a serious error. If the error exceeds
Error Range
this value, the motor will stop immediately and go into
an error state.
Maximum number of correction tries that the
Correction Attempt controller will attempt before stopping and going into
an error state.
Command
SLR[axis]
SLT[axis]
SLE[axis]
SLA[axis]
Table 6.11
†A convenient way to find the StepNLoop ratio is to set EX=0, PX=0 and move the
motor +1000 pulses. The ratio can be calculated by dividing 1000 by the resulting EX
value. Note that the value must be positive. If it is not, then the direction polarity must
be adjusted. This test can be performed on all axes that require StepNLoop. See Table
8.2 for details.
To enable/disable the SNL feature use the SL[axis] command. To read the SNL status,
use SLS[axis] command to read the status.
See Table 6.12 for a list of the SLS[axis] return values.
Return
Value
0
1
2
3
4
5
6
7
8
9
10
PMX-4EX-SA Manual
Description
Idle
Moving
Correcting
Stopping
Aborting
Jogging
Homing
Z-Homing
Correction range error. To clear this
error, use CLRS or CLR command.
Correction attempt error. To clear this
error, use CLRS or CLR command.
Stall Error. DX value has exceeded
page 72
Rev 3.01
the correction range value. To clear
this error, use CLRS or CLR
command.
Limit Error
N/A (i.e. SNL is not enabled)
Limit homing
11
12
13
Table 6.12
See Table 6.13 for SNL behavior within different scenarios.
Condition
SNL behavior
(motor is moving)
SNL behavior
(motor is idle)
δ <= SLT
Continue to monitor the DX[axis]
In Position. No correction is
performed.
Continue to monitor the DX[axis]
Out of Position. A correction is
performed.
Stall Error. Motor stops and
signals and error.
Error Range Error. Motor stops
and signals and error.
NA
Max Attempt Error. Motor stops
and signals and error.
δ > SLT
AND
δ < SLE
δ > SLT
AND
δ > SLE
Correction
Attempt >
SLA
Table 6.13
Key
[δ]:
Error between the target position and actual position
SLT:
SLE:
SLA:
Tolerance range
Error range
Max correction attempt
Notes:
Once SNL is enabled, position move commands are in term of encoder position. For
example, X1000 means to move the motor to encoder 1000 position. This applies to
individual as well as interpolated moves.
Once SNL is enabled, the speed is in encoder speed. For example HSPD=1000 when
SNL is enabled means that the target high speed is 1000 encoder counts per second. This
only applies to individual axis moves.
Linear Interpolation w/ StepNLoop: If StepNLoop is used during a linear interpolation
move, StepNLoop must be enabled for all axes being moved. Also note that unlike the
individual axis moves, the speed during a linear interpolation is calculated as pulse/sec,
NOT encoder counts/sec.
Arc/Circular Interpolation w/ StepNLoop: If StepNLoop is used during an arc/circular
interpolation move, StepNLoop must be enabled for both X and Y axes. Also note that
PMX-4EX-SA Manual
page 73
Rev 3.01
unlike the individual axis and linear interpolation moves, the StepNLoop ratio of X and Y
MUST be the same. Also note that the speed during an arc/circular interpolation move is
calculated as pulse/sec, NOT encoder counts/sec.
Device Number
PMX-4EX-SA module provides the user with the ability to modify the unique device
number. In order to make these changes, first store the desired number using the DN
command. Note that this value must be within the range [4EX00,4EX99].
To write the values to the device’s flash memory, use the STORE command. After a
complete power cycle, the new device number will be written to memory. Note that
before a power cycle is completed, the settings will not take effect.
By default:
Device name is set to: 4EX00
Baud Rate Setting
PMX-4EX-SA provides the user with the ability to set the desired baud rate of the serial
communication. In order to make these changes, first store the desired baud rate by using
the DB command.
Return Value
Description
1
9600
2
19200
3
38400
4
57600
5
115200
Table 6.14
To write the values to the device’s flash memory, use the STORE command. After a
complete power cycle, the new device number will be written to memory. Note that
before a power cycle is completed, the settings will not take effect.
By default:
Baud rate is set to: 1 (9600 bps)
Standalone Program Specification
Standalone Program Specification:
Memory size: 1,275 assembly lines.
Note: Each line of pre-compiled code equates to 1-4 lines of assembly lines.
WAIT Statement: When writing a standalone program, it is generally necessary to wait
until a motion is completed before moving on to the next line. In order to do this, the
WAIT statement must be used. See the examples below:
PMX-4EX-SA Manual
page 74
Rev 3.01
In the example below, the variable V1 will be set immediately after the X10000 move
command begins; it will not wait until the controller is idle.
X10000
V1=100
;* Move to position 0
Conversely, in the example below, the variable V1 will not be set until the motion has
been completed. V1 will only be set once the controller is idle.
X10000
WAITX
V1=100
;* Move to position 0
;* Wait for the move to complete
Multi-Threading: PMX-4EX-SA supports the simultaneous execution of up to 4
standalone programs. Programs 0,1,2,3 are controlled via the SR0, SR1, SR2 and SR3
commands respectively. For examples of multi-threading, please refer to the Example
Stand-alone Programs section.
Note: Sub-routines can be shared by different threads.
Error Handling: If an error occurs during standalone execution (i.e. limit error), the
program automatically jumps to SUB 31. If SUB 31 is NOT defined, the program will
cease execution and go to error state. If SUB 31 is defined by the user, the code within
SUB 31 will be executed. The return jump line will be determined by value of the SAP
register. If the value is 0, the return jump line will be the line that caused the error.
Otherwise, the return jump line will be line 0.
Calling subroutines over communication: Once a subroutine is written into the flash, they
can be called via USB communication using the GS command. The subroutines are
referenced by their subroutine number [0-31]. If a subroutine number is not defined, the
controller will return with an error.
Standalone Run on Boot-Up: Standalone can be configured to run on boot-up using the
SLOAD command. See description below:
Bit
Description
0
1
2
3
Standalone Program 0
Standalone Program 1
Standalone Program 2
Standalone Program 3
Table 6.15
Timer Register
PMX-4EX-SA comes with a timer register. Once the timer register is set, it begins to
count down to 0. Read and write to the timer register using the TR command. The units
are in milliseconds.
PMX-4EX-SA Manual
page 75
Rev 3.01
Communication Time-out Feature (Watchdog)
PMX-4EX-SA allows for the user to trigger an alarm if the master has not communicated
with the device for a set period of time. When an alarm is triggered bit 11 of the MSTX
parameter is turned on. The time-out value is set by the TOC command. Units are in
milliseconds. This feature is usually used in stand-alone mode. Refer to the Example
Stand-alone Programs section for an example.
In order to disable this feature set TOC=0.
Storing to Flash
The following items are stored to flash:
ASCII Command
Description
DN
DB
DOBOOT
EDEC
EOBOOT
IACC
IERR
POL[axis]
SAP
EOP
DIP
DOP
SCV[axis]
SL[axis], SLR[axis],
SLE[axis], SLT[axis],
SLA[axis]
JO, JF, JV[1-12], JL[116],JMAX[axis],JMIN[axis]
SLOAD
TOC
V50-V99
Device name
Serial communication baud rate
DO configuration at boot-up
Unique deceleration enable
EO configuration at boot-up
Automatic I-move acceleration/deceleration enable
Ignore limit error enable
Polarity settings
Jump return line select (Stand-alone error handling)
EO polarity
DI polarity
DO polarity
S-curve enable
StepNLoop parameters
Joystick settings
Standalone program run on boot-up parameter
Time-out counter reset value
Note that on boot-up, V0-V49 are reset to value 0
Table 6.16
Note: When a standalone program is downloaded, the program is immediately written to
flash memory.
PMX-4EX-SA Manual
page 76
Rev 3.01
7. Communication – USB
PMX-4EX-SA USB communication is USB 2.0 compliant.
Communication between the PC and PMX-4EX-SA is done using Windows compatible
DLL API function calls as shown below. Windows programming language such as
Visual BASIC, Visual C++, LABView, or any other programming language that can use
DLL can be used to communicate with the Performax module.
Typical communication transaction time between PC and PMX-4EX-SA for sending a
command from a PC and getting a reply from PMX-4EX-SA using the
fnPerformaxComSendRecv() API function is in single digit milliseconds. This value
will vary with CPU speed of PC and the type of command.
USB Communication API Functions
For USB communication, following DLL API functions are provided.
BOOL fnPerformaxComGetNumDevices(OUT LPDWORD lpNumDevices);
- This function is used to get total number of all types of Performax and
Performax USB modules connected to the PC.
BOOL fnPerformaxComGetProductString(IN DWORD dwNumDevices,
OUT LPVOID lpDeviceString,
IN DWORD dwOptions);
- This function is used to get the Performax or Performax product string. This
function is used to find out Performax USB module product string and its
associated index number. Index number starts from 0.
BOOL fnPerformaxComOpen(IN DWORD dwDeviceNum,
OUT HANDLE* pHandle);
- This function is used to open communication with the Performax USB module
and to get communication handle. dwDeviceNum starts from 0.
BOOL fnPerformaxComClose(IN HANDLE pHandle);
- This function is used to close communication with the Performax USB
module.
BOOL fnPerformaxComSetTimeouts(IN DWORD dwReadTimeout,
DWORD dwWriteTimeout);
- This function is used to set the communication read and write timeout. Values
are in milliseconds. This must be set for the communication to work. Typical
value of 1000 msec is recommended.
BOOL fnPerformaxComSendRecv(IN HANDLE pHandle,
PMX-4EX-SA Manual
page 77
Rev 3.01
-
IN LPVOID wBuffer,
IN DWORD dwNumBytesToWrite,
IN DWORD dwNumBytesToRead,
OUT LPVOID rBuffer);
This function is used to send command and get reply. Number of bytes to
read and write must be 64 characters.
BOOL fnPerformaxComFlush(IN HANDLE pHandle)
- Flushes the communication buffer on the PC as well as the USB controller. It
is recommended to perform this operation right after the communication
handle is opened.
USB Communication Issues
A common problem that users may have with USB communication is that after sending a
command from the PC to the device, the response is not received by the PC until another
command is sent. In this case, the data buffers between the PC and the USB device are
out of sync. Below are some suggestions to help alleviate this issue.
1) Buffer Flushing: If USB communication begins from an unstable state (i.e. your
application has closed unexpectedly, it is recommended to first flush the USB
buffers of the PC and the USB device. See the following function prototype
below:
BOOL fnPerformaxComFlush(IN HANDLE pHandle)
Note: fnPerformaxComFlush is only available in the most recent
PerformaxCom.dll which is not registered by the standard USB driver installer. A
sample of how to use this function along with this newest DLL is available for
download on the website
2) USB Cable: Another source of USB communication issues may come from the
USB cable. Confirm that the USB cable being used has a noise suppression
choke. See photo below:
Figure 7.0
PMX-4EX-SA Manual
page 78
Rev 3.01
8. Communication – RS-485 (ASCII)
When communicating on RS-485 (ASCII), it is recommended to add 120 Ohm
terminating resistor between 485+ and 485- signal on the last module.
Communication Port Settings
Parameter
Setting
Byte Size
Parity
Flow Control
Stop Bit
8 bits
None
None
1
Table 8.0
ASCII Protocol
Sending Command
ASCII command string in the format of
@[DeviceName][ASCII Command][CR]
[CR] character has ASCII code 13.
Receiving Reply
The response will be in the format of
[Response][CR]
[CR] character has ASCII code 13.
Examples:
For querying the x-axis polarity
Send: @00POX[CR]
Reply: 7[CR]
For jogging the x-motor in positive direction
Send: @00JX+[CR]
Reply: OK[CR]
For aborting any motion in progress
Send: @00ABORT[CR]
Reply: OK[CR]
PMX-4EX-SA Manual
page 79
Rev 3.01
9. ASCII Language Specification
Invalid command is returned with ?(Error Message). Always check for proper reply
when command is sent. Like the commands, all responses are in ASCII form.
Command
ABORT
ABORTX
ABORTY
ABORTZ
ABORTU
ABS
ACC
ACC=[Value]
ACCX
ACCY
ACCZ
ACCU
ACCX=[value]
ACCY=[value]
ACCZ=[value]
ACCU=[value]
AI[1-8]
ARCP[X]:[Y]:[θA]:[θR]
ARCN[X]:[Y]:[θA] :[θR]
BF
BO
CIRP[X]:[Y]
CIRN[X]:[Y]
CLRX
CLRY
CLRZ
CLRU
DB
DB=[value]
DEC
DEC=[Value]
DECX
DECY
DECZ
DECU
DECX=[value]
DECY=[value]
DECZ=[value]
DECU=[value]
DI
DI[1-8]
PMX-4EX-SA Manual
Description
Immediately stops all the motor if in motion. Abort turns off the
buffered move.
Immediately stops individual motor if in motion. Abort turns off
the buffered move.
Return
OK
Turns on absolute move mode
Returns current global acceleration value in milliseconds.
Sets global acceleration value in milliseconds.
Returns current individual acceleration value in milliseconds.
OK
Sets individual acceleration value in milliseconds.
OK
Get analog input status. Units in mV
XY Arc interpolation move (CW direction)
XY Arc interpolation move (CCW direction)
Disable buffered move
Enable buffer move on
XY Circular interpolation move (CW direction)
XY Circular interpolation move (CCW direction)
Clears motor limit or alarm status bit. Also clears a StepNLoop
errors
[0-5000]
OK
OK
OK
OK
OK
OK
OK
Return baud rate
Set baud rate
1 – 9600 bps
2 – 19200 bps
3 – 38400 bps
4 – 57600 bps
5 – 115200 bps
Returns the current global deceleration value in milliseconds
Sets the global deceleration value in milliseconds
Returns the current individual deceleration value in milliseconds
[1,2,3,4,5]
OK
OK
OK
OK
Sets the individual deceleration value in milliseconds
OK
Returns 8 bits of general purpose digital input.
Returns bit status of general purpose digital input.
[0-255]
[0,1]
page 80
Rev 3.01
DIP
DIP=[0 or 1]
DO
DO=[value]
DO[1-8]
DO[1-8]=[value]
DOBOOT
Returns the digital input polarity
Sets the digital input polarity
Returns 8 bits of general purpose digital output value.
Sets 8 bits of general purpose digital output.
Returns bit of general purpose digital output value.
Sets bit of general purpose digital output.
Get DO boot-up state
DOBOOT=[Value]
DOP
DOP=[0,1]
DN
Set DO boot-up state
Returns the digital output polarity
Sets the digital output polarity
Return device name
DN=[value]
DXX
DXY
DXZ
DXU
EDEC
EDEC=[0 or 1]
EO
EO=[value]
EO[1-4]
EO[1-4]=[value]
EOBOOT
Set device name. value must be in the range [4EX00, 4EX99]
Get StepNLoop delta value of axis
EOBOOT=[Value]
EOP
EOP=[0,1]
EX
EY
EZ
EU
EX=[value]
EY=[value]
EZ=[value]
EU=[value]
GS[0-31]
HS
Set EO boot-up state
Returns the enable output polarity
Sets the enable output polarity
Get encoder value of axis
HS=[value]
HSX
HSY
HSZ
HSU
HSX=[value]
HSY=[value]
HSZ=[value]
HSU=[value]
HX[+/-][mode]
HY[+/-][mode]
HZ[+/-][mode]
HU[+/-][mode]
PMX-4EX-SA Manual
Returns the enable deceleration status
Sets the enabled deceleration status
Returns 4 bits of enable output value.
Sets 4 bits of enable outputs.
Returns bit of enable output value.
Set bit of enable outputs.
Get EO boot-up state
[0,1]
OK
[0-255]
OK
[0,1]
OK
See Table
6.6
OK
[0,1]
[4EX004EX99]
OK
[0,1]
OK
[0-15]
OK
[0,1]
OK
See Table
6.7
OK
[0,1]
28-bit
number
Set encoder value of axis
OK
Call a defined subroutine
Returns global high speed setting
OK
[16,000,000]
OK
[16,000,000]
Sets global high speed
Returns individual high speed setting
Sets individual high speed
OK
Homes the motor in plus [+] or minus [-] direction using different
homing mode.
OK
page 81
Rev 3.01
I[X axis]:
[Y axis]:
[Z axis]:
[speed]
IACC
IACC=[0 or 1]
IERR
IERR=[0 or 1]
INC
JE
JE=[value]
JX[+/-]
JY[+/-]
JZ[+/-]
JU[+/-]
JV[1-12]
JV[1-12]=[value]
JL[1-16]
JL[1-16=[value]
JMAXX
JMAXY
JMAXZ
JMAXU
JMAXX=[value]
JMAXY=[value]
JMAXZ=[value]
JMAXU=[value]
JMINX
JMINY
JMINZ
JMINU
JMINX=[value]
JMINY=[value]
JMINZ=[value]
JMINU=[value]
LS
LS=[value]
LSX
LSY
LSZ
LSU
LSX=[value]
LSY=[value]
LSZ=[value]
LSU=[value]
LTX=[0 or 1]
LTY=[0 or 1]
LTZ=[0 or 1]
LTU=[0 or 1]
LTXE
LTYE
LTZE
LTUE
PMX-4EX-SA Manual
XYZ interpolated move. Target move values are separated by ‘:’
character. Last value is the constant speed that will be used in the
move.
OK
Get automatic acceleration during buffer interpolated move status
Set automatic acceleration during buffer interpolated move status
Get the ignore limit/alarm error status
Set the ignore limit/alarm error status
Enable incremental move mode
Get joystick enable status
Set joystick enable status
Jogs the motor in plus [+] or minus [-] direction.
[0-1]
OK
[0-1]
OK
OK
[0-15]
OK
OK
Get joystick speed, delta and tolerance settings
Set joystick speed, delta and tolerance settings
Get joystick soft limit settings
Set joystick soft limit settings
Get joystick control maximum voltage level
OK
OK
[0-5000
mV]
Set joystick control maximum voltage level
OK
Get joystick control minimum voltage level
[0-5000
mV]
Set joystick control minimum voltage level
OK
Returns global low speed setting
[16,000,000]
OK
[16,000,000]
Sets global low speed
Returns individual low speed setting
Sets individual low speed
OK
Enable or disable position latch feature
OK
Returns latched encoder position
28-bit
number
page 82
Rev 3.01
LTXP
LTYP
LTZP
LTUP
LTXS
LTYS
LTZS
LTUS
Returns latched pulse position
28-bit
number
Returns latch status.
MST
Returns all motor status, buffer move status, and move mode
status
Returns current encoder counter values of all 4 axes
0 – Latch off
1 – Latch on
and waiting
for latch
trigger
2 – Latch
triggered
See Table
6.1
[X Enc
Position]:
[Y Enc
Position]:
[Z Enc
Position]:
[U Enc
Position]
See Table
6.2
PE
POX
POY
POZ
POU
POX=[value]
POY=[value]
POZ=[value]
POU=[value]
PP
Sets polarity
OK
Returns current pulse counter values of all 4 axes
PS
Returns current pulse speed values of all 4 axes
PX
PY
PZ
PU
PX=[value]
PY=[value]
PZ=[value]
PU=[value]
SA[LineNumber]
Get position value of axis
[X Pulse
Position]:
[Y Pulse
Position]:
[Z Pulse
Position]:
[U Pulse
Position]
[X Speed]:
[Y Speed]:
[Z Speed]:
[U Speed]
28-bit
number
Set position value of axis
OK
Get standalone line
SA[LineNumber]=[Value]
SAP
SAP=[0 or 1]
Set standalone line
Get the return jump line (standalone error handling)
Sets the return jump line (standalone error handling)
Single line
of compiled
code
OK
[0,1]
OK
PMX-4EX-SA Manual
Returns polarity setup
page 83
Rev 3.01
SASTAT
SCVX
SCVY
SCVZ
SCVU
SCVX=[0 or 1]
SCVY=[0 or 1]
SCVZ=[0 or 1]
SCVU=[0 or 1]
SLAX
SLAY
SLAZ
SLAU
SLAX=[value]
SLAY=[value]
SLAZ=[value]
SLAU=[value]
SLEX
SLEY
SLEZ
SLEU
SLEX=[value]
SLEY=[value]
SLEZ=[value]
SLEU=[value]
SLRX
SLRY
SLRZ
SLRU
SLRX=[value]
SLRY=[value]
SLRZ=[value]
SLRU=[value]
SLSX
SLSY
SLSZ
SLSU
SLTX
SLTY
SLTZ
SLTU
SLTX=[value]
SLTY=[value]
SLTZ=[value]
SLTU=[value]
SLX
SLY
SLZ
SLU
SLX=[value]
PMX-4EX-SA Manual
Get standalone program status
0 – Stopped
1 – Running
2 – Paused
4 – In Error
Returns the s-curve control
[0-4]
Enable or disable s-curve. If disabled, trapezoidal acceleration/
deceleration will be used.
OK
[0,1]
Get StepNLoop maximum attempt value of axis
Set StepNLoop maximum attempt value of axis
OK
Get StepNLoop error range value of axis
Set StepNLoop error range value of axis
OK
Get StepNLoop ratio of axis (ppr / cpr)
[0.001999.999]
Set StepNLoop ratio of axis (ppr / cpr)
OK
Get StepNLoop status of axis
[0-12]
Get StepNLoop tolerance of axis
Set StepNLoop tolerance of axis
OK
Get StepNLoop enable of axis
[0,1]
Set StepNLoop enable of axis
OK
page 84
Rev 3.01
SLY=[value]
SLZ=[value]
SLU=[value]
SLOAD
SLOAD=[value]
SR[0-3]=[value]
SPC[0-3]
SSPDX=[value]
SSPDY=[value]
SSPDZ=[value]
SSPDU=[value]
SSPDMX
SSPDMY
SSPDMZ
SSPDMU
SSPDMX=[value]
SSPDMY=[value]
SSPDMZ=[value]
SSPDMU=[value]
STOP
STOPX
STOPY
STOPZ
STOPU
STORE
SYNXC
SYNYC
SYNZC
SYNUC
SYNXC=
SYNYC=
SYNZC=
SYNUC=
SYNXF
SYNYF
SYNZF
SYNUF
SYNXO
SYNYO
SYNZO
SYNUO
SYNXP
SYNYP
SYNZP
SYNUP
SYNXP=
SYNYP=
SYNZP=
SYNUP=
SYNXT
PMX-4EX-SA Manual
Returns the RunOnBoot parameter
Set the 4 bit RunOnBoot parameter
Controls the specified standalone program:
0 – Stop standalone program
1 – Run standalone program
2 – Pause standalone program
3 – Continue standalone program
Returns the program counter for the specified standalone program
PMX on-the-fly speed change. In order to use this command on a
certain axis, S-curve control must be disabled for the
corresponding axis. Use SCV[axis] command to enable and
disable s-curve acceleration/ deceleration control.
Get on-the-fly speed change mode for each axis
[0-15]
OK
OK
[0-1275]
OK
[0-7]
Set on-the-fly speed change mode for each axis.
OK
Performs ramp down to low speed and stop if the motor is moving.
(All axes)
Performs ramp down to low speed and stop if the motor is moving.
(Individual axis)
OK
Store parameters to flash
Read sync output configuration for each axis
1 – trigger when encoder equals position
2 – trigger when encoder is greater than position
3 – trigger when encoder is less than position
Set sync output configuration for each axis
1 – trigger when encoder equals position
2 – trigger when encoder is greater than position
3 – trigger when encoder is less than position
Turn of sync output for each axis
OK
[1-3]
OK
Turn on sync output for each axis
OK
Get trigger position for each axis
28 bit signed
number
Set trigger position for each axis
28 bit signed
number
Get pulse width time (ms). Only applicable if sync output
[0-10]
page 85
OK
OK
Rev 3.01
SYNYT
SYNZT
SYNUT
SYNXT=
SYNYT=
SYNZT=
SYNUT=
T[axis][value]
TOC
TOC=[value]
TR
TR=[value]
V[0-99]
V[0-99]=[Value]
VER
X[target X]
Y[target Y]
Z[target Z]
U[target U]
configuration is set to 1.
Set pulse width time (ms). Only applicable if sync output
configuration is set to 1.
OK
Set on-the-fly target position change
Returns the communication time-out parameter. Value is in
milliseconds.
Set the communication time-out parameter.
Get timer register value
OK
32-bit
number
OK
32-bit
number
OK
Set timer register value (ms)
Get standalone variable value
Write standalone variable value
Returns controller firmware version
Individual/interpolation move command
OK
V[#]
OK
Error Codes
If an ASCII command cannot be processed by the PMX-4EX-SA, the controller will
reply with an error code. See below for possible error responses:
Error Code
Description
?[Command]
?ALARM
?BUFFER FULL
?ERRORED
?In Incremental mode
The ASCII command is not understood by the PMX-4EX-SA
A move command is sent while the alarm is on.
An attempt to add a move to a full buffer has been made.
Command has been issued while the controller is in error state.
A circle or arc interpolation move has been issue while the PMX-4EXSA is in incremental mode.
The index for the command sent to the controller is not valid.
A move command is sent while the axis has a limit error.
A move or position change command is sent while the PMX-4EX-SA
is outputting pulses.
An on-the-fly speed change was issued without initialized the SSPDM
parameter.
Call to a subroutine using the GS command is not valid because the
specified subroutine has not been defined.
An attempt to set the timer register while it is running has been made.
?Index out of Range
?LIMIT
?PULSING
?SSPD Error
?Sub not Initialized
?Timer Running
Table 8.1
PMX-4EX-SA Manual
page 86
Rev 3.01
10. Standalone Language Specification
;
Description:
Comment notation. In programming, comment must be in its own line.
Syntax:
; [Comment Text]
Examples:
; ***This is a comment
JOGX+
;***Jogs X axis to positive direction
DELAY=1000
;***Wait 1 second
ABORT
;***Stop immediately all axes including X axis
ABORT
Description:
Motion: Immediately stops all axes if in motion without deceleration.
Syntax:
ABORT
Examples:
JOGX+
;***Jogs X axis to positive direction
DELAY=1000
;***Wait 1 second
ABORT
;***Stop immediately all axes including X axis
ABORT[axis]
Description:
Motion: Immediately stops individual axis without deceleration.
Syntax:
ABORT[axis]
Examples:
JOGX+
;***Jogs X axis to positive direction
JOGY+
;***Jogs Y axis to positive direction
JOGZ+
;***Jogs Z axis to positive direction
ABS
Description:
Motion: Changes all move commands to absolute mode.
Syntax:
ABS
Examples:
ABS
;***Change to absolute mode
PX=0
;***Change X position to 0
X1000
;***Move X axis to position 1000
WAITX
X2000
;***Move X axis to position 2000
WAITX
PMX-4EX-SA Manual
page 87
Rev 3.01
ACC
Description:
Read: Get acceleration value
Write: Set acceleration value.
Value is in milliseconds.
Syntax:
Read: [variable] = ACC
Write: ACC = [value]
ACC = [variable]
Conditional: IF ACC=[variable]
ENDIF
IF ACC=[value]
ENDIF
Examples:
ACC=300
;***Sets the acceleration to 300 milliseconds
V3=500
;***Sets the variable 3 to 500
ACC=V3
;***Sets the acceleration to variable 3 value of 500
ACC[axis]
Description:
Read: Get individual acceleration value
Write: Set individual acceleration value.
Value is in milliseconds.
Syntax:
Read: [variable] = ACC[axis]
Write: ACC[axis] = [value]
ACC[axis] = [variable]
Conditional: IF ACC[axis]=[variable]
ENDIF
IF ACC[axis]=[value]
ENDIF
Examples:
ACCX=300 ;***Sets the X acceleration to 300 milliseconds
V3=500
;***Sets the variable 3 to 500
ACCX=V3 ;***Sets the X acceleration to variable 3 value of 500
AI[1-8]
Description:
Read: Gets the analog input value. PMX-4EX-SA has 8 analog inputs.
Range is from 0-5000 mV
PMX-4EX-SA Manual
page 88
Rev 3.01
Syntax:
Read: [variable] = AI[1-8]
Conditional: IF AI[1-8]=[variable]
ENDIF
IF AI[1-8]=[value]
ENDIF
Examples:
IF AI1 < 500
DO=1
;***If analog input 1 is less than 500, set DO=1
ENDIF
ARC
Description:
Motion: Perform arc move using X and Y axis.
Specify clockwise or counter-clockwise, center location, and the absolute and
relative angle. Angle is in whole number in thousandth. For example, 45 degrees
is 45,000.
Syntax:
ARC[P for CW, N for CCW][Center X]:[Center Y]:[AngleA]]:[AngleR]
Examples:
;*** move 90 degrees CW to absolute angle 90 degrees
ARCP1000:0:90000:90000
WAITX
;**** move 180 degrees CCW to absolute angle 0 degrees
ARCN0:1000:0:180000
WAITX
CIR
Description:
Motion: Perform circle move using X and Y axis.
Specify clockwise or counter-clockwise and the center location.
Syntax:
CIR[P for CW, N for CCW] [Center X]:[Center Y]
Examples:
CIRP1000:1000 ;***Using X 1000 and Y 1000 perform circular move (CW)
WAITX
CIRN0:2000
;***Using X 0 and Y 2000 perform circular move (CCW)
WAITX
DEC
Description:
Read: Get deceleration value
Write: Set deceleration value.
Value is in milliseconds.
Syntax:
Read: [variable] = DEC
PMX-4EX-SA Manual
page 89
Rev 3.01
Write: DEC = [value]
DEC = [variable]
Examples:
DEC=300
;***Sets the deceleration to 300 milliseconds
V3=500
;***Sets the variable 3 to 500
DEC=V3
;***Sets the deceleration to variable 3 value of 500
DEC[axis]
Description:
Read: Get individual deceleration value
Write: Set individual deceleration value.
Value is in milliseconds.
Syntax:
Read: [variable] = DEC[axis]
Write: DEC[axis] = [value]
DEC[axis] = [variable]
Conditional: IF ACC[axis]=[variable]
ENDIF
IF ACC[axis]=[value]
ENDIF
Examples:
DECX=300 ;***Sets the X deceleration to 300 milliseconds
V3=500
;***Sets the variable 3 to 500
DECX=V3
;***Sets the X deceleration to variable 3 value of 500
DELAY
Description:
Set a delay (1 ms units)
Syntax:
Delay=[Number] (1 ms units)
Examples:
JOGX+
;***Jogs X axis to positive direction
DELAY=10000
;***Wait 10 second
ABORT
;***Stop with deceleration all axes including X axis
EX=0
;***Sets the current X encoder position to 0
EY=0
;***Sets the current Y encoder position to 0
EZ=0
;***Sets the current Z encoder position to 0
EU=0
;***Sets the current U encoder position to 0
PMX-4EX-SA Manual
page 90
Rev 3.01
DI
Description:
Read: Gets the digital input value
Performax 4EX has 8 digital inputs
Syntax:
Read: [variable] = DI
Conditional: IF DI=[variable]
ENDIF
IF DI=[value]
ENDIF
Examples:
IF DI=255
DO=1
;***If no digital inputs are triggered, set DO=1
ENDIF
DI[1-8]
Description:
Read: Gets the digital input value
Performax 4EX has 8 digital inputs
Syntax:
Read: [variable] = DI[1-8]
Conditional: IF DI[1-8]=[variable]
ENDIF
IF DI[1-8]=[0 or 1]
ENDIF
Examples:
IF DI1=1
DO=1
;***If digital input 1 is triggered, set DO=1
ENDIF
DO
Description:
Read: Gets the digital output value
Write: Sets the digital output value
Performax 4EX has 8 digital outputs
Syntax:
Read: [variable] = DO
Write: DO = [value]
DO = [variable]
Conditional: IF DO=[variable]
ENDIF
IF DO=[value]
ENDIF
Examples:
DO=7
;***Turn first 3 bits on and rest off
PMX-4EX-SA Manual
page 91
Rev 3.01
DO[1-8]
Description:
Read: Gets the individual digital output value
Write: Sets the individual digital output value
Performax 4EX has 8 digital outputs
Syntax:
Read: [variable] = DO[1-8]
Write: DO[1-8] = [0 or 1]
DO[1-8] = [variable]
Conditional: IF DO[1-8]=[variable]
ENDIF
IF DO[1-8]=[0 or 1]
ENDIF
Examples:
DO7=1
;***Turn DO7 on
DO6=1
;***Turn DO6 on
E[axis]
Description:
Read: Gets the current encoder position
Write: Sets the current encoder position
Syntax:
Read: [variable] = E[axis]
Write: E[axis] = [value]
E[axis] = [variable]
Conditional: IF E[axis]=[variable]
ENDIF
IF E[axis]=[value]
ENDIF
Examples:
JOGX+
;***Jogs X axis to positive direction
DELAY=1000
;***Wait 1 second
ABORT
;***Stop with deceleration all axes including X axis
EX=0
;***Sets the current X encoder position to 0
EY=0
;***Sets the current Y encoder position to 0
EZ=0
;***Sets the current Z encoder position to 0
EU=0
;***Sets the current U encoder position to 0
ECLEAR[axis]
Description:
Write: Clears error status. Also clears StepNLoop error.
Syntax:
Write: ECLEAR[axis]
Examples:
ECLEARX
;***Clears error of axis X
ECLEARY
;***Clears error of axis Y
PMX-4EX-SA Manual
page 92
Rev 3.01
ECLEARZ
ECLEARU
;***Clears error of axis Z
;***Clears error of axis U
ELSE
Description:
Perform ELSE condition check as a part of IF statement
Syntax:
ELSE
Examples:
IF V1=1
X1000
;***If V1 is 1, then move to 1000
WAITX
ELSE
X-1000
;***If V1 is not 1, then move to -1000
WAITX
ENDIF
ELSEIF
Description:
Perform ELSEIF condition check as a part of the IF statement
Syntax:
ELSEIF [Argument 1] [Comparison] [Argument 2]
[Argument] can be any of the following:
Numerical value
Pulse or Encoder Position
Digital Output
Digital Input
Enable Output
Motor Status
[Comparison] can be any of the following
=
Equal to
>
Greater than
<
Less than
>=
Greater than or equal to
<=
Less than or equal to
!=
Not Equal to
Examples:
IF V1=1
X1000
WAITX
ELSEIF V1=2
X2000
WAITX
ELSEIF V1=3
X3000
WAITX
PMX-4EX-SA Manual
page 93
Rev 3.01
ELSE
X0
WAITX
ENDIF
END
Description:
Indicate end of program.
Program status changes to idle when END is reached.
Note: Subroutine definitions should be written AFTER the END statement
Syntax:
END
Examples:
X0
WAITX
X1000
WAITX
END
ENDIF
Description:
Indicates end of IF operation
Syntax:
ENDIF
Examples:
IF V1=1
X1000
WAITX
ENDIF
ENDSUB
Description:
Indicates end of subroutine
When ENDSUB is reached, the program returns to the previously called
subroutine.
Note: Subroutine 31 is reserved for error handling
Syntax:
ENDSUB
Examples:
GOSUB 1
END
SUB 1
X0
WAITX
PMX-4EX-SA Manual
page 94
Rev 3.01
X1000
WAITX
ENDSUB
ENDWHILE
Description:
Indicate end of WHILE loop
Syntax:
ENDWHILE
Examples:
WHILE V1=1
;***While V1 is 1 continue to loop
X0
WAITX
X1000
WAITX
ENDWHILE
;***End of while loop so go back to WHILE
EO
Description:
Read: Gets the enable output value
Write: Sets the enable output value
Performax 4EX has 4 enable outputs.
Syntax:
Read: [variable] = EO
Write: EO = [value]
EO = [variable]
Conditional: IF EO=[variable]
ENDIF
IF EO=[value]
ENDIF
Examples:
EO=3
;***Turn first 2 bits of enable outputs
IF V1=1
EO=V2
;***Enable output according to variable 2
ENDIF
EO[1-4]
Description:
Read: Gets the individual enable output value
Write: Sets the individual enable output value
Performax 4EX has 4 enable outputs.
Syntax:
Read: [variable] = EO[1-4]
Write: EO[1-4] = [0 or 1]
EO[1-4] = [variable]
Conditional: IF EO=[variable]
PMX-4EX-SA Manual
page 95
Rev 3.01
ENDIF
IF EO=[value]
ENDIF
Examples:
EO1=31
IF V1=1
EO2=V2
ENDIF
;***Turn enable output 1 on
;***Enable output 2 according to variable 2
GOSUB
Description:
Perform go to subroutine operation
Subroutine range is from 0 to 31.
Note: Subroutine definitions should be written AFTER the END statement
Subroutine 31 is reserved for error handling
Syntax:
GOSUB [subroutine number]
[Subroutine Number] range is 0 to 31
Examples:
GOSUB 1
END
SUB 1
X0
WAITX
X1000
WAITX
ENDSUB
HLHOME[axis][+ or -]
Description:
Command: Perform low speed homing using current high speed, low speed, and
acceleration.
Syntax:
HLHOME[Axis][+ or -]
Examples:
HLHOMEX+ ;***Low speed homes X axis in positive direction
WAITX
HLHOMEZ- ;***Low speed homes Z axis in negative direction
WAITZ
HOME[axis][+ or -]
Description:
Command: Perform homing using current high speed, low speed, and
acceleration.
Syntax:
HOME[Axis][+ or -]
PMX-4EX-SA Manual
page 96
Rev 3.01
Examples:
HOMEX+
WAITX
HOMEZ-
;***Homes X axis in positive direction
;***Homes Z axis in negative direction
HSPD
Description:
Read: Gets high speed. Value is in pulses/second
Write: Sets high speed. Value is in pulses/second.
Range is from 1 to 6M
Syntax:
Read: [variable] = HSPD
Write: HSPD = [value]
HSPD = [variable]
Conditional: IF HSPD=[variable]
ENDIF
IF HSPD=[value]
ENDIF
Examples:
HSPD=10000 ;***Sets the high speed to 10,000 pulses/sec
V1=2500
;***Sets the variable 1 to 2,500
HSPD=V1
;***Sets the high speed to variable 1 value of 2500
HSPD[axis]
Description:
Read: Gets individual high speed. Value is in pulses/second
Write: Sets individual high speed. Value is in pulses/second.
Range is from 1 to 6M
Syntax:
Read: [variable] = HSPD[axis]
Write: HSPD[axis] = [value]
HSPD[axis] = [variable]
Conditional: IF HSPD[axis]=[variable]
ENDIF
IF HSPD[axis]=[value]
ENDIF
Examples:
HSPDY=10000
;***Sets the Y high speed to 10,000 pulses/sec
V1=2500
;***Sets the variable 1 to 2,500
HSPDY=V1
;***Sets the Y high speed to variable 1 value of 2500
PMX-4EX-SA Manual
page 97
Rev 3.01
IF
Description:
Perform IF condition check
Syntax:
IF [Argument 1] [Comparison] [Argument 2]
[Argument] can be any of the following:
Numerical value
Pulse or Encoder Position
Digital Output
Digital Input
Enable Output
Motor Status
[Comparison] can be any of the following
=
Equal to
>
Greater than
<
Less than
>=
Greater than or equal to
<=
Less than or equal to
!=
Not Equal to
Examples:
IF V1=1
X1000
WAITX
ENDIF
INC
Description:
Command: Changes all move commands to incremental mode.
Syntax:
INC
Examples:
INC
;***Change to increment mode
PX=0
;***Change X position to 0
X1000
;***Move X axis to position 1000 (0+1000)
WAITX
X2000
;***Move X axis to position 3000 (1000+2000)
WAITX
ABORT
;***Stop immediately all axes including X axis
JOG[axis]
Description:
Command: Perform jogging using current high speed, low speed, and
acceleration.
Syntax:
JOG[Axis][+ or -]
Examples:
PMX-4EX-SA Manual
page 98
Rev 3.01
JOGX+
JOGY-
;***Jogs X axis in positive direction
;***Jogs Y axis in negative direction
JOYENA
Description:
Write: Enable joystick feature for axis
Range is from 0 or 15
Syntax:
Write: JOYENA=[value]
Examples:
JOYENA=1 ;***Enable joystick feature on X axis only
JOYENA=3 ;***Enable joystick feature on X and Y axis
JOYHS[axis]
Description:
Write: Set high speed setting for joystick control
Syntax:
Write: JOYHS[axis] = [value]
JOYHS[axis] = [variable]
Examples:
JOYHSX=10000
;***High speed of X axis is set to 10,000 pps
JOYHSU=20000
;***High speed of U axis is set to 20,000 pps
JOYDEL[axis]
Description:
Write: Set maximum delta value of change in speed for joystick control
Syntax:
Write: JOYDEL[axis] = [value]
JOYDELaxis] = [variable]
Examples:
JOYDELX=100
;***Speed delta of X axis is set to 100 pps
JOYDELU=200
;***Speed delta of Y axis is set to 200 pps
JOYNO[axis]
Description:
Write: Set negative outer limit for joystick control
Syntax:
Write: JOYNO[axis] = [value]
JOYNO[axis] = [variable]
Examples:
JOYNOX=-10000
;*** negative outer limit of x-axis set to -10000
JOYNIX=-9000
;*** negative inner limit of x-axis set to -9000
JOYPIX=9000
;*** positive inner limit of x-axis set to 9000
JOYPOX=10000
;*** positive outer limit of x-axis set to 10000
PMX-4EX-SA Manual
page 99
Rev 3.01
JOYNI[axis]
Description:
Write: Set negative inner limit for joystick control
Syntax:
Write: JOYNI[axis] = [value]
JOYNI[axis] = [variable]
Examples:
See JOYNO[axis]
JOYPI[axis]
Description:
Write: Set positive inner limit for joystick control
Syntax:
Write: JOYPI[axis] = [value]
JOYPI[axis] = [variable]
Examples:
See JOYNO[axis]
JOYPO[axis]
Description:
Write: Set positive outer limit for joystick control
Syntax:
Write: JOYPO[axis] = [value]
JOYPO[axis] = [variable]
Examples:
See JOYNO[axis]
LHOME[axis][+ or -]
Description:
Command: Perform limit homing using current high speed, low speed, and
acceleration.
Syntax:
LHOME[Axis][+ or -]
Examples:
LHOMEX+ ;***Limit homes X axis in positive direction
WAITX
LHOMEZ;***Limit homes Z axis in negative direction
LSPD
Description:
Read: Get low speed. Value is in pulses/second.
Write: Set low speed. Value is in pulses/second.
Range is from 1 to 6M
Syntax:
Read: [variable]=LSPD
PMX-4EX-SA Manual
page 100
Rev 3.01
Write: LSPD=[long value]
LSPD=[variable]
Conditional: IF LSPD=[variable]
ENDIF
IF LSPD=[value]
ENDIF
Examples:
LSPD=1000 ;***Sets the start low speed to 1,000 pulses/sec
V1=500
;***Sets the variable 1 to 500
LSPD=V1
;***Sets the start low speed to variable 1 value of 500
LSPD[axis]
Description:
Read: Get individual low speed. Value is in pulses/second.
Write: Set individual low speed. Value is in pulses/second.
Range is from 1 to 6M
Syntax:
Read: [variable]=LSPD[axis]
Write: LSPD[axis]=[long value]
LSPD[axis]=[variable]
Conditional: IF LSPD[axis]=[variable]
ENDIF
IF LSPD[axis]=[value]
ENDIF
Examples:
LSPDZ=1000 ;***Sets the Z low speed to 1,000 pulses/sec
V1=500
;***Sets the variable 1 to 500
LSPDZ=V1 ;***Sets the Z low speed to variable 1 value of 500
MST[axis]
Description:
Command: Get motor status of axis
Syntax:
MST[Axis]
Examples:
IF MSTX=0
DIO=6
ELSEIF MSTY=0
DIO=3
ELSEIF MSTZ=0
DIO=2
ELSEIF MSTU=0
DIO=1
ENDIF
PMX-4EX-SA Manual
page 101
Rev 3.01
P[axis]
Description:
Read: Gets the current pulse position
Write: Sets the current pulse position
Syntax:
Read: Variable = P[axis]
Write: P[axis] = [value]
P[axis] = [variable]
Conditional: IF P[axis]=[variable]
ENDIF
IF P[axis]=[value]
ENDIF
Examples:
JOGX+
;***Jogs X axis to positive direction
DELAY=1000
;***Wait 1 second
ABORT
;***Stop without deceleration all axes including X axis
PX=0
;***Sets the current pulse position to 0
PRG
Description:
Indicates the start of a program
When END is reached, the program is concluded
Syntax:
PRG [program number]
Examples:
PRG 0
X8000
END
;***Program 0
PRG 1
Y1000
END
;***Program 1
PS[axis]
Description:
Read: Get the current pulse position of an axis
Syntax:
Read: Variable = PS[Axis]
Conditional: IF PS[axis]=[variable]
ENDIF
IF PS[axis]=[value]
ENDIF
Examples:
JOGX+
;***Jogs X axis to positive direction
PMX-4EX-SA Manual
page 102
Rev 3.01
DELAY=1000
ABORT
V1=PSX
JOGY+
V2=PSY
;***Wait 1 second
;***Stop without deceleration all axes including X axis
;***Sets variable 1 to pulse X
;***Jogs Y axis to positive direction
;***Sets variable 2 to pulse Y
SCV[axis]
Description:
Read: Get individual s-curve enable. Value is 0 or 1.
Write: Set individual s-curve enable.
Range is from 0 or 1
Syntax:
Read: [variable]=SCV[axis]
Write: SCV[axis]=[0 or 1]
SCV[axis]=[variable]
Note: If s-curve is enabled for an axis, on-the-fly speed feature cannot be used
for the corresponding axis.
Examples:
SCVX=1
;***Sets X axis to use s-curve acceleration: on-the-fly speed ; ;
; change is NOT allowed for this axis.
SCVY=0
;***Sets Y axis to use s-curve acceleration: on-the-fly speed ; ;
; change is allowed for this axis.
SCVZ=1
;***Sets Z axis to use s-curve acceleration: on-the-fly speed ; ;
; change is NOT allowed for this axis.
SCVU=0
;***Sets U axis to use s-curve acceleration: on-the-fly speed ; ;
; change is allowed for this axis.
SL[axis]
Description:
Write: Set individual StepNLoop enable.
Range is from 0 or 1
Syntax:
Write: SL[axis]=[0 or 1]
Examples:
SLX=1
;***Enables StepNLoop control for the X axis.
SLY=0
;***Disables StepNLoop control for the Y axis.
SLS[axis]
Description:
Command: Get the StepNLoop status of axis
Syntax:
SLS[Axis]
V[Value] = SLS[Axis]
Examples:
IF SLSX=0
PMX-4EX-SA Manual
page 103
Rev 3.01
DIO=6
ELSEIF SLSY=0
DIO=3
ENDIF
SR[0,3]
Description:
Write: Set the standalone control for the specified standalone program
Syntax:
Write: SR[0-3] = [0-3]
SR[0-3] = [0-3]
Examples:
IF DI1=1
; If digital input 1 is on
SR0=0
; Turn off standalone program 0
ENDIF
SSPD[axis]
Description:
Write: Set on-the-fly speed change for an individual axis.
Range is from 1 to 6,000,000 PPS
Syntax:
Write: SSPD[axis]=[value]
SSPD[axis]=[variable]
Note: If s-curve is enabled for an axis, on-the-fly speed feature cannot be used
for the corresponding axis.
Examples:
SCVX=0
;***Disable s-curve acceleration for X-axis
HSPDX=1000
;***X-axis high speed
LSPDX=100
;***Set X-axis low speed
ACCX=100
;***Set X-axis acceleration
JOGX+
;***Jogs X axis to positive direction
DELAY=1000
;***Wait 1 second
SSPDX=3000
;***Change speed on X-axis on-the-fly to 3000 PPS
SSPDM[axis]
Description:
Write: Set individual on-the-fly speed change mode
Range is from 0 to 7
Syntax:
Write: SSPDM[axis]=[0-7]
SSPDM[axis]=[variable]
Examples:
SCVX=0
;***Disable s-curve acceleration for X-axis
HSPDX=1000
;***X-axis high speed
LSPDX=100
;***Set X-axis low speed
ACCX=100
;***Set X-axis acceleration
PMX-4EX-SA Manual
page 104
Rev 3.01
JOGX+
DELAY=1000
SSPDMX=1
ACCX=20000
SSPDX=190000
;***Jogs X axis to positive direction
;***Wait 1 second
;***Set on-the-fly speed change mode to 1
;***Set acceleration to 20 seconds
;***Change speed on X-axis on-the-fly to 190000 PPS
STOP
Description:
Command: Stop all axes if in motion with deceleration.
Previous acceleration value is used for deceleration.
Syntax:
STOP
Examples:
JOGX+
;***Jogs X axis to positive direction
DELAY=1000
;***Wait 1 second
STOP
;***Stop with deceleration all axes including X axis
STOP[axis]
Description:
Stop individual axis if in motion with deceleration.
Previous acceleration value is used for deceleration.
Syntax:
STOP[axis]
Examples:
JOGX+
;***Jogs X axis to positive direction
DELAY=1000
;***Wait 1 second
JOGY+
;***Jogs Y axis to positive direction
DELAY=1000
;***Wait 1 second
STOPX
;***Stop with deceleration X axis only
STORE
Description:
Command: Store all values to flash
Syntax:
STORE
Examples:
V80=EX
;***Put encoder value in V80
DELAY=1000
;***Wait 1 second
STORE
;***Store V80 to non-volatile flash
SUB
Description:
Indicates start of subroutine
Note: Subroutine definitions should be written AFTER the END statement
Subroutine 31 is reserved for error handling
PMX-4EX-SA Manual
page 105
Rev 3.01
Syntax:
SUB [subroutine number]
[Subroutine Number] range is 0 to 31
Examples:
GOSUB 1
END
SUB 1
X0
WAITX
X1000
WAITX
ENDSUB
SYNCFG[axis]
Description:
Write: Set sync output configuration for axis
Syntax:
Write: SYNCFG[axis]=[value]
SYNCFG[axis]=[variable]
Examples:
SYNCFGX=1
;*** Set sync output configuration to 1 for x-axis
SYNPOSX=3000
;*** Set sync output position to 3000 for x-axis
SYNTIMEX=10
;*** Set sync output pulse time to 10 ms for x-axis
SYNONX
;*** Turn on sync output for x-axis
V1=1
;*** Wait until sync output is triggered for x-axis
WHILE V1 != 2
V1=SYNSTATX
ENDWHILE
SYNOFFX
;*** Disable sync output for x-axis
SYNOFF[axis]
Description:
Write: Disable sync output for axis
Syntax:
Write: SYNOFF[axis]
Examples:
See SYNCFG[axis]
SYNON[axis]
Description:
Write: Enable sync output for axis
Syntax:
Write: SYNON[axis]
Examples:
See SYNCFG[axis]
PMX-4EX-SA Manual
page 106
Rev 3.01
SYNPOS[axis]
Description:
Write: Set sync output position for axis. 28-bit signed number
Syntax:
Write: SYNPOS[axis]=[value]
Write: SYNPOS[axis]=[variable]
Examples:
See SYNCFG[axis]
SYNSTAT[axis]
Description:
Read: Get status for sync output of axis
Syntax:
Read: [variable] = SYN[axis]S
Examples:
See SYNCFG[axis]
SYNTIME[axis]
Description:
Write: Set pulse output width time for sync output of axis
Syntax:
Write: SYNTIME[axis]=[value]
Examples:
See SYNCFG[axis]
TOC
Description:
Sets the communication time-out parameter. Value is in milli-seconds.
Syntax:
TOC=[long value]
Examples:
TOC=10000 ;***Sets time-out parameter to 10 seconds
TR
Description:
Read: Get count status of timer register
Write: Set timer register
Once TR is set, it begins to count down to 0. Units ms.
Syntax:
Read: [variable]=TR
Write: TR=[value]
Conditional: IF TR=[variable]
ENDIF
Examples:
PMX-4EX-SA Manual
page 107
Rev 3.01
TR=1000
WHILE 1=1
IF TR>8000
X0
WAITX
ELSEIF TR>5000
X3000
WAITX
ELSE
X8000
WAITX
ENDIF
ENDWHILE
U
Description:
Command: Perform U axis move to target location
With other Axis moves in the same line, linear interpolation move is done.
Syntax:
U[value]
U[variable]
Examples:
U10000
;***Move U Axis to position 10000
WAITU
V10 = 1200
;***Set variable 10 value to 1200
UV10
;***Move U Axis to variable 10 value
WAITU
V[index]
Description:
Assign to variable.
Performax 4EX has 100 variables [V0-V99]
Syntax:
V[Variable Number] = [Argument]
V[Variable Number] = [Argument1][Operation][Argument2]
Special case for BIT NOT:
V[Variable Number] = ~[Argument]
[Argument] can be any of the following:
Numerical value
Pulse or Encoder Position
Digital Output
Digital Input
Enable Output
Motor Status
[Operation] can be any of the following
+
Addition
PMX-4EX-SA Manual
page 108
Rev 3.01
*
/
%
>>
<<
&
|
~
Examples:
V1=12345
V2=V1+1
V3=DI
V5=~EO
Subtraction
Multiplication
Division
Modulus
Bit Shift Right
Bit Shift Left
Bit AND
Bit OR
Bit NOT
;***Set Variable 1 to 123
;***Set Variable 2 to V1 plus 1
;***Set Variable 3 to digital input value
;***Sets Variable 5 to bit NOT of enable output value
WAIT[axis]
Description:
Tell program to wait until move on the certain axis is finished before executing
next line.
Syntax:
WAIT[axis]
X[variable]
Examples:
X10000
;***Move X Axis to position 10000
WAITX
;***Wait until X Axis move is done
DO=5
;***Set digital output
Y3000
;***Move Y Axis to 3000
WAITY
;***Wait until Y Axis move is done
WHILE
Description:
Perform WHILE loop
Syntax:
WHILE [Argument 1] [Comparison] [Argument 2]
[Argument] can be any of the following:
Numerical value
Pulse or Encoder Position
Digital Output
Digital Input
Enable Output
Motor Status
[Comparison] can be any of the following
=
Equal to
>
Greater than
<
Less than
>=
Greater than or equal to
PMX-4EX-SA Manual
page 109
Rev 3.01
<=
!=
Examples:
WHILE V1=1
X0
WAITX
X1000
WAITX
ENDWHILE
Less than or equal to
Not Equal to
;***While V1 is 1 continue to loop
X
Description:
Command: Perform X axis move to target location
With other Axis moves in the same line, linear interpolation move is done.
Syntax:
X[value]
X[variable]
Examples:
X10000
WAITX
X2000Y3000
WAITX
V10 = 1200
XV10
WAITX
;***Move X Axis to position 10000
;***Move X to 2000 and Y to 3000 in linear interpolation move
;***Set variable 10 value to 1200
;***Move X Axis to variable 10 value
Y
Description:
Command: Perform Y axis move to target location
With other Axis moves in the same line, linear interpolation move is done.
Syntax:
Y[value]
Y[variable]
Examples:
Y10000
;***Move Y Axis to position 10000
WAITY
Y2000Z3000 ;***Move Y to 2000 and Z to 3000 in linear interpolation move
WAITY
V10 = 1200 ;***Set variable 10 value to 1200
YV10
;***Move Y Axis to variable 10 value
WAITY
Z
Description:
Command: Perform Z axis move to target location
PMX-4EX-SA Manual
page 110
Rev 3.01
With other Axis moves in the same line, linear interpolation move is done.
Syntax:
Z[value]
Z[variable]
Examples:
Z10000
;***Move X Axis to position 10000
WAITZ
Y1000Z2000U3000 ;***Move Y to 1000, Z to 2000, U to 3000
WAITY
V10 = 1200 ;***Set variable 10 value to 1200
ZV10
;***Move Z Axis to variable 10 value
WAITZ
ZHOME[axis][+ or -]
Description:
Command: Perform Z-homing using current high speed, low speed, and
acceleration.
Syntax:
ZHOME[Axis][+ or -]
Examples:
ZHOMEX+ ;***Z Homes X axis in positive direction
ZHOMEZ;***Z Homes Z axis in negative direction
ZOME[axis][+ or -]
Description:
Command: Perform Zoming using current high speed, low speed, and
acceleration.
Syntax:
ZOME[Axis][+ or -]
Examples:
ZOMEX+
;***Homes X axis in positive direction
ZOMEZ;***Homes Z axis in negative direction
PMX-4EX-SA Manual
page 111
Rev 3.01
11. Example Standalone Programs
Standalone Example Program 1 – Single Thread
Task: Set the high speed and low speed and move the motor to 1000 and back to 0.
HSPD=20000
;* Set the high speed to 20000 pulses/sec
LSPD=1000
;* Set the low speed to 1000 pulses/sec
ACC=300
;* Set the acceleration to 300 msec
EO=1
;* Enable the motor power
X1000
;* Move to 1000
WAITX
;*Wait for X-axis move to complete
X0
;* Move to zero
WAITX
;*Wait for X-axis move to complete
END
;* End of the program
Standalone Example Program 2 – Single Thread
Task: Move the motor back and forth indefinitely between position 1000 and 0.
HSPD=20000
LSPD=1000
ACC=300
EO=1
WHILE 1=1
X0
WAITX
X1000
WAITX
ENDWHILE
END
;* Set the high speed to 20000 pulses/sec
;* Set the low speed to 1000 pulses/sec
;* Set the acceleration to 300 msec
;* Enable the motor power
;* Forever loop
;* Move to zero
;*Wait for X-axis move to complete
;* Move to 1000
;*Wait for X-axis move to complete
;* Go back to WHILE statement
Standalone Example Program 3 – Single Thread
Task: Move the motor back and forth 10 times between position 1000 and 0.
HSPD=20000
LSPD=1000
ACC=300
EO=1
V1=0
WHILE V1<10
X0
WAITX
X1000
WAITX
V1=V1+1
ENDWHILE
END
PMX-4EX-SA Manual
;* Set the high speed to 20000 pulses/sec
;* Set the low speed to 1000 pulses/sec
;* Set the acceleration to 300 msec
;* Enable the motor power
;* Set variable 1 to value 0
;* Loop while variable 1 is less than 10
;* Move to zero
;*Wait for X-axis move to complete
;* Move to 1000
;*Wait for X-axis move to complete
;* Increment variable 1
;* Go back to WHILE statement
page 112
Rev 3.01
Standalone Example Program 4 – Single Thread
Task: Move the motor back and forth between position 1000 and 0 only if the digital
input 1 is turned on.
HSPD=20000
;* Set the high speed to 20000 pulses/sec
LSPD=1000
;* Set the low speed to 1000 pulses/sec
ACC=300
;* Set the acceleration to 300 msec
EO=1
;* Enable the motor power
WHILE 1=1
;* Forever loop
IF DI1=1
;* If digital input 1 is on, execute the statements
X0
;* Move to zero
WAITX
;*Wait for X-axis move to complete
X1000
;* Move to 1000
WAITX
;*Wait for X-axis move to complete
ENDIF
ENDWHILE
;* Go back to WHILE statement
END
Standalone Example Program 5 – Single Thread
Task: Using a subroutine, increment the motor by 1000 whenever the DI1 rising edge is
detected.
HSPD=20000
;* Set the high speed to 20000 pulses/sec
LSPD=1000
;* Set the low speed to 1000 pulses/sec
ACC=300
;* Set the acceleration to 300 msec
EO=1
;* Enable the motor power
V1=0
;* Set variable 1 to zero
WHILE 1=1
;* Forever loop
IF DI1=1
;* If digital input 1 is on, execute the statements
GOSUB 1
;* Move to zero
ENDIF
ENDWHILE
;* Go back to WHILE statement
END
SUB 1
XV1
WAITX
V1=V1+1000
WHILE DI1=1
ENDWHILE
ENDSUB
PMX-4EX-SA Manual
;* Move to V1 target position
;*Wait for X-axis move to complete
;* Increment V1 by 1000
;* Wait until the DI1 is turned off so that
;* 1000 increment is not continuously done
page 113
Rev 3.01
Standalone Example Program 6 – Single Thread
Task: If digital input 1 is on, move to position 1000. If digital input 2 is on, move to
position 2000. If digital input 3 is on, move to 3000. If digital input 5 is on, home the
motor in negative direction. Use digital output 1 to indicate that the motor is moving or
not moving.
HSPD=20000
LSPD=1000
ACC=300
EO=1
WHILE 1=1
IF DI1=1
X1000
WAITX
ELSEIF DI2=1
X2000
WAITX
ELSEIF DI3=1
X3000
WAITX
ELSEIF DI5=1
HOMEXWAITX
ENDIF
V1=MSTX
V2=V1&7
IF V2!=0
DO1=1
ELSE
DO1=0
ENDIF
ENDWHILE
END
PMX-4EX-SA Manual
;* Set the high speed to 20000 pulses/sec
;* Set the low speed to 1000 pulses/sec
;* Set the acceleration to 300 msec
;* Enable the motor power
;* Forever loop
;* If digital input 1 is on
;* Move to 1000
;*Wait for X-axis move to complete
;* If digital input 2 is on
;* Move to 2000
;*Wait for X-axis move to complete
;* If digital input 3 is on
;* Move to 3000
;*Wait for X-axis move to complete
;* If digital input 5 is on
;* Home the motor in negative direction
;*Wait for X-axis move to complete
;* Store the motor status to variable 1
;* Get first 3 bits
;* Go back to WHILE statement
page 114
Rev 3.01
Standalone Example Program 7 – Multi Thread
Task: Program 0 will continuously move the motor between positions 0 and 1000.
Simultaneously, program 1 will control the status of program 0 using digital inputs.
PRG 0
HSPD=20000
LSPD=500
ACC=500
WHILE 1=1
X0
WAITX
X1000
WAITX
ENDWHILE
END
;* Start of Program 0
;* Set high speed to 20000pps
;* Set low speed to 500pps
;* Set acceleration to 500ms
;* Forever loop
;* Move to position 0
;* Wait for the move to complete
;* Move to position 1000
;* Wait for the move to complete
;* Go back to WHILE statement
;* End Program 0
PRG 1
WHILE 1=1
IF DI1=1
ABORTX
SR0=0
ELSE
SR0=1
ENDIF
ENDWHILE
END
;* Start of Program 1
;* Forever loop
;* If digital input 1 is triggered
;* Stop movement
;* Stop Program 1
;* If digital input 1 is not triggered
;* Run Program 1
;* End if statements
;* Go back to WHILE statement
;* End Program 1
PMX-4EX-SA Manual
page 115
Rev 3.01
Standalone Example Program 8 – Multi Thread
Task: Program 0 will continuously move the motor between positions 0 and 1000.
Simultaneously, program 1 will monitor the communication time-out parameter and
triggers digital output 1 if a time-out occurs. Program 1 will also stop all motion, disable
program 0 and then re-enable it after a delay of 3 seconds when the error occurs.
PRG 0
HSPD=1000
LSPD=500
ACC=500
TOC=5000
EO=1
WHILE 1=1
X0
WAITX
X1000
WAITX
ENDWHILE
END
;* Start of Program 0
;* Set high speed to 1000 pps
;* Set low speed to 500pps
;* Set acceleration to 500ms
;* Set time-out counter alarm to 5 seconds
;* Enable motor
;* Forever loop
;* Move to position 0
;* Wait for the move to complete
;* Move to position 1000
;* Wait for the move to complete
;* Go back to WHILE statement
;* End Program 0
PRG 1
;* Start of Program 1
WHILE 1=1
;* Forever loop
V1=MSTX&2048
;* Get bit time-out counter alarm variable
IF V1 = 2048
;* If time-out counter alarm is on
SR0=0
;* Stop program 0
ABORTX
;* Abort the motor
DO=0
;* Set DO=0
DELAY=3000;* Delay 3 seconds
SR0=1
;* Turn program 0 back on
DO=1
;* Set DO=1
ENDIF
ENDWHILE
;* Go back to WHILE statement
END
;* End Program 1
PMX-4EX-SA Manual
page 116
Rev 3.01
Appendix A: Speed Settings
HSPD value
[PPS] †
1 - 65K
65K - 130K
130K - 325K
325K - 650 K
650K - 1.3M
1.3M - 3.2M
3.2M - 6M
Speed
Window
[SSPDM]
0,1
2
3
4
5
6
7
Min.
LSPD
value
1
2
5
10
20
50
100
Min. ACC
[ms]
δ
Max ACC setting [ms]
2
1
1
1
1
1
1
50
100
200
800
1500
3800
7500
((HSPD – LSPD) / δ) × 1000
Table A.0
†If StepNLoop is enabled, the [HSPD range] values needs to be transposed from PPS (pulse/sec)
to EPS (encoder counts/sec) using the following formula:
EPS = PPS / Step-N-Loop Ratio
Acceleration/Deceleration Range
The allowable acceleration/deceleration values depend on the LS and HS settings.
The minimum acceleration/deceleration setting for a given high speed and low speed is
shown in Table A.0.
The maximum acceleration/deceleration setting for a given high speed and low speed can
be calculated using the formula:
Note: The ACC parameter will be automatically adjusted if the value exceeds the
allowable range.
Max ACC = ((HS – LS) / δ) × 1000 [ms]
Figure A.0
Examples:
a) If HSPD = 20,000 pps, LSPD = 10,000 pps:
a. Min acceleration allowable: 1 ms
b. Max acceleration allowable:
((20,000 – 10000) / 50) x 1,000 ms = 200,000 ms (200 sec)
b) If HSPD = 900,000 pps, LSPD = 9,000 pps:
a. Min acceleration allowable: 1 ms
b. Max acceleration allowable:
((900,000 – 9,000) / 1500) x 1000 ms = 594,000 ms (594 sec)
PMX-4EX-SA Manual
page 117
Rev 3.01
Acceleration/Deceleration Range – Positional Move
When dealing with positional moves, the controller automatically calculates the
appropriate acceleration and deceleration based on the following rules.
Figure A.1
1) ACC vs. DEC 1: If the theoretical position where the controller begins
deceleration is less than L/2, the acceleration value is used for both ramp up and
ramp down. This is regardless of the EDEC setting.
2) ACC vs. DEC 2: If the theoretical position where the controller begins constant
speed is greater than L/2, the acceleration value is used for both ramp up and
ramp down. This is regardless of the EDEC setting.
3) Triangle Profile: If either (1) or (2) occur, the velocity profile becomes triangle.
Maximum speed is reached at L/2.
PMX-4EX-SA Manual
page 118
Rev 3.01
Contact Information
Arcus Technology, Inc.
3159 Independence Dr
Livermore, CA 94551
925-373-8800
www.arcus-technology.com
The information in this document is believed to be accurate at the time of publication but is subject to
change without notice.
PMX-4EX-SA Manual
page 119
Rev 3.01
Open as PDF
Similar pages