(Command Reference) DMC-B140 - Rev.1.0
(Command Reference) DMC-B140 - Rev.1.0
COMMAND
REFERENCE
Manual Rev. 1.0
Rev 10/2008
ARRAYS CONTROL FEEDBACK MATH PROGRAM STEPPER
DA deallocate MO motor off @ABS[n] |n| BK breakpoint KS smoothing
_DA arrays left _MO motor off? AL arm latch @ACOS[n] arccos DL download LC low
DM define SH servo here _AL latch @ASIN[n] arcsin _DL labels left MT motor
_DM space left SH servo here CE configure @ATAN[n] ED edit QS query error
LA list TM sample time @COM[n] bit not ELSE if else YA drive
QD download ECAM @COS[n] cosine EN end YB motor
QU print/upload EA master @FRAC[n] ENDIF if YC encoder
RA record EB enable @INT[n] HX halt thread YR correction
RC begin EC counter @RND[n] round IF conditional YS maintenance
RC recording? EG engage slave RL read latch @SIN[n] sine JP for/while VECTOR
RD data EM modulus _RL latch @SQR[n] x^0.5 JS jump AV wait for arc
_RD address EP master TD tell dual @TAN[n] tangent ^L^K _AVS arc length
[] index EQ disengage TP tell position + add LL list -
COMMUNICATE ET table TV tell - subtract LS list CR circle
CW unsolicited EW widen segment GEAR * multiply LV list CS clear sequence
DR data record EY cycle count GA axes / divide NO (') comment _CS segment
CF config EEPROM GD distance % modulus _NO threads ES elliptical scale
EO echo ^R^S master reset GM gantry mode () parenthesis PW password LE linear end
IN user input BN burn _GP phase & and RE return error _LE total arc length
LZ leading BP burn program GR ratio | or REM fast LI linear point
MG message BV burn variables HOME $ hexadecimal RI return LM linear axes
PF position format RS reset DE define dual < less than SL single step _LM buffer space
QR data record DP define position > greater than TB tell status TN tangent scale
QZ record info ERRORS FE find home = assign / equal TR debug trace _TN 1st position
VF variable AB abort FI find index <= less or equal UL upload VA acceleration
ZA DR _AX abort input HM home >= greater or _UL variables VD deceleration
DH DHCP BL reverse soft _HM home input <> not equal XQ execute VE vector end
CONTOUR ED program line MOTION _XQ current line VM vector axes
CD data ED1 thread INFO AC acceleration ZS zero stack VM velocity
CM axes - _BN serial number BG begin _ZS stack level VP vector point
_CM buffer full FL forward soft _BV axes _BG in motion? #AUTO; EN _VP last point
DT delta time LD limit ^R^V firmware DC deceleration #AUTOERR; EN VR VS
ETHERNET LF forward limit I/O IP increment ; command VS speed
IA IP address _LR reverse limit - IT s curve # subroutine VV Vector
` line continuation Variable
IH Ethernet OE off on error @IN[x] digital JG jog TIME
IK Port block SC stop code @OUT[x] digital PA position AT wait
MB modbus SD switch decel AI wait for _PA last target TIME clock
MW modbus wait TC tell code AO analog out PR position WT wait
SA send command #CMDERR; EN1 CB clear digital PR relative target MOTION WAIT
SM subnet mask #LIMSWI; RE1 CN configure PT position AD distance
TH handle status #POSERR; RE1 CI communication RP desired AM complete
WH which handle II input SP speed AP position
interrupt (TP)
OB output bit ST stop AR distance
OP output port ~a axis variable AS at speed (SP)
SB set digital out MC complete
TI tell input MF forward (TP)
TS tell switches MR reverse (TP)
#ININT; RI1
#COMINT;EN
Overview.....................................................................................................................................................................................1
Controller Notation .................................................................................................................................................................1
Trippoints ................................................................................................................................................................................1
Command Descriptions ...........................................................................................................................................................2
Parameter Arguments ..........................................................................................................................................................2
Direct Command Arguments ...............................................................................................................................................3
Interrogation ........................................................................................................................................................................3
Operand Usage ....................................................................................................................................................................3
Usage Description................................................................................................................................................................3
Default Description..............................................................................................................................................................3
Resetting the Controller to Factory Default.........................................................................................................................4
# ...........................................................................................................................................................................................5
$ ...........................................................................................................................................................................................6
& | ........................................................................................................................................................................................7
( ) .........................................................................................................................................................................................8
;............................................................................................................................................................................................9
[ ] .......................................................................................................................................................................................10
+ - * / % .............................................................................................................................................................................11
<, >, =, <=, >=, <> .............................................................................................................................................................12
=.........................................................................................................................................................................................13
~.........................................................................................................................................................................................14
AB .....................................................................................................................................................................................15
@ABS[n] ...........................................................................................................................................................................17
AC .....................................................................................................................................................................................18
@ACOS[n] ........................................................................................................................................................................19
AD .....................................................................................................................................................................................20
AI.......................................................................................................................................................................................21
AL......................................................................................................................................................................................22
AM.....................................................................................................................................................................................23
@AN[n] .............................................................................................................................................................................24
AO .....................................................................................................................................................................................25
AP ......................................................................................................................................................................................26
AR .....................................................................................................................................................................................27
AS ......................................................................................................................................................................................28
@ASIN[n] .........................................................................................................................................................................29
AT......................................................................................................................................................................................30
@ATAN[n]........................................................................................................................................................................31
#AUTO ..............................................................................................................................................................................32
#AUTOERR ......................................................................................................................................................................33
AV .....................................................................................................................................................................................34
Controller Notation
This command reference describes commands for Galil Motion Controller: B140. Commands are listed in
alphabetical order.
Please note that all commands may not be valid for every controller. To identify the controllers for which
the command is applicable, please review the Usage Section of the command description.
Trippoints
The controller provides several commands that can be used to make logical decisions, or “trippoints,” based
on events during a running program. Such events include: the completion of a specific motion, waiting for
a certain position to be reached, or simply waiting for a certain amount of time to elapse.
When a program is executing on the controller, each program line is executed sequentially. However,
when a trippoint command is executed, the program halts execution of the next line of code until the status
of the trippoint is cleared. Note that the trippoint only halts execution of the thread from which it is
commanded while all other independent threads are unaffected. Additionally, if the trippoint is
commanded from a subroutine, execution of the subroutine, as well as the main thread, is halted.
Since trippoint commands are used as program flow instructions during a running program, they should not
be implemented directly from the command line of the terminal. Sending a trippoint command directly
from the command line might cause an interruption in communications between the host PC and the
controller until the trippoint is cleared.
As a brief introduction, the following table lists the available commands and their basic usages:
AD after distance
AI after input
AM after move
AP after absolute position
AR after relative position
AS at speed
AT at time relative to a reference time
AV after vector distance
MC motion complete and “in position”
1
MF after motion forward
MR after motion reverse
WT wait for time
Command Descriptions
Each executable instruction is listed in the following section in alphabetical order. Below is a description
of the information which is provided for each command.
The two-letter Opcode for each instruction is placed in the upper left corner. Below the opcode is a
description of the command and required arguments.
Axes Arguments
Some commands require the user to identify the specific axes to be affected. These commands are
followed by uppercase X,Y,Z, W or A,B,C,D,E,F,G and H. No commas are needed and the order of axes is
not important. Do not insert any spaces prior to any command. For example, STX; AMX is invalid
because there is a space after the semicolon. The proper syntax for commands requires that the command
argument be separated from the command by a single space. When an argument is not required and is not
given, the command is executed for all axes.
Valid syntax
SH A Servo Here, A only
SH ABD Servo Here, A,B and D axes
SH ACD Servo Here, A,C and D axes
SH ABCD Servo Here, A,B, C and D axes
SH BCAD Servo Here, A,B,C and D axes
SH ADEG Servo Here, A,D,E and G axes
SH H Servo Here, H axis only
SH Servo Here, all axes
Parameter Arguments
Some commands require numerical arguments to be specified following the instruction. In the argument
description, these commands are followed by lower case n,n,n,n,n,n,n,n, where the letter, n, represents the
value. Values may be specified for any axis separately or any combination of axes. The argument for each
axis is separated by commas. Examples of valid syntax are listed below.
Valid syntax
AC n Specify argument for A axis only
AC n,n Specify argument for A and B only
AC n,,n Specify argument for A and C only
AC n,n,n,n Specify arguments for A,B,C,D axes
Interrogation
Most commands accept a question mark (?) as an argument. This argument causes the controller to return
parameter information listed in the command description. Type the command followed by a ? for each axis
requested. The syntax format is the same as the parameter arguments described above except '?' replaces
the values.
PR ? The controller will return the PR value for the A axis
PR ,,,? The controller will return the PR value for the D axis
PR ?,?,?,? The controller will return the PR value for the A,B,C and D axes
PR*=? The controller will return the PR value for all axes
Operand Usage
Most commands have a corresponding operand that can be used for interrogation. The Operand Usage
description provides proper syntax and the value returned by the operand. Operands must be used inside of
valid DMC expressions. For example, to display the value of an operand, the user could use the command:
MG ‘operand’
All of the command operands begin with the underscore character (_). For example, the value of the
current position on the A axis can be assigned to the variable ‘V’ with the command:
V=_TPA
Usage Description
The Usage description specifies the restrictions on proper command usage. The following provides an
explanation of the command information provided:
"While Moving":
Describes whether the command is valid while the controller is performing a motion.
"In a program":
Describes whether the command may be used as part of a user-defined program.
"Command Line":
Describes whether the command may be used as a direct command.
“Controller Usage”:
Identifies the controller models that can accept the command.
Default Description
In the command description, the DEFAULT section provides the default values for controller setup
parameters. These parameters can be changed and the new values can be saved in the controller's non-
RELATED COMMANDS:
LL List labels
DL Labels left
JP Jump statement
JS Jump subroutine
EXAMPLES:
#Loop; JP#Loop, x=10 ;'wait until x becomes 10
RELATED COMMANDS:
+-*/% Multiply (shift left)
+-*/% Divide (shift right)
MG {$8.4} Print in hexadecimal
EXAMPLES:
x = $7fffffff.0000 ;'store 2147483647 in x
y = x & $0000ffff.0000 ;'store lower 16 bits of x in y
z = x & $ffff0000.0000 / $10000 ;'store upper 16 bits of x in z
USAGE: DEFAULTS:
While Moving Yes Default Value -
In a Program Yes Default Format -
Command Line Yes
Controller Usage ALL
RELATED COMMANDS:
@COM[n] Bitwise complement
IF If statement
JP Jump statement
JS Jump subroutine
EXAMPLES:
IF (x > 2) & (y = 4) ;'x must be greater than 2 and y equal to 4
MG "true" ;'for the message to print
ENDIF
RELATED COMMANDS:
+-*/% Math Operators
&l Logical Operators
EXAMPLES:
:MG 1 + 2 * 3
9.0000
:MG 1 + (2 * 3)
7.0000
:
RELATED COMMANDS:
NO ( ‘ apostrophe also accepted) comment
EXAMPLES:
BGX; 'comment
USAGE: DEFAULTS:
While Moving Yes Default Value -
In a Program Yes Default Format -
Command Line Yes
Controller Usage ALL
RELATED COMMANDS:
DM Dimension Array
QU Print/Upload Array
EXAMPLES:
USAGE: DEFAULTS:
While Moving Yes Default Value -
In a Program Yes Default Format -
Command Line Yes
Controller Usage ALL
RELATED COMMANDS:
() Parenthesis
EXAMPLES:
:x =((1+(2*3))/7)-2 ;'assign -1 to x
:MG 40 % 6 ;'integer remainder of 40 divided by 6
4.0000
:
RELATED COMMANDS:
() Parentheses
IF If statement
JP Jump
JS Jump subroutine
EXAMPLES:
IF(x > 2) & (y = 4) ;'x must be greater than 2 and y equal to 4 for
MG "true" ;'the message to print
ENDIF
RELATED COMMANDS:
MG Print Message
EXAMPLES:
:x=5 ;'define and initialize x to 5
:x=
;'print x two different ways
5.0000
:MG x
5.0000
:
USAGE: DEFAULTS:
While Moving Yes Default Value -
In a Program Yes Default Format 1.0
Command Line Yes
Controller Usage ALL CONTROLLERS
OPERAND USAGE:
~n contains the axis number 0-11
EXAMPLES:
DESCRIPTION:
Allows a command in an application program to extend beyond the confines of the maximum line length of 40
characters. This is especially useful for code compression, long MG statements, or multiple conditions in an IF,JP
or JS statement.
ARGUMENTS: none
USAGE:
Default Value -
In a Program Yes Default Format -
Command Line No
OPERAND USAGE:
RELATED COMMANDS:
MG Print Message
EXAMPLES:
IF((var100=1000)&(var101=50));MG"GO";EL`
SE;MG"STOP";ENDIF;
RELATED COMMANDS:
SH Re-enables motor
OE Specifies Off On Error
EXAMPLES:
AB ;'Stops motion
OE 1,1,1,1 ;'Enable off on error
AB ;'Shuts off motor command and stops motion
Hint: Remember to use the parameter 1 following AB if you only want the motion to be aborted.
Otherwise, your application program will also be aborted.
USAGE: DEFAULTS:
While Moving Yes Default Value -
In a Program Yes Default Format -
Command Line Yes
Controller Usage ALL
RELATED COMMANDS:
@SQR[n] Square Root
EXAMPLES:
:MG @ABS[-2147483647]
2147483647.0000
:
OPERAND USAGE:
_ACx contains the value of acceleration for the specified axis.
RELATED COMMANDS:
DC Specifies deceleration rate.
Feedforward Acceleration
IT Smoothing constant - S-curve
EXAMPLES:
AC 150000,200000,300000,400000 Set A-axis acceleration to 150000, B-axis to
200000 counts/sec2, the C axis to 300000
counts/sec2, and the D-axis to 400000
count/sec2.
AC ?,?,?,? Request the Acceleration
149504, 199680, 299008, 399360 Return Acceleration
(resolution, 1024)
V=_ACB Assigns the B acceleration to the variable V
Hint: Specify realistic acceleration rates based on your physical system such as motor torque rating,
loads, and amplifier current rating. Specifying an excessive acceleration will cause large following error
during acceleration and the motor will not follow the commanded profile.
RELATED COMMANDS:
@ASIN[n] Arc sine
@SIN[n] sine
@ATAN[n] Arc tangent
@COS[n] Cosine
@TAN[n] Tangent
EXAMPLES:
:MG @ACOS[-1]
180.0000
:MG @ACOS[0]
90.0000
:MG @ACOS[1]
0.0001
:
RELATED COMMANDS:
AV After distance for vector moves
AP After position trip point
AR After relative distance trip point
MF Motion Forward trip point
MR Motion Reverse trip point
EXAMPLES:
#A;DP0,0 ;'Begin Program
PR 10000,20000 ;'Specify positions
BG ;'Begin motion
AD 5000 ;'After A reaches 5000
MG "Halfway to A";TPA ;'Send message
AD ,10000 ;'After B reaches 10000
MG "Halfway to B";TPB ;'Send message
EN ;'End Program
Hint: The AD command is accurate to the number of counts that occur in 2*TM μsec. Multiply your speed
by 2*TM μsec to obtain the maximum position error in counts. Remember AD measures incremental
distance from start of move on one axis.
RELATED COMMANDS:
@IN[n] Function to read input 1 through 8
II Input interrupt
#ININT Label for input interrupt
EXAMPLES:
#A ;'Begin Program
AI 8 ;'Wait until input 8 is high
SP 10000 ;'Speed is 10000 counts/sec
AC 20000 ;'Acceleration is 20000 counts/sec2
PR 400 ;'Specify position
BGA ;'Begin motion
EN ;'End Program
Hint: The AI command actually halts execution until specified input is at desired logic level. Use the
conditional Jump command (JP) or input interrupt (II) if you do not want the program sequence to halt.
The command RL returns the captured position for the specified axes. When interrogated the AL
command will return a 1 if the latch for that axis is armed or a zero after the latch has
occurred. The CN command can be used to change the polarity of the latch function.
ARGUMENTS: AL nnnn or AL n,n,n,n, where
n can be A,B,C,D, specifying the main encoder for the axis to be latched
n can be SA,SB,SC,SD, specifying the auxiliary encoder.
n can be TA,TB,TC,TD, specifying the main encoder is latched from the index pulse instead of a
digital input.
USAGE: DEFAULTS:
While Moving Yes Default Value 0
In a Program Yes Default Format 1.0
Command Line Yes
Controller Usage ALL CONTROLLERS
OPERAND USAGE:
_ALn contains the state of the specified latch. 0 = not armed, 1 = armed.
RELATED COMMANDS:
RL Report Latch
EXAMPLES:
#A ;'Program Label
ALB ;'Arm B-axis latch
JG,50000 ;'Set up jog at 50000 counts/sec
BGB ;'Begin the move
#LOOP ;'Loop until latch has occurred
JP #LOOP,_ALB=1
RLB ;'Transmit the latched position
EN ;'End of program
RELATED COMMANDS:
BG _BGn contains a 0 if motion complete
MC Motion Complete
EXAMPLES:
#MOVE ;'Program MOVE
PR 5000,5000,5000,5000 ;'Position relative moves
BG A ;'Start the A-axis
AM A ;'After the move is complete on A,
BG B ;'Start the B-axis
AM B ;'After the move is complete on B,
BG C ;'Start the C-axis
AM C ;'After the move is complete on C
BG D ;'Start the D-axis
AM D ;'After the move is complete on D
EN ;'End of Program
Hint: AM is a very important command for controlling the timing between multiple move sequences. For
example, if the A-axis is in the middle of a position relative move (PR) you cannot make a position absolute
move (PAA, BGA) until the first move is complete. Use AMA to halt the program sequences until the first
profiled motion is complete. AM tests for profile completion. The actual motor may still be moving. To
halt program sequence until the actual physical motion has completed, use the MC command. Another
method for testing motion complete is to check for the internal variable _BGn, being equal to zero (see BG
command).
RELATED COMMANDS:
Analog Range
@IN[n] Read digital input
@OUT[n] Read digital output
SB Set digital output bit
CB Clear digital output bit
EXAMPLES:
:MG @AN[1001] ;'print analog input 1
1.7883
:x = @AN[1001] ;'assign analog input 1 to a
variable
RELATED COMMANDS:
SB Set Bit
CB Clear Bit
MB Modbus
RELATED COMMANDS:
AR Trippoint for relative distances
MF Trippoint for forward motion
EXAMPLES:
#TEST ;'Program B
DP0 ;'Define zero
JG 1000 ;'Jog mode (speed of 1000 counts/sec)
BG A ;'Begin move
AP 2000 ;'After passing the position 2000
V1=_TPA ;'Assign V1 A position
MG "Position is", V1 ;'Print Message
ST ;'Stop
EN ;'End of Program
Hint: The accuracy of the AP command is the number of counts that occur in 2*TM μsec. Multiply the
speed by 2*TM μsec to obtain the maximum error. AP tests for absolute position. Use the AD command to
measure incremental distances.
RELATED COMMANDS:
AV Trippoint for after vector position for coordinated moves
AP Trippoint for after absolute position
EXAMPLES:
#A;DP 0,0,0,0 ;'Begin Program
JG 50000,,,7000 ;'Specify speeds
BG AD ;'Begin motion
#B ;'Label
AR 25000 ;'After passing 25000 counts of relative distance on A-axis
MG "Passed _A",_TPA ;'Send message on A-axis
JP #B ;'Jump to Label #B
EN ;'End Program
Hint: AR is used to specify incremental distance from last AR or AD command. Use AR if multiple position
trippoints are needed in a single motion sequence.
EXAMPLES:
#SPEED ;'Program A
PR 100000 ;'Specify position
SP 10000 ;'Specify speed
BGA ;'Begin A
ASA ;'After speed is reached
MG "At Speed" ;'Print Message
EN ;'End of Program
WARNING:
The AS command applies to a trapezoidal velocity profile only with linear acceleration. AS used with
smoothing profiling will be inaccurate.
RELATED COMMANDS:
@ACOS[n] Arc cosine
@SIN[n] sine
@ATAN[n] Arc tangent
@COS[n] Cosine
@TAN[n] Tangent
EXAMPLES:
:MG @ASIN[-1]
-90.0000
:MG @ASIN[0]
0.0000
:MG @ASIN[1]
90.0000
:
EXAMPLES:
The following commands are sent sequentially
AT 0 Establishes reference time 0 as current time
AT 50 Waits 50 msec from reference 0
AT 100 Waits 100 msec from reference 0
AT -150 Waits 150 msec from reference 0 and sets new reference at 150
AT 80 Waits 80 msec from new reference (total elapsed time is 230 msec)
RELATED COMMANDS:
@ASIN[n] Arc sine
@SIN[n] sine
@ACOS[n] Arc cosine
@COS[n] Cosine
@TAN[n] Tangent
EXAMPLES:
:MG @ATAN[-10]
-84.2894
:MG @ATAN[0]
0.0000
:MG @ATAN[10]
84.2894
:
RELATED COMMANDS:
BP Burn program
EN End program
EXAMPLES:
RELATED COMMANDS:
_RS Checksum error code
EN End program
EXAMPLES:
#AUTO
WT 2000
MG "AUTO"
JP#AUTO
EN
#AUTOERR
WT500
MG "AUTOERR ", _RS
EN
OPERAND USAGE:
_AVS contains the vector distance from the start of the sequence in the S coordinate system.
EXAMPLES:
#MOVE;DP 0,0 ;'Label
CAT ;'Specify the T coordinate system
LMAB ;'Linear move for A,B
LI 1000,2000 ;'Specify distance
LI 2000,3000 ;'Specify distance
LE
BGT ;'Begin motion in the T coordinate system
AV ,500 ;'After path distance = 500,
MG "Path>500";TPAB ;'Print Message
EN ;'End Program
Hint: Vector Distance is calculated as the square root of the sum of the squared distance for each axis in
the linear or vector mode.
DESCRIPTION: Input 8 can be used as an undedicated digital input or as the controller abort input. AZ
sets the behavior of input 8.
USAGE: DEFAULTS:
While Moving: Yes Default Value: 1
In a Program Yes
Command Line Yes
Controller Usage B140 only
FUNCTION: Begin
DESCRIPTION:
The BG command starts a motion on the specified axis or sequence.
ARGUMENTS: BG nnnnnnnnnn where
n is A,B,C,D, S, or N, or any combination to specify the axis or sequence
USAGE: DEFAULTS:
While Moving Yes Default Value 0
In a Program Yes Default Format -
Command Line Yes
Controller Usage ALL CONTROLLERS
OPERAND USAGE:
_BGn contains a ‘0’ if motion complete on the specified axis or coordinate system, otherwise
contains a ‘1’.
RELATED COMMANDS:
AM After motion complete
ST Stop motion
EXAMPLES:
PR 2000,3000,,5000 Set up for a relative move
BG ABD Start the A,B and D motors moving
HM Set up for the homing
BGA Start only the A-axis moving
JG 1000,4000 Set up for jog
BGY Start only the B-axis moving
BSTATE=_BGB Assign a 1 to BSTATE if the B-axis is performing a move
VP 1000,2000 Specify vector position
VS 20000 Specify vector velocity
BGS Begin coordinated sequen0ce
VMAB Vector Mode
VP 4000,-1000 Specify vector position
VE Vector End
PR ,,8000,5000 Specify C and D position
BGSCD Begin sequence and C,D motion
MG _BGS Displays a 1 if motion occurring on coordinated system "S"
Hint: A BG command cannot be executed for any axis in which motion has not completed. Use the AM
trippoint to wait for motion complete between moves. Determining when motion is complete can also be
accomplished by testing for the value of the operand _BGn.
OPERAND USAGE:
_BK will tell whether a breakpoint has been armed, whether it has been encountered, and the
program line number of the breakpoint:
= -LineNumber: breakpoint armed
= LineNumber: breakpoint encountered
= -2147483648: breakpoint not armed
RELATED COMMANDS:
SL Single Step
TR Trace
EXAMPLES:
BK 3 Pause at line 3 (the 4th line) in thread 0
BK 5 Continue to line 5
SL Execute the next line
SL 3 Execute the next 3 lines
BK Resume normal execution
OPERAND USAGE:
_BLn contains the value of the reverse software limit for the specified axis.
RELATED COMMANDS:
FL Forward Limit
PF Position Formatting
EXAMPLES:
#TEST ;'Test Program
AC 1000000 ;'Acceleration Rate
DC 1000000 ;'Deceleration Rate
BL -15000 ;'Set Reverse Limit
JG -5000 ;'Jog Reverse
BGA ;'Begin Motion
AMA ;'After Motion (limit occurred)
TPA ;'Tell Position
EN ;'End Program
Hint: Galil Controllers also provide hardware limits. Both hardware or software limits will trigger the
#LIMSWI automatic subroutine.
USAGE: DEFAULTS:
While Moving Yes Default Value -
In a Program Yes Default Format -
Command Line Yes
Controller Usage ALL CONTROLLERS
OPERAND USAGE:
_BN contains the serial number of the controller.
RELATED COMMANDS:
BP Burn Program
BV Burn Variables
EXAMPLES:
DESCRIPTION::
The BP command saves the application program in non-volatile EEPROM memory. This
command typically takes up to 2 seconds to execute and must not be interrupted. The
controller returns a : when the Burn is complete.
ARGUMENTS: None
USAGE: DEFAULTS:
While Moving No Default Value ---
In a Program Yes
Not in a Program Yes
Controller Usage ALL CONTROLLERS
RELATED COMMANDS:
BN Burn Parameters
BV Burn Variable
OPERAND USAGE:
_BV returns the number of controller axes.
RELATED COMMANDS:
BN Burn Parameters
BP Burn Program
Note 1: This command will store the ECAM table values in non-volatile EEPROM memory.
Note 2: This command may cause the Galil software to issue the following warning "A time-out occurred
while waiting for a response from the controller". This warning is normal and is designed to warn the user
when the controller does not respond to a command within the timeout period. This occurs because this
command takes more time than the default timeout of 5 sec. The timeout can be changed in the Galil
software but this warning does not affect the operation of the controller or software.
RELATED COMMANDS:
SB Set Bit
OB Output Bit
OP Define output port (byte-wise).
EXAMPLES:
CB 3 Clear output bit 3
CB 1 Clear output bit 1
RELATED COMMANDS:
CM Contour Mode
DT Time Increment
EXAMPLES:
#Cont0 ;'Define label #Cont0
CM ABCD ;'Specify Contour Mode
DT 4 ;'Specify time increment for contour
CD 200,350,-150,500 ;'Specify incremental positions on A,B,C and C axes
'A-axis moves 200 counts B-axis moves 350 counts C-
'axis moves -150 counts C-axis moves 500 counts
CD 100,200,300,400 ;'New position data
CD 0,0,0,0=0 ;'End of Contour Buffer/Sequence
#Wait;JP#Wait,_CM<>531 ;'Wait until path is done
EN ;'End program
For example: n = 10 implies M = 2 and N = 8, thus both encoders are reversed quadrature.
n=? Returns the value of the encoder configuration for the specified axes.
USAGE: DEFAULTS:
While Moving Yes Default Value 0
In a Program Yes Default Format 2.0
Command Line Yes
Controller Usage ALL CONTROLLERS
OPERAND USAGE:
_CEn contains the value of encoder type for the axis specified by ‘n’.
RELATED COMMANDS:
MT Specify motor type
EXAMPLES:
CE 0, 3, 6, 2 Configure encoders
CE ?,?,?,? Interrogate configuration
:0,3,6,2
V = _CEB Assign configuration to a variable
V = ?
:3
Note: When using pulse and direction encoders, the pulse signal is connected to CHA and the direction
signal is connected to CHB.
RELATED COMMANDS:
CW Configures MSB of unsolicited messages
WH What Handle
TH Tell Handles
PARAMETER EXPLANATION
n=0 Do not interrupt
n=1 Interrupt on carriage return
n=2 Interrupt on any character
n = -1 Clear interrupt data buffer
USAGE: DEFAULTS:
While Moving Yes Default Value n = 0, m = 0
In a Program Yes Default Format -
Command Line Yes
Controller Usage ALL CONTROLLERS
RELATED COMMANDS:
Configure communications
IN Communication input
MG Message output
EXAMPLES:
CI 1,1 Interrupt when the <enter> key is received on port 1
CI 2,1 Interrupt on a single character received on Port 1
OPERAND USAGE:
_CM contains a ‘0’ if the contour buffer is full; otherwise it contains the number of available
contour segments.
RELATED COMMANDS:
CD Contour Data
DT Time Increment
EXAMPLES:
V=_CM;V= Return contour buffer status
CM? Return contour buffer status
CM AC Specify A,C axes for Contour Mode
RELATED COMMANDS:
TC Tell Error Code
_ED Last program line with an error
EN End program
EXAMPLES:
#BEGIN ;'Begin main program
IN "ENTER SPEED",Speed ;'Prompt for speed
JG Speed
BGX ;'Begin motion
EN ;'End main program
NOTE: An application program must be executing for #CMDERR to execute, which runs in thread 0.
USAGE: DEFAULTS:
While Moving Yes Default Value -1,-1,-1,0,0
In a Program Yes Default Format 2.0
Command Line Yes
Controller Usage ALL CONTROLLERS
OPERAND USAGE:
_CN0 Contains the limit switch configuration
_CN1 Contains the home switch configuration
_CN2 Contains the latch input configuration
_CN3 Contains the state of the selective abort function (1 enabled, 0 disabled)
_CN4 Contains whether the abort input will terminate the program
RELATED COMMANDS:
AL Arm latch
EXAMPLES:
CN 1,1 Sets limit and home switches to active high
CN,, -1 Sets input latch active low
RELATED COMMANDS:
&| Logical operators AND and OR
EXAMPLES:
:MG {$8.0} @COM[0]
$FFFFFFFF
:MG {$8.0} @COM[$FFFFFFFF]
$00000000
:
RELATED COMMANDS:
P1CD Serial port 1 code
P1CH Serial port 1 character
P1NM Serial port 1 number
P1ST Serial port 1 string
CI Configure #COMINT
EN End subroutine
EXAMPLES:
#A ;'Program Label
#Loop
MG "Loop" ;'print a message every second
WT 1000
JP#Loop
#COMINT
MG "COMINT" ;'print a message when a character is received
EN1,1
NOTE: An application program must be executing for the automatic subroutine to function, which runs in
thread 0.
RELATED COMMANDS:
@ASIN[n] Arc sine
@SIN[n] sine
@ATAN[n] Arc tangent
@ACOS[n] Arc cosine
@TAN[n] Tangent
EXAMPLES:
:MG @COS[0]
1.0000
:MG @COS[90]
0.0000
:MG @COS[180]
-1.0000
:MG @COS[270]
0.0000
:MG @COS[360]
1.0000
:
OPERAND USAGE:
_CSn contains the segment number in the sequence specified by n, S. This operand is valid in the
Linear mode, LM, Vector mode, VM
RELATED COMMANDS:
CR Circular Interpolation Segment
LI Linear Interpolation Segment
LM Linear Interpolation Mode
VM Vector Mode
VP Vector Position
EXAMPLES:
#CLEAR ;'Label
OPERAND USAGE:
_CW contains the value of the data adjustment bit. 2 = off, 1 = on
Note: The CW command can cause unrecognized characters to be returned by the controller. The default
state of the controller is to disable the CW command, however, the Galil Servo Design Kit software and
terminal software may sometimes enable the CW command for internal usage. If the controller is reset
while the Galil software is running, the CW command could be reset to the default value which would
create difficulty for the software. It may be necessary to re-enable the CW command. The CW command
status can be stored in EEPROM
OPERAND USAGE:
_DA contains the total number of arrays available. For example, before any arrays have been
defined, the operand _DA is 6. If one array is defined, the operand _DA will return 5.
RELATED COMMANDS:
DM Dimension Array
Note: Since this command deallocates the spaces and compacts the array spaces in the memory, it is
possible that execution of this command may take longer time than 2 ms.
EXAMPLES:
PR 10000 Specify position
AC 2000000 Specify acceleration rate
DC 1000000 Specify deceleration rate
SP 5000 Specify slew speed
BG Begin motion
Note: The DC command may be changed during the move in JG move, but not in PR or PA move.
The DE command defines the encoder position when used with stepper motors.
USAGE: DEFAULTS:
While Moving Yes Default Value 0,0,0,0
In a Program Yes Default Format Position Format
Command Line Yes
Controller Usage ALL CONTROLLERS
OPERAND USAGE:
_DEn contains the current position of the specified encoder.
RELATED COMMANDS:
DP Define position
TD
5 Tell Dual Encoder position
EXAMPLES:
DE 0,100,200,400 Set the current encoder position to 0,100,200,400 on A,B,C
and D axes
DE?,?,?,? Return auxiliary encoder positions
DualA=_DEA Assign auxiliary encoder position of A-axis to the variable
DualA
ARGUMENTS: DH n where
n = 0 disables DHCP and enables BOOT-P
n = 1 disables BOOT-P and enables DHCP
n = ? returns the current state of the setting
USAGE: DEFAULTS:
While Moving Yes Default Value 1.0
In a Program Yes Default Format -
Command Line Yes
RELATED COMMANDS:
IA IP Address
EXAMPLES:
DH 1 Sets the DHCP function on. IA assignment will no
longer work. IP address cannot be burned.
Controller will receive its IP address from the
DHCP server on the network.
DH 0 Sets the DHCP function off, and the Boot-P
function on.
OPERAND USAGE:
When used as an operand, _DL gives the number of available labels (62 maximum)
RELATED COMMANDS:
UL Upload
EXAMPLES:
DL; Begin download
#A;PR 4000;BGA Data
AMA;MG DONE Data
EN Data
<control> Z End download
OPERAND USAGE:
_DM contains the available array space. For example, before any arrays have been defined, the
operand _DM will return 800. If an array of 100 elements is defined, the operand _DM will
return 700.
RELATED COMMANDS:
DA Deallocate Array
EXAMPLES:
DM Pets[5],Dogs[2],Cats[3] Define dimension of arrays, pets with 5 elements;
Dogs with 2 elements; Cats with 3 elements
DM Tests[600] Define dimension of array Tests with 600 elements
OPERAND USAGE:
_DPn contains the current position of the specified axis.
RELATED COMMANDS:
PF Position Formatting
EXAMPLES:
DP 0,100,200,400 Sets the current position of the A-axis to 0, the B-
axis to 100, the C-axis to 200, and the D-axis to 400
DP ,-50000 Sets the current position of B-axis to -50000. The
B,C and D axes remain unchanged.
DP ?,?,?,? Interrogate the position of A,B,C and D axis.
:0, -0050000, 200, 400 Returns all the motor positions
DP ? Interrogate the position of A axis
:0 Returns the A-axis motor position
Hint: The DP command is useful to redefine the absolute position. For example, you can manually
position the motor by hand using the Motor Off command, MO. Turn the stepper back on with SH and then
use DP0 to redefine the new position as your absolute zero.
OPERAND USAGE:
_DR contains the data record update rate.
RELATED COMMANDS:
QZ Sets format of data
QR Query a single data record
EXAMPLES:
:DR1000,0
:G x ~ P
_ ` @~ P
_ H `~ P
_ 0 ~ P
DR0
Note: The data record is in a binary, non-printable format (the output above is normal)
EXAMPLES:
RELATED COMMANDS:
EB Enable ECAM
EC Set ECAM table index
EG Engage ECAM
EM Specify ECAM cycle
EP Specify ECAM table intervals & staring point
EQ Disengage ECAM
ET ECAM table
EXAMPLES:
EAB Select B as a master for ECAM
OPERAND USAGE:
_EB contains the state of Ecam mode. 0 = disabled, 1 = enabled
RELATED COMMANDS:
EA Choose ECAM master
EC Set ECAM table index
EG Engage ECAM
EM Specify ECAM cycle
EP Specify ECAM table intervals & staring point
EQ Disengage ECAM
ET ECAM table
EXAMPLES:
EB1 Starts ECAM mode
EB0 Stops ECAM mode
B = _EB Return status of cam mode
OPERAND USAGE:
_EC contains the current value of the index into the ECAM table.
RELATED COMMANDS:
EA Choose ECAM master
EB Enable ECAM
EG Engage ECAM
EM Specify ECAM cycle
EP Specify ECAM table intervals & staring point
EQ Disengage ECAM
ET ECAM table
EXAMPLES:
EC0 Set ECAM index to 0
ET 200,400 Set first ECAM table entries to 200,400
ET 400,800 Set second ECAM table entries to 400,800
Hint: Remember to quit the Edit Mode prior to executing or listing a program.
OPERAND USAGE:
_EGn contains ECAM status for specified axis. 0 = axis is not engaged, 1 = axis is engaged.
RELATED COMMANDS:
EA Choose ECAM master
EB Enable ECAM
EC Set ECAM table index
EM Specify ECAM cycle
EP Specify ECAM table intervals & staring point
EQ Disengage ECAM
ET ECAM table
EXAMPLES:
EG 700,1300 Engages the A and B axes at the master position 700 and
1300 respectively.
B = _EGB Return the status of B axis, 1 if engaged
Note: This command is not a trippoint. This command will not hold the execution of the program flow. If
the execution needs to be held until master position is reached, use MF or MR command.
RELATED COMMANDS:
ENDIF End of IF conditional Statement
EXAMPLES:
#A
IF (@IN[1]=0) ;'IF conditional statement based on
;'input 1
IF (@IN[2]=0) ;'2nd IF conditional statement
;'executed if 1st IF conditional true
MG "INPUT 1 AND INPUT 2 ARE ACTIVE" ;'Message to be executed if 2nd IF
;'conditional is true
ELSE ;'ELSE command for 2nd IF conditional
;'statement
MG "ONLY INPUT 1 IS ACTIVE" ;'Message to be executed if 2nd IF
;'conditional is false
ENDIF ;'End of 2nd conditional statement
ELSE ;'ELSE command for 1st IF conditional
;'statement
MG "ONLY INPUT 2 IS ACTIVE" ;'Message to be executed if 1st IF
;'conditional statement is false
ENDIF ;'End of 1st conditional statement
EN
OPERAND USAGE:
_EMn contains the cycle of the specified axis.
RELATED COMMANDS:
EA Choose ECAM master
EB Enable ECAM
EC Set ECAM table index
EG Engage ECAM
EP Specify ECAM table intervals & staring point
EQ Disengage ECAM
ET ECAM table
EXAMPLES:
EAC Select C axis as master for ECAM.
EM 0,3000,2000 Define the changes in A and B to be 0 and 3000
respectively. Define master cycle as 2000.
V = _EMA Return cycle of A
RELATED COMMANDS:
RE Return from error subroutine
RI Return from interrupt subroutine
EXAMPLES:
#A ;'Program A
PR 500 ;'Move A axis forward 500 counts
BGA ;'Begin motion
AMA ;'Pause the program until the A axis completes the motion
EN ;'End of Program
Note: Instead of EN, use the RE command to end the error subroutine and limit subroutine. Use the RI
command to end the input interrupt subroutine
RELATED COMMANDS:
IF Command to begin IF conditional statement
ELSE Optional command to be used only after IF command
JP Jump command
JS Jump to subroutine command
EXAMPLES:
#A
IF (@IN[1]=0) ;'IF conditional statement based on
;'input 1
IF (@IN[2]=0) ;'2nd IF conditional statement
;'executed if 1st IF conditional true
MG "INPUT 1 AND INPUT 2 ARE ACTIVE" ;'Message to be executed if 2nd IF
;'conditional is true
ELSE ;'ELSE command for 2nd IF conditional
;'statement
MG "ONLY INPUT 1 IS ACTIVE" ;'Message to be executed if 2nd IF
;'conditional is false
ENDIF ;'End of 2nd conditional statement
ELSE ;'ELSE command for 1st IF conditional
;'statement
MG "ONLY INPUT 2 IS ACTIVE" ;'Message to be executed if 1st IF
;'conditional statement is false
ENDIF ;'End of 1st conditional statement
EN
EXAMPLES:
EO 0 Turns echo off
EO 1 Turns echo on
OPERAND USAGE:
_EP contains the value of the interval m.
RELATED COMMANDS:
EA Choose ECAM master
EB Enable ECAM
EC Set ECAM table index
EG Engage ECAM
EM Specify ECAM cycle
EQ Disengage ECAM
ET ECAM table
EXAMPLES:
EP 20,100 Sets the cam master points to 100,120,140 . . .
D = _EP Set the variable D equal to the ECAM internal valve
OPERAND USAGE:
_EQn contains 1 if engage command issued and axis is waiting to engage, 2 if disengage
command issued and axis is waiting to disengage, and 0 if ECAM engaged or disengaged.
RELATED COMMANDS:
EA Choose ECAM master
EB Enable ECAM
EC Set ECAM table index
EG Engage ECAM
EM Specify ECAM cycle
EP Specify ECAM table intervals & staring point
ET ECAM table
EXAMPLES:
EQ 300,700 Disengages the A and B motors at master positions 300
and 700 respectively.
Note: This command is not a trippoint. This command will not hold the execution of the program flow. If
the execution needs to be held until master position is reached, use MF or MR command.
RELATED COMMANDS:
VM Vector Mode
CR Circle move
VP Vector position
EXAMPLES:
VMAB;ES3,4 Divide B resolution by 4/3
VMCA;ES2,3 Divide A resolution by 3/2
VMAC; ES3,2 Divide A Resolution by 3/2
RELATED COMMANDS:
EA Choose ECAM master
EB Enable ECAM
EC Set ECAM table index
EG Engage ECAM
EM Specify ECAM cycle
EP Specify ECAM table intervals & staring point
EQ Disengage ECAM
EXAMPLES:
ET[0]=0,,0 Specifies the position of the slave axes A and C to be
synchronized with the starting point of the master.
ET[1]=1200,,400 Specifies the position of the slave axes A and C to be
synchronized with the second point of the master
EC0 Set the table index value to 0, the first element in the
table
ET 0,,0 Specifies the position of the slave axes A and C to be
synchronized with the starting point of the master.
ET 1200,,400 Specifies the position of the slave axes A and C to be
synchronized with the second point of the master
OPERAND USAGE:
_EW0 contains m1, the index of the first widened segment.
_EW1 contains n1, the length of the first widened segment.
_EW2 contains m2, the index of the second widened segment
_EW3 contains n2, the length of the second widened segment.
RELATED COMMANDS:
EP ECAM master positions
EA Choose ECAM master
EB Enable ECAM
EC Set ECAM table index
EG Engage ECAM Slave
EM Specify ECAM cycle
EQ Disengage ECAM Slave
ET ECAM table
EXAMPLES:
EW 41=688 :’Widen segment 41 to 688 master counts
EW 41=688, 124=688 :’Widen segments 41 and 124 to 688 master counts
OPERAND USAGE:
_EY returns the current cycle count
RELATED COMMANDS:
EM ECAM modulus
EXAMPLES:
MG _EY * _EMY + _TPY print absolute position of master (Y)
RELATED COMMANDS:
FI Find Index
HM Home
BG Begin
AC Acceleration Rate
DC Deceleration Rate
SP Speed for search
EXAMPLES:
FE Set find edge mode
BG Begin all axes
FEA Only find edge on A
BGA
FEB Only find edge on B
BGB
FECD Find edge on C and D
BGCD
Hint: Find Edge only searches for a change in state on the Home Input. Use FI (Find Index) to search for
the encoder index. Use HM (Home) to search for both the Home input and the Index. Remember to specify
BG after each of these commands.
RELATED COMMANDS:
FE Find Edge
HM Home
BG Begin
AC Acceleration Rate
DC Deceleration Rate
SP Search Speed
EXAMPLES:
#HOME ;'Home Routine
JG 500 ;'Set speed and forward direction
FIA ;'Find index
BGA ;'Begin motion
AMA ;'After motion
MG "FOUND INDEX"
EN
Hint: Find Index only searches for a change in state on the Index. Use FE to search for the Home. Use
HM (Home) to search for both the Home input and the Index. Remember to specify BG after each of these
commands.
OPERAND USAGE:
_FLn contains the value of the forward software limit for the specified axis.
RELATED COMMANDS:
BL Reverse Limit
PF Position Formatting
EXAMPLES:
FL 150000 Set forward limit to 150000 counts on the A-axis
Hint: Galil controllers also provide hardware limits. Both hardware or software limits will trigger the
#LIMSWI automatic subroutine if a program is running.
RELATED COMMANDS:
@INT[n] Integer part
EXAMPLES:
:MG @FRAC[1.2]
0.2000
:MG @FRAC[-2.4]
-0.4000
:
RELATED COMMANDS:
GR Gear Ratio
GM Gantry Mode
EXAMPLES:
#GEAR ;'Gear program
GA ,A,PS ;'Specify A axis as master for B and vector motion
;'on PS as master for C
GR ,.5,-2.5 ;'Specify B and C ratios
JG 5000 ;'Specify master jog speed
BGA ;'Begin motion
WT 10000 ;'Wait 10000 msec
STA ;'Stop
AMA ;'Wait for motion to complete
EN ;'End Program
Hint: Using the command position as the master axis is useful for gantry applications. Using the vector
motion as master is useful in generating Helical motion.
OPERAND USAGE:
_GDn contains the distance the master axis will travel for the specified slave axis to fully engage,
disengage, or change ratios.
RELATED COMMANDS:
EXAMPLES:
#A
GA,X ;'Sets the X axis as the gearing master for the Y axis
GD,5000 ;'Set distance over which gearing is engaged to 5000 counts
;'of the master axis.
JG5000 ;'Set the X axis jog speed to 5000 cts/sec
BGX ;'Begin motion on the X axis
ASX ;'Wait until X axis reaches the set speed of 5000 counts/sec
GR,1 ;'Engage gearing on the Y axis with a ration of 1:1, the
;'distance to fully engage gearing will be 5000 counts of the
;'master axis
WT1000 ;'Wait 1 second
GR,3 ;'Set the gear ratio to three. The ratio will be changed
;'over the distance set by the GD command
WT1000 ;'Wait 1 second
GR,0 ;'Disengage the gearing between the Y axis slave and the
;'master. The gearing will be disengaged over the number of
;'counts of the master specified with the GD command above
EN ;'End program
OPERAND USAGE:
_GMn contains the state of gantry mode for the specified axis: 0 gantry mode disabled, 1 gantry
mode enabled
RELATED COMMANDS:
GR Gear Ratio
GA Gear Axes
EXAMPLES:
GM 1,1,1,1 Enable GM on all axes
GM 0 Disable GM on A-axis, other axes remain unchanged
GM ,,1,1 Enable GM on C-axis and D-axis, other axes remain unchanged
GM 1,0,1,0 Enable GM on A and C-axis, disable GM on B and D axis
Hint: The GM command is useful for driving heavy load on both sides (Gantry Style).
EXAMPLES:
#A
GAY ;'Sets the Y axis as the gearing master for the X axis.
;'This axis does not have to be under servo control. In
;'this example, the axis is connected to a conveyor
;'operating open loop.
GD1000 ;'Set the distance that the master will travel to 1000
;'counts before the gearing is fully engaged for the X
;'axis slave.
AI-1 ;'Wait for input 1 to go low. In this example, this
;'input is representing a sensor that senses an object
;'on a conveyor. This will trigger the controller to
;'begin gearing and synchronize the master and slave
;'axes together.
GR1 ;'Engage gearing between the master and slave
P1=_TPY ;'Sets the current Y axis position to variable P1. This
;'variable is used in the next command, because MF
;'requires an absolute position..
MF,(P1+1000) ;'Wait for the Y axis (master) to move forward 1000
;'encoder counts so the gearing engagement period is
;'complete. Then the phase difference can be adjusted
;'for. Note this example assumes forward motion.
IP_GPX ;'Increment the difference to bring the master/slave in
;'position sync from the point that the GR1 command was
;'issued.
EN ;'End Program
OPERAND USAGE:
_GRn contains the value of the gear ratio for the specified axis.
RELATED COMMANDS:
GA Master Axis
GM Gantry Mode
EXAMPLES:
#GEAR
MOB ;'Turn off servo to B motor
GAB,,B ;'Specify master axis as B
GR .25,,-5 ;'Specify A and C gear ratios
EN ;'End program
Now when the B motor is rotated by hand, the A will rotate at 1/4th the speed and C will rotate 5
times the speed in the opposite direction.
Hint: when the geared motors must be coupled "strongly" to the master, use the gantry mode GM.
USAGE: DEFAULTS:
While Moving No Default Value
In a Program Yes Default Format
Command Line Yes
Controller Usage ALL CONTROLLERS
OPERAND USAGE:
_HMn contains the state of the home switch for the specified axis
RELATED COMMANDS:
CN Configure Home
FI Find Index Only
FE Find Home Only
HV Homing velocity
EXAMPLES:
HM Set Homing Mode for all axes
BG Home all axes
BGA Home only the A-axis
BGB Home only the B-axis
BGC Home only the C-axis
BGD Home only the D-axis
Hint: You can create your own custom homing sequence by using the FE (Find Home Sensor only) and FI
(Find Index only) commands.
RELATED COMMANDS:
IH Internet Handle
EXAMPLES:
HSC=D Connection for handle C is assigned to handle D. Connection for
handle D is assigned to handle C.
HSS=B Executing handle connection is assigned to handle B. Connection
for handle B is assigned to executing handle.
OPERAND USAGE:
When used as an operand, _HXn contains the running status of thread n with:
0 Thread not running
1 Thread is running
2 Thread has stopped at trippoint
RELATED COMMANDS:
XQ Execute program
HX Stop all threads of motion
EXAMPLES:
XQ #A Execute program #A, thread zero
XQ #B,3 Execute program #B, thread three
HX0 Halt thread zero
HX3 Halt thread three
OPERAND USAGE:
_IA0 contains the IP address representing a 32 bit signed number (Two’s complement)
_IA1 contains the value for t (retry time)
_IA2 contains the number of available handles
_IA3 contains the number of the handle using this operand where the number is 0 to 5. 0
represents handle A, 1 handle B, etc.
_IA4 contains the number of the handle that lost communication last, contains A-1 on reset to
indicate no handles lost
_IA5 returns autonegotiation Ethernet speed. Returns 10 for 10-Base T and returns 100 for
100-Base T, it will return -1 if there is no physical link
RELATED COMMANDS:
IH Internet Handle
EXAMPLES:
IA 151,12,53,89 Assigns the controller with the address 151.12.53.89
IA 2534159705 Assigns the controller with the address 151.12.53.89
IA < 500 Sets the timeout value to 500msec
USAGE: DEFAULTS:
While Moving Yes Default Value -
In a Program Yes Default Format -
Command Line No
Controller Usage ALL CONTROLLERS
RELATED COMMANDS:
ELSE Optional command to be used only after IF command
ENDIF End of IF conditional Statement
EXAMPLES:
#A
IF (_TEA<1000) ;'IF conditional statement based on
;'A motor position
MG "Motor is within 1000 counts of zero" ;'Message to be executed if "IF"
;'conditional statement is true
ENDIF ;'End of IF conditional statement
EN ;'End Program
RELATED COMMANDS:
IA Internet Address
EXAMPLES:
IHA=251,29,51,1 Open handle A at IP address 251.29.51.1
IHA= -2095238399 Open handle A at IP address 251.29.51.1
Note: When the IH command is given, the controller initializes an ARP on the slave device before opening
a handle. This operation can cause a small time delay before the controller responds.
OPERAND USAGE:
_IK can not be used as an operand.
RELATED COMMANDS:
TH Tell Handles
IH Open new Ethernet handle
EXAMPLES:
IK1 Blocks undesirable port communication
IK0 Allows all Ethernet ports to be used
EXAMPLES:
Operator specifies length of material to be cut in inches and speed in inches/sec (2 pitch lead screw, 2000
counts/rev encoder).
#A ;'Program A
IN "Enter Speed(in/sec)",V1 ;'Prompt operator for speed
IN "Enter Length(in)",V2 ;'Prompt for length
V3=V1*4000 ;'Convert units to counts/sec
V4=V2*4000 ;'Convert units to counts
SP V3 ;'Speed command
PR V4 ;'Position command
BGA ;'Begin motion
AMA ;'Wait for motion complete
MG "MOVE DONE" ;'Print Message
EN ;'End Program
RELATED COMMANDS:
@AN[n] Read analog input
@OUT[n] Read digital output
SB Set digital output bit
CB Clear digital output bit
OF Set analog output offset
EXAMPLES:
MG @IN[1] print digital input 1
:1.0000
x = @IN[1] assign digital input 1 to a variable
x = ? query variable
:1.000
RELATED COMMANDS:
II Input interrupt
@IN[n] Read digital input
RI Return from interrupt
EXAMPLES:
#A
II1 ;' arm digital input 1
RELATED COMMANDS:
@FRAC[n] Fractional part
EXAMPLES:
:MG @INT[1.2]
1.0000
:MG @INT[-2.4]
-2.0000
:
RELATED COMMANDS:
PF Position Formatting
EXAMPLES:
IP 50 50 counts with set acceleration and speed
#CORRECT ;Label
AC 100000 ;Set acceleration
JG 10000;BGA ;Jog at 10000 counts/sec rate
WT 1000 ;Wait 1000 msec
IP 10 ;Move the motor 10 counts instantaneously
STA ;Stop Motion
AMA ;Wait for ST to complete
EN ;End Program
OPERAND USAGE:
_ITn contains the value of the independent time constant for the specified ‘n’ axis.
RELATED COMMANDS:
PR Position relative
PA Position absolute
JG Jog
VM Vector mode
LM Linear Interpolation Mode
EXAMPLES:
IT 0.8, 0.6, 0.9, 0.1 Set independent time constants for a,b,c,d axes
IT ? Return independent time constant for A-axis
:0.8
OPERAND USAGE:
_JGn contains the absolute value of the jog speed for the specified axis.
RELATED COMMANDS:
BG Begin
ST Stop
AC Acceleration
DC Deceleration
IP Increment Position
TV Tell Velocity
EXAMPLES:
JG 100,500,2000,5000 Set for jog mode with a slew speed of 100 counts/sec
for the A-axis, 500 counts/sec for the B-axis, 2000
counts/sec for the C-axis, and 5000 counts/sec for D-
axis.
BG Begin Motion
JG ,,-2000 Change the C-axis to slew in the negative direction at
-2000 counts/sec.
RELATED COMMANDS:
JS Jump to Subroutine
IF
6 If conditional statement
ELSE Else function for use with IF conditional statement
ENDIF End of IF conditional statement
EXAMPLES:
JP #POS1,V1<5 Jump to label #POS1 if variable V1 is less than 5
JP #A,V7*V8=0 Jump to #A if V7 times V8 equals 0
JP #B Jump to #B (no condition)
Hint: JP is similar to an IF, THEN command. Text to the right of the comma is the condition that must be
met for a jump to occur. The destination is the specified label before the comma.
RELATED COMMANDS:
EN End
EXAMPLES:
JS #SQUARE,V1<5 Jump to subroutine #SQUARE if V1 is less than 5
JS #LOOP,V1<>0 Jump to #LOOP if V1 is not equal to 0
JS #A Jump to subroutine #A (no condition)
OPERAND USAGE:
_KSn contains the value of the stepper motor smoothing constant for the specified axis.
RELATED COMMANDS:
MT Motor Type
EXAMPLES:
KS 2, 4 , 8 Specify a,b,c axes
KS 5 Specify a-axis only
KS ,,15 Specify c-axis only
RELATED COMMANDS:
LL List Labels
LS List Program
LV List Variable
EXAMPLES:
: LA
CA [10]
LA [5]
NY [25]
VA [17]
OPERAND USAGE:
_LCn contains the low current value.
RELATED COMMANDS:
MT Motor Type
EXAMPLES:
MTZ=2 Specify stepper mode for the z axis
LCZ=1 Specify low current mode for the z axis and disable immediately
OPERAND USAGE:
_LDn contains the current value
RELATED COMMANDS:
_LFX State of Forward limit
_LRX State of Reverse limit
SC Stop code
BL Backward soft limit
FL Forward soft limit
EXAMPLES:
LDX=1 Disable the forward limit switch on the X axis
OPERAND USAGE:
_LEn contains the total vector move length in steps.
RELATED COMMANDS:
LI Linear Distance
BG BGS - Begin Sequence
LM Linear Interpolation Mode
VS Vector Speed
VA Vector Acceleration
VD Vector Deceleration
PF Position Formatting
EXAMPLES:
CAS Specify S coordinated motion system
LM CD Specify linear interpolation mode for C and D axes
LI ,,100,200 Specify linear distance
LE End linear move
BGS Begin motion
* The term “active” refers to the condition when at least 1 ma of current is flowing through the
input circuitry. The input circuitry can be configured to sink or source current to become
active.
EXAMPLES:
MG _LFA Display the status of the A axis forward limit switch
RELATED COMMANDS:
LE Linear end
LM Linear Interpolation Mode
EXAMPLES:
LM ABC Specify linear interpolation mode
LI 1000,2000,3000 Specify distance
LE Last segment
BGS Begin sequence
RELATED COMMANDS:
_LFX State of Forward limit switch
_LRX State of Reverse limit switch
EXAMPLES:
#Main ;'print a message every second
MG "Main"
WT1000
JP#Main
EN
RELATED COMMANDS:
PW Password
ED Edit program
UL Upload program
LS List program
TR Trace program
EXAMPLES:
:PW test,test Set password to "test"
:^L^Ktest,1 Lock the program
:ED Attempt to edit program
?
:TC1
106 Privilege violation
:
RELATED COMMANDS:
List Arrays
LA
LS List Program
LV List Variables
EXAMPLES:
: LL
# FIVE=5
# FOUR=4
# ONE=1
# THREE=3
# TWO=2
OPERAND USAGE:
_LM contains the number of spaces available in the sequence buffer for the 'n' coordinate system.
RELATED COMMANDS:
LE Linear end
LI Linear Distance
VA Vector acceleration
VS Vector Speed
VD Vector deceleration
AV Vector distance
CS _CS - Sequence counter
EXAMPLES:
LM ABCD Specify linear interpolation mode
VS 10000; VA 100000;VD 1000000 Specify vector speed, acceleration and deceleration
LI 200,300,400,500 Specify linear distance
LE; BGS Last vector, then begin motion
* The term “active” refers to the condition when at least 1 ma of current is flowing through the
input circuitry. The input circuitry can be configured to sink or source current to become
active. See Chapter 3 in the User’s Manual for further details.
EXAMPLES:
MG _LRA Display the status of the A axis reverse limit switch
RELATED COMMANDS:
List Arrays
LA
LL List Labels
LV List Variables
EXAMPLES:
:LS #A,6 List program starting at #A through line 6
2 #A
3 PR 500
4 BGA
5 AM
6 WT 200
Hint: Remember to quit the Edit Mode <cntrl> Q prior to giving the LS command. (DOS)
RELATED COMMANDS:
List Arrays
LA
LS List Program
LL List Labels
EXAMPLES:
: LV
APPLE = 60.0000
BOY = 25.0000
ZEBRA = 37.0000
OPERAND USAGE:
_LZ contains the state of the LZ function. ‘0’ is disabled and ‘1’ is enabled.
EXAMPLES:
LZ 0 Disable the LZ function
TPA Interrogate the controller for current position of A axis
:0000021645.0000 Value returned by the controller
VAR1= Request value of variable “VAR1” (previously set to 10)
:0000000010.0000 Value of variable returned by controller
LZ1 Enable LZ function
TPA Interrogate the controller for current position of A axis
:21645.0000 Value returned by the controller
VAR1= Request value of variable “VAR1” (previously set to 10)
:10.0000 Value of variable returned by controller
Note: Port 502 must be used as the Modbus Ethernet handle. See the IH command for more info on how to
open a handle with a specific port number.
When used in stepper mode, the controller will hold up execution of the proceeding
commands until the controller has generated the same number of steps as specified in the
commanded position. The actual number of steps that have been generated can be
monitored by using the interrogation command TD. Note: The MC command is
recommended when operating with stepper motors since the generation of step pulses can
be delayed due to the stepper motor smoothing function, KS. In this case, the MC
command would only be satisfied after all steps are generated.
ARGUMENTS: MC nnnn where
n is A,B,C,D or any combination to specify the axis or axes
No argument specifies that motion on all axes is complete.
USAGE: DEFAULTS:
While Moving Yes Default Value -
In a Program Yes Default Format -
Command Line No
Controller Usage ALL CONTROLLERS
RELATED COMMANDS:
BG Begin
AM After Move
EXAMPLES:
#MOVE ;'Program MOVE
PR 2000,4000 ;'Independent Move on A and B axis
BG AB ;'Start the B-axis
MC AB ;'After the move is complete on T coordinate system,
MG "DONE"; TP ;'Print message
EN ;'End of Program
Hint: MC can be used to verify that the actual motion has been completed.
RELATED COMMANDS:
AR Trippoint for after Relative Distances
AP Trippoint for after Absolute Position
EXAMPLES:
#TEST ;'Program Test
DP0 ;'Define zero
JG 1000 ;'Jog mode (speed of 1000 counts/sec)
BG A ;'Begin move
MF 2000 ;'After passing the position 2000
V1=_TDA ;'Assign V1 A position
MG "Position is", V1 ;'Print Message
ST ;'Stop
EN ;'End of Program
Hint: The accuracy of the MF command is the number of counts that occur in 2*TM μsec. Multiply the
speed by 2*TM μsec to obtain the maximum error. MF tests for absolute position. The MF command can
also be used when the specified motor is driven independently by an external device.
EXAMPLES:
Case 1: Message command displays ASCII strings
MG "Good Morning" Displays the string
Case 2: Message command displays variables or arrays
MG "The Answer is", Total {F4.2} Displays the string with the content of variable 'Total'
in local format of 4 digits before and 2 digits after the decimal point.
Case 3: Message command sends any ASCII characters to the port.
MG {^13}, {^10}, {^48}, {^055} displays carriage return and the characters 0 and 7.
OPERAND USAGE:
_MOn contains the state of the motor for the specified axis.
RELATED COMMANDS:
SH Servo Here
EXAMPLES:
MO Turn off all motors
MOA Turn off the A motor. Leave the other motors unchanged
MOB Turn off the B motor. Leave the other motors unchanged
MOCA Turn off the C and A motors. Leave the other motors
unchanged
SH Turn all motors on
Bob=_MOA Sets Bob equal to the A-axis servo status
Bob= Return value of Bob. If 1, in motor off mode, If 0, in
servo mode
Hint: The MO command is useful for positioning the motors by hand. Turn them back on with the SH
command.
RELATED COMMANDS:
AR Trippoint for Relative Distances
AP Trippoint for after Absolute Position
EXAMPLES:
#TEST ;'Program Test
DP0 ;'Define zero
JG -1000 ;'Jog mode (speed of 1000 counts/sec)
BG A ;'Begin move
MF -3000 ;'After passing the position -3000
V1=_TPA ;'Assign V1 A position
MG "Position is", V1 ;'Print Message
ST ;'Stop
EN ;'End of Program
Hint: The accuracy of the MR command is the number of counts that occur in 2*TM μsec. Multiply the
speed by 2*TM μsec to obtain the maximum error. MR tests for absolute position. The MR command can
also be used when the specified motor is driven independently by an external device.
OPERAND USAGE:
_MTn contains the value of the motor type for the specified axis.
RELATED COMMANDS:
CE Configure encoder type
EXAMPLES:
MT 2,2,2,2
MT ?,? Interrogate motor type
V=_MTA Assign motor type to variable
OPERAND USAGE:
MW? contains the state of the Modbus Wait.
_MW contains returned function code
_MW1 contains returned error code
RELATED COMMANDS:
MB Modbus
EXAMPLES:
MW1 Enables Modbus Wait
SB1001 Set Bit 1 on Modbus Handle A
CB1001 Clear Bit 1 on Modbus Handle A
Hint: The MW command ensures that the command that was sent to the Modbus device was successfully
received before continuing program execution. This prevents the controller from sending multiple
commands to the same Modbus device before it has a chance to execute them.
OPERAND USAGE:
_NO returns a bit field indicating which threads are running. For example, 0 means no threads are
running, 1 means only thread 0 is running, 3 means threads 0 and 1 are running, and 15 means
all 4 threads are running).
EXAMPLES:
#A ;'Program A
NO ;'No Operation
NO This Program ;'No Operation
NO Does Absolutely ;'No Operation
NO Nothing ;'No Operation
EN ;'End of Program
EXAMPLES:
OB 1, POS=1 If POS 1 is non-zero, Bit 1 is high.
If POS 1 is zero, Bit 1 is low
OB 2, @IN[1]&@IN[2] If Input 1 and Input 2 are both high, then
Output 2 is set high
OB 3, COUNT[1] If the element 1 in the array is zero, clear bit 3
OB N, COUNT[1] If element 1 in the array is zero, clear bit N
OPERAND USAGE:
_OEn contains the status of the off on error function for the specified axis.
RELATED COMMANDS:
Abort
SH Servo Here
#POSERR Error Subroutine
#LIMSWI Limit switch automatic subroutine
EXAMPLES:
OE 1,1,1,1 Enable OE on all axes
OE 0 Disable OE on A-axis; other axes remain unchanged
OE ,,1,1 Enable OE on C-axis and D-axis; other axes remain unchanged
OE 1,0,1,0 Enable OE on A and C-axis; Disable OE on B and D axis
OPERAND USAGE:
_OP0 contains the value of the first argument, m
RELATED COMMANDS:
SB Set output bit
CB Clear output bit
EXAMPLES:
OP 0 Clear Output Port -- all bits
OP $05 Set outputs 1,3; clear the others
MG _OP0 Returns the first parameter "m"
RELATED COMMANDS:
@AN[n] Read analog input
@IN[n] Read digital input
SB Set digital output bit
CB Clear digital output bit
OF Set analog output offset
EXAMPLES:
MG @OUT[1] ;'print digital output 1
:1.0000
x = @OUT[1] ;'assign digital output 1 to a variable
OPERAND USAGE:
_PAn contains the last commanded position at which motion stopped.
RELATED COMMANDS:
PR Position relative
SP Speed
AC Acceleration
DC Deceleration
BG Begin
PF Position Formatting
EXAMPLES:
PA 400,-600,500,200 A-axis will go to 400 counts B-axis will go to –600
counts C-axis will go to 500 counts D-axis will go to
200 counts
BG;AM Execute Motion and Wait for Motion Complete
PA ?,?,?,? Returns the current commanded position after motion has
completed
:400, -600, 500, 200
BG Start the move
PA 700 A-axis will go to 700 on the next move while the
BG B,C and D-axis will travel the previously set relative
distance if the preceding move was a PR move, or will
not move if the preceding move was a PA move.
OPERAND USAGE:
_PF contains the value of the position format parameter.
EXAMPLES:
TPX Tell position of X
:0 Default format
PF 5.2 Change format to 5 digits of integers and 2 of fractions
TPX Tell Position
:21.00
PF-5.2 New format. Change format to hexadecimal
TPX Tell Position
:$00015.00 Report in hex
RELATED COMMANDS:
P1CH Serial port 1 character
Serial port1 number
P1NM Serial port 1 string
CI Configure #COMINT
EXAMPLES:
:MG "TEST" {P1} ;'send a message to the hand terminal
:MG P1CD ;'no characters entered on hand terminal
0.0000
:MG P1CD ;'the number 6 was pushed on the hand terminal
1.0000
:MG P1CD ;'enter key pushed on hand terminal
3.0000
:MG P1CD ;'the character B was pushed (shift f2) then enter
2.0000
RELATED COMMANDS:
P1CD Serial port1 code
P1NM Serial port1 number
P1ST Serial port 1 string
CI Configure #COMINT
RELATED COMMANDS:
P1CD Serial port 1 code
P1CH Serial port1 character
P1ST Serial port 1 string
CI Configure #COMINT
RELATED COMMANDS:
P1CD Serial port 1 code
P1CH Serial port 1 character
P1NM Serial port 1 number
CI Configure #COMINT
RELATED COMMANDS:
OE Off an error
YA Step Drive Resolution
YB Step Motor Resolution
YE Encoder Resolution
YR Error Correction
YS Stepper Position Maintenance. Mode (SPM) Enable
Q5 Error Magnitude
EXAMPLES:
#A ;'"Dummy" program
JP #A
146 ●
#POSERR B140 Command Reference
PR
FUNCTION: Position Relative
DESCRIPTION:
The PR command sets the incremental distance and direction of the next move. The move is
referenced with respect to the current position. .
ARGUMENTS: PR n,n,n,n or PRA=n where
n is a signed integer in the range -2147483648 to 2147483647 decimal. Units are in encoder
counts
n=? Returns the current incremental distance for the specified axis.
USAGE: DEFAULTS:
While Moving No Default Value 0
In a Program Yes Default Format Position Format
Command Line Yes
Controller Usage ALL CONTROLLERS
OPERAND USAGE:
_PRn contains the current incremental distance for the specified axis.
RELATED COMMANDS:
PA Position Absolute
BG Begin
AC Acceleration
DC Deceleration
SP Speed
IP Increment Position
PF Position Formatting
EXAMPLES:
PR 100,200,300,400 On the next move the A-axis will go 100 counts,
BG the B-axis will go to 200 counts forward, C-axis will
go 300 counts and the D-axis will go 400 counts.
PR ?,?,? Return relative distances
:100, 200, 300
PR 500 Set the relative distance for the A axis to 500
BG The A-axis will go 500 counts on the next move while
the B-axis will go its previously set relative
distance.
RELATED COMMANDS:
PA Position Absolute
AC Acceleration
DC Deceleration
SP Speed
EXAMPLES:
#A
PT1,1,1,1 ;'Enable the position tracking mode for axes X, Y, Z, and W
#LOOP ;'Create label #LOOP in a program. This small program will
;'update the absolute position at 100 Hz. Note that the
;'user must update the variables V1, V2, V3 and V4 from the
;'host PC, or another thread operating on the controller.
PAV1,V2,V3,V4 ;'Command XYZW axes to move to absolute positions. Motion
;'begins when the command is processed. BG is not required
;'to begin motion in this mode. In this example, it is
;'assumed that the user is updating the variables at a
;'specified rate. The controller will update the new
;'target position every 10 milliseconds (WT10).
WT10 ;'Wait 10 milliseconds
JP#LOOP ;'Repeat by jumping back to label LOOP
Special Notes: The AM, and MC trip points are not valid in this mode. It is recommended to use MF and
MR as trip points with this command, as they allow the user to specify both the absolute position, and the
direction. The AP trip point may also be used.
USAGE: DEFAULTS:
While Moving Yes Default Value “” (null string)
In a Program No Default Format -
Command Line Yes
Controller Usage ALL CONTROLLERS
RELATED COMMANDS:
<control>L<control>K Lock/Unlock
ED Edit program
UL Upload program
LS List program
TR Trace program
EXAMPLES:
:PWtest,test Set password to "test"
:^L^K test,1 Lock the program
:ED Attempt to edit program
?
:TC1
106 Privilege violation
:
PWtest,test Set the password to "test"
RELATED COMMANDS:
QU Upload array
HINT:
Using Galil terminal software, the command can be used in the following manner:
1. Set the timeout to 0
2. Send the command QD
3a. Use the send file command to send the data file.
OR
3b. Enter data manually from the terminal. End the data entry with the character '\'
Note: The Galil windows terminal will not display the results of the QR command since the results are in
binary format.
OPERAND USAGE:
_QSn contains the error magnitude in drive step counts for the given axis.
RELATED COMMANDS:
YA Step Drive Resolution
YB Step Motor Resolution
YC Encoder Resolution
YR Error Correction
YS Stepper Position Maintenance Mode Enable, Status
EXAMPLES:
1. For Q microstepping drive, query the error of B axis:
:QSB=?
:253 This shows 253 step counts of error. The drive
resolution is 64 microsteps per full motor step, nearly
four full motor steps of error.
2. Query the value of all axes:
:QS
Response shows all axes error values
:0,253,0,0,0,0,0,0
Notes:
1. When QS exceeds three full motor steps of error, the YS command indicates the excessive
position error condition by changing to 2. This condition also executes the #POSERR
automatic subroutine if included in the runtime code.
2. The operand use of the QS command can be used in conjunction with the YR command to
correct for position error. See the YR command for more details.
RELATED COMMANDS:
QD Download array
RELATED COMMANDS:
DR Ethernet data record update rate
RELATED COMMANDS:
DM Dimension Array
RD Record Data
RC Record Interval
EXAMPLES:
#Record ;'Label
DM POS[100] ;'Define array
RA POS[] ;'Specify Record Mode
RD _TPA ;'Specify data type for record
RC 1 ;'Begin recording at 2 msec intervals
PR 1000;BG ;'Start motion
EN ;'End
Hint: The record array mode is useful for recording the real-time motor position during motion. The data
is automatically captured in the background and does not interrupt the program sequencer. The record
mode can also be used for a teach or learn of a motion path.
OPERAND USAGE:
_RC contains status of recording. ‘1’ if recording, ‘0’ if not recording.
RELATED COMMANDS:
DM Dimension Array
RD Record Data
QZ Record Array Mode
EXAMPLES:
#RECORD ;'Record
DM POS ;'Define Array
RA T800 ;'Specify Record Mode
RD POS ;'Specify Data Type
RC TDA ;'Begin recording and set 4 msec between records
JG 1000;BG ;'Begin motion
#A;JP #A,_RC=1 ;'Loop until done
MG "DONE RECORDING" ;'Print message
EN ;'End program
_TPn Position
_TDn Stepper Position
OPERAND USAGE:
_RD contains the address for the next array element for recording.
RELATED COMMANDS:
RA Record Array
RC Record Interval
DM Dimension Array
EXAMPLES:
DM ERRORA[50],ERRORB[50] Define array
RA ERRORA[],ERRORB[ ] Specify record mode
RD _TEA,_TEB Specify data type
RC1 Begin record
JG 1000;BG Begin motion
RELATED COMMANDS:
#POSERR Error Subroutine
#LIMSWI Limit Subroutine
EXAMPLES:
#A;JP #A;EN ;'Label for main program
#POSERR ;'Begin Error Handling Subroutine
MG "ERROR" ;'Print message
SB1 ;'Set output bit 1
RE ;'Return to main program and clear trippoint
NO (or ‘) should be used instead of REM unless speed or program space is an issue.
ARGUMENTS: REM n where
n is a text string comment
USAGE: DEFAULTS:
While Moving Yes Default Value -
In a Program Yes Default Format -
Command Line No
Controller Usage ALL
RELATED COMMANDS:
NO (‘ apostrophe also No operation (comment)
accepted)
EXAMPLES:
RELATED COMMANDS:
#ININT Input interrupt subroutine
II Enable input interrupts
EXAMPLES:
#A;II1;JP #A;EN ;'Program label
#ININT ;'Begin interrupt subroutine
MG "INPUT INTERRUPT" ;'Print Message
SB 1 ;'Set output line 1
RI 1 ;'Return to the main program and restore trippoint
The armed state of the latch can be configured using the CN command.
Note: The Latch Function works with the main encoder. When working with a stepper motor
without an encoder, the latch can be used to capture the stepper position. To do this,
place a wire from the controller Step (PWM) output into the main encoder input, channel
A+. Connect the Direction (sign) output into the channel B+ input. Configure the main
encoder for Step/Direction using the CE command. The latch will now capture the
stepper position based on the pulses generated by the controller.
ARGUMENTS: RL nnnnnn where
n is X,Y,Z,W,A,B,C,D, or any combination to specify the axis or axes
USAGE: DEFAULTS:
While Moving Yes Default Value 0
In a Program Yes Default Format Position Format
Command Line Yes
Controller Usage ALL CONTROLLERS
OPERAND USAGE:
_RLn contains the latched position of the specified axis.
RELATED COMMAND:
AL Arm Latch
EXAMPLES:
JG ,5000 Set up to jog the B-axis
BGB Begin jog
ALB Arm the B latch; assume that after about 2 seconds, input goes low
RLB Report the latch
:10000
FUNCTION: Round
DESCRIPTION:
Rounds the given number to the nearest integer
ARGUMENTS: @RND[n]
n is a signed number in the range -2147483648 to 2147483647.
USAGE: DEFAULTS:
While Moving Yes Default Value -
In a Program Yes Default Format -
Command Line Yes
Controller Usage ALL
RELATED COMMANDS:
@INT[n] Truncates to the nearest integer
EXAMPLES:
:MG @RND[1.2]
1.0000
:MG @RND[5.7]
6.0000
:MG @RND[-1.2]
-1.0000
:MG @RND[-5.7]
-6.0000
:MG @RND[5.5]
6.0000
:MG @RND[-5.5]
-5.0000
:
OPERAND USAGE:
_RPn contains the commanded reference position for the specified axis.
RELATED COMMAND:
TP Tell Position
EXAMPLES: Assume that ABC and D axes are commanded to be at the positions 200, -10, 0, -110
respectively. The returned units are in quadrature counts.
PF 7 Position format of 7
LZ0 Turn leading zeroes on
RP
0000200,-0000010,0000000,-0000110 Return A,B,C,D reference positions
RPA
0000200 Return the A motor reference position
RPB
-0000010 Return the B motor reference position
PF-6.0 Change to hex format
RP
$0000C8,$FFFFF6,$000000,$FFFF93 Return A,B,C,D in hex
Position =_RPA Assign the variable, Position, the value
of RPA
Hint: RP command is useful when operating step motors since it provides the commanded
position in steps when operating in stepper mode.
OPERAND USAGE:
_RS returns the state of the processor on its last power-up condition. The value returned is the
decimal equivalent of the 4 bit binary value shown below.
OPERAND USAGE:
_SAhn gives the value of the response to the command sent with an SA command. The h value
represents the handle A thru D and the n value represents the specific field returned from the
controller (0-3). If the specific field is not used, the operand will be –2^31.
RELATED COMMAND:
MG Display messages
IH
8 Opens handle
EXAMPLES:
#A
IHA=10,0,0,12 ;'Configures handle A to be connected to a controller with
;'the IP address 10.0.0.12
#B;JP#B,_IHA2<>-2 ;'Wait for connection
SAA="KI", 1, 2 ;'Sends the command to handle A (slave controller): KI 1,2
WT5
SAA="TE" ;'Sends the command to handle A (slave controller): TE
WT5
MG_SAA0 ;'Display the content of the operand_SAA (first response to
;'TE command)
: 132 --response from controller--
MG_SAA1 ;'Display the content of the operand_SAA (2nd response to TE
;'command)
: 12 --response from controller--
SAA="TEMP=",16 ;'Sets variable temp equal to 16 on handle A controller
EN ;'End Program
RELATED COMMAND
CB Clear Bit
EXAMPLES:
SB 4 Set output line 4
SB 1 Set output line 1
OPERAND USAGE:
_SCn contains the value of the stop code for the specified axis.
RELATED COMMANDS:
LCD Update
EXAMPLES:
Tom =_SCD Assign the Stop Code of D to variable Tom
EXAMPLES:
PR 10000 Specify position
AC 2000000 Specify acceleration rate
DC 1000000 Specify deceleration rate
SD 5000000 Specify Limit Switch Deceleration Rate
SP 5000 Specify slew speed
Note: The SD command may be changed during the move in JG move, but not in PR or PA move.
RELATED COMMANDS:
MO Motor-off
EXAMPLES:
SH Activate A,B,C,D motors
SHA Only activate the A motor, the B,C and D motors remain in
its previous state.
SHB Activate the B motor; leave the A,C and D motors
unchanged
SHC Activate the C motor; leave the A,B and D motors
unchanged
SHD Activate the D motor; leave the A,B and C motors
unchanged
Note: The SH command changes the coordinate system. Therefore, all position commands given prior to
SH, must be repeated. Otherwise, the controller produces incorrect motion.
FUNCTION: Sine
DESCRIPTION:
Returns the sine of the given angle in degrees
ARGUMENTS: @SIN[n] where
n is a signed number in degrees in the range of -32768 to 32767, with a fractional resolution of 16-
bit..
USAGE: DEFAULTS:
While Moving Yes Default Value -
In a Program Yes Default Format -
Command Line Yes
Controller Usage ALL
RELATED COMMANDS:
@ASIN[n] Arc sine
@COS[n] Cosine
@ATAN[n] Arc tangent
@ACOS[n] Arc cosine
@TAN[n] Tangent
EXAMPLES:
:MG @SIN[0]
0.0000
:MG @SIN[90]
1.0000
:MG @SIN[180]
0.0000
:MG @SIN[270]
-1.0000
:MG @SIN[360]
0.0000
:
RELATED COMMANDS:
BK Breakpoint
TR Trace
EXAMPLES:
BK 3 Pause at line 3 (the 4th line) in thread 0
BK 5 Continue to line 5
SL Execute the next line
SL 3 Execute the next 3 lines
BK Resume normal execution
OPERAND USAGE:
_SM0 contains the subnet mask representing a 32 bit signed number (Two’s complement)
RELATED COMMANDS:
IH Internet Handle
IA IP address
EXAMPLES:
SM 255, 255, 255, 255 Ignore all incoming Ethernet packets
SM 0, 0, 0, 0 Process all incoming Ethernet packets
OPERAND USAGE:
_SPn contains the speed for the specified axis.
RELATED COMMANDS:
AC Acceleration
DC Deceleration
PA Position Absolute
PR Position Relative
BG Begin
EXAMPLES:
PR 2000,3000,4000,5000 Specify a,b,c,d parameter
SP 5000,6000,7000,8000 Specify a,b,c,d speeds
BG Begin motion of all axes
Note: For vector moves, use the vector speed command (VS) to change the speed. SP is not a "mode" of
motion like JOG (JG).
RELATED COMMANDS:
@ABS[n] Absolute value
EXAMPLES:
:MG @SQR[2]
1.4142
:MG @SQR[-2]
1.4142
:
RELATED COMMANDS:
BG Begin Motion
DC Deceleration rate
EXAMPLES:
ST A Stop A-axis motion
ST S Stop coordinated sequence
ST ABCD Stop A,B,C,D motion
ST Stop ABCD motion
ST SCD Stop coordinated AB sequence, and C and D motion
Hint: Use the after motion complete command, AM, to wait for motion to be stopped.
RELATED COMMANDS:
@ASIN[n] Arc sine
@COS[n] Cosine
@ATAN[n] Arc tangent
@ACOS[n] Arc cosine
@SIN[n] Sine
EXAMPLES:
:MG @TAN[-90]
-2147483647.0000
:MG @TAN[0]
0.0000
:MG @TAN[90]
2147483647.0000
:
BIT STATUS
Bit 7 Executing application program
Bit 6 N/A
Bit 5 Contouring
Bit 4 Executing error or limit switch routine
Bit 3 Input interrupt enabled
Bit 2 Executing input interrupt routine
Bit 1 N/A
Bit 0 Echo on
ARGUMENTS:
TB ? returns the status byte
USAGE: DEFAULTS:
While Moving Yes Default Value -
In a Program Yes Default Format 3.0
Command Line Yes
Controller Usage ALL CONTROLLERS
OPERAND USAGE:
_TB Contains the status byte
EXAMPLES:
TB?
:65 Data Record Active and Echo is on (26 + 20 = 64 + 1 = 65)
USAGE: DEFAULTS:
While Moving Yes Default Value ---
In a Program Yes Default Format 3.0
Not in a Program Yes
Controller Usage ALL CONTROLLERS
USAGE:
_TC contains the error code
EXAMPLES:
GF32 Bad command
:? Tell error code
TC
:001 Unrecognized command
This error means that the client on handle A did not respond with a TCP acknowledgement (for
example because the Ethernet cable was disconnected). Handle A is closed in this case.
#TCPERR allows the application programmer to run code (for example to reestablish the
connection) when error 123 occurs.
USAGE:
While Moving Yes
In a Program Yes
Command Line No
Controller Usage B140
RELATED COMMANDS:
TC Tell error code
_IA4 Last dropped handle
MG Print message
SA Send ASCII command via Ethernet
EXAMPLES:
#L
MG {EA} "L"
WT1000
JP#L
#TCPERR
MG {P1} "TCPERR. Dropped handle", _IA4
RE
OPERAND USAGE:
_TDn contains value of dual encoder register.
RELATED COMMANDS:
DE Define Encoder Position
EXAMPLES:
TD Return A,B,C,D Stepper Positions
:200, -10, 0, -110
TDA Return the A Stepper Position
:200
DStep=_TDA Assign the variable, Step, the value of TDA
RELATED COMMANDS:
IH Internet Handle
WH Which Handle
EXAMPLES:
:TH ;'Tell current handle configuration
CONTROLLER IP ADDRESS 10,51,0,87 ETHERNET ADDRESS 00-50-4C-08-01-1F
IHA TCP PORT 1050 TO IP ADDRESS 10,51,0,89 PORT 1000
IHB TCP PORT 1061 TO IP ADDRESS 10,51,0,89 PORT 1001
IHC TCP PORT 1012 TO IP ADDRESS 10,51,0,93 PORT 1002
IHD TCP PORT 1023 TO IP ADDRESS 10,51,0,93 PORT 1003
USAGE: DEFAULTS:
While Moving Yes Default Value -
In a Program Yes Default Format 3.0
Command Line Yes
Controller Usage ALL CONTROLLERS
OPERAND USAGE:
_TIn contains the status byte of the input block specified by ‘n’. Note that the operand can be
masked to return only specified bit information.
EXAMPLES:
TI
:08 Input 4 is high, others low
TI
:00 All inputs low
Input =_TI Sets the variable, Input, with the TI value
TI
:255 All inputs high
OPERAND USAGE:
_TM contains the value of the sample time.
EXAMPLES:
TM -1000 Turn off internal clock
TM 2000 Set sample rate to 2000 msec
TM 1000 Return to default sample rate
OPERAND USAGE:
_TN contains the first position value for the tangent axis. This allows the user to correctly
position the tangent axis before the motion begins.
RELATED COMMANDS:
VM Vector mode
CR Circle Command
EXAMPLES:
VM A,B,C Specify coordinated mode for A and B-axis; C-axis is
tangent to the motion path
TN 100,50 Specify scale factor as 100 counts/degree and 50 counts
at which tangent angle is zero
VP 1000,2000 Specify vector position A,B
VE End Vector
BGS Begin coordinated motion with tangent axis
OPERAND USAGE:
_TPx contains the current position value for the specified axis.
RELATED COMMANDS:
PF Position Formatting
EXAMPLES:
Assume the A-axis is at the position 200 (decimal), the B-axis is at the position -10 (decimal), the
C-axis is at position 0, and the D-axis is at -110 (decimal). The returned parameter units are
in quadrature counts.
TP Return A,B,C,D positions
:200,-10,0,-110
TPA Return the A motor position
:200
TPB Return the B motor position
:-10
PF-6.0 Change to hex format
TP Return A,B,C,D in hex
:$0000C8,$FFFFF6,$000000,$FFFF93
Position =_TPA Assign the variable, Position, the value of
TPA
RELATED COMMANDS:
CW Set/clear most significant bit
EXAMPLES:
:ED ;’define a small looping program
0 #L
1 WT1000
2 JP#L
3
<control>q
2 JP#L
0 #L
1 WT1000
TR0 ;’turn the trace off
Note: For active high or active low configuration (CN command), the limit switch bits are '1'
when the switch is inactive and '0' when active.
ARGUMENTS: TS nnnnnn where
n is A,B,C,D, or any combination to specify the axis or axes
No argument will provide the status for all axes
USAGE: DEFAULTS:
While Moving Yes Default Value -
In a Program Yes Default Format 3.0
Command Line Yes
Controller Usage ALL CONTROLLERS
OPERAND USAGE:
_TS contains the current status of the switches.
EXAMPLES:
V1=_TSB Assigns value of TSB to the variable V1
V1= Interrogate value of variable V1
:15 Decimal value corresponding to bit pattern 00001111
Y axis not in motion (bit 7 - has a value of 0)
Y axis error limit not exceeded (bit 6 has a value of 0)
Y axis motor is on (bit 5 has a value of 0)
Y axis forward limit is inactive (bit 3 has a value of 1)
Y axis reverse limit is inactive (bit 2 has a value of 1)
Y axis home switch is high (bit 1 has a value of 1)
Y axis latch is not armed (bit 0 has a value of 1)
OPERAND USAGE:
_TVn contains the value of the velocity for the specified axis.
EXAMPLES:
VELA=_TVA Assigns value of A-axis velocity to the variable VELA
TVA Returns the A-axis velocity
:3420
Note: The TV command is computed using a special averaging filter (over approximately 0.25 sec for
TM1000). Therefore, TV will return average velocity, not instantaneous velocity.
OPERAND USAGE:
When used as an operand, _UL gives the number of available variables. The number of available
variables is 126.
RELATED COMMAND:
DL Download
EXAMPLES:
UL; Begin upload
#A Line 0
NO This is an Example Line 1
NO Program Line 2
EN Line 3
<cntrl>Z Terminator
OPERAND USAGE:
_VAx contains the value of the vector acceleration for the specified axis.
RELATED COMMANDS:
VS Vector Speed
VP Vector Position
VE End Vector
CR Circle
VM Vector Mode
BG Begin Sequence
VD Vector Deceleration
IT Smoothing constant - S-curve
EXAMPLES:
VA 1024 Set vector acceleration to 1024 counts/sec2
VA ? Return vector acceleration
:1024
VA 20000 Set vector acceleration
VA ?
:19456 Return vector acceleration
ACCEL=_VA Assign variable, ACCEL, the value of VA
USAGE: DEFAULTS:
While Moving No Default Value 256000
In a Program Yes Default Format 10.0
Command Line Yes
Controller Usage ALL CONTROLLERS
OPERAND USAGE:
_VDn contains the value of the vector deceleration.
RELATED COMMANDS:
VA Vector Acceleration
VS Vector Speed
VP Vector Position
CR Circle
VE Vector End
VM Vector Mode
BG Begin Sequence
IT Smoothing constant - S-curve
EXAMPLES:
#VECTOR ;'Vector Program Label
VMAB ;'Specify plane of motion
VA1000000 ;'Vector Acceleration
VD 5000000 ;'Vector Deceleration
VS 2000 ;'Vector Speed
VP 10000, 20000 ;'Vector Position
VE ;'End Vector
BGS ;'Begin Sequence
AMS ;'Wait for Vector sequence to complete
EN ;'End Program
OPERAND USAGE:
_VEn contains the length of the vector in counts for the specified coordinate system, S or T.
RELATED COMMANDS:
VM Vector Mode
VS Vector Speed
VA Vector Acceleration
VD Vector Deceleration
CR Circle
VP Vector Position
BG Begin Sequence
CS Clear Sequence
EXAMPLES:
#A ;'Program Label
VM AB ;'Vector move in AB
VP 1000,2000 ;'Linear segment
CR 0,90,180 ;'Arc segment
VP 0,0 ;'Linear segment
VE ;'End sequence
BGS ;'Begin motion
AMS ;'Wait for VE to execute in buffer
EN ;'End program
OPERAND USAGE:
_VF contains the value of the format for variables and arrays.
RELATED COMMANDS:
PF Position Format
EXAMPLES:
VF 5.3 Sets 5 digits of integers and 3 digits after the decimal point
VF 8.0 Sets 8 digits of integers and no fractions
VF -4.0 Specify hexadecimal format with 4 bytes to the left of the decimal
OPERAND USAGE:
_VMn contains instantaneous commanded vector velocity for the specified coordinate system, S
RELATED COMMANDS:
VP Vector Position
CR Circle
VE End Vector Sequence
CS Clear Sequence
IT Vector smoothing constant -- S-curve
AV Trippoint for Vector distance
EXAMPLES:
#A ;'Program Label
VM AB ;'Vector move in AB
VP 1000,2000 ;'Linear segment
VE ;'End sequence
BGS ;'Begin motion
AMS ;'Wait for vector motion to complete
EN ;'End program
OPERAND USAGE:
_VPn contains the absolute coordinate of the axes at the last intersection along the sequence. For
example, during the first motion segment, this instruction returns the coordinate at the start of
the sequence. The use as an operand is valid in the linear mode, LM, and in the Vector mode,
VM.
RELATED COMMANDS:
VM Vector Mode
VE Vector End
BG Begin Sequence
IT Vector smoothing
EXAMPLES:
#A ;'Program Label
VM AB ;'Specify motion plane
VP 1000,2000 ;'Specify vector position 1000,2000
VP 2000,4000 ;'Specify vector position 2000,4000
CR 1000,0,360 ;'Specify arc
VE ;'Vector end
BGS ;'Begin motion sequence
AMS ;'Wait for vector motion to complete
EN ;'End Program
Hint: The first vector in a coordinated motion sequence defines the origin for that sequence. All other
vectors in the sequence are defined by their endpoints with respect to the start of the move sequence.
Note: VR is useful for feed rate override, particularly when specifying the speed of individual segments
using the operator ‘<’ and '>'.
OPERAND USAGE:
_VSn contains the vector speed of the specified coordinate system, S
RELATED COMMANDS:
VA Vector Acceleration
VP Vector Position
CR Circle
LM Linear Interpolation
VM Vector Mode
BG Begin Sequence
VE Vector End
EXAMPLES:
VS 2000 Define vector speed of S coordinate system
VS ? Return vector speed of S coordinate system
:2000
Hint: Vector speed can be attached to individual vector segments. For more information, see description
of VP, CR, and LI commands.
OPERAND USAGE:
_VVn contains the vector speed variable of the specified coordinate system (n= S)
RELATED COMMANDS:
VA Vector Acceleration
VD Vector Deceleration
VP Vector Position Segment
CR Circular Interpolation Segment
LI Linear Interpolation Segment
VM Vector Mode
LM Linear Interpolation Mode
EXAMPLES:
VVS= 20000 Define vector speed variable to 20000 for the S coordinate system
VP1000,2000<-1>100 Define vector speed variable for specific segment.
VVS=? ReturnsÆ 20000 <CRLF>: (as set above)
OPERAND USAGE:
_WH contains the numeric representation of the handle in which a command is executed. Handles
A through D are indicated by the value 0-3, while a-1 indicates the serial port.
RELATED COMMANDS:
TH Tell Handle
EXAMPLES:
WH Request handle identification
:IHC Command executed in handle C
WH Request handle identification
:RS232 Command executed in RS232 port
EXAMPLES: Assume that 10 seconds after a move is over a relay must be closed.
#A ;'Program A
PR 50000 ;'Position relative move
BGA ;'Begin the move
AMA ;'After the move is over
WT 10000 ;'Wait 10 seconds
SB 0 ;'Turn on relay
EN ;'End Program
OPERAND USAGE:
_XQn contains the current line number of execution for thread n, and -1 if thread n is not running.
RELATED COMMANDS:
HX Halt execution
EXAMPLES:
XQ #APPLE,0 Start execution at label APPLE, thread zero
XQ #DATA,2 Start execution at label DATA, thread two
XQ 0 Start execution at line 0
Hint: Don't forget to quit the edit mode first before executing a program! (DOS)
OPERAND USAGE:
_YAn contains the resolution for the specified axis.
RELATED COMMANDS:
QS Error Magnitude
YS Stepper Position Maintenance Mode Enable, Status
YB Step Motor Resolution
YC Encoder Resolution
YR Error Correction
EXAMPLES:
1. Set the step drive resolution for the SDM-44140 Microstepping Drive:
YA 64,64,64,64
2. Query the D axis value:
MG_YAD
:64.0000 Response shows D axis step drive resolution
Notes:
1. This value must be the same as the step drive resolution for the axis. The error magnitude (QS) will
climb quickly causing a false error state if the assigned value differs from the actual.
USAGE: DEFAULTS:
While Moving No Default Value 200
In a Program Yes Default Format 1.4
Command Line Yes
OPERAND USAGE:
_YBn contains the stepmotor resolution for the specified axis.
RELATED COMMANDS:
QS Error Magnitude
YS Stepper Position Maintenance Mode Enable, Status
YA Step Drive Resolution
YC Encoder Resolution
YR Error Correction
EXAMPLES:
1. Set the step motor resolution of the A axis for a 1.8° step motor:
YBA=200
2. Query the A axis value:
YBA=?
:200 Response shows A axis step motor resolution
Notes:
1. This value must be the same as the step motor resolution for that axis. The error magnitude (QS) will
climb quickly causing a false error state if the assigned value differs from actual.
USAGE: DEFAULTS:
While Moving No Default Value 4000
In a Program Yes Default Format 1.4
Command Line Yes
OPERAND USAGE:
_YCn contains the encoder resolution for the specified axis.
RELATED COMMANDS:
QS Error Magnitude
YS Stepper Position Maintenance Mode Enable, Status
YA Step Drive Resolution
YB Step Motor Resolution
YR Error Correction
EXAMPLES:
1. Set the encoder resolution of the D axis for a 4000 count/rev encoder:
YC,,,4000
2. Query the D axis value:
YCD=?
:4000 Response shows D axis encoder resolution
Notes:
1. This value must be the same as the encoder resolution for that axis. The error magnitude (QS) will climb
quickly causing a false error state if the assigned value differs from actual.
USAGE: DEFAULTS:
While Moving No Default Value 0
In a Program Yes Default Format 1.4
Command Line Yes
OPERAND USAGE:
None
RELATED COMMANDS:
QS Error Magnitude
YA Step Drive Resolution
YB Step Motor Resolution
YR Error Correction
YS Stepper Position Maintenance Mode Enable, Status
EXAMPLES:
Notes:
1. The YR command issues an increment position move. The magnitude of AC, DC, SP, KS as well as axis
non-linearities will affect the accuracy of the correction. It is recommended to use a significant
KS value, as well as low AC, DC, and SP for corrections.
OPERAND USAGE:
_YSn contains the status of the mode for the specified axis.
RELATED COMMANDS:
QS Error Magnitude
YA Step Drive Resolution
YB Step Motor Resolution
YC Encoder Resolution
YR Error Correction
EXAMPLES:
1. Enable the mode:
YSH=1
2. Query the value:
YS*=?
:0,0,0,0,0,0,0,1 Response shows H axis is enabled
Notes:
1. Ensure the axis is energized and stable before enabling Stepper Position Maintenance mode. Error will
result from enabling YS and then energizing the axis.
2. Assigning a value of 1 to an axis after encountering an error condition will clear the trippoint and will also
clear QS.
3. A value of 2 is automatically assigned to YS when the position error exceeds three full motor steps. See the
QS command for more details.
OPERAND USAGE:
_ZAn contains the current value
RELATED COMMANDS:
DR Data record update rate
QZ Data record format
EXAMPLES:
#Thread
ZAX=MyVar ;'constantly update ZA
JP#Thread
OPERAND USAGE:
_ZSn contains the stack level for the specified thread where n = 0 to 7.
EXAMPLES:
#A ;'Main Program
II1 ;'Input Interrupt on 1
#B;JP #B;EN ;'Loop
#ININT ;'Input Interrupt
MG "INTERRUPT" ;'Print message
S=_ZS ;'Interrogate stack
S= ;'Print stack
ZS ;'Zero stack
S=_ZS ;'Interrogate stack
S= ;'Print stack
EN ;'End