Command Sets

Communication

ADDR=expression Set motor's serial communications address. Applies for both RS232 and RS485

BAUD (x)=y This allows for COM0 or COM1 to be changed, x is the channel (0 or 1) and y is baud rate

CADDR=expression Set CAN address, can be different from serial address, default is 63

CBAUD=expression Set CAN baud rate, default is 125000

CCHN (RS2,0) Close communication channel command

ECHO Must be used to insure all data received in one

motor will be echoed to next motor

ECHO_OFF Default, turn communication's echo off

GETCHR Get the next character from channel 0

GETCHR1 Get the next character from channel 1

LEN Number of characters in channel 0 buffer

LEN1 Number of characters in channel 1 buffer

RCADDR Reports CAN address

RCBAUD Reports CAN baud rate

RCHN (0) Report channel 0 error bits

RCHN (1) Report channel 1 error bits

SILENT Ignore print commands to channel 0 from user program

SILENT1 Ignore print commands to channel 1 from user program

SLEEP Ignore commands for channel 0 except the WAKE command

SLEEP1 Ignore commands for channel 1 except the WAKE command

STDOUT=0 Sets internal report commands to RS232 (default)

STDOUT=1 Sets internal report commands to RS485

TALK Enable prints for channel 0 from user program

TALK1 Enable prints for channel 1 from user program

WAKE Wake for channel 0

WAKE1 Wake for channel 1

Program Flow

CASE expression Switch case statement

Cconstant Subroutine label, e.g. C10 for subroutine 10, must have a RETURN for each C label

DEFAULT Default action for switch case statement

DITR (x) Individual interrupt disable where x is interrupt # 0-8

ELSEIF expression Used for IF statements to test another condition, if expression is true, then execute code

END End program execution

ENDIF End statement for IF code structures

ENDS Command for end of switch case statement

GOSUB (value) Call a subroutine, value up to 999

GOTO (value) Jump program execution to a label, value up to 999

IF expression Conditional Test, expression can be multiple math operations

ITR (x, status_wrd#, bit#, s ,label#) Interrupt setup

ITRD Global interrupt scanner disable

ITRE Global interrupt scanner enable

LOOP Loop command for while loops

PAUSE Pause program execution, used for interrupts

RESUME Resume program execution

RETURN Return from subroutine

RETURNI Return from interrupt

RUN Start program execution

RUN? Wait at this point for RUN command before pro gram starts to execute

STACK Reset the stack for GOSUB commands

SWITCH expression Switch case statement

TWAIT Wait for trajectory to complete, only used in pro gram

WAIT=expression Set wait time in milliseconds

WHILE expression

LOOP While loop format

I/O

EIGN (#) Assign a single I/O point as general use input

EIGN (W,0) Assign all local I/O as general use inputs

EIGN (W,0,12) Assign inputs 2 and 3 as general use inputs at once (disabling over-travel limits)

EIGN (W,0,m) Assign a masked word-sized set of local I/O as general use inputs at once

EILN Set port C (I/O-2) as negative over travel limit

EILP Set port D (I/O-3) as positive over travel limit

EIRE Set I/O 6 to capture external encoder's current value

EIRI Set I/O 6 to capture internal encoder's current value

EISM (6) Issue (G) when local input 6 goes low

EITR (x) Individual interrupt enable where x is interrupt # 0-7

EOBK (#) Configure a given output to control an external brake

IN (#) x=IN(#), assign the state of a specific I/O to a vari- able (x in this case)

IN (W,0) x=IN(W,0), assign the state of the first word of local I/O to the variable x

INA (A,#) x=INA(A,#), raw analog reading: 10 bit resolution spanned over signed 16 bit range

INA (V,#) x=INA(V,#), scaled voltage from supply of analog input value for a given I/O defined by #

INA (V1,#) x=INA(V1,#), scaled 0-5 VDC reading in millivolts directly, 3456 would be 3.456 VDC

OC (#) x=OC(#), individual output status, bit 1 if output is being driven

OC (W,#) x=OC(W,#), block output status, bit 1 if output is being driven

OF (#) x=OF(#), returns present fault state for I/O defined by #

OF (L,#) x=OF(W,#), returns bit mask fault latched for I/O points

OF (W,#) x=OF(W,#), returns bit mask of present faulted I/O points

OR (value) Reset output (turn off)

OS (value) Set output (turn on)

OUT(#)=expression If argument to the right of "=" is true, then set I/O defined by # on(1), else off(0)

Math

- Subtract

!| Bitwise exclusive OR

!= Not equal to

% Modulo (remainder) division

& Bitwise AND

* Multiply

/ Divide

^ Power limited to 4th power and below, integers only

| Bitwise inclusive OR

+ Add

< Less than

<= Less than or equal to

== Equal to

> Greater than

>= Greater than or equal to

ABS (value) Absolute Value

ACOS (value) Arc Cosine

ASIN (value) Arc Sine

COS (value) Cosine

FABS (value) Floating point absolute value

FSQRT (value) Floating point square root

RANDOM Random number variable, 2^31-1 unsigned

RRANDOM Report a random number, 2^31-1 unsigned

SIN (value) Sine

SQRT (value) Square Root

TAN (value) Tangent

TMR (x,t) Sets timer x for t milliseconds

Motion

ADT=expression Set the accel/decel at once for a move

Ai (0) Re-arms the index/trap register for rising edge for internal encoder

Ai (1) Re-arms the index/trap register for rising edge for external encoder

Aij

Aj (0) Re-arms the index/trap register for rising edge for internal encoder

Aj (1) Re-arms the index/trap register for rising edge for external encoder

Aji

AMPS=expression Current limit value. 0-1023

AT=expression Set the acceleration target for a move

ATAN (value) Arc Tangent

BREAK Break out of while loop

BRKENG Manually Engage the brake

BRKRLS Manually Release the brake

BRKSRV Brake Servo, engage the brake when the drive is not active (default)

BRKTRJ Brake Trajectory

CTR (0) Present value of internal encoder, same as PA command

CTR (1) Present value of external encoder

DEL=expression Set maximum allowable derivative error limit

DT=expression Set the deceleration target for a move

EL=expression Set maximum allowable following error limit

ENC1 Enable external encoder for servo

ENC0 Enable internal encoder for servo

F Set tuning values

G Go, initiates all buffered modes of operation

KA=expression Feed forward gain

KD=expression Derivative gain coefficient

KG=expression Gravity offset

KI=expression PID integral gain

KL=expression PID integral limit

KP=expression PID proportional gain

KS=expression Differential sample rate

KV=expression Velocity feed forward gain

MDB Enable TOB when in one of the 2 trapezoidal modes

MDE Set motor to enhanced trapezoidal mode commun tation by using encoder

MDS Set motor to sine mode commutation

MDT Set motor to trapezoidal mode communtation using hall sensors (default mode)

MFA (value) Accel over value master distance. Default is zero (off)

MFD (value) Decel over value master distance. Default is zero (off)

MFDIV=expression Assign Incoming counts Divisor

MFMUL=expression Assign Incoming counts Multiplier

MF0 Initiate and zero counter, but do not follow

MFR Calculate Mode Follow Ratio and prepare to follow

MFSLEW (value) Stay at slew for value distance, then decel

MFX Slow down based on MFD

MINV (0) Default, no invert, shaft rotates normally

MINV (0) Default motor commutation direction

MINV (1) Invert commutation, shaft rotates opposite direction

MINV (1) Invert motor commutation from default

MP Initiate Position Mode

MS0 Initiate and zero counter, but do not follow

MSR Calculate Mode Step Ratio and prepare to follow

MT Initiate Torque Mode (Open Loop)

MTB Enable mode torque brake

MV Initiate Velocity Mode

O=expression Set origin, set present position to some value

OFF Turn the amplifier off

OSH (value) Origin shift of position counter on the fly

PID1 Set default PID update rate

PID2 Set default PID/2 update rate

PID4 Set default PID/4 update rate

PID8 Set default PID/8 update rate

PML=expression Sets the position modulo limit wrap value

PMT=expression Set position modulo target

POD=expression Sets phase offset denominator

PON=expression Sets phase offset numerator

PRT=expression Set the relative target position

PT=expression Set the absolute target position

S Instantly stop motor

SLD Disable software travel limits

SLE Enable software travel limits

SLM (0) Make a soft limit only trigger the flag, but not cause a fault

SLM (1) Make s soft limit trigger the flag and cause a fault (default mode)

SLN=expression Set negative software travel limit

SLP=expression Set positive software travel limit

T=expression Set commanded torque while in MT mode

TH=expression Set maximum allowable thermal limit (degrees C)

THD=expression Sets the number of cycle delays before soft over current foldback

VT=expression Set the velocity target for a move

X Decelerate to a stop at present deceleration rate

Status

Ba Over current bit, status word 0, bit 4 status word 1, bit 3

Be Excessive position error, status word 0, bit 6

Bh Excessive temperature occurred, status word 0, bit 5

Bi (0) Rising Edge Capture on Encoder 0 (internal), status word 1, bit 2

Bi (1) Rising Edge Capture on Encoder 1 (external), status word 1, bit 6

Bj (0) Falling Edge Capture on Encoder 0 (internal),

Bj (1) Falling Edge Capture on Encoder 1 (external), status word 1, bit 7

Bk Main program checksum error, program is corrupt and cannot run, status word 2, bit 15

Bl Left (-) over travel limit, status word 0, bit 13

Bls Left (-) over travel software limit occurred, status word 1, bit 13

Bm Left (-) over travel limit active, status word 0, bit 15

Bms Left (-) over travel software limit active, status word 1, bit 15

Bo Motor is off, status word 0, bit 1

Bp Right (+) over travel limit active, status word 0, bit 14

Bps Right (+) over travel software limit active, status word 1, bit 14

Br Right (+) over travel limit, status word 0, bit 12

Brs Right (+) over travel software limit occurred, status word 1, bit 12

Bs Command Syntax error note, status word 2, bit 14

Bt Trajectory in progress, status word 0, bit 2

Bv Velocity limit, status word 0, bit 7

Bw Wrap around occurred, position wrapped through +/- 2^31, status word 3, bit 3

Bx (0) Hardware index input probe state for internal en coder, status word 1, bit 8

Bx (1) Hardware index input probe state for external en coder, status word 1, bit 9

CLK=expression Hardware clock variable

ERRC Get most recent command error code

ERRW Where/Who commanded most recent error

FSA (fault type #,fault mode #) FSA(0,0) is default, sets all types of faults to result in MTB

RAA Report actual accel/decel

RAC Report commanded accel/decel

RAT Report target acceleration

Ra Report value of variable 'a'

Rab[0] Report value of ab[0]

Raf[0] Report floating point value of af[0]

Ral[0] Report value of al[0]

Raw[0] Report value of aw[0]

REPTR Reports EEPROM pointer value

RCKS Report Checksum

RB (sw,b) Report status bit, b, from status word, sw

RCTR (0) Report present value of internal encoder

RCTR (1) Report present value of external encoder

RDEA Report actual derivative error

RDEL Report commanded derivative error limit

RDT Report target deceleration

REA Report actual following error

REL Report commanded following error limit

RI (0) Report where the rising edge of the internal index was detected

RI (1) Report where the rising edge of the external index was detected

RIN (#) Report the state of a I/O

RIN (value) Report state of Input

RIN (W,0) Report the first word of local I/O

RINA (A,#) Reports analog input value for a given I/O defined by RINA (V,#) Reports voltage level (scaled from supply) of analog input value for a given I/O defined by #

RINA(V1,#) Reports voltage level (scaled 0-5 VDC) of analog input value for a given I/O defined by #

RJ (0) Report where the falling edge of the internal index was detected

RJ(1) Report where the falling edge of the external index was detected

RMFDIV Report Divisor

RMFMUL Report Multiplier

RMODE Report mode of operation

RPA Report present actual position

RPC Report present commanded position (difference between present position and position error)

RPMA Report the current modulo counter

RPML Report position modulo limit

RPMT Report the most recent setting of PMT (position modulo target)

RPOD Report phase offset denominator

RPON Report phase offset numerator

RPRA Report actual relative position

RPRC Report commanded relative position

RPRT Report present relative target position

RPT Report present target position

RRES Report encoder resolution of motor

RSLN Report value of negative software limit

RSLP Report value of positive software limit

RSP Report sampling rate and firmware version

RSP1 Report firmware revision date

RTH Report maximum allowable thermal limit

RTMR (x) Report timer x (present time left in milliseconds)

RT Report commanded torque

RVC Report commanded velocity

RVT Report target velocity

RUIA Reports current (Amps=UIA/100)

RUJA Reports bus voltage (Volts=UJA/10)

RVA Report actual velocity

RW (value) Report status word

Z (sw,b) Clears/zeros status word bits

Za Reset over current bit

Ze Reset position error bit

Zh Reset over temperature bit

Zl Reset left(-) historical limit bit

Zls Reset left(-) software historical limit bit

Zr Reset right(+) historical limit bit

Zrs Reset right(+) software historical limit bit

Zs Reset syntax error bit

ZS Clear all errors, reset system latches to power up state

Zw Reset wraparound bit

Variable/Other

   

* Variable Commands

a=expression Variable, 32 bit signed integers, a-z, aa-zz, aaa-zzz, 78 total variables

ab[x]=expression Array variables, 8 bit byte arrays, x can be 0-200

af[x]=expression Floating point array variables, x can be 0-7

al[x]=expression Array variables, 32 bit long arrays, x can be 0-50

aw[x]=expression Array variables, 16 bit word arrays, x can be 0-100

EPTR=expression EEPROM pointer, non-volatile memory, use before VLD and VST commands

VLD (variable,quantity) Load values from EEPROM to variables starting at EPTR location

VST(variable,quantity) Store values to EEPROM from variables starting at EPTR location

* Other Commands

LOCKP Physically disable program (EEPROM) upload

UPLOAD Upload the program

OCHN (RS2,0,N,9600,1,8,C,1000) Default: (RS232,chan=0, no parity, 9600 baud,1 stopbit, 8 databits, command,1000 ms timeout)

PRINT ("Hello World",#13) Print command to say "Hello World", see print section for more detailed examples

PRINT1 ("Hello World",#13) Print command to say "Hello World" on channel 1, see print section for more detailed example