MCode LMM
MCode LMM
MCode LMM
Revision
Changes
05/02/2013
V1.00, 02.2013
Initial Release
01/10/2013
V1.00, 10.2013
04/07/2014
V1.00, 01.2014
Support for firmware release 5.007 - Added status marker for the read
voltage level (VT) command.
04/24/2014
V1.00, 04.2014
08/15/2014
V1.00, 08.2014
12/15/2014
V1.00, 12.2014
06/04/2015
V1.00, 06.2015
05/26/2016
V2.00, 05.2016
Added support for advanced math functions. Added support for the
Lexium Motion Module. Reorganized to optimize usability.
Important information
This manual is part of the product.
Carefully read this manual and observe all instructions.
Keep this manual for future reference.
Hand this manual and all other pertinent product documentation over to all
users of the product.
Carefully read and observe all safety instructions and the chapter Before
you begin - safety information.
Table of Contents
Table of Contents
Important information.............................................................................3
1.3
1.5
2 Safety.....................................................................................................2-1
V2.00, 05.2016
2.1
2.2
2.3
2.4
Command summary.............................................................................4-1
Command details..................................................................................5-1
3.1
3.2
Table of Contents
V2.00, 05.2016
5.1.12
5.1.13
5.1.14
5.1.15
5.1.16
5.1.17
5.1.18
5.1.19
5.1.20
5.1.21
5.1.22
5.1.23
5.1.24
5.1.25
5.1.26
5.1.27
5.1.28
5.1.29
5.1.30
5.1.31
5.1.32
5.1.33
5.1.34
5.1.35
5.1.36
5.1.37
5.1.38
5.1.39
5.1.40
5.1.41
5.1.42
5.1.43
5.1.44
5.1.45
5.1.46
5.1.47
5.1.48
5.1.49
5.1.50
5.1.51
5.1.52
5.1.53
5.1.54
5.1.55
5.1.56
5.1.57
5.1.58
5.1.59
5.1.60
5.1.61
5.1.62
5.1.63
5.1.64
5.1.65
5.1.66
5.1.67
5.1.68
ii
V2.00, 05.2016
Table of Contents
5.1.69
5.1.70
5.1.71
5.1.72
5.1.73
5.1.74
5.1.75
5.1.76
5.1.77
5.1.78
5.1.79
5.1.80
5.1.81
5.1.82
5.1.83
5.1.84
5.1.85
5.1.86
5.1.87
5.1.88
5.1.89
5.1.90
5.1.91
5.1.92
5.1.93
5.1.94
5.1.95
5.1.96
5.1.97
5.1.98
5.1.99
5.1.100
5.1.101
5.1.102
5.1.103
5.1.104
5.1.105
5.1.106
5.1.107
5.1.108
5.1.109
5.1.110
5.1.111
5.1.112
5.1.113
5.1.114
5.1.115
5.1.116
5.1.117
5.1.118
5.1.119
5.1.120
5.1.121
5.1.122
5.1.123
5.1.124
iii
Table of Contents
5.1.125
5.1.126
5.1.127
5.1.128
5.1.129
5.1.130
5.1.131
5.1.132
5.1.133
5.1.134
5.1.135
5.1.136
5.1.137
5.1.138
5.1.139
5.1.140
5.1.141
5.1.142
5.1.143
V2.00, 05.2016
5.2.1
5.2.2
5.2.3
5.2.4
5.2.5
5.2.6
5.2.7
5.2.8
5.2.9
5.2.10
5.2.11
5.2.12
5.2.13
5.2.14
5.2.15
5.2.16
5.2.17
5.2.18
5.2.19
5.2.20
5.2.21
iv
Supporting Software............................................................................6-1
Table of Contents
7.3
7.3.1
7.3.3
7.3.4
7.3.5
7.3.6
7.3.7
8 hMTechnology......................................................................................8-1
8.1
8.1.1
8.1.2
8.1.3
8.2
8.2.1
8.2.2
8.2.3
8.2.4
8.3
8.4
8.5
Sample programs.................................................................................9-1
9.1
9.2
9.3
9.4
9.5
9.6
9.7
9.8
9.9
9.10
9.11
10 Error codes.........................................................................................10-1
10.1 Lexium MDrive Error Codes................................................... 10-1
10.2 Lexium Motion Module Error Codes...................................... 10-4
V2.00, 05.2016
Index..................................................................................................................i
Table of Contents
V2.00, 05.2016
vi
Work steps
XX
Step 1
YY
XX
Step 2
If a response to a work step is indicated, this allows you to verify that the
work step has been performed correctly.
Unless otherwise stated, the individual steps must be performed in the
specified sequence.
Bulleted lists
Subitem for 2
Subitem for 2
Parameters
Units of measure
Draft V0.900.08.2011
Examples:
1.00 in (25.4 mm)
100 oz-in (70 N-cm)
Draft V0.900.08.2011
1 Introduction
INTRODUCTION
1.1
1.2
Lexium MCode/TCP is the Lexium MCode language adapted to communicate over Ethernet TCP/IP networks. The function and usage are identical as with Lexium MDrive Motion Control products with the exception
that the commands related to RS-422/485 communication and serial
party mode are disabled. Lexium MCode/TCP connects to TCP or UDP
port 503. Multidrop addressing is done using IPv4.
Uses an adaptation of Lexium MCode for use with the Lexium Motion
Module communicating via the UART. Functional differences are:
V2.00, 05.2016
Integrated Lexium MDrive Motion Control communicates over an RS422/485 serial interface.
1-1
1 Introduction
1.3
Documentation reference
The following users manuals are available for the Lexium MCode devices:
Product software manual describes the configuration and programming of the product.
1.4.1
Related documents
Lexium Software Suite
The Lexium Software Suite Manual documents the installation and use
of the programming tool for the Lexium Motion products and Ethernet
products.
Associated Ethernet protocols
The Lexium MDrive Ethernet TCP/IP products support multiple industrial
networking protocols:
Modbus/TCP
EtherNet/IP
Profinet IO
1.5
Product software
The Lexium Software Suite is the program used to commission, program and operate the Lexium Motion products. It may be downloaded
from the website at:
LEXIUM SOFTWARE SUITE
V2.00, 05.2016
Instructions for installation and use of this software may be found in the
Lexium Software Suite product manual.
1-2
2 Safety
2 SAFETY
2.1
Qualification of personnel
Only technicians who are familiar with and understand the contents
of this manual and the other relevant documentation are authorized
to work on and with this drive system. The technicians must be able
to detect potential dangers caused by setting parameters, changing parameter values and generally by the operation of mechanical,
electrical and electronic equipment.
The technicians must have sufficient technical training, knowledge
and experience to recognize and avoid dangers.
The technicians must be familiar with the relevant standards, regulations and safety regulations observed when working on the drive
system.
2.2
Intended Use
The drive systems described here are products for general use that
conform to the state of the art in technology and are designed to prevent any dangers. However, drives and drive controllers that are not
specifically designed for safety functions are not approved for applications where the functioning of the drive could endanger persons.
The possibility of unexpected or un-braked movements can never be
totally excluded without additional safety equipment.
For this reason personnel must never be in the danger zone of the
drives unless additional suitable safety equipment prevents any
personal danger. This applies to operation of the machine during
production and also to all service and maintenance work on drives
and the machine. The machine design must ensure personal safety.
Suitable measures for prevention of property damage are also required.
V2.00, 05.2016
In all cases the applicable safety regulations and the specified operating conditions, such as environmental conditions and specified
technical data, must be observed.
The drive system must not be commissioned and operated until
completion of installation in accordance with the EMC regulations
and the specifications in this manual. To prevent personal injury and
damage to property damaged drive systems must not be installed or
operated.
2-1
2 Safety
2.3
Hazard Categories
Safety notes and general information are indicated by hazard messages in the manual. In addition there are symbols and instructions
affixed to the product that warn of possible hazards and help to
operate the product safely.
Depending on the seriousness of the hazard, the messages are
divided into three hazard categories.
! DANGER
V2.00, 05.2016
CAUTION used without the safety alert symbol, is used to address practices not related to personal injury (e.g. can result in
equipment damage).
2-2
2.4
2 Safety
EXPOSED SIGNALS
Hazardous voltage levels may be present if using an open
frame power supply to power the product.
Failure to follow these instructions will result in death or
serious injury.
LOSS OF CONTROL
V2.00, 05.2016
1) For USA: Additional information, refer to NEMA ICS 1.1 (latest edition), Safety
Guidelines for the Application, Installation, and Maintenance of Solid State Control
and to NEMA ICS 7.1 (latest edition), Safety Standards for Construction and Guide
for Selection, Installation and Operation of Adjustable-Speed Drive Systems.
2-3
2 Safety
V2.00, 05.2016
2-4
This section will acquaint the user with basics of Lexium MCode programming and the simple 1 and 2 character mnemonics which make up
the Lexium MCode programming language.
3.1
Operational modes.
Operational modes
There are two operational modes for the Lexium MCode compatible
products: Immediate and Program.
3.2
1)
2)
3.2.1 Instructions
An instruction results in an action. There are four types of instructions:
Motion instructions are those that lead to the movement of a motor. The
syntax for these commands is as follows: type the command followed by
a space, and then the velocity or position data. For example MA 2000
moves the motor to an absolute position of 2000.
I/O
V2.00, 05.2016
Motion
3-1
Program
System
A system instruction is an instruction that can only be used in immediate mode to perform a system operation such as program execution
(EX) or listing the contents of program memory (L). For example EX 100
executes a program located at address 100 of program memory space,
or EX K1 executes a program labeled K1.
3.2.2 Variables
A Variable is identified by a mnemonic and allows the user to define
or manipulate data. These can also be used with the math functions to
manipulate data. There are two classes of variables: factory-defined and
user-defined. There are 192 user program labels and variables available. The syntax for each variable may differ.
Factory defined variables cannot be deleted; they may only have their
values modified. When an FD (Factory Default) instruction processes,
these variables are reset to their factory default values. There are two
types of factory defined variables:
V2.00, 05.2016
1) Using a name that already exist as an MCode mnemonic is disallowed. An error 24, Illegal data entered, is asserted when attempted.
3-2
3.2.3 Flags
Flags show the status of an event or condition. A flag only has one of
two possible states: either 1 or 0. Unlike variables, there are only factory
defined flags.
Factory defined flags are part of the MCode operating system and may
not be deleted. When an FD (Factory Defaults) instruction executes
given, these flags are returned to their factory default state. There are
two types of factory defined flags::
Read/Writable: This kind of flag is user alterable. They are typically used to set a condition or mode of operation for the device.
For example EE = 1 would enable encoder operation, or EE = 0
would disable the encoder functions.
3.2.4 Keywords
V2.00, 05.2016
Keywords operate in conjunction with the PR and IP instructions to indicate or control variables and flags. For instance, PR UV would print the
state of all the user-defined variables to the screen. IP would restore all
the factory variables from the NVM.
3-3
3.2.5
Math functions
The Lexium products is capable of either integer math or double-precision floating point math.
Math functions are used to perform various arithmetic functions on numeric data stored in registers or variables. Supported functions are +, ,
*, , >, <, =, <=, >=, <>, AND, OR, XOR, NOT.
For floating point calculations, eight (8) registers are provided (F1 - F8).
Available floating point math functions are: ABS, SIN, COS, TAN, ARCSIN, ARCCOS, ARCTAN, PI, SQRT, LOG2, LOG10
Note: Floating-point calculations may only be performed using the
registers provided (F1-F8). Registers R1-R4, MCode variables and user
variables declared using the VA instruction are only capable of integer
math.
3.3
Program structuring
Proper structuring of your Lexium MCode application ensures your
ability to work efficiently and aids in troubleshooting your program. The
figure below illustrates how your application can be blocked out to group
the global system declarations, the program main body, and the subroutines.
'[VARIABLES]
Is = 1,0,0
Ms=256
A=1000000
D=A
Hc=2
Rc=75
P=0
'[PROGRAMS]
PG 1
LB X1
P=0
LB X2
CL Z1, I1-1
H 10
BR X1
Subroutine from
trigger event
LB Z1
MA 51200
H
MA 0
H
RT
Block 3: Subroutines
Subroutines are called from the main program
block based upon a condition such as an input
state, a trip, or a numeric value stored in a
register or variable. They may also be called
unconditionally.
E
PG
V2.00, 05.2016
3-4
3.3.1
Programming aids
Lexium MDrive Programmer
One of the most powerful tools available to you is the Lexium MDrive
Programmer module of the Lexium MDrive Software Suite. The Lexium
MDrive Programmer is visual IDE (Integrated Development Environment) for developing, debugging, simulating and deploying Lexium
MDrive programs written in Lexium MCode.
It features a program text editor, terminal emulation, program simulation
and graphing. Program development may be accomplished by direct
entry or by selecting an action and filling out a dialog.
User Labels
The Lexium MCode programming language allows for 192 user labels
for your programs, subroutines, and user variables and flags. A label
consists of 2 characters, the first of which must be a letter, the second
may be alphanumeric. A label cannot use the same character combination as any of the mnemonics used in the Lexium MCode programming
language.
For purpose of this manual we have used the following example labels:
Program label (G)................Example: G1, G8, Ga
Subroutine label (K)............. Example: K7, K2, Ks
User variable label (Q)........ Example: Q3, Q9, Qz
Example labeling
VA Q1
PG 100
Enter Program mode
LB G1
Label Program G1
CL K1, I2=1
Call Subroutine K1 if Input 2 is HIGH
BR G1
Unconditional Branch to G1
K1
Comments
Declare Subroutine K1
V2.00, 05.2016
Programming reference
Another powerful tool is this manual. Section 5 contains detailed explanations and usage examples of each mnemonic in the Lexium MCode
Programming Language. These are organized alphabetically. In Section
8 there are a number of fully commented example programs that can be
used to learn the basics of programming and using the various functions
of your Lexium MCode compatible device.
3-5
3.4
3.4.1 Variables
MS (Microstep resolution)
Microsteps/step:
MS
Microsteps/rev:
MS * 200
MS default:
To read:
PR MS
To write:
MS=<integer>
Notes:
As we continue you will see that all motion variables use this value.
P (Position)
V2.00, 05.2016
VI (Initial velocity)
3-6
Encoder enabled:
To read:
PR P
To write:
Notes:
1000 steps/sec
To read:
PR VI
To write:
VI=<integer>
Notes:
VM (Maximum velocity)
A (Acceleration)
D (Deceleration)
3.4.2
768000 steps/sec
To read:
PR VM
To write:
VM=<integer>
Notes:
1000000 steps/sec2
To read:
PR A
To write:
A=<integer>
Notes:
1000000 steps/sec2
To read:
PR D
To write:
D=<integer>
Notes:
Motion instructions
V2.00, 05.2016
All motion is programmed either microsteps per second or encoder counts (pulses) per second. When the encoder is disabled
(EE=0), or hMTechnology is enabled (AS=1/2/3) motion scales
in step clock pulses. In encoder mode, (EE-1), the motion commands are scaled in encoder counts.
3-7
MA (Move absolute)
MR (Move relative)
You may program moves in the minus direction by typing the minus sign
(-) before the value.
SL (Slew axis)
H (Hold)
V2.00, 05.2016
PG 100
enter program mode at address 100
LB M1
label program M1
MR 20000 set mode to relative, move relative 20000
steps
H
hold until motion completes
MR -20000 move relative -20000 steps
H
hold until motion completes
E
end program
PG
exit program mode
3-8
3.4.3
I/O instructions
Is (Set input function)
This command configures the Line, Type and Active state of inputs 1-4.
Type
Function
Description
GP
Home
Limit minus ()
G0
Soft stop
Pause
Jog minus ()
11
Reset
Capture
When set as a capture input is a momentary highspeed input that operates with the Trip Capture
(TC) variable to run a subroutine upon the trip. It
features variable input filtering ranging from 50 nS
to 12.9 S.
14
Encoder A/B
15
Step Up/Down
V2.00, 05.2016
13
3-9
Is =1,0,0
Is =2,7,1
Is =3,2,0
Is =4,3,0
Is =1,12,1
V2.00, 05.2016
3-10
Used to read the decimal equivalent of the 4-bit binary nibble represented by all inputs collectively. Note the Input 4 is the Most Significant Bit.
Function
Description
16
General purpose
17
Moving
18
Error
19
Stall
20
Velocity changing
21
Locked rotor*
23
Moving to position
24
hMT active*
25
Make-up active*
29
Attention
Encoder A
Encoder B
Trip
Not
Os =1,16,0
Os =2,17,1
Os =3,28,1
V2.00, 05.2016
Used to set the 3 bit binary equivalent of the decimal number represented by all 3 outputs collectively. Note the output 3 is the most significant
bit.
OT=5 will set the outputs to 101
3-11
3.4.4
System instructions
The following system instructions will be used frequently.
3.4.5
<esc> The ESCAPE key will stop the user program and stop the motor with no decel rate.
CTRL+C will reboot the unit. This includes reloading of the programs
stored in nonvolatile memory into RAM and executing any programs
residing at label SU (Start Up).
Program instructions
PG (Begin program mode)
LB (User label)
|
Switch out of program mode
Lexium MCode also offers the user the convenience of naming programs, subroutines and processes to ease in branching from one part of
a program to another, or calling a subroutine.
These labels, once set, will act as pointers to locations in program
memory space.
The LB, or label instruction, allows the user to assign a 2 character
name to a program or branch process within a program or subroutine.
V2.00, 05.2016
3-12
1)
2)
3)
4)
PG
Switch out of program mode
BR (Branch)
CL (Call subroutine)
E (End program)
V2.00, 05.2016
3-13
PR (Print)
V2.00, 05.2016
PG 200
Switch to program mode at address 200
VA Q1
Define user variable Q1
LB K1
Label command will name the program
xxxxx
xxxxx
Program named by LB command
xxxxx
H 2000
Hold 2 seconds before execution
PR Position =, P
Print position
BR K1, Q1<10
Cond branch to K1 if Q1 less than 10
E End Program
PG
Switch out of program mode
3-14
4 Command Summary
COMMAND SUMMARY
4
Lexium MCode supports multiple families of motion control devices. Not
all instructions, variables and flags apply to all motion control products.
4.1 Compatibility
4.1.1
V2.00, 05.2016
Abbreviations
Access: RO = Read only, RW = Read/Write, RC = Read/Clear, WO=Write only
Usage: I - Immediate, P = Program, I/P = Immediate or program
Mnemonic
Function
Access
Usage
Type
Compatibility notes
Acceleration
RW
I/P
Variable
AJ
Acceleration Jerk
RW
I/P
Variable
AL
Instruction
AO
RW
I/P
Variable
AT
Acceleration Type
RW
I/P
Variable
BE
Backlash Enable
RW
I/P
Flag
BL
Backlash Amount
RW
I/P
Variable
BM
Backlash Mode
RW
I/P
Variable
BP
Break Point
I/P
Instruction
BR
Branch
Instruction
BY
RO
Flag
C1
RW
I/P
Variable
C2
Counter 2 (encoder)
RW
I/P
Variable
Encoder required
CE
RW
I/P
Flag
CL
Call Subroutine
Instruction
CP
Instruction
CW
Clock Width
RW
I/P
Variable
D<1-4>
Input Filter
RW
I/P
Variable
D5
RW
I/P
Variable
Deceleration
RW
I/P
Variable
DB
Encoder Dead-band
RW
I/P
Variable
Encoder required
DC
Decrement Variable
I/P
Math
4-1
4 Command Summary
Abbreviations
Access: RO = Read only, RW = Read/Write, RC = Read/Clear, WO=Write only
Usage: I - Immediate, P = Program, I/P = Immediate or program
Mnemonic
V2.00, 05.2016
Function
Access
Usage
Type
Compatibility notes
DE
Drive Enable/Disable
RW
I/P
Flag
DJ
Deceleration Jerk
RW
I/P
Variable
DT
Deceleration Type
RW
I/P
Variable
End Program
Instruction
EE
Encoder Enable/Disable
RW
I/P
Flag
Encoder required
EF
Error Flag
RC
I/P
Flag
EL
Encoder Lines
RW
I/P
Variable
EM
Echo Mode
RW
I/P
Flag
ER
Error Register
RC
I/P
Variable
ES
RW
I/P
Flag
EX
Execute Program
Instruction
F<1-8>
RW
I/P
Variable
FC
RW
I/P
Variable
FD
I/P
Instruction
FL
RW
I/P
Flag
FS
RW
I/P
Variable
FT
Reserved
Instruction
HC
Hold Current
RW
I/P
Variable
HF
I/P
Instruction
HI
Home to Index
I/P
Instruction
HM
I/P
Instruction
HT
RW
I/P
Variable
I<1-4>
Read Input 1 - 4
RO
I/P
Variable
I5
RO
I/P
Variable
I6
RO
I/P
Variable
Encoder required
IC
Increment Variable
I/P
Instruction
IF
RC
Flag
IN
RO
I/P
Variable
IP
Initialize Parameters
Variable
IS<1-4>
Input 1 - 4 Setup
RW
I/P
Variable
IS 5
RW
I/P
Variable
IS 6
RW
I/P
Variable
Encoder required
IT
Internal Temperature
RW
I/P
Variable
IV
Input to Variable
Variable
JE
Jog Enable/Disable
RW
I/P
Flag
Instruction
LB
Label
Instruction
LK
Lock Program
RW
Flag
LM
Limit Mode
RW
I/P
Variable
4-2
4 Command Summary
Abbreviations
Access: RO = Read only, RW = Read/Write, RC = Read/Clear, WO=Write only
Usage: I - Immediate, P = Program, I/P = Immediate or program
Function
Access
Usage
Type
Compatibility notes
LS
Mnemonic
Software Limit
RW
I/P
Variable
MA
Move Absolute
I/P
Instruction
MD
Motion Mode
RW
I/P
Variable
MP
Moving to Position
RO
I/P
Flag
MR
Move Relative
I/P
Instruction
MS
Microstep Resolution
RW
I/P
Variable
MT
RW
I/P
Variable
MV
Moving
RO
I/P
Flag
NE
Numeric Enable/Disable
RW
I/P
Flag
O<1-3>
WO
I/P
Variable
OE
On Error Handler
Instruction
OF
Output Fault
RC
I/P
Variable
OS
Output Setup
RW
I/P
Variable
OT
WO
I/P
Variable
Position Counter
RW
I/P
Variable
PC
Captured Position
RO
I/P
Variable
PF
Print Format
RW
I/P
Variable
PG
Program Mode
Instruction
PK
Reserved
PM
Position Maintenance
RW
I/P
Flag
Encoder required
PN
Part Number
RO
I/P
Keyword
PR
I/P
Instruction
PS
Pause Program
I/P
Instruction
R<1-4>
User Register
RW
I/P
Variable
RA
Radians/degrees
RW
I/P
Variable
RC
Run Current
RW
I/P
Variable
RD
Reverse Direction
I/P
Instruction
RS
Resume Program
I/P
Instruction
RT
I/P
Instruction
Save to FLASH
I/P
Instruction
SF
Stall Factor
RW
I/P
Variable
Encoder required
SL
Slew at Velocity
I/P
Instruction
V2.00, 05.2016
4-3
4 Command Summary
Abbreviations
Access: RO = Read only, RW = Read/Write, RC = Read/Clear, WO=Write only
Usage: I - Immediate, P = Program, I/P = Immediate or program
Mnemonic
Function
Access
Usage
Type
Compatibility notes
SM
RW
I/P
Variable
Encoder required
SN
Serial Number
RO
I/P
Keyword
SU
Start Up
Keyword
ST
Stall Flag
RO
I/P
Flag
Encoder required
TE
Trip Enable
RW
I/P
Flag
TC
Trip on Capture
RW
I/P
Variable
TI
Trip on Input
RW
I/P
Variable
TM
RW
I/P
Variable
TP
Trip on Position
RW
I/P
Variable
TR
Trip on Relative
RW
I/P
Variable
TT
Trip on Time
RW
I/P
Variable
UG
Upgrade Firmware
Instruction
UV
User Variables
Keyword
Current Velocity
RO
I/P
Variable
VA
I/P
Instruction
VC
Velocity Changing
RO
I/P
Flag
VI
Initial Velocity
RW
I/P
Variable
VM
Max. Velocity
RW
I/P
Variable
VR
Version
I/P
Keyword
VT
Read Voltage
RO
I/P
Variable
WT
Warning Temperature
RW
I/P
Variable
4.1.2
V2.00, 05.2016
Abbreviations
Access: RO = Read only, RW = Read/Write, RC = Read/Clear, WO=Write only
Usage: I - Immediate, P = Program, I/P = Immediate or program
Mnemonic
Function
Access
Usage
Type
Compatibility notes
BD
BAUD Rate
RW
Variable
CK
Checksum Mode
RW
I/P
Variable
DG
RW
I/P
Flag
DN
Device Name
RW
Variable
PY
RW
I/P
Flag
QD
Device Queued
Rw
Flag
4-4
4.1.3
4 Command Summary
Abbreviations
Access: RO = Read only, RW = Read/Write, RC = Read/Clear, WO=Write only
Usage: I - Immediate, P = Program, I/P = Immediate or program
Mnemonic
Function
Access
Usage
Type
Compatibility notes
EL
Encoder Lines
RW
I/P
Variable
PW
PWM Mask
RW
I/P
Variable
SA
Step Angle
RW
I/P
Variable
Table 4.3: MCode command summary - Lexium Motion Module specific commands
4.1.4
hMTechnology specific
The commands listed in Table 4.4 apply specifically to Lexium MDrive
closed loop products with the hMTechnology functions. These will return
an Error 37: Command/Variable/Flag not available if used on open loop
or Lexium Motion Module products.
Abbreviations
Access: RO = Read only, RW = Read/Write, RC = Read/Clear, WO=Write only
Usage: I - Immediate, P = Program, I/P = Immediate or program
Mnemonic
Function
Access
Usage
Type
Compatibility notes
AF
hMT Status
RO
I/P
Flag
AS
hMT Mode
RW
I/P
Variable
AV
RO
I/P
Variable
CB
Control Bounds
RW
I/P
Variable
CF
I/P
Instruction
LD
Lead Limit
RW
I/P
Variable
LG
Lag Limit
RW
I/P
Variable
LL
Position Lead/Lag
RO
I/P
Variable
LR
Locked rotor
RO
I/P
Flag
LT
RW
I/P
Variable
MF
Makeup Frequency
RW
I/P
Variable
MU
RW
I/P
Variable
TD
Torque Direction
RW
I/P
Variable
TQ
Torque Percent
RW
I/P
Variable
TS
Torque Speed
RW
I/P
Variable
VF
RW
I/P
Variable
V2.00, 05.2016
4-5
4 Command Summary
4.2
Math functions
The MCode math, comparison, logic and trigonometric operators
shown in Table 4.5 are compatible with all Lexium Motion Control
and Ethernet TCP/IP products. The advanced floating point math
and trigonometric functions are the ONLY available in models with
Firmware Version 6.0.01 +.
Note that math and trigonometric functions performed outside the floating point registers (F1 - F8) will be rounded down to the nearest integer.
Operator
Function
Usage
R1 + R2
R1 - R2
R1 * R2
R1/R2
R1 <> R2
R1 = R2
R1 < R2
R1 <= R2
R1 > R2
R1 >= R2
R1 = R2 &
R1 = R2 |
R1 = R2 ^
R1 = R2 !
<>
Not Equal
Equal
<
Less Than
<=
>
Greater Than
>=
&
AND (Bitwise)
OR (Bitwise)
XOR (Bitwise)
NOT (Bitwise)
R3
R3
R3
R3
AB
Absolute Value
CS
Cosine
C_
Arc Cosine
LO
Logarithm (Base 2)
L_
PI
Value of Pi 3.141592654
SI
Sine
SQ
Square Root
S_
Arc Sine
TG
Tangent
T_
Arc tangent
F1
F1
F1
F1
F1
F1
F1
F1
F1
F1
F1
=
=
=
=
=
=
=
=
=
=
=
AB
CS
C_
LO
L_
PI
SI
SQ
S_
TG
T_
V2.00, 05.2016
4-6
R1
F2
F2
F2
F2
F2
F2
F2
F2
F2
5 COMMAND DETAILS
COMMAND DETAILS
5.1 Commands
5.1.1 A (Acceleration)
Compatibility
LMD(O)
Mnemonic
LMD(C)
Function
Function Group
Set/Read Acceleration
Notes
LMM
Access
Motion variable
RW
Usage
Program/
Immediate
Description
Defines the acceleration rate when changing velocity. If the value of A is 76800 steps per second2, the motor accelerates at
a rate of 76800 counts per second, every second at the default linear acceleration type.
With VM (Maximum Velocity) set at 768000 microsteps per second, it takes 10 seconds to reach VM from an initial velocity
(VI) of 0 (axis stopped).
The primary factor determining the range and units applied to the acceleration profile is the logic state of the EE (Encoder
Enable) flag. When disabled (EE=0) acceleration is measured in steps/sec2. When enabled (EE=1) the value represents
encoder counts/sec2.
The secondary factors impacting acceleration is the configuration of AT (Acceleration Type) and AJ (Acceleration Jerk). AT
adds triangle and sinusoidal S-curve capability to the default linear acceleration type. The AJ variable allows the user to set
a constant value to compensate for load oscillations.
Range (Clock mode)
66 to 1100 X 106
Units
106
Range (Encoder)
6 to 44 X
Syntax
A=<integer>, PR A
steps/sec2
counts/sec2
Default
1000000
78125
Code example
Related
A=20000
A=Q1
PR A
AT (Accel Type)
D (Deceleration)
EE (Encoder Enable)
VI (Initial Velocity)
VM (Max Velocity)
V2.00, 05.2016
5-1
class
instance
attribute
0x66
0x01
Modbus/TCP
0x0000
5 COMMAND DETAILS
Compatibility
LMD(C)
LMM
Function
Mnemonic
AF
Notes
Function Group
Access
Status Flag
RO
Usage
Program/Immediate
Description
The AF status flag holds the status code reflecting the last hMT status event. In the case where multiple status conditions
exist, the returned result will represent the sum of the active status conditions.
In most cases the flag will return a status code 128: hMT Initialization complete, as hMT will initialize on power up/reset.
Example: PR AF returns a status code of 5, indicating that LD (Lead Limit) and LL (Max. Lead/Lag Limit) were reached.
Status code
Condition
Locked rotor
16
32
64
At zero
128
256
Range
See above
Syntax
Units
Default
Code example
Related
PR AF
BR Q1, AF&2
CL Q1, AF=4
AO (Attn Output)
AS (hMT Mode)
V2.00, 05.2016
EtherNet/IP
5-2
class
instance
attribute
0x6A
0x01
Modbus/TCP
0x008F
5 COMMAND DETAILS
LMD(O)
Mnemonic
LMD(C)
Function
AJ
Function Group
Acceleration Jerk
Firmware 6.00.00+
Notes
LMM
Access
Motion Variable
RW
Usage
Program/
Immediate
Description
Acceleration Jerk is the rate of change of acceleration, or, the derivative of acceleration with respect to time.
The acceleration jerk variable only impacts the motion profile when an S-curve acceleration type (AT=2 or AT=3) is selected.
The jerk value may be adjusted to any integer value between 0 and 127 to compensate for load oscillations. The motion
logic in the Lexium product samples 256 data points during the acceleration ramp. The value applied to AJ represents the
number of data points on either side of the center of the acceleration table, at which the acceleration is at a constant, linear
acceleration at the value defined by A (Acceleration). For example: With AJ=64, the Acceleration ramp will be constant for
128 samples, or 64 samples on either side of the ramp center.
See Figure 5.1: Acceleration Jerk, for example.
DP256
Velocity
DP196
DP128
AJ=127
DP64
AJ=0
DP1
AJ=64
Time
0 to 127
Syntax
AJ=<value>,, PR AJ
Units
Default
Code example
Related
AJ=32
PR AJ
AT (Accel Type)
D (Deceleration)
DJ (Decel Jerk)
VI (Initial Velocity)
VM (Max Velocity)
DT (Decel Type)
V2.00, 05.2016
EtherNet/IP
5-3
Modbus/TCP
5 COMMAND DETAILS
LMD(O)
Mnemonic
LMD(C)
Function
AL
Notes
LMM
Function Group
Access
Keyword
RO
Usage
Immediate
Description
The AL keyword is used with the PR (PRINT) instruction to print the value/state of all variables and flags to
the terminal program.
Range
Syntax
PR AL
Units
Default
Code example
PR AL
Related
IP (Initialize Parameters)
V2.00, 05.2016
EtherNet/IP
5-4
Modbus/TCP
5 COMMAND DETAILS
LMD(O)
Mnemonic
LMD(C)
Function
AO
Notes
LMM
Function Group
Access
I/O variable
RW
Usage
Program/Immediate
Description
The AO variable will define the condition(s) on which the attention output triggers LED 2, or to the output point
assigned to the Attention Output function.
If multiple conditions need to trigger the output the result is additive. i.e. Lead limit (4) and Lag limit (8) AO=12,
Moving flag (16384) and Stall Flag (32768) AO=49152
Note that the available trigger events will vary depend on the model Lexium Motion Control product.
Highlighted events apply only to Lexium MDrive models with hMTechnology.
*External encoder required for function
Range
0 - 4,294,967,295
Syntax
AO=<mask>,
Units
Default
Code example
Related
AO=512
PR AO
OS (Output Setup)
V2.00, 05.2016
EtherNet/IP
5-5
class
instance
attribute
0x67
0x01
Modbus/TCP
See Modbus/TCP
Fieldbus Manual Section
4.3: Mfg Specific
Function Codes
5 COMMAND DETAILS
Failure to follow these instructions can result in death, serious injury or equipment damage.
Compatibility
LMD(O)
Mnemonic
LMD(C)
Function
AS
Notes
LMM
Function Group
Access
Motion Variable
RW
Usage
Program/
Immediate
Description
Sets the operating mode for hMTechnology device to one of four modes: Off, Fixed Current, Variable Current and Torque.
These modes will determine the operational characteristics of the closed loop Lexium MDrive Motion product.
NOTE: MS (Microstep Resolution cannot be set lower than ten (10) when hMTechnology is enabled.
Mode
Operation
Fixed current mode, motor current will be as specified by the run current (RC) and hold current (HC) variables
Variable current mode, motor current will vary as needed to move/position the load with a
maximum current level established by the run current (RC) variable
Torque mode, motor torque and speed will vary as needed to move/position the load at the
maximum torque specified by the set torque percent variable (TQ) at the maximum speed as
specified by the set torque speed variable (TS).
IMPORTANT: Motion will commence IMMEDIATELY upon setting AS=3 without warning.
Range
0-3
Syntax
AS=<mode>, PR AS
Units
Default
Code example
Related
AS=2
PR AS
RC (Run Current)
HC (Hold Current)
LR (Locked Rotor)
MF (Makeup Freq)
MU (Position Makeup)
MS (Microstep resolution)
TD (Torque Dir)
TQ (Torque %)
TS (Torque Speed)
V2.00, 05.2016
5-6
class
instance
attribute
0x6A
0x02
Modbus/TCP
0x008E
5 COMMAND DETAILS
LMD(O)
Mnemonic
LMD(C)
Function
AT
Function Group
Set/Read Acceleration
Type
Firmware 6.00.00+
Notes
LMM
Access
Motion Variable
RW
Usage
Program/Immediate
Description
Defines the type of acceleration profile used when a move is executed. There are three (3) acceleration types available for
Lexium MDrive products: Linear (constant), triangle s-curve and sinusoidal s-curve.
Velocity
VM
linear (AT = 1)
triangle s-curve (AT = 2)
sinusoidal s-curve (AT = 3)
VI
Time
Accel Ramp
Description
Linear (default)
Triangle
Sinusoidal
The sinusoidal s-curve profile is very similar to the triangle s-curve. The
main difference is that it has less jerk when starting or stopping.
Range
1- 3
Syntax
AT=<type>, PR AT
Units
Default
1 - Linear
Code example
Related
AT=3
PR AT
AJ (Acceleration Jerk)
D (Deceleration)
DT (Decel Type)
VI (Initial Velocity
VM (Max Velocity)
DJ (Decel Jerk)
V2.00, 05.2016
EtherNet/IP
5-7
Modbus/TCP
5 COMMAND DETAILS
Mnemonic
LMD(O)
LMD(C)
Function
AV
Notes
LMM
Function Group
hMT Variable
Firmware 6.00.00+
Access
RO
Usage
Program/Immediate
Description
AV reads the actual axis velocity when hMT is enabled. The granularity of the output is based upon the setting of
the VF (Velocity Filter).
Syntax
Code example
Related
PR AV
0
BR Q1,AV>10000
AS (hMT Mode)
VF (Velocity Filter)
V2.00, 05.2016
EtherNet/IP
5-8
class
instance
attribute
Modbus/TCP
5 COMMAND DETAILS
LMD(O)
Mnemonic
LMD(C)
Function
BD
LMM
Notes
Function Group
Access
Communications
Variable
RW
Usage
Program/Immediate
Description
This variable sets the baud rate for serial communications via the RS-422/485 interface. The baud rate is set by indicating
the first two digits of the desired rate as shown in the table below.
In order for the new BAUD rate to take effect, the user must issue the S (SAVE) instruction and then reset the device. When
the Lexium device is reset, it will communicate at the new BAUD rate. Additionally. when the BAUD is changed, it MUST be
matched in Lexium Motion Control Programmer.
A delay time between the command requests to the device must be considered to allow it time to interpret a command and
respond to the host before sending a subsequent command. The time between requests is dependent on the command and
the corresponding response from the device.
The BAUD command is incompatible with Lexium MDrive TCP/IP products. If used, an Error 37: Command not available,
will return when queried.
Mode
Operation
48
4800 bps
96
19
19200 bps
38
38000 bps
11
115000 bps
Note: When placing the product into firmware upgrade mode UG (Upgrade Firmware) the device will automatically set the
BAUD to 19200 bps.
Range
Syntax
BD =<mode>, PR BD
Units
Default
96 (9600 bps)
Code example
Related
BD=48
PR BD
EM (Echo mode)
UG (Upgrade)
V2.00, 05.2016
EtherNet/IP
5-9
Modbus/TCP
5 COMMAND DETAILS
LMD(O)
Mnemonic
LMD(C)
Function
BE
Notes
LMM
Function Group
Motion Flag
Firmware 6.00.00+
Access
RW
Usage
Immediate/Program
Description
The BE flag enables the backlash compensation feature.
Backlash is the amount of mechanical variance within a system. For example, the nut on a leadscrew may require several
steps to engage the screw thread. During a direction change, several steps would again be required before the actual
motion in the opposite direction would begin.
Lexium Motion Products are able to compensate for that amount, eliminating any positional errors due to backlash.
using the BM (Backlash Compensation Mode) and BL (Backlash Compensation Amount) variables.
State
Meaning
Range
0/1
Syntax
BE=<0/1> | PR BE
Units
Default
Code example
Related
BE=1
PR BE
BM (Backlash Mode
V2.00, 05.2016
EtherNet/IP
5-10
Modbus/TCP
5 COMMAND DETAILS
LMD(O)
Mnemonic
LMD(C)
Function
BL
Notes
LMM
Function Group
Firmware 6.00.00+
Access
Motion Variable
RW
Usage
Immediate/Program
Description
This variable represents the amount of backlash compensation employed in motor steps, or in encoder counts if encoder
functions are enabled (EE=1).
The BL variable is signed. If no sign precedes the value, it is assumed to be positive. The minus (-) symbol must always be
programmed, The sign indicates the direction and is only required when using Backlash Compensation Mode 1 (BM=1 Mechanical Compensation).
BL
Ballscrew
Nut
Range
2147483648
Syntax
BL=<steps> | PR BL
Units
steps /
counts
Default
Code example
Related
BL=25600
BL=2000
PR BL
BE (Backlash Enable)
BM (Backlash Mode)
EE (Encoder Enable)
MS (Microstep Resolution)
V2.00, 05.2016
EtherNet/IP
5-11
Modbus/TCP
5 COMMAND DETAILS
LMD(O)
Mnemonic
LMD(C)
Function
BM
Notes
LMM
Function Group
Firmware 6.00.00+
Access
Motion Variable
RW
Usage
Program/Immediate
Description
The BM (Backlash Mode) variable sets the mode of operation for backlash compensation, either mathematical (mode 0) or mechanical (mode 1).
Backlash compensation must be enabled using the BE (Backlash Enable) flag in order to function.
Mode 0: Mathematical Compensation
When mathematical backlash compensation has employed the value of BL (Backlash Amount) adds to each
change of direction. On each reversal move, the controller outputs the programmed move plus the backlash
units to the driver, taking up the backlash from the change in direction and completes the move to the correct
position.
MCode parameters
BE=1
enable backlash compensation
BL=1000
set backlash amount to 1k steps
BM=0
set backlash mode to mathematical
100k
1k
50k
50k
1k
Figure 5.4 illustrates Mode 0 operation using the assumption that backlash is taken up before the first move:
is +100k steps
1)
Move
2)
Move
is -50k steps. When the motor reverses direction, there are 1000 steps of backlash where no
physical motion occurs. When Move
executes on the reversal of direction, the value of BL (1000) is
added to the value of the motion command: MA 50000 + 1000 results in a total motor move distance of
51000 steps, though the load only moves 50000 steps. The position counter (P) records the total move
distance of 51000.
3)
Move
sated
4)
is -50k steps. Because the backlash was taken up during Move , Move is uncompen
, is a reversal of direction, BL
V2.00, 05.2016
Mechanical backlash compensation always loads the axis in the direction of the sign () of the BL. A move
in the direction opposite to that indicated by the sign () of BL has the value specified by BL added to it. A
5-12
5 COMMAND DETAILS
separate move is then made relative to the sign () of BL to take up the backlash amount and load the axis.
Whenever possible, program more backlash than there actually is.
MCode parameters
BE=1
enable backlash compensation
BL=15000 set backlash amount to 15k steps
BM=1
set backlash mode to mechnaical
100k
3 1
15k
+
100k + 10k + 5k
10k Mech.
Backlash
Figure 5.5 illustrates Mode 1 operation using the assumption that backlash is taken up and the axis loaded
in the plus (+) direction before the first move:
1)
Move
NOTE: Whenever possible, always enter a larger compensation value than the actual to ensure proper backlash
removal and proper axis loading.
2)
The example in Figure 5.5 assumes 10k steps of mechanical backlash, set BL (Backlash Amount) to
15000 (or some value greater than 10000)
3)
Move
indexes the axis minus (-) 100k steps but due to 10k steps backlash, the (uncompensated) physical movement of the axis would only be 90k steps. Since Move
is opposite the sign of the compensation, 15k sites of compensation is added giving a sum of 115k steps. Because of the physical backlash, the
result would be a 5 unit overshoot.
4)
On execution of Move
, the axis moves back in the plus (+) direction 15k steps 10k to take up backlash and 5k to go to the correct position and load the axis again.
Range
0/1
Syntax
BM=<mode> | PR BM
Units
Default
Code example
Related
BM=1
PR BM
BL (Backlash Amount)
V2.00, 05.2016
EtherNet/IP
5-13
Modbus/TCP
5 COMMAND DETAILS
LMD(O)
Mnemonic
LMD(C)
Function
BP
Notes
LMM
Function Group
Break Point
Access
Program Instruction
Usage
Program/Immediate
Description
The Break Point Instruction is a debugging tool used to set break points within a program to assist in troubleshooting and
optimizing your Lexium MCode programs.
The program must execute in either trace or single-step mode for the BP instruction to take effect. The program executes for
the number of times specified by the count, then goes into single-step mode at the address or label specified by BP. Press
the spacebar to step through the program if in single-step mode.
While a program is running; typing BP without a value will break a program and allow the spacebar to step through the
program where it is. As if a BP was set.
To disable the break point, set BP=0.
Range
Syntax
BP <label/address>,<count>
Units
Default
Code example
Related
BP X1,3
EX P1,2
V2.00, 05.2016
EtherNet/IP
5-14
Modbus/TCP
5 COMMAND DETAILS
5.1.14 BR (Branch)
Compatibility
LMD(O)
Mnemonic
LMD(C)
LMM
Function
BR
Function Group
Branch
Notes
Access
Program Instruction
Usage
Program/Immediate
Description
The branch instruction is used to perform a conditional or unconditional branch to a location in a Lexium MCode program. It
can also be used to perform loops and IF THEN logic within a program.
There are two parameters to a branch instruction. These are used to perform two types of branches:
Conditional Branch
Two parameters define a conditional branch: the first specifies an address or user label where program execution should
continue when the conditions defined by the second parameter occur. The condition parameter may include flag states,
variable values or logical functions. Only one condition may exist.
Example conditions defining the second parameter include:
Variable values (user or factory): V1<=10 (User Variable V1 is less than/equal to 10)
Unconditional Branch
In this type of branch the second parameter is not specified, and then the execution continues at the label or address
specified by the first parameter.
Range
Syntax
Units
Default
Code example
Related
BR Q1
BR Q1,I1=1
CL (Call Subroutine)
EX (Execute Program)
V2.00, 05.2016
EtherNet/IP
5-15
Modbus/TCP
5 COMMAND DETAILS
LMD(O)
Mnemonic
LMD(C)
LMM
Function
BY
Function Group
Notes
Access
Status Flag
RO
Usage
Immediate
Description
The BY flag indicates the status of program execution: (0) program is not executing or (1) program running.
Range
0/1
Syntax
PR BY
Units
Default
Code example
PR BY
Related
EX (Execute program)
PG (Program Mode)
V2.00, 05.2016
EtherNet/IP
5-16
Modbus/TCP
5 COMMAND DETAILS
LMD(O)
Mnemonic
LMD(C)
Function
C1
Notes
LMM
Function Group
Motion Variables
Access
RW
Usage
Program/Immediate
Description
This variable contains the 32-bit integer count of the clock pulses generated by the Lexium MCode compatible device.
Counter 1 supplies the position count for P (Position Counter) when the Lexium Motion product is operating in open loop
mode without an encoder or EE (Encoder Enable) is set to zero (0/disabled).
Rollover behavior:
When C1 reaches its limit in either the plus (+) or minus(-) direction rolls over to the limit value of the opposite signed count
and counts up or down from there.
For example
Range
-2147483648 to
+2147483647
Syntax
Units
motor counts
Default
V2.00, 05.2016
Code example
5-17
C1=10000
PR C1
BR Q1, C1=512000
CL X5, C1=512000
5 COMMAND DETAILS
Program Contents
PG 1
LB X1
'***Motion***
CL X2, C1>=2000000000
BR X1
'***Subroutine***
LB X2
IC Xr
PR Xr
PR C1
C1=0
RT
Increment the rollover counter register, reset C1 to zero, return from subroutine X2
E
PG
Related
EE (Encoder Enable)
P (Position Counter)
V2.00, 05.2016
EtherNet/IP
5-18
class
instance
attribute
0x68
0x01
Modbus/TCP
0x0005
5 COMMAND DETAILS
LMD(O)
Mnemonic
LMD(C)
Function
C2
Notes
LMM
Function Group
Read/Set Counter 2
(Encoder Counts)
Access
Motion Variables
RW
Usage
Program/Immediate
Description
This variable contains the 32-bit integer value of the encoder counts read by the Lexium MCode compatible device. In
encoder mode Counter 2 supplies the position count for P (Position Counter) when the Lexium Motion product is operating
in open loop mode without an encoder or EE (Encoder Enable) is set to one (1/enabled).
Rollover behavior:
When C2 reaches its limit in either the plus (+) or minus(-) direction rolls over to the limit value of the opposite signed count
and counts up or down from there.
For example
Range
-2147483648 to
+2147483647
Syntax
encoder counts
Units
Default
Code example
Related
C2=10000
PR C2
BR Q1, C2=40000
CL X5, C2=40000
C1 (Counter 1)
EE (Encoder Enable)
EL (Encoder Lines)
P (Position Counter)
V2.00, 05.2016
EtherNet/IP
5-19
class
instance
attribute
0x69
0x01
Modbus/TCP
0x0007
5 COMMAND DETAILS
LMD(O)
Mnemonic
LMD(C)
Function
CB
Notes
LMM
Function Group
Access
Motion Variable
Usage
Program/
Immediate
RW
Description
The CB (Control Bounds) variable defines the operational tolerance for the closed loop hMTechnology. The four (4)
settings that are used to tune the control tolerance to optimize the device for torque, speed or balanced torque-speed
performance.
The mode settings represent a range value in full motor steps. The hMTechnology feature keeps the relationship
between the rotor and the stator within the tolerance by the particular mode setting.
For example, CB=0 provides the tightest control bounds for optimal torque performance. The hMT algorithm keeps the
rotor-stator relationship within 1.1 full steps. CB =3 opens the performance gap between the rotor and the stator to 1.7
steps for better speed performance.
CB (Control Bounds) is only applicable when hMTechnology is in fixed or variable current modes (AS=1 or AS=2).
When hMT torque mode (AS=3) is active, control bounds are predefined at 1.1 motor steps (CB=0) and may not be
adjusted.
2 FULL STEPS
STALL
1-2
1-2
STALL
LEAD*
LAG*
Value
Operation
1.1
1.3
1.5
1.7
Range
0-3
Syntax
CB=<mode> | PR CB
Units
Default
Code example
Related
CB=2
Set the control bounds mode for hMT to 1.5 motor full steps
PR CB
V2.00, 05.2016
5-20
class
instance
attribute
0x6A
0x03
Modbus/TCP
0x0091
5 COMMAND DETAILS
LMD(O)
Mnemonic
LMD(C)
Function
CE
Notes
LMM
Function Group
Access
Configuration flag
R/W
Usage
Program/Immediate
Description
This setup flag will configure the device to respond or not respond to a CTRL+C software reset.
Mode
Operation
Enabled (default) CTRL+C entry will assert a software reset, stopping motion and running
programs. Unsaved user variables and data will be lost.
Is addressable in party mode (PY=1), CTRL+C will respond the same as CE=1 when not in
party mode.
Range
02
Syntax
CE=<mode>, PR CE
Units
Default
1 (enabled)
Code example
Related
CE=0
PR CE
PY (Party Mode)
V2.00, 05.2016
EtherNet/IP
5-21
class
instance
attribute
0x64
0x01
Modbus/TCP
0x0009
5 COMMAND DETAILS
LMD(O)
Mnemonic
LMD(C)
Function
CF
Notes
LMM
Function Group
Access
hMT instruction
Usage
Program/Immediate
Description
The CF instruction clears a locked rotor fault and re-enables the output bridge.
A locked rotor is indicated by both the LR (Locked Rotor Flag), by the assertion of an Error 104, or, by a latched state on the
Attention Output, if so configured using the AO (Attention Output Mask) variable.
A power cycle will also clear a locked rotor.
Range
Syntax
CF
Units
Default
Code example
CF
Related
LR (Locked Rotor)
V2.00, 05.2016
EtherNet/IP
5-22
class
instance
attribute
0x6A
0x04
Modbus/TCP
0x0093
5 COMMAND DETAILS
LMD(O)
Mnemonic
LMD(C)
Function
CK
Notes
LMM
Function Group
Access
Configuration Variable
Usage
R/W
Program/Immediate
Description
This setup variable configures the device to operate in checksum mode. In this mode, appending the ASCII character
representing the value of the checksum is required following the command string.
To calculate the checksum, using an example motion command: MR 51200 (move relative one revolution):
Command
<space>
82
32
53
49
50
48
48
7-bits
ASCII:
77
Action:
1011
0111
Action:
0100
1000
Action:
0100
1001
Action:
1100
1001
Result:
sum
Checksum (decimal) =
ASCII Table lookup DEC 201 provides check sum character =
439
201
To assist in calculating the checksum, we have provided a Microsoft Excel spreadsheet which calculates the checksum and displays
the checksum character. See the Resource Download portion of this table to download the Checksum Calculator.
Mode
Operation
Puts the device into checksum mode. When enabled, all communications with the device require a checksum
to follow the commands. The checksum is the 2s complement of the 7-bit sum of the ASCII value of all the
characters in the command OR ed with 128 (Hex = 0x80). The command is acknowledged with an NAK (0x15
Checksum verification failure) if the checksum is incorrect or an ACK (0x06 - checksum verification successful)
when the command correctly processes (no error).
Enables checksum mode. However, NAK only sent for bad checksum. ACK is not echoed if a program is running, NAK is only echoed if an error occurs. In immediate mode, both ACK or NAK characters are echoed.
Range
0-2
Syntax
CK=<mode>, PR CK
Units
Default
0 (disabled)
Code example
Related
CK=1
PR CK
Resource download
V2.00, 05.2016
Download
5-23
class
instance
attribute
0x64
0x01
Modbus/TCP
0x0009
5 COMMAND DETAILS
LMD(O)
Mnemonic
LMD(C)
Function
CL
LMM
Notes
Function Group
Call Subroutine
Access
Program Instruction
Usage
Program
Description
This instruction is used to invoke a subroutine within a program, allowing the user to segment code and call a subroutine
from multiple places rather than repeating code within a program.
There are two parameters to the CL (Call Subroutine) instruction. The first specifies the program address or label of
the subroutine to be invoked if the second parameter, the condition, is satisfied. If the second parameter is not used or
blank, the subroutine indicated by the first parameter is always invoked.
The condition setting includes variables, flags as well as logical and input functions that are to be evaluated. There can
only be one condition.
The subroutine must end with an RT (Return) instruction. The RT instruction will cause program execution to return to
the address line following the line invoking a subroutine call.
Range
Syntax
(unconditional) CL <label/address>
(conditional) CL <label/address>, [VAR/FLG/IN]<math><condition>
Units
Default
Code example
Related
CL Q3
CL Q3,I1=1
BR (Branch)
V2.00, 05.2016
EtherNet/IP
5-24
Modbus/TCP
5 COMMAND DETAILS
LMD(O)
Mnemonic
LMD(C)
Function
CP
LMM
Notes
Function Group
Access
Program Instruction
Usage
Immediate
Description
Clears the program space in the NVM as specified by the instruction parameter. Programs are stored and executed directly
from NVM. The CP instruction will empty program memory only. It will not erase globally declared user variables or flags.
An S (Save) command must be issued following the invocation of a CP (Clear Program).
Issuing an FD (Factory Defaults) will also clear program memory space.
CP may be used with a parameter to determine whether or not to leave user variables.
Parameter
Operation
Range
Syntax
CP <label/address> | CP
Units
Default
Code example
Related
CP
S
CP 0, P1
Clear program memory occupied by labeled program P1, retain user variables
FD (Factory Defaults)
IP (Initialize Parameters)
S (Save)
V2.00, 05.2016
EtherNet/IP
5-25
Modbus/TCP
5 COMMAND DETAILS
LMD(O)
Mnemonic
LMD(C)
Function
CW
Function Group
Notes
LMM
Access
I/O Variable
RW
Usage
Program/Immediate
Description
CW sets the pulse width duration for the trip output in 50 nanosecond increments. The trip output will be active for the
duration specified by the CW variable.
ON
50 nS
100 nS
CW=1
CW=3
OUT3 (TRIP)
OFF
Figure 5.7 Clock width command impact on Trip output pulse width
Range
0 - 255
Syntax
CW=<time>, PR CW
50 nSec
Units
Default
10 (x 50 nSec)
Code example
Related
CW=100
PR CW
100
V2.00, 05.2016
EtherNet/IP
5-26
class
instance
attribute
0x64
0x02
Modbus/TCP
0x000E
5 COMMAND DETAILS
Mnemonic
LMD(O)
LMD(C)
Function
D1-D4
Notes
LMM
Function Group
Access
I/O Variable
RW
Usage
Program/Immediate
Description
Variable defines the time in milliseconds that the input is allowed to settle following a state transition, a factor
common to mechanical switches..
Filtering is applied separately to each input.
Range
Syntax
D[1-4]=<time> | PR D[1-4]
milliseconds
Units
Default
Code example
Related
D2=50
PR D2
50
D5 (Analog Filter)
IS (Input Setup)
V2.00, 05.2016
EtherNet/IP
5-27
class
instance
attribute
0x67
0x02 0x06
Modbus/TCP
0x000F
0x0010
0x0011
0x0012
5 COMMAND DETAILS
Mnemonic
LMD(O)
LMD(C)
Function
D5
Notes
LMM
Function Group
Access
I/O Variable
RW
Usage
Program/Immediate
Description
The Analog Filter is a continuously updating process. It does a running average (AA) by computing the equation
shown below where D5 (Analog Filter) is a value between 0 and 1000 and I5 (Read Analog Input) is the current
reading between 0 and 4095.
0 1000
Syntax
D5=<counts> | PR D5
milliseconds
Units
Default
Code example
Related
D5=50
PR D5
50
IS (Input Setup)
V2.00, 05.2016
EtherNet/IP
5-28
class
instance
attribute
0x67
0x06
Modbus/TCP
0x0013
5 COMMAND DETAILS
5.1.27 D (Deceleration)
Compatibility
LMD(O)
Mnemonic
LMD(C)
Function
Function Group
Set/Read Deceleration
Notes
LMM
Access
Motion variable
RW
Usage
Program/Immediate
Description
Defines the deceleration rate when changing velocity. If the value of D is 76800 steps per second2, the motor decelerates at
a rate of 76800 counts per second, every second at the default linear acceleration type.
The primary factor determining the range and units applied to the deceleration profile is the logic state of the EE (Encoder
Enable) flag. When disabled (EE=0) deceleration is measured in steps/sec2. When enabled (EE=1) the value represents
encoder counts/sec2.
The secondary factors impacting deceleration is the configuration of DT (Deceleration Type) and DJ (Deceleration Jerk). DT
adds triangle and sinusoidal S-curve capability to the default linear deceleration type. The DJ variable allows the user to set
a constant value to compensate for load oscillations.
Range (Clock mode)
66 to 1100 X 106
106
Range (Encoder)
66 to 44 X
Syntax
D=<integer> | PR D
steps/sec2
Units
counts/sec2
Default
1000000
40000
Code example
D=2000
PR D
2000
Related
A (Acceleration)
DJ (Decel Jerk)
VM (Max Velocity)
EE (Encoder Enable)
DT (Decel Type)
VI (Initial Velocity)
V2.00, 05.2016
EtherNet/IP
5-29
class
instance
attribute
0x66
0x02
Modbus/TCP
0x0018
5 COMMAND DETAILS
Mnemonic
LMD(O)
LMD(C)
Function
DB
Notes
LMM
Function Group
Encoder Deadband
Access
Motion Variable
Usage
RW
Program/Immediate
Description
This variable defines the plus (+) and minus (-) length of the encoder dead-band in encoder counts.
A move completes when motion stops within the range defined by the DB (Encoder Deadband) parameter. If
PM (Position Maintenance) is enabled, (PM=1), the position corrects when pushed outside of DB value once in
position.
Encoder functions must be enabled (EE=1) for the DB to take effect.
Range
0 65000
Syntax
DB=<counts>, PR DB
counts
Units
Default
Code example
Related
DB=10
PR DB
C2 (Counter 2)
EE (Encoder Enable)
SM (Stall Mode)
ST (Stall Flag)
PM (Position Maint.)
SF (Stall Factor)
V2.00, 05.2016
EtherNet/IP
5-30
class
instance
attribute
0x69
0x02
Modbus/TCP
0x001A
5 COMMAND DETAILS
Mnemonic
DC
LMD(O)
LMD(C)
Function
LMM
Function Group
Decrement Variable
Instruction
Notes
Access
Usage
Program/Immediate
Description
Decrements the specified factory or user variable by one (1).
Attempting to decrement an unspecified or a read-only variable asserts an Error 25: variable is read-only.
Attempting to decrement a mode select or configuration variable, for example MS (Microstep Resolution) asserts
an Error 26: attempting to increment or decrement an illegal variable.
DC <var>
Syntax
Code example
DC V1
Related
IC (Increment Variable)
V2.00, 05.2016
EtherNet/IP
5-31
Modbus/TCP
0x001B
5 COMMAND DETAILS
Mnemonic
LMD(O)
LMD(C)
Function
DE
Notes
LMM
Function Group
Drive Enable/disable
Access
Configuration Flag
RW
Usage
Program/Immediate
Description
Enables (1- default) or disables (0) the drive output bridges.
Issuing a motion command, for example, MA (Move Absolute), MR (Move Relative), SL (Slew), or any homing
command while the drive is disabled (DE=0), returns an Error 94: attempting motion while the drive is disabled.
Mode
Operation
Range
0/1
Syntax
DE=<mode>
Units
Default
1 - Enabled
Code example
DE=0
Related
V2.00, 05.2016
EtherNet/IP
5-32
class
instance
attribute
0x64
0x03
Modbus/TCP
0x001C
5 COMMAND DETAILS
Mnemonic
LMD(O)
LMD(C)
LMM
Function
DG
Function Group
Enable/disable global
response in party mode
Notes
Access
ConfigurationFlag
RW
Usage
Program/Immediate
Description
Enables or disables device response to global commands made while in party mode (PY=1). In the default state
(DG=1) the device executes global commands without sending back a response. By setting DG=0, that device
responds global commands.
Mode
Operation
Disable global response to commands (default command does not echo back to terminal)
Note that DG only impacts operation when the device is in serial party mode (PY=1).
Range
0/1
Syntax
DG=<mode> | <dn>DG=0
Units
Default
Code example
V2.00, 05.2016
Related
5-33
DG=0
aDG=0
DN (Device name)
PY (Party Mode)
5 COMMAND DETAILS
LMD(O)
Mnemonic
LMD(C)
Function
DJ
Firmware 6.00.00+
Notes
LMM
Function Group
Read/Set Deceleration
Jerk
Access
Motion Variable
Usage
RW
Program/Immediate
Description
Deceleration Jerk is the rate of change of Deceleration, or, the derivative of Deceleration with respect to time.
The Deceleration jerk variable only impacts the motion profile when an S-curve Deceleration type (DT=2 or DT=3) is
selected.
The jerk value may be adjusted to any integer value between 0 and 127 to compensate for load oscillations. The motion
logic in the Lexium product samples 256 data points during the deceleration ramp. The value applied to DJ represents the
number of data points on either side of the center of the deceleration table, at which the deceleration is at a constant, linear
deceleration at the value defined by D (Deceleration). For example: With DJ=64, the deceleration ramp will be constant for
128 samples, or 64 samples on either side of the ramp center. See Figure 5.8: Deceleration Jerk, for example.
DP256
Velocity
DP196
DP128
DJ=127
DP64
DJ=0
DP1
DJ=64
Time
0 to 127
Syntax
DJ=<value> | PR DJ
Units
Default
Code example
Related
DJ 32
PR DJ
32
AJ (Accel Jerk)
VI (Initial Velocity)
VM (Max Velocity)
AT (Accel Type)
DT (Decel Type)
V2.00, 05.2016
EtherNet/IP
5-34
Modbus/TCP
5 COMMAND DETAILS
Mnemonic
LMD(O)
LMD(C)
Function
DN
LMM
Function Group
Notes
Access
Communication variable
RW
Usage
Program/Immediate
Description
Configures the name of the device for party mode communications. The acceptable range of characters is a-z,
A-Z, 0-9. The factory default is ! Once named, the device name must precede the instruction to that drive. When
assigning a device name, the character MUST be within quotation marks. Attempting to assign a device name
without enclosing it within quotation marks returns an Error 21.
The name is case sensitive.
Resetting the device to the default character (!) requires an FD (Factory Default Reset). The device name must be
saved or it will be lost on power cycle or factory reset.
Range
Syntax
DN="<char>" | PR DN
Units
ASCII
Code example
V2.00, 05.2016
Related
5-35
DN="a"
PR DN
PY (Party Mode)
Default
5 COMMAND DETAILS
LMD(O)
Mnemonic
LMD(C)
Function
DT
LMM
Function Group
Read/Set Deceleration
Type
Firmware 6.00.00+
Notes
Access
Motion Variable
RW
Usage
Program/Immediate
Description
Defines the type of deceleration profile used when a move is executed. There are three (3) deceleration types available for
Lexium products: Linear (constant), triangle s-curve and sinusoidal s-curve.
Velocity
VM
VI
linear (DT = 1)
triangle s-curve (DT = 2)
sinusoidal s-curve (DT = 3)
Time
Accel Ramp
Description
Linear (default)
Triangle
Sinusoidal
The sinusoidal s-curve profile is very similar to the triangle s-curve. The
main difference is that it has less jerk when starting or stopping.
Range
1- 3
Syntax
DT=<type> | PR DT
Units
Default
1 - Linear
Code example
Related
DT=3
PR DT
AJ (Acceleration Jerk)
D (Deceleration)
DT (Decel Type)
VI (Initial Velocity
VM (Max Velocity)
DJ (Decel Jerk)
V2.00, 05.2016
EtherNet/IP
5-36
Modbus/TCP
5 COMMAND DETAILS
LMD(O)
Mnemonic
LMD(C)
Function
LMM
Notes
Function Group
End program
Program Instruction
Access
Usage
Program/Immediate
Description
The operation of the E (End Program) instruction differs between immediate and program mode.
Program mode
In program mode, the E instruction is used to designate the end of a program.
Immediate mode
An E issued while in immediate mode ends the currently executing program. If a move is in progress, the program
ends after motion completes.
Syntax
Code example
E
V2.00, 05.2016
Related
5-37
End program
EX (Execute Program)
PG (Program Mode)
5 COMMAND DETAILS
LMD(O)
Mnemonic
LMD(C)
Function
EE
Notes
LMM
Function Group
Access
Usage
Configuration flag
Description
Enables or disables encoder mode. Once placed in encoder mode, all motion-related variables and commands
register in encoder counts. The value of P (Position Counter) will update from C2 (Encoder Counter).
Encoder functions such as stall detection and position mainteneance require that encoder functions be enabled
(EE=1).
Mode
Operation
Enable encoder functions, motion registers in encoder counts. Functions such as stall detection and position maintenance are available.
Range
0/1
Syntax
EE=<mode> | PR EE
Units
Default
0 (disabeled)
Code example
Related
EE=1
PR EE
C2 (Encoder Counter 2)
DB (Deadband)
EL (Encoder Lines)
FM (Filter Motion)
PM (Position Maintenance)
SF (Stall Factor)
SM (Stall Mode)
ST ((Stall Flag)
V2.00, 05.2016
EtherNet/IP
5-38
class
instance
attribute
0x69
0x03
Modbus/TCP
0x001E
5 COMMAND DETAILS
Mnemonic
LMD(O)
LMD(C)
Function
EF
Function Group
Error Flag
Notes
LMM
Access
Status Flag
RO
Usage
Program/Immediate
Description
EF Indicates whether or not an error condition exists. It clears automatically when a new program executes. The
only way to manually clear EF is to read the value of the ER (Error) variable or set ER=0.
If an external indication of the EF status is desired, the AO (Attention Output Mask) may be set to one (AO=1). The
EF state displays on the output point configured as the attention output or on LED 2 on Lexium MDrive products.
There is an instruction, OE (On Error), which allows the user to specify the execution of a subroutine in the
program memory when an error occurs. The subroutine might contain instructions to read the ER variable that
would clear the EF flag.
Value
Operation
Range
0/1
Syntax
PR EF
Units
Default
Code example
PR EF
Related
ER (Error)
OE (On Error)
V2.00, 05.2016
EtherNet/IP
5-39
class
instance
attribute
0x65
0x03
Modbus/TCP
0x001F
5 COMMAND DETAILS
LMD(O)
Mnemonic
LMD(C)
Function
EL
Notes
LMM
Function Group
Encoder Lines
Access
Configuration Variable
RW
Usage
Program/Immediate
Description
The Lexium Motion Module features quadrature encoder inputs (A/B/Index). EL (Encoder Lines), sets the line count
for the connected encoder and is used as the scaling factor for calculating encoder moves, C2 (Counter 2) reads 4
x EL or 4 counts per line.
MS (Microstep Resolution) is relative to EL. To calculate the minimum value for MS use the following equation:
MS minimum = (EL x 8) <FSREV>
The following example uses a 512 line encoder and a 1.8 stepper motor (200 F:
512 X 8 = 4096, 4096 200 = 20.48
Minimum MS = 25 steps/step (5000 steps/rev.)
Range
1 to 2000
Syntax
EL=<lines>, PR EL
Units
lines
Default
1000
Code example
Set encoder lines
EL=500
Set the encoder lines to match a 500 line encoder (2000 counts/rev)
Related
C2 (Encoder Counter)
EE (Encoder Enable)
MS (Microstep Resolution)
SA (Step Angle)
V2.00, 05.2016
EtherNet/IP
5-40
Modbus/TCP
5 COMMAND DETAILS
LMD(O)
Mnemonic
LMD(C)
Function
EM
Notes
LMM
Function Group
Access
Configuration Variable
Usage
RW
Program/Immediate
Description
Sets the echo configuration of the communications channel.
Mode
Operation
Echo all entered commands and data back to the terminal. Carriage return/line feed indicates that the
command accepted (full duplex) (default) by the display of the prompt character >.
Do not echo entered commands and data back to the terminal, only return the cursor. CR/LF indicates command accepted by the display of a blinking cursor. Printed values display to the terminal,
i.e. PR EM returns 1.
Does not return prompt, only echoes data requested by PRINT (PR) and LIST (L) commands.
Command and data echo stored in the print queue, returns to the terminal upon termination of the
command string.
Range
03
Syntax
EM=<mode>, PR EM
Units
Default
0 (echo all)
Code example
Related
EM=1
Set the echo mode to 1, do not echo commands and data except for a print.
PR EM
1
V2.00, 05.2016
EtherNet/IP
5-41
Modbus/TCP
5 COMMAND DETAILS
LMD(O)
Mnemonic
LMD(C)
Function
ER
Notes
LMM
Function Group
Variable
Error Register
Usage
R/W
Program/Immediate
Description
Holding register for the most recent error that has occurred. The ER variable must be read or set to zero to clear
the error code and reset EF (Error Flag).
An error condition is indicated by question mark character (?) in place of the prompt (>).
A command, OE (On Error Handler) is used to execute a subroutine when an error condition occurs. While OE
activates on any error, subroutines may be executed for specific error codes using BR (Branch) and CL (Call
Subroutine) instructions.
While many error codes are common across the product family, each particular device has error codes associated
with it specifically. Section 9: Error codes lists the error codes for each product:
Section 9.1: Lexium MDrive (Open Loop)
Section 9.2: Lexium MDrive (Closed Loop with hMTechnology)
Section 9.3: Lexium Motion Module
Syntax
Code example
Set to a value
ER=0
Display error
PR ER
Program Flow
Related
BR Q1, ER=86
CL Z2, ER=104
BR (Branch)
OE (On Error)
RT (Return)
CL (Call Subroutine)
EF (Error Flag)
V2.00, 05.2016
5-42
class
instance
attribute
0x65
0x03
Modbus/TCP
0x00121
5 COMMAND DETAILS
LMD(O)
Mnemonic
LMD(C)
LMM
Function
ES
Notes
Function Group
Access
Configuration Variable
R/W
Usage
Program/Immediate
Description
Sets the mode of escaping a program or motion event, either using the [ESC] key or by keying in [CTRL+E]. Modes
2 and 3 add an addressability function to the escape for operation in PY (Party Mode).
Mode
Operation
Range
03
Syntax
ES=<mode>,, PR ES
Units
Default
Code example
Set escape mode
ES=0
Related
V2.00, 05.2016
EtherNet/IP
5-43
Modbus/TCP
5 COMMAND DETAILS
Mnemonic
LMD(O)
LMD(C)
Function
EX
Function Group
Execute Program
Notes
LMM
Access
Program Instruction
Usage
Immediate
Description
Executes a specified program label or address at a selected mode of execution. If the mode is unspecified or 0,
the program executes in normal mode. Modes 1 and 2 aid in application development and troubleshooting by
adding trace and single-step modes.
A custom factory label, SU (Start Up) is provided to execute a program so named on power cycle/software reset
[CTRL + C].
There are three modes of program execution.
Note: Attempting to execute an undefined label will return an Error 30.
Mode
Operation
Normal execution
The program executes continuously until the program E (End), but the instructions are
traced to the communications port so the user can see the instructions as they process
The user can step through the program using the space bar to process each line of the program. The program can be resumed at normal speed in this mode by pressing the enter key
Range
<label/address>, 0 2
Syntax
EX <label/address>,<mode>
Units
Default
Code example
Related
EX G1
EX G1,2
SU (Start Up)
V2.00, 05.2016
EtherNet/IP
5-44
class
instance
attribute
0x64
0x06
Modbus/TCP
0x0041, 0x0024
5 COMMAND DETAILS
LMD(O)
Mnemonic
LMD(C)
Function
Notes
LMM
Function Group
Firmware 6.00.00+
Access
Mathematics Variable
RW
Usage
Program/Immediate
Description
Double precision 64-bit floating point registers are used to perform calculations requiring a floating decimal point.
For use with advanced math and trigonometric operators.
When transferred to a user variable or an integer register R1 R4 (User Registers), the fraction portion of the
floating point number is discarded.
When a motion command is used with a floating point register, for example SL=F2 or MA F5 the axis will move at
the rate or to the position represented by the register value, rounded down to the nearest integer.
The display format for the data contained in floating point registers derives from the PF (Print Format) command.
Range
max +
1.7976931348623158308
min +
4.9406564584124655324
Units
Default
F<num>=<fpvalue>, F<num><math/trig><var/reg>
Syntax
Code example
Set to a value
F2=3.256
Related
F2=CS R3
F1=R2*F2
Multiply R2 by F2
PF (Print Format)
V2.00, 05.2016
EtherNet/IP
5-45
Modbus/TCP
5 COMMAND DETAILS
LMD(O)
Mnemonic
LMD(C)
Function
FC
Notes
LMM
Function Group
I/O Variable
Access
RW
Usage
Program/Immediate
Description
Sets the digital filtering to be applied to Input 1 when configured as a Capture input (type = 12).
Mode
'
Min Pulse
Cutoff Frequency
0 (default)
50 nS
10 MHz
150 nS
3.3 MHz
200 nS
2.5 MHz
300 nS
1.67 MHz
500 nS
1.0 MHz
900 nS
555 kHz
1.7 S
294.1 kHz
3.3 S
151 kHz
6.5 S
76.9 kHz
12.9 S
38.8 kHz
Note that the FC command is not available on Lexium MDrive NEMA 17 Motion Control and Ethernet TCP/IP
product.
Range
09
Syntax
FC=<mode>, PR FC
Units
Default
Code example
Related
FC=2
Set capture input to filter signals with a pulse width <150 nS, or of frequency
greater than 3.3 MHz
PR FC
IS (Input Setup)
TC (Trip Capture)
V2.00, 05.2016
EtherNet/IP
5-46
class
instance
attribute
0x67
0x07
Modbus/TCP
0x0024
5 COMMAND DETAILS
LMD(O)
Mnemonic
LMD(C)
Function
FD
Notes
LMM
Function Group
Instruction
Access
Usage
Immediate
Description
Issuance of the FD (Factory Defaults) command resets the device to factory default state WITHOUT WARNING
upon entering FD followed by a carriage return. An FD results in the loss of all saved data: programs, user
variables, and stored parameter values.
NVM values will be retained. PN (Part Number), SN (Serial Number), PW (PWM Mask) and FS (Index Offset)
settings.
FD
Syntax
Code example
FD
V2.00, 05.2016
Related
5-47
CP (Clear Program)
IP (Initialize Parameters)
5 COMMAND DETAILS
LMD(O)
Mnemonic
LMD(C)
Function
FL
Notes
LMM
Function Group
Configuration Flag
Firmware 6.00.00+
Access
Usage
RW
Program/Immediate
Description
When in an enabled state (FL=1), the axis follows the signals on the input pins 3 and 4 at a 1:1 ratio.
Prerequisite: Configuration of IN3 and IN4 as an clock inputs: Step/Direction, ENC A/ENC-B or Step Up/Step Down
is required.
Mode
Operation
Note that the FL command is not applicable to the encoder inputs on the Lexium Motion Module. These inputs are
strictly for encoder mode of operation.
Range
0/1
Syntax
FL=<0/1>, PR FL
Units
Default
0 (disabled)
Code example
Prerequisite
IS=3,13,1
IS=4,13,1
Operation
FL=1
Return status
PR FL
Related
FM (Filter Motion)
IS (Input Setup)
V2.00, 05.2016
EtherNet/IP
5-48
Modbus/TCP
5 COMMAND DETAILS
LMD(O)
Mnemonic
LMD(C)
Function
FM
Function Group
Firmware 6.00.00+
Notes
LMM
Access
I/O Variable
Usage
RW
Description
Sets the digital filtering applied to Inputs 3 and 4 when configured as clock inputs.
Prerequisite: Configuration of IN3 and IN4 as an clock inputs: Step/Direction, ENCA/ENCB or Step Up/Step Down
is required.
Mode
Min Pulse
Cutoff Frequency
50 nS
10 MHz
150 nS
3.3 MHz
200 nS
2.5 MHz
300 nS
1.67 MHz
500 nS
1.0 MHz
900 nS
555 kHz
1.7 S
294.1 kHz
3.3 S
151 kHz
6.5 S
76.9 kHz
12.9 S
38.8 kHz
Range
09
Syntax
FM=<mode>, PR FM
Units
Default
Code example
Related
IS=3,13,1
IS=4,13,1
FM=2
Set the motion inputs to filter signals with a pulse width <150 nS, or of frequency
greater than 3.3 MHz
PR FM
2
IS (Input Setup)
V2.00, 05.2016
EtherNet/IP
5-49
Modbus/TCP
5 COMMAND DETAILS
Compatibility
Mnemonic
LMD(O)
LMD(C)
Function
FS
LMM
Notes
Function Group
Access
Configuration Variable
RW
Usage
Program/Immediate
Description
FS (Index Offset) sets the reference position for HF (Home to Index Offset) operation. It represents the offset
between the encoder index mark and the manually set shaft flat position.
FS is configured using a utility included in the Motion Control Programmer application. To configured, select View >
Set Shaft Flat Position and follow the instructions on the configuration dialogs.
To manually calculate the value of FS (no load on shaft):
1)
Perform a Home to Index operation. For example HI 1 will home the axis to the encoder index mark. You
may verify the index by entering PR I6 in the terminal. A returned value of 1 indicates the index mark is
aligned.
2)
3)
Disable the driver by entering DE=0 to allow free rotation of the shaft.
4)
5)
6)
7)
Make a positional move, HF <mode> will home the axis to the Index offset position.
NOTE: A closed loop Lexium MDrive or Lexium Motion Module with a connected and configured encoder is
required.
Range
25600
Syntax
FS=<counts>, PR FS
Units
Counts
Default
Code example
Related
FS=10246
PR FS
HF (Home to Offset)
I6 (Index Mark)
V2.00, 05.2016
EtherNet/IP
5-50
Modbus/TCP
5 COMMAND DETAILS
5.1.49 FT (Reserved)
Mnemonic
FT
Function
Function Group
Reserved
Access
Usage
Description
FT is reserved for factory use. Attempting to use FT as a user variable or label will return an Error 24: Illegal data
entered.
V2.00, 05.2016
Range
5-51
Units
Default
5 COMMAND DETAILS
Mnemonic
LMD(O)
LMD(C)
Function
Notes
LMM
Function Group
Access
Program Instruction
Usage
Program
Description
The hold instruction is used in a program to suspend program execution. There are two ways to use the hold
instruction:
H, when not followed by the time parameter suspends program execution until the motion completes. Used without
the time parameter, a Hold should always follow a programmed motion instruction such as MA (Move Absolute) or
MR (Move Relative). H should also follow the homing instructions: HI (Home to Index), HM (Home to Home Switch)
or HF (Home to Offset)
The only parameter to the hold instruction suspends program execution for the specified number of milliseconds.
Range
1 - 65000
Syntax
H, H <time>
Units
milliseconds
Default
Code example
Related
MA 512000
H
H 20000
E (End Program)
EX (Execute Program)
MA (Move Absolute)
HI (Home to Index)
MR (Move Relative)
V2.00, 05.2016
EtherNet/IP
5-52
Modbus/TCP
5 COMMAND DETAILS
LMD(O)
Mnemonic
LMD(C)
Function
HC
LMM
Notes
Function Group
Access
Motion variable
R/W
Usage
Program/Immediate
Description
Defines the motor holding current as 0, or OFF, or as a percentage value from 1 to 100%. The transition from RC
(Run Current) to HC (Hold Current) is impacted by two other commands: HT (Hold Current Delay) and MT (Motor
Settling Delay Time). These two variables are additive, with the sum being the total time to transition from the RC
(Run Current) level to the specified standstill current.
Notes:
For Lexium MDrive products the current is only given in a percentage range as the driver is already sized and
tuned to the integrated motor.
The Lexium Motion Module is a 1.5A RMS standalone integrated driver/controller. The actual drive output current is
derived thus: HC=5 results in a holding current level of 0.075A 1.5A * 0.05 = 0.75A.
Range
0 (disabled), 1 to 100
Syntax
HC=<percent>, PR HC
Percent (%)
Units
Default
5%
Code example
Related
HC=0
PR HC
RC (Run Current)
V2.00, 05.2016
EtherNet/IP
5-53
class
instance
attribute
0x66
0x03
Modbus/TCP
0x0029
5 COMMAND DETAILS
Compatibility
LMD(O)
Mnemonic
LMD(C)
Function
HF
Notes
LMM
Function Group
Firmware 6.00.00+
Encoder
Access
Motion instruction
Usage
R/W
Program/Immediate
Description
This instruction moves the axis to an offset position of the encoder index mark position specified by FS (Offset
Setting)
When HF executes, the axis moves in specified direction at VM (Maximum Velocity) until it reaches the preset
position. It then creeps away from the home position in the direction specified at VI (Initial Velocity). Motion ceases
as soon as the shaft flat position clears.
Diagrammed in detail in [homing parameter details section] are the four combinations for this command, as well as
for the related HI (Home to Index Mark) and HM (Home to Home Switch) instructions.
Type
(-) minus
(+) plus
(-) minus
(-) minus
(+) plus
(-) minus
(+) plus
(+) plus
Range
1 to 4
Syntax
HF <type>
Units
Default
Code example
Seek index offset position in the (+) direction, creep off position in (-) minus
direction
HF 3
Related
EE (Encoder Enable)
FS (Offset Setting)
VI (Initial Velocity)
VM (Maximum Velocity)
HI (Home to Index)
V2.00, 05.2016
EtherNet/IP
5-54
Modbus/TCP
5 COMMAND DETAILS
Compatibility
LMD(O)
Mnemonic
LMD(C)
Function
HI
Notes
LMM
Function Group
Encoder
Access
Motion instruction
Usage
R/W
Program/Immediate
Description
This instruction homes the axis to the encoder index mark.
When HI executes, the axis moves in specified direction at VM (Maximum Velocity) until it reaches the encoder
index. It then creeps away from the index position in the direction specified at VI (Initial Velocity). Motion ceases as
soon as the shaft flat position clears.
Diagrammed in detail in [section var] are the four combinations for this command, as well as for the related HF
(Home to Index Offset) and HM (Home to Home Switch) instructions.
Type
(-) minus
(+) plus
(-) minus
(-) minus
(+) plus
(-) minus
(+) plus
(+) plus
Range
1 to 4
Syntax
HI <type>
Units
Default
Code example
HI 1
Related
Seek encoder index in the (-) minus direction, creep off in (+) plus direction
EE (Encoder Enable)
FS (Offset Setting)
VI (Initial Velocity)
VM (Maximum Velocity)
HF (Home to Offset)
HM (Home to Home)
V2.00, 05.2016
EtherNet/IP
5-55
class
instance
attribute
0x69
0x04
Modbus/TCP
0x002A
5 COMMAND DETAILS
Compatibility
LMD(O)
Mnemonic
LMD(C)
Function
HM
Notes
LMM
Function Group
Access
Motion instruction
R/W
Usage
Program/Immediate
Description
This instruction homes the axis to Home Switch.
When HM executes, the axis moves in specified direction at VM (Maximum Velocity) until it reaches the home
switch. It then creeps away from the switch in the direction specified at VI (Initial Velocity). Motion ceases as soon
as the switch deactivates.
To use HM (Home to Home Switch), a switch connected to an input defined as home using the IS (Input Setup)
command thus IS=<input #>, 5,<active>. For example, Is=2,5,0 configures Input 2 as a homing input, active when
low.
Diagrammed in detail in [homing parameter details section] are the four combinations for this command, as well as
for the related HF (Home to Index Offset) and HI (Home to Index) instructions.
Note that HM is the only homing function available without an encoder.
Type
(-) minus
(+) plus
(-) minus
(-) minus
(+) plus
(-) minus
(+) plus
(+) plus
Range
1 to 4
Syntax
HM <type>
Units
Default
Code example
HM 1
Related
Seek home switch in the (-) minus direction, creep off in (+) plus direction
EE (Encoder Enable)
FS (Offset Setting)
HF (Home to Offset)
HI (Home to Index)
IS (Input Setup)
LM (Limit Method)
VI (Initial Velocity)
VM (Maximum Velocity)
V2.00, 05.2016
EtherNet/IP
5-56
class
instance
attribute
0x68
0x02
Modbus/TCP
0x002B
5 COMMAND DETAILS
LMD(O)
Mnemonic
LMD(C)
LMM
Function
HT
Notes
Function Group
Access
Motion variable
R/W
Usage
Program/Immediate
Description
Delay in milliseconds between the RC (Motor Run Current) and HC (Motor Hold Current)., The delay time is also
impacted by the MT (Motor Settling Delay) variable. The sum of MT + HT represents the total time delay between
RC and HC.
The total of MT+HT cannot add up to more than 65535, thus, the value of MT is included in the total delay.
Thus the maximum setting for HT=(65535-MT). If setting HT to 0, MT is still in effect. If both HT and MT are set to
0, the current will not reduce, but maintain the RC (Run Current) percentage.
Exceeding this maximum returns an Error 21: Illegal data value entered.
DELAY =
HT +
MT
Current
HC% (HoldCurrent)
Time
Figure 5.10 HT (Hold Current Delay) and MT (Motor Settling Delay) relationship
Range
0 to (65535-MT)
Syntax
HT=<time>, PR HT
milliseconds
Units
Default
500
Code example
Related
HT=0
PR HT
HC (Hold Current)
RC (Run Current)
V2.00, 05.2016
EtherNet/IP
5-57
class
instance
attribute
0x66
0x04
Modbus/TCP
0x002C
5 COMMAND DETAILS
LMD(O)
Mnemonic
LMD(C)
Function
Notes
LMM
Function Group
I/O variable
Usage
Program/Immediate
Description
Reads the state of the specified input 1 - 4. I(x) is used with PR (Print), BR (Branch) and CL (Call Subroutine)
instructions and with registers and user variables.
The response to the input state will be dependent on active (low/high) setting of the input.
Range
0/1
Syntax
Units
Default
Code example
Related
PR I2
BR L2,I3=1
CL Q5,I4=0
IS (Input setup)
OS (outut setup)
V2.00, 05.2016
EtherNet/IP
5-58
class
instance
0x67
attribute
0x09 0x0C
Modbus/TCP
0x002D
0x002E
0x002F
0x0030
5 COMMAND DETAILS
Mnemonic
LMD(O)
LMD(C)
Function
I5
LMM
Notes
Function Group
I/O variable
Access
RO
Usage
Program/Immediate
Description
Reads the current value of the 12-bit analog input, which ranges from 0 to 4096 counts. The counts represent the
signal amplitude sensed on the analog input.
Range
0 to 4096
counts
Syntax
Units
Default
Code example
Related
PR I5
BR L2,I5>2048
CL Q5,I5=<2048
IS (Input setup)
V2.00, 05.2016
EtherNet/IP
5-59
class
instance
attribute
0x67
0x0D
Modbus/TCP
0x0031
5 COMMAND DETAILS
Mnemonic
LMD(O)
LMD(C)
Function
I6
Notes
LMM
Function Group
I/O variable
Access
Usage
RO
Program/Immediate
Description
Reads the logic state of the encoder index mark. This will either be one or zero, as there are no configuration
settings for the index mark.
Typical uses for this variable would include: running a subroutine or incrementing a counter variable when the
index mark is active.
Range
0 or 1
Syntax
Units
Default
Code example
Related
PR I6
BR L2,I6=0
CL Q5,I5=1
IS (Input setup)
V2.00, 05.2016
EtherNet/IP
5-60
class
instance
attribute
0x69
0x05
Modbus/TCP
0x0037
5 COMMAND DETAILS
I7-I13
Function
Reserved
Function Group
Reserved
Access
Usage
Description
V2.00, 05.2016
Reserved for factory use. Attempting to use as a user variable or label will return an Error 24: Illegal data entered.
5-61
5 COMMAND DETAILS
Mnemonic
LMD(O)
LMD(C)
Function
IC
LMM
Function Group
Increment variable
Instruction
Notes
Access
Usage
Program/Immediate
Description
Increments the specified variable by adding one.
Attempting to increment an unspecified or a read-only variable asserts an Error 25: variable is read-only.
Attempting to increment a mode select or configuration variable, for example MS (Microstep Resolution) asserts an
Error 26: attempting to increment or decrement an illegal variable.
IC <var>
Syntax
Code example
Related
IC R1
Increment register 1
IC V2
DC (Decrement Variable)
V2.00, 05.2016
EtherNet/IP
5-62
Modbus/TCP
5 COMMAND DETAILS
LMD(O)
Mnemonic
LMD(C)
Function
IF
LMM
Notes
Function Group
Conditional Flag
Access
Usage
RW
Program/Immediate
Description
The IF instruction is automatically set to 1 when IV command is executed. The IF flag reflects an input value from
the communications port is pending, not that one has been received. IF will be cleared to zero (0) with a carriage
return or can be reset manually by entering IF=0.
Note that IF may only be cleared, not manually set to 1.
Range
0/1
Syntax
IF=0
Units
Default
Code example
IF=0
Related
IV (Input to Variable)
V2.00, 05.2016
EtherNet/IP
5-63
Modbus/TCP
5 COMMAND DETAILS
Mnemonic
LMD(O)
LMD(C)
Function
IN
Notes
LMM
Function Group
Access
I/O keyword
RO
Usage
Program/Immediate
Description
Reads the binary state of the inputs and returns them as a decimal value. When used thus, Input 1 is the Least
Significant Bit (LSb) and Input 4* is the Most Significant Bit (MSb). It may be used in conjunction with PR (Print),
BR (Branch) and CL (Call Subroutine) instructions.
The value is a function of the actual state of the IO where 1 = input voltage (+5 to +24 +VDC) and 0 = Ground. The
level used to define the active state is a parameter of the IS (Input setup) variable.
Digital input filtering (D1-D4) has no effect on the data read.
* Lexium MDrive NEMA 17 (42 mm) products have only three inputs. In these products input 3 will be the MSb and the total range
is IN=<0-7>
Range
0 - 15
Syntax
Units
Default
Code example
Related
PR IN
>07
BR L5,IN=07
CL K3,IN=13
IS (Input setup)
OS (Output setup)
V2.00, 05.2016
EtherNet/IP
5-64
class
instance
attribute
0x67
0x0E
Modbus/TCP
0x003B
5 COMMAND DETAILS
LMD(O)
Mnemonic
LMD(C)
Function
IP
LMM
Notes
Function Group
Initialize parameters
Instruction
Access
RW
Usage
Program/Immediate
Description
Restores all of the device variable and flag parameters to their stored values. This instruction will not delete user
variables, but it will restore the last saved value of the user value.
If IP is used while the motor is moving an Error 74: Tried to initialize parameters or clear program while moving, will
be asserted.
IP
Syntax
Code example
IP
Related
Return all saved variable values and flag states to the last saved.
FD (Factory Defaults)
S (Save)
V2.00, 05.2016
EtherNet/IP
5-65
Modbus/TCP
0x003C
5 COMMAND DETAILS
Compatibility
Mnemonic
LMD(O)
LMD(C)
LMM
Function
IS
Function Group
Setup Inputs 1 to 4
Notes
Access
I/O Instruction
Usage
RW
Program/Immediate
Description
This instruction is used to configure the input parameters. These parameters define the function and active state.
When used as a keyword (PR IS), the instruction will return the configuration of all inputs.
Input parameters
Param
Description
Values
Default
1-4
0 (LOW active)
V2.00, 05.2016
Type
5-66
Function
Notes/restrictions
General purpose user; (default for all inputs) typically used to trigger
events within a program
Soft stop; stops motion with deceleration and halts program execution. If
program is paused (PS), input is ignored.
11
12
Capture; operates with the Trip Capture (TC) trip to run a subroutine when
active
13
Step (IN3) / Direction (IN 4); step clock and direction inputs
14
15
StepUp (IN3) / StepDown (IN 4); step up and step down inputs
5 COMMAND DETAILS
Syntax
IS=<1-4>,<type>,<active> | PR IS
Code example
IS=1,2,1
IS=3,13,0
Set input 3 to step clock function type. Input 4 will automatically set to direction
type
PR IS
IS =
IS =
IS =
IS =
IS =
Related
1,
2,
3,
4,
6,
2, 1
0, 1
13, 0
13, 0
0, 1
OS (Output Setup)
V2.00, 05.2016
EtherNet/IP
5-67
class
instance
attribute
0x67
0x0F
Modbus/TCP
5 COMMAND DETAILS
LMD(O)
Mnemonic
LMD(C)
Function
IS
Notes
LMM
Function Group
I/O Instruction
Usage
RW
Program/Immediate
Description
This instruction is used to configure the analog input sense and range for the Lexium MDrive products.When used
as a keyword (PR IS), the instruction will return the configuration of all inputs.
Lexium MDrive
Param
Description
Values
Default
5 (Analog input)
Sense
Range
9 (Voltage)
9 (Voltage)
10 (Current)
0 (0 to 5V / 0 to 20 mA )
1 (0 to 10V / 4 to 20 mA)
0 (0 to 5V)
IS=<5>,<sense>,<range> | PR IS
Code example
Related
IS=5,9,1
IS=5,10,0
OS (Output Setup)
V2.00, 05.2016
EtherNet/IP
5-68
class
instance
attribute
0x67
0x0F
Modbus/TCP
5 COMMAND DETAILS
LMD(O)
Mnemonic
LMD(C)
Function
IS
Notes
LMM
Function Group
I/O Instruction
Access
Usage
RW
Program/Immediate
Description
This applies strictly to the encoder index mark. The only user configurable parameter is the active state.
Param
Description
Values
Default
6 (Index input)
6 (Index input)
Active
Syntax
0 (LOW active)
1 (HIGH active)
0 (LOW active)
IS=<5>,<sense>,<range> | PR IS
Code example
IS=6,1
Related
EE (Encoder Enable)
FS (Index Offset)
HI (Home to Index
I6 (Read Index)
V2.00, 05.2016
EtherNet/IP
5-69
class
instance
attribute
0x67
0x0F
Modbus/TCP
5 COMMAND DETAILS
LMD(O)
Mnemonic
LMD(C)
Function
IT
Notes
LMM
Function Group
Status Keyword
Access
RO
Usage
Program/Immediate
Description
This keyword, when used with the PR (Print instruction) will return the internal temperature of the device
electronics, measured at two locations, in the following order.
Param
1)
2)
Microcontroller
Description
<blank>
Range
-20 to 100
Syntax
PR IT,<param>
Units
Default
Code example
Related
PR IT
34,37
PR IT,1
34
PR IT,2
37
WT (Warning Temperature)
V2.00, 05.2016
EtherNet/IP
5-70
class
instance
attribute
0x65
0x04
Modbus/TCP
MFG specific
function code, See
MODBUS/TCP
manual, Section
4.3
5 COMMAND DETAILS
Mnemonic
LMD(O)
LMD(C)
LMM
Function
IV
Notes
Function Group
Input to Variable
Access
Program instruction
Usage
Program
Description
The IV instruction facilitates the input of numeric data into a system or user-defined variable. User variables MUST
be declared prior to issuing an IV.
When using IV, a conditional program loop using the logic state of the IF (Variable Input Pending) flag.
IV <var/reg>
Syntax
Code example
IV used with conditional loop example
IV F1
LB X2
BR X2,IF=1
Related
Conditional loop to suspend program while the variable input is pending, once
the input is satisfied the IF flag will clear and the program will continue, with the
value input stored in variable F1
V2.00, 05.2016
EtherNet/IP
5-71
Modbus/TCP
5 COMMAND DETAILS
LMD(O)
Mnemonic
LMD(C)
Function
JE
Notes
LMM
Function Group
Configuration flag
Access
RW
Usage
Program/Immediate
Description
JE enables/disables input jog functions. Jogging the motor with using an input point requires the two parameters be
configured.
State
1)
2)
Jog - and/or Jog + input function must be assigned to the appropriate inputs.
Description
Range
0/1
Syntax
JE
Units
Default
Code example
Related
JE=1
PR JE
>1
IS (Input Setup)
V2.00, 05.2016
EtherNet/IP
5-72
class
instance
attribute
0x66
0x05
Modbus/TCP
0x003F
5 COMMAND DETAILS
LMD(O)
Mnemonic
LMD(C)
Function
Notes
LMM
Function Group
Access
Program instruction
Usage
Immediate
Description
Retrieves the contents of program memory beginning at the specified label or address to the end of user program
space. If no parameter is given it will list the full contents of user program space beginning at address 1.
L <label/address>
Syntax
Code example
Related
L G1
FD (Factory Defaults
IP (Initialize Parameters)
V2.00, 05.2016
EtherNet/IP
5-73
Modbus/TCP
5 COMMAND DETAILS
Mnemonic
LMD(O)
LMD(C)
Function
LB
Notes
LMM
Function Group
Access
Program Instruction
Usage
Program
Description
The Label Instruction allows the user to assign a 2 character name to a program, program location or subroutine.
This label is then accessed within a program using the BR (Branch) and CL (Call Subroutine) instructions.
Labels applied to a program may be executed from immediate mode using the EX (Execute Program) command,
or be label target subroutines for the various MCode trip functions.
There is a limit of 192, an amount shared with user variable names created using the VA (Create User Variable)
instruction.
The restrictions for this command are:
1.
A label cannot be named after an Lexium MCode Instruction, Variable, Flag or Keyword.
2.
The first character must be alpha, the second character may be alpha-numeric.
3.
4.
5.
Usage Tip:
Establish labeling conventions prior to beginning to write a program. For example: G1, G2, G3... for executable
programs, V1, V2, V3 ... for user variables, Q1, Q2, Q3 ... for subroutines, B1, B2, B3 ... for branch targets, T1,
T2, T3 ... for trip routines and etc.
LB <alpha><blank or alpha-num>
Syntax
Code example
LB G1
Related
BR (Branch)
CL (Call Subroutine)
EX (Execute Program)
V2.00, 05.2016
EtherNet/IP
5-74
Modbus/TCP
5 COMMAND DETAILS
LMD(O)
Mnemonic
LMD(C)
Function
LD
Notes
LMM
Function Group
Lead limit
hMT Variable
Access
RW
Usage
Program/Immediate
Description
LD sets the limit in motor steps in which the rotor may lead the stator for hMTechnology. When this limit is reached,
an Error 106: Lead limit reached, is asserted.
Conditions causing the rotor position to lead the stator position:
1)
Note that Lead Limit values are only active when AS (hMTechnology Mode) is set to 1, 2, or 3
Range
0 to 2147483647
Syntax
LD=<steps>, PR LD
motor steps
Units
Default
102400
Code example
Related
LD=51200
PR LD
>51200
LG (Lag Limit)
LL (Position Lead-Lag)
V2.00, 05.2016
EtherNet/IP
5-75
class
instance
attribute
0x6A
0x06
Modbus/TCP
0x0095 0x0096
5 COMMAND DETAILS
LMD(O)
Mnemonic
LMD(C)
Function
LG
Notes
LMM
Function Group
Lag limit
hMT Variable
Access
RW
Usage
Program/Immediate
Description
LG sets the limit in motor steps in which the rotor may lag the stator for hMTechnology. When this limit is reached,
an Error 107: Lag limit reached, is asserted.
Conditions causing the rotor position to lag the stator position:
1)
2)
Transient load, sudden interuption in the load due to load inertia change or mechanical changes in
the system.
Note that Lag Limit values are only active when AS (hMTechnology Mode) is set to 1, 2, or 3
Range
0 to 2147483647
Syntax
LG=<steps>, PR LG
motor steps
Units
Default
102400
Code example
Related
LG=51200
PR LG
>51200
LD (Lead Limit)
LL (Position Lead-Lag)
V2.00, 05.2016
EtherNet/IP
5-76
class
instance
attribute
0x6A
0x08
Modbus/TCP
0x0097 0x0098
5 COMMAND DETAILS
LMD(O)
LMD(C)
Function
LL
Notes
LMM
Function Group
Access
hMTechnology Variable
RO
Usage
Program/Immediate
Description
Read only register holding the number of counts that the rotor leads or lags the stator. A positive value indicates
position lag. A negative value indicates position lead.
hMTechnology will use this counter for position correction.
Note that LL values are only measured when AS (hMTechnology Mode) is set to 1, 2, or
Range
-2147483647 to +2147483647
Syntax
Units
motor steps
Default
Code example
Related
CL k5,LL>102500
PR LL
>0
LD (Lead Limit)
LG (Lag Limit)
V2.00, 05.2016
EtherNet/IP
5-77
class
instance
attribute
0x6A
0x07
Modbus/TCP
0x0099 0x009A
5 COMMAND DETAILS
LMD(O)
Mnemonic
LMD(C)
LMM
Function
LK
Function Group
Notes
Access
Program Flag
RW
Usage
Program/Immediate
Description
LK may be used to prohibit user interaction with stored MCode programs by disallowing:
1)
Program upload
2)
Modification
3)
Listing
Once enabled, attempting to list or modify the stored program space will assert an Error 44: User program space
locked.
Once saved program space may only be unlocked by issuing a full CP (Clear Program Space) without parameters
or by entering an FD (Reset to Factory Defaults).
If not saved a lock may be cleared by a power cycle or software reset (CTRL+C).
State
Description
Range
0/1
Syntax
LK=<0/1>, PR LK
Units
Default
Code example
V2.00, 05.2016
Related
5-78
LK=1
PR LK
>1
5 COMMAND DETAILS
LMD(O)
Mnemonic
LMD(C)
Function
LM
Notes
LMM
Function Group
I/O Variable
Access
Usage
RW
Program/Immediate
Description
LM defines the response taken when a limit is reached. The mode for LM applies to both hardware I/O limit
switches or position limits set in software.
Home
Switch
Plus Direction
Minus
Limit
Plus
Limit
Minus Direction
Switch Trip Point
(Switch Closed)
Limits must be configured, either hardware switch limits using the IS (Input Setup) command, or
software limits configured using the LS (Software Limits) variable.
2)
Limits only work in the defined direction of travel; i.e. +limit only works in the positive direction,
limits only work in the minus direction.
3)
If the limit is active and maintained, the software will only allow motion in the opposite direction.
4)
If homing is active HM (Home to Home Switch), motion will decelerate to a stop, then reverse direction to seek the home switch/ If the home switch is not reached on the reverse and the opposite limit
is reached, all motion will stop with a deceleration ramp.
Operation
Normal limit function with a deceleration ramp: motion stops, unless homing. If the limit
is active and maintained, the software will only allow motion in the opposite direction.
V2.00, 05.2016
5-79
If homing is active HM (Home to Home Switch), motion will decelerate to a stop, then reverse
direction to seek the home switch/ If the home switch is not reached on the reverse and the
opposite limit is reached, all motion will stop with a deceleration ramp.
A limit stops all motion with a deceleration ramp whether or not homing is active
A limit stops all motion with a deceleration ramp and stop program execution
5 COMMAND DETAILS
Range
1 to 6
Syntax
LM=<mode>, PR LM
Mode
Units
Default
Code example
Related
LM=6
Stop motion without deceleration and program execution when a limit is reached
PR LM
6
HM (Home to Home)
LS (Soft Limits)
IS (Input Setup)
V2.00, 05.2016
EtherNet/IP
5-80
class
instance
attribute
0x066
0x06
Modbus/TCP
0x0042
5 COMMAND DETAILS
LMD(O)
LMD(C)
Function
LR
Notes
LMM
Function Group
Locked Rotor
Access
RO
Usage
Program/Immediate
Description
A locked rotor is defined as no rotor movement while at the maximum allowed lag for a specified period of time.
When lag becomes equal to the bounds, a timer starts to count down. Upon reaching zero, a locked rotor will be
indicated by the assertion of a status flag. The timer reloads on any encoder movement. The timer timeout period is
user selectable from 2mS to 65.5 seconds.
When HMT is configured AS=1 or 2, a locked rotor will also cause an internal fault (LR) disabling the output bridge.
he flag may be cleared and the bridges re-enabled by cycling power, or via software command CF: Clear Locked
Rotor Fault. A locked rotor condition will assert an error 104 as well.
In torque mode, a locked rotor does not disable the bridges. The locked rotor flag (LR) can be used to indicate the
rotor has been stopped at the specified torque for a preset amount of time.
State
Description
Rotor locked
Range
0/1
Syntax
PR LR
Units
Default
Code example
PR LR
0
Related
AO (Attention Output)
AF (hMT Status)
AS (hMT Mode)
V2.00, 05.2016
EtherNet/IP
5-81
class
instance
attribute
0x6A
0x09
Modbus/TCP
0x009B
5 COMMAND DETAILS
LMD(O)
Mnemonic
LMD(C)
Function
LS
Firmware 6.00.00+
Notes
LMM
Function Group
Access
Motion Variable
Usage
RW
Program/Immediate
Description
Sets the direction, position and enabled state for software limit switches. There are three parameters:
Param
Description
Limit direction
Position
Enable/disable
Values
Default
0 (minus)
1 (plus)
-2147483648 to 214748364
0 (disable)
0 (disabled)
1 (enable)
The first parameter provides the limit direction. The second parameter provides the position at which the limits
will respond, note that the limits must have a logical gap, meaning that the negative limit must be set to a value
more negative than the positive limit.
Finally the third parameter enables or disables the limit function.
When a software limit is reached, the product will respond as specified by the LM (Limit Response Mode)
variable.
minus SW Limit
plus SW Limit
minus
LOAD
plus
LS=0, -102400
LS=1, 102400
Range
See table
See table
Syntax
LS=<0/1>,<position>,<0/1> | PR LS
Units
Default
See table
Code example
Related
LS=0,-102400,1
LS=1,102400,1
PR LS
LS=0,-102400,1
LS=1,102400,1
HM (Home to Home)
V2.00, 05.2016
5-82
Modbus/TCP
5 COMMAND DETAILS
LMD(O)
LMD(C)
Function
LT
Notes
LMM
Function Group
Access
hMT Variable
RW
Usage
Program/Immediate
Description
Defines the time in milliseconds between the assertion of an LR (Locked Rotor) condition and the output H-bridges
being disabled
Note that if the Lexium MDrive is in hMTechnology Torque Mode (AS=3), the output bridges will not disable upon a
locked rotor condition
Range
2 to 65535
Syntax
LT=<time>, PR LT
milliseconds
Units
Default
2000
Code example
Related
LT=50
PR LT
50
AS (hMT Mode)
LR (Locked Rotor)
V2.00, 05.2016
EtherNet/IP
5-83
class
instance
attribute
0x6A
0x0A
Modbus/TCP
0X009C 0x009D
5 COMMAND DETAILS
Mnemonic
LMD(O)
LMD(C)
Function
MA
Notes
LMM
Function Group
Access
Motion Instruction
Usage
Program/Immediate
Description
Set mode for absolute move and move to an absolute position relative to (0) zero. MD (Motion Mode) will be set to
MA.
0
MA 102400
MA 51200
MA -51200
Figure 5.13 MA - move to an absolute position
MA moves the axis to a position in motor steps relative to zero (0). In the case of the profile shown in Figure 5:13
the end position of the first move (2) is + 51200, or 51200 motor steps from 0, a value which will be stored in the P
(Position Counter).
The second move, MA 102400 moves the axis an additional 51200 steps, ending at position 3 or 102400 steps
from 0. The third MA will index the axis 153600 steps in the negative direction from position 3, with a final position
of -51200 absolute from 0.
The time required to calculate each move is 20 Sec.
NOTES:
The MA command will not operate during a homing sequence.
An in progress MA can be stopped with an [ESC] or an SL 0 command entry.
In addition to the commanded position, there are two optional parameters to define specific functions within the
move.
Param
1
Description
Values
Default
Motor position
-2147483648 to +2147483648
V2.00, 05.2016
0 - no operation
5-84
Motion
5 COMMAND DETAILS
Range
See table
Syntax
motor steps
Units
Default
See table
Code example
Related
MA 102400
MA 1024900,0,1
MD (Motion Mode)
MR (Move Relative)
P (Position Counter)
SL (Slew)
V2.00, 05.2016
EtherNet/IP
5-85
class
instance
attribute
0x66
0x07
Modbus/TCP
0x0043-0x0044
5 COMMAND DETAILS
Mnemonic
MD
LMD(O)
LMD(C)
Function
LMM
Notes
Function Group
Motion Mode
Status Variable
Access
RO
Usage
Program/Immediate
Description
Read-only status variable holds the last used motion instruction. It is used in the (invisibly to the user) with the NE
(Numeric Enable) flag to facilitate repeated move types (absolute position, relative position or slew) by entering a
numeric value instead of the full command string.
May be used as a keyword with the PR (Print) instruction to view the last move type. The device will respond with
the command mnemonic: MA (Move Absolute), MR (Move Relative) or SL (Slew).
Range
MA. MR. SL
Syntax
PR MD
Units
Default
Code example
MA 51200
PR MD
MA
Related
MA (Move Absolute)
MR (Move Relative)
NE (Numeric Enable)
SL (Slew)
V2.00, 05.2016
EtherNet/IP
5-86
Modbus/TCP
5 COMMAND DETAILS
MF
LMD(O)
LMD(C)
Notes
LMM
Function
Function Group
Access
hMT Variable
Usage
RW
Program/Immediate
Description
Defines the frequency at which missed steps are re-inserted into the move profile when MU (Make-up Mode) is set
to mode 1.
When used as a keyword with the PR (Print) command it will return the stored value for MF.
Range
92 to VM
Syntax
MF=<steps/sec>, PR MF
motor steps/sec
Units
Default
768000
Code example
Related
MF=512000
PR MF
512000
AS (hMT Mode)
MU (Make-up Mode)
V2.00, 05.2016
EtherNet/IP
5-87
class
instance
attribute
0x6A
0x0B
Modbus/TCP
0x009E 0x009F
5 COMMAND DETAILS
Mnemonic
LMD(O)
LMD(C)
Function
MP
Notes
LMM
Function Group
Moving to a Position
Access
Status Flag
RO
Usage
Program/Immediate
Description
Read-only status flag is active (1) when the axis is indexing to a position.
Example use: wait subroutine while positional moves are in process.
Note that MP will be active for the total move, which includes the delays added to compensate for HT (Hold Current
Delay) and MT (Motor Settling Delay)
State
Description
The moving to position flag may be used to give external indication via an output point specifically configured for
the Moving to Position type (Os=<output>,23,<active>).
Range
0/1
Syntax
CL <label/address>,MP=<0/1> | PR MP
Units
Default
Code example
MA 5120000
PR MP
1
Related
MA (Move Absolute)
MR (Move Relative)
V2.00, 05.2016
EtherNet/IP
5-88
class
instance
attribute
0x66
0x08
Modbus/TCP
0x0045
5 COMMAND DETAILS
Mnemonic
LMD(O)
LMD(C)
Function
MR
Notes
LMM
Function Group
Access
Motion Instruction
Usage
Program/Immediate
Description
Set mode for relative move and move to a position relative to the current position. MD (Motion Mode) will be set to
MR.
0
MR 51200
MR 51200
MR -153600
Figure 5.14 MR - move to a relative position
MR moves the axis to a position in motor steps relative to the current motor position, zero (0). In the case of the
profile shown in Figure 5:14 the end position of the first move (2) is + 51200, or 51200 motor steps from 0, a value
which will be stored in the P (Position Counter).
The second move, MR 51200 moves the axis an additional 51200 steps, ending at position 3 or 102400 steps from
0. The third MR will index the axis -153600 steps in the negative direction from position 3, with a final position of
-51200 relative to the starting position of 0.
The time required to calculate each move is 20 Sec.
NOTES:
The MR command will not operate during a homing sequence.
An in progress MR can be stopped with an [ESC] or an SL 0 command entry.
In addition to the commanded position, there are two optional parameters to define specific functions within the
move.
Param
1
Description
Values
Default
Motor position
-2147483648 to +2147483648
V2.00, 05.2016
0 - no operation
5-89
Motion
5 COMMAND DETAILS
Range
See table
Syntax
motor steps
Units
Default
See table
Code example
Related
MR 102400
MR 102400,0,1
Move 102400 steps relative to the current motor position, do not stop motion
upon position
MD (Motion Mode)
MA (Move Absolute)
P (Position Counter)
SL (Slew)
V2.00, 05.2016
EtherNet/IP
5-90
class
instance
attribute
0x66
0x09
Modbus/TCP
0x0046-0x0047
5 COMMAND DETAILS
LMD(O)
Mnemonic
LMD(C)
Function
MS
Notes
LMM
Function Group
Access
Motion Variable
RW
Usage
Program/Immediate
Description
Sets the Microstep Resolution for the device. There are 20 fixed microstep resolutions that the Lexium Motion
product will accept ranging from full step (MR=1) to 256 microsteps per full step, or MR=256.
It is important to consider that when changing MS (Mcrostep Resolution), other motion variables will automatically
scale to the equivalent ratio, as shown in the table below, the settings for a particular velocity profile can change
dramatically based on the setting of MS:
MS=<param>
Default
MS=256
Change
MS=2
Steps/rev
VI (Initial V)
VM (Max V)
51200
1000
768000
1000000
1000000
400
3000
3906
3906
The table below is based upon the Lexium MDrive products with 1.8 (200 Step/Rev) motor. If using a Lexium
modular product with a different motor, the motor resolution will apply. For example a 0.9 motor has 400 steps per
revolution. The following equation applies where SA is the setting of the Step Angle variable.
Steps/Rev = (360/SA)*MS
Parameters
Binary resolution parameters
per step
8*
16
32
64
128
256
per rev,
200
400
800
1600
3200
6400
12800
25600
51200
5*
10
25
50
100
125
200
250
per rev,
1000
2000
5000
10000
20000
25000
40000
50000
108
127
180
per rev,
25400 (0.001mm/Step)
36000 (0.01/Step)
V2.00, 05.2016
All shown steps per revolution values assume the 1.8 motor standard with Lexium MDrive products. If using a
custom integrated product, or a Lexium Motion Module with a motor with a step angle other than 1.8 refer to the
SA (Step Angle) command
5-91
5 COMMAND DETAILS
Range
Syntax
MS=<param>, PR MS
steps/full step
Units
Default
256
Code example
Related
MS=4
PR MS
4
A (Acceleration)
D (Deceleration)
MA (Move Absolute)
MR (Move Relative)
SA (Step Angle)
SL (Slew at Velocity)
VI (Initial Velocity)
VM (Maximum Velocity)
V2.00, 05.2016
EtherNet/IP
5-92
class
instance
attribute
0x66
0x0A
Modbus/TCP
0x0048
5 COMMAND DETAILS
LMD(O)
Mnemonic
LMD(C)
Function
MT
Function Group
Notes
LMM
Access
Motion Variable
RW
Usage
Program/Immediate
Description
Delay in milliseconds given to allow the motor to settle into position following a move., The delay time is also
impacted by the HT (Hold Current Delay) variable. The sum of MT + HT represents the total time delay between
RC and HC.
The total of MT+HT cannot add up to more than 65535, thus, the value of MT is included in the total delay.
Thus the maximum setting for MT=(65535-HT). If setting HT to 0, MT is still in effect. If both HT and MT are set to
0, the current will not reduce, but maintain the RC (Run Current) percentage.
Exceeding this maximum returns an Error 21: Illegal data value entered.
DELAY =
HT +
MT
Current
HC% (HoldCurrent)
Time
Figure 5.15 MT (Motor Settling Delay) and HT (Hold Current Delay) relationship
MT should be at least 50 mS when encoder functions are enabled(EE=1)
Range
0 to (65535-HT)
Syntax
MT=<time>, PR MT
milliseconds
Units
Default
500
Code example
Related
MT=0
PR MT
0
HC (Hold Current)
RC (Run Current)
V2.00, 05.2016
EtherNet/IP
5-93
class
instance
attribute
0x66
0x0B
Modbus/TCP
0x0049
5 COMMAND DETAILS
LMD(O)
Mnemonic
LMD(C)
Function
MU
Notes
LMM
Function Group
hMT Variable
Access
Usage
RW
Program/Immediate
Description
Defines the mode for hMTechnology position make-up. Make-up only occurs when motor lag/lead is within 1.1
motor steps. Make up steps may be interleaved with motion steps and made after a move has completed.
Where make-up occurs is dependant on motor lag/lead, motion frequency and selected make up speed.
Make up mode will be cleared when bridges are disabled and hMTechnology is enabled (AS=1 or 2).
Mode
Description
Use system speed , an internally defined velocity limited to 2560000 steps/sec (3000 RPM) as make
up frequency
Range
0 to 2
Syntax
MU=<mode>
Units
Default
Code example
Related
MU=1
PR MU
1
AS (hMTechnology Mode)
MF (Make-up Frequency)
V2.00, 05.2016
EtherNet/IP
5-94
class
instance
attribute
0x6A
0x0C
Modbus/TCP
0x00A0
5 COMMAND DETAILS
5.1.88 MV (Moving)
Compatibility
LMD(O)
Mnemonic
LMD(C)
Function
MV
Notes
LMM
Function Group
Axis is Moving
Access
Status Flag
RO
Usage
Program/Immediate
Description
Read-only status flag is active (1) when the axis is moving, regardless of the move type.
Note that MP will be active for the total move, which includes the delays added to compensate for HT (Hold Current
Delay) and MT (Motor Settling Delay)
State
Description
Not moving
Moving
NOTES:
The moving flag may be used to give external indication via either an output point specifically configured for
the Moving type (Os=<output>,17,<active>) or by setting the attention output mask variable (AO=16384) to
indicate on LED 2 (Lexium MDrive Motion Control models only) or an output defined as the Attention Output type
(OS=<output>,29,<active>)
Range
0/1
Syntax
CL <label/address>,MV=<0/1> | PR MVP
Units
Default
Code example
SL 51200
PR MV
1
Related
MA (Move Absolute)
MR (Move Relative)
OS (Output Setup)
SL (Slew)
V2.00, 05.2016
EtherNet/IP
5-95
class
instance
attribute
0x66
0x0C
Modbus/TCP
0x004A
5 COMMAND DETAILS
LMD(O)
Mnemonic
LMD(C)
Function
NE
Notes
LMM
Function Group
Setup Variable
Access
RW
Usage
Program/Immediate
Description
Facilitates repeated move types (absolute position, relative position or slew) by entering a numeric value instead of
the full command string.
When a move is executed, the type of move (MA, MR or SL) is stored in the MD (Motion Mode) variable. This
stored value will be used as the move type whenever NE is in an enabled state.
If disabled, the user must enter a motion command to execute a move, i.e. MA 100000, MR -50000, SL 300000 etc.
Value
Description
Disabled (default)
Range
0/1
Syntax
NE=<0/1>, PR NE
Units
Default
Code example
Related
NE=1
PR NE
1
MA (Move Absolute)
MD (Motion Mode)
MR (Move Relative)
SL (Slew)
V2.00, 05.2016
EtherNet/IP
5-96
Modbus/TCP
5 COMMAND DETAILS
LMD(O)
Mnemonic
LMD(C)
Function
O1/O2/O3
Notes
LMM
Function Group
Set Output #
I/O Instruction
Usage
RO
Program/Immediate
Description
Sets the state of the specified output to 1 or 0 for output type 16 (General Purpose User).
The output response is determined by the third parameter of OS (Output Setup), which defines the output as active
when HIGH (1) or LOW (0).
Setting
O<output>=0
O<output>=1
Output Config
Output State
OS=x,16,0
INACTIVE
OS=x,16, 1
ACTIVE
OS=x,16,0
ACTIVE
OS=x,16, 1
INACTIVE
NOTES:
On LMDxM42x or LMDxE42x (NEMA 17) Outputs 1 and 2 are not present. Use of this command will return an Error
37: Command, variable or flag not available.
Range
0/1
Syntax
O<1/2/3>=<0/1>
Units
Default
Code example
Related
O1=1
O1=0
OF (Output Fault)
OS (Output Setup)
V2.00, 05.2016
EtherNet/IP
5-97
class
instance
attribute
0x67
0x10 (O1)
0x11 (O2)
0x12 (O3)
Modbus/TCP
0x004B (O1)
0x004C (O2)
0x004D (O3)
5 COMMAND DETAILS
Mnemonic
LMD(O)
LMD(C)
LMM
Function
OE
Function Group
On Error Handler
Notes
Access
Program Instruction
Usage
RW
Program/Immediate
Description
OE declares the label or address of the subroutine which will execute when an error code ER (Error Code) is
asserted and EF (Error Flag) activated.
Attempting to target OE to a non-existent subroutine will throw an Error 30: Unknown User Label or Variable.
Standard rules for subroutines apply to subroutines called by OE: and RT must be inserted at the end of the
subroutine, After the subroutine completes, the program will return to the line following the command string that
caused the error.
NOTES:
1)
OE may be declared inside a program, between the opening and closing PG (Program Mode) tags
2)
OE may be declared in immediate mode ONLY if the target subroutine is resident in program memory
space, The program need not be running
3)
Subroutines targeted by an OE will execute when an error is encountered during immediate operations.
The target subroutine need only be resident in program memory space, it does not need to be running.
4)
Syntax
Code example
OE Q1
Related
EF (Error Flag)
ER (Error Code)
V2.00, 05.2016
EtherNet/IP
5-98
Modbus/TCP
5 COMMAND DETAILS
Mnemonic
LMD(O)
LMD(C)
Function
OF
Notes
LMM
Function Group
I/O Variable
Usage
Program/Immediate
Description
Read-only status variable indicates an over-current fault condition on the power outputs (Outputs 1 and 2).
Though an Error code 1 or 2 will also be asserted, read the Output Fault from OF, as the ER (Error Register) will
only hold the last asserted error, indicating a single output fault condition when in fact both outputs may be faulted.
Status code
Description
No Fault (default)
Range
0 to 4
Syntax
Units
Default
Code example
Related
PR OF
0
CL Q1,OF=1
EF (Error Flag)
ER (Error Register)
Os (Output Setup)
V2.00, 05.2016
EtherNet/IP
5-99
class
instance
attribute
0x67
0x13
Modbus/TCP
0x004E
5 COMMAND DETAILS
Compatibility
Mnemonic
LMD(O)
LMD(C)
LMM
Function
OS
Notes
Function Group
Setup Outputs 1 to 3
I/O Instruction
Usage
RW
Program/Immediate
Description
This instruction is used to configure the output parameters. These parameters define the function and active state.
When used as a keyword (PR OS), the instruction will return the configuration of all outputs.
Output parameters
Param
Description
Values
Default
1-3
Output active
0 (LOW active)
V2.00, 05.2016
Type
5-100
Function
Notes/restrictions
16
General purpose user: (default for all inputs) typically used to trigger
events external to the device using O1-O3 and OT
17
See MV (Moving)
18
Se ER (Error)
20
Velocity Changing: active when the axis is changing velocity, such as acceleration and deceleration, linked to the VC (Velocity Changing) flag
21
23
Moving to a Position: active while the axis is moving to a position from and
MA (Move Absolute) or MR (Move Relative). Includes HT and MT delays,
Linked to the status of the MP (Moving to Position) flag.
24
See AS (hMTechnology
Mode) [hMT LMD ONLY]
25
28
Trip: active when an assigned trip event occurs. Available on Output 3 (Signal Output) only. The trip function is active when LOW only.
29
5 COMMAND DETAILS
Lexium MDrive NEMA 17 (42 mm) models are equipped with OUT 3 (Signal Output)
only. Attempting to setup Outputs 1 or 2 will generate an Error 10: Illegal I/O number.
Some output functions are hMTechnology specific and not available on all products.
Such variances are noted in the type table on the previous page.
Syntax
OS=<1-3>,<type>,<active> | PR OS
Code example
OS=1,17,1
OS=3,29
PR OS
OS = 1, 17, 1
OS = 2, 16, 0
OS = 3, 29, 0
Related
IS (Input Setup))
V2.00, 05.2016
EtherNet/IP
5-101
class
instance
attribute
0x67
0x14
Modbus/TCP
5 COMMAND DETAILS
Compatibility
LMD(O)
Mnemonic
LMD(C)
Function
OT
Function Group
Notes
LMM
Access
I/O Instruction
RW
Usage
Program/Immediate
Description
Allows the user to set outputs 1-3 as one 3 bit binary value. The value is entered in decimal, with a range of 0-7 in
binary where Output 1 will be the LSb and Output 3 will be the MSb.
Range
1-7
Syntax
OT=
Units
Default
Code example
OT=7
Related
OS (Output Setup)
V2.00, 05.2016
EtherNet/IP
5-102
class
instance
attribute
0x67
0x015
Modbus/TCP
0x0056
5 COMMAND DETAILS
LMD(O)
Mnemonic
LMD(C)
Function
Notes
LMM
Function Group
Position Counter
Access
Instruction
RW
Usage
Program/Immediate
Description
Reads or writes the value of the position counter. The position will read in Motor Steps from C1 (Counter 1) by
default, if encoder functions are enabled on closed loop models, the position counter will read in Encoder Counts
from C2 (Counter 2).
Modifying P in essence changes the frame of reference for the axis for Move Absolute (MA) instructions. P will
likely be set once during system set up to reference or home for the system.
Range
EE=0
-2147483648 to +2147483647
EE=1
-2147483648 to +2147483647
Units
Motor steps
Encoder counts
Default
Syntax
Code example
Related
P=0
PR P
0
C1 (Counter 1)
C2 (Counter 2)
V2.00, 05.2016
EtherNet/IP
5-103
class
instance
attribute
0x68
0x03
Modbus/TCP
0x0057-0x0058
5 COMMAND DETAILS
Mnemonic
LMD(O)
LMD(C)
Function
PC
Notes
LMM
Function Group
Instruction
Access
RW
Usage
Program/Immediate
Description
Captures motor or encoder position during a trip event. Activation will occur upon any trip function EXCEPT a
position trip (TP or TR). Will display in either motor steps (EE=0) or encoder counts (EE=1)
PR PC
Syntax
Code example
PR PC
0
Related
TC (Trip Capture)
TE (Trip Enable)
TI (Trip on Input)
TT (Trip on Time)
V2.00, 05.2016
EtherNet/IP
5-104
class
instance
attribute
0x68
0x04
Modbus/TCP
0x0059 - 0x005A
5 COMMAND DETAILS
LMD(O)
Mnemonic
LMD(C)
Function
PF
Notes
LMM
Function Group
System Variable
Firmware 6.00.00+
Access
Usage
RW
Program/Immediate
Description
Sets the format for displaying the contents of the floating point registers F1 through F8. This command is used to
format floating point values for setting the width, digits following the decimal, notation and justification. Note this
setting will not truncate the floating point register values for numbers that extend beyond the PF setting.
Param
Description
Values
Default
width
10
decimal
notation
justification
0 (right), 1 (left)
Range
Syntax
PF=<width>,<dec>,<0/1>,<0/1>, PR PF
Units
Default
10,6,0,0
Code example
Related
PR PF
10,6,0,0
PR F1
0.000000
PF=8,4,1,1
PR F1
0.0000E+00
PR (Print)
V2.00, 05.2016
EtherNet/IP
5-105
Modbus/TCP
5 COMMAND DETAILS
LMD(O)
Mnemonic
LMD(C)
Function
PG
Notes
LMM
Function Group
Program Instruction
Access
Usage
Program/Immediate
Description
Toggles the device into or out of program mode.
PG <address>
Syntax
Code example
Related
PG 1
[MAIN PROG]
[SUBROUTINES]
PG
E
FD (Factory Defaults)
V2.00, 05.2016
EtherNet/IP
5-106
class
instance
attribute
Modbus/TCP
5 COMMAND DETAILS
5.1.99 PK (Reserved)
Compatibility
Mnemonic
PK
LMD(O)
Function
Null
LMD(C)
Notes
LMM
Function Group
Reserved
Description
V2.00, 05.2016
5-107
Access
Usage
5 COMMAND DETAILS
5.1.100
PM (Position Maintenance)
Compatibility
LMD(O)
Mnemonic
LMD(C)
Notes
LMM
Function
PM
Function Group
Encoder Flag
Encoder required
Access
RW
Usage
Program/Immediate
Description
Enables the position maintenance functions of an Lexium MCode compatible device with encoder. The position
maintenance velocity will be at the setting for VI (Initial Velocity). If moved beyond the value of DB (DeadBand),
unit will correct.
Encoder functions must be enabled (EE=1) for position maintenance.
Param
Description
The method for position maintenance will depend on the setting of the SM (Stall Detect Mode) variable:
PM=
1
SM=
Position maintenance
Position maintenance occurs provided position is within the setting of SF (Stall Factor)
Position maintenance is not to be confused with hMTechnology MU (Position Makeup) function. While similar, the
method for correcting and maintaining position are different.
Encoder functions (EE=1) must be enable for PM to take effect.
Range
0/1
Syntax
PM=<0/1>
Units
Default
Code example
Related
PM=1
PR PM
1
C2 (Encoder Counter)
DB (Encoder Deadband)
SF (Stall Factor)
EE (Encoder Enable)
V2.00, 05.2016
EtherNet/IP
5-108
class
instance
attribute
0x69
0x06
Modbus/TCP
0x005C
5 COMMAND DETAILS
5.1.101
PN (Part Number)
Compatibility
Mnemonic
PN
LMD(O)
LMD(C)
Function
Notes
LMM
Function Group
Access
Identification variable
RO
Usage
Program/Immediate
Description
Read only register holds the factory defined part number.
Syntax
PR PN
Code example
PR PN
LMDCM571
Related
SN (Serial Number)
VR (Version)
V2.00, 05.2016
EtherNet/IP
5-109
class
instance
attribute
0x65
0x05
Modbus/TCP
5 COMMAND DETAILS
5.1.102
PR (Print specified data and/or text)
Compatibility
LMD(O)
Mnemonic
LMD(C)
Function
PR
LMM
Notes
Function Group
System Instruction
Access
RW
Usage
Program/Immediate
Description
Outputs text and parameter value(s) to the communications host. Text strings are enclosed in quotation marks
while parameters (variables and flags) should not. Text strings and parameters which are to be output by the same
PR instruction should be separated by commas. The information being output is followed by a carriage return
unless a semicolon (;) is included at the end of the PR instruction to indicate that the cursor should remain on the
same line.
It is important to note that the receive buffer for the Lexium MCode device is 64 characters, this includes the PR
instruction itself, any spaces, text characters, etc. If the buffer length is exceeded a CR/LF occurs and Error 20:
Tried to set unknown variable or flag.
ASCII control codes
ASCII control codes may be used to enhance the performance of the PR instruction. They must be enclosed within
quotes, for example PR P, " motor steps\r" would terminate a string requesting the axis position with a carriage
return.
The table below shows the most commonly used escape codes, though most ASCIII escape codes used with
terminal emulators may be used.
Param
Description
\b
Backspace
\c
\e
ESC
\g
Bell/beep
\n
Line feed
\r
Carriage return
\t
Tab
Syntax
Code example
PR P
PR "Position = ",P
Position = 12345
12345
V2.00, 05.2016
Related
PF (Print Format)
5-110
Modbus/TCP
5 COMMAND DETAILS
5.1.103
PS (Pause Program)
Compatibility
LMD(O)
Mnemonic
LMD(C)
LMM
Function
PS
Notes
Function Group
Access
Program Instruction
Usage
Program/Immediate
Description
Pauses an executing program with normal deceleration ramp. Immediate mode instruction may be issued and will
be executed while a program is paused.
The RS (Resume Paused Program) is used to resume the paused program.
PS
Syntax
Code example
PS
Related
E (End Program)
EX (Execute Program)
PG (Program Mode)
V2.00, 05.2016
EtherNet/IP
5-111
Modbus/TCP
5 COMMAND DETAILS
5.1.104
PW (PWM Mask)
Compatibility
Mnemonic
LMD(O)
LMD(C)
Function
PW
Notes
LMM
Function Group
Configuration Variable
Access
RW
Usage
Program/Immediate
Description
The PW variable is only used on the Lexium Motion Module product only. It is not a reserved word on the Lexium
MDrive products and may be used as a user variable or label.
This variable is used to set the PWM current control settings of the LMM ONLY! It does not apply in any function
to the Lexium MDrive and may be used as a label or user variable or flag. See Section 7: Programming and
Applications Notes of this document for parameter settings and usage.
The PW variable is defaulted to SEM NEMA 17 (42 mm) motors. Recommended settings for additional motor sizes
offered by SEM are located in Section 7 of this document. A settings dialog is also available from the View Menu
when the LMMxM drive type is selected in the terminal settings.
Range
See Section 7
Syntax
PW=<mask>,<period>,<sfreq>,<ctrl> | PR PW
Units
See Section 7
Default
Code example
See Section 7
Related
V2.00, 05.2016
EtherNet/IP
5-112
Modbus/TCP
5 COMMAND DETAILS
5.1.105
PY (Party Mode)
Compatibility
Mnemonic
LMD(O)
LMD(C)
Function
PY
Notes
LMM
Function Group
Communications Variable
Access
RW
Usage
Program/Immediate
Description
The party flag must be set to 1 if the device is being used in a multidrop communication system.
When Party Mode is enabled, each device in the system must be addressed by the host computer by using the
device name specified by the DN instruction. This name will precede any command given to a specified unit in the
system and be terminated with a Control J (CTRL + J). One CTRL + J must be issued after power up or entering
the Party Mode to activate the Party Mode. By default the DN assigned at the factory is the exclamation character
(!) .
The global Drive Name is the asterisk character (*). Commands preceded by this character will be recognized by
every Lexium MCode compatible device in the system.
After the Party Mode is enabled, send CTRL + J (^J) to activate it. Type commands with Device Name (DN) and
use CTRL + J as the Terminator.
Note: A delay time between the command requests to the device must be considered to allow the device time to
interpret a command and answer the host before a subsequent command can be sent. The time between requests
is dependent on the command and the corresponding response from the Device.
Value
Description
Disabled (default)
LMM Note:
The Lexium Motion Module features hardware inputs for device name (address). When ever any og these inputs is
active, the LMM will automatically enable Party Mode.
Range
0/1
Syntax
PY=<0/1>, PR PY
Units
Default
Code example
Related
PY=1[Enter][CTRL+J]
!MR 512000[CTRL+J]
!PR P[CTRL+J]
512000
DG (Disable Global)
DN (Device Name)
EtherNet/IP
5-113
Modbus/TCP
5 COMMAND DETAILS
5.1.106
QD (Queued)
Compatibility
Mnemonic
QD
LMD(O)
LMD(C)
Function
Function Group
Device Queued
Notes
LMM
Access
Comm Flag
Usage
RW
Program/Immediate
Description
Function is to queue drives on party lines. QD may be set outside of party mode, but will only take effect if PY
(Party Mode) is enabled (PY=1)
If a drive or drives are Queued, then, when they see the address ^, they will respond to it. All other, non-queued
drives will ignore the command
Range
o/1
Syntax
<dn>QD=<0/1>, <dn>PR QD
Units
Default
Code example
Related
!QD=1[CTRL+J]
^MA 0[CTRL+J]
DN (Device Name)
PY (Party Mode)
V2.00, 05.2016
EtherNet/IP
5-114
Modbus/TCP
5 COMMAND DETAILS
5.1.107
R1-R4 (User Register)
Compatibility
Mnemonic
R<1-4>
LMD(O)
LMD(C)
Function
Notes
LMM
Function Group
Access
Mathematics Variable
Usage
RW
Program/Immediate
Description
Four 32 bit user registers to contain numerical data. These registers may contain up to 11 digits including the sign
and may be used to store and retrieve data to set variables, perform math functions, store and retrieve moves and
set conditions for branches and call subroutine.
These registers contain integer values only, to perform floating point calculations, use F<1-8> (Floating Point
Registers).
Range
-2147483647 to 2147483647
Syntax
Units
Default
Code example
Related
R1=12345
Set R1 to 12345
PR R1
12345
R1=R2+R3
CL Q2, R1<25
V2.00, 05.2016
EtherNet/IP
5-115
class
instance
attribute
0x65
R1: 0x06
R2: 0x07
R3: 0x08
R4: 0x09
Modbus/TCP
5 COMMAND DETAILS
5.1.108
RA (Radians or degrees)
Compatibility
LMD(O)
Mnemonic
LMD(C)
LMM
Function
RA
Notes
Function Group
Configuration Variable
Firmware 6.00.00+
Access
RW
Usage
Program/Immediate
Description
Selects the Radians or Degrees as the units for trigonometric calculations. When used as a keyword with the PR
(Print) statement it will return the setting to the terminal.
Value
Description
Degrees
Range
0/1
Syntax
RA=<0/1> | PR RA
Units
Default
Code example
Related
RA=0
PR RA
0
V2.00, 05.2016
EtherNet/IP
5-116
Modbus/TCP
5 COMMAND DETAILS
5.1.109
RC (Run Current)
Compatibility
Mnemonic
LMD(O)
LMD(C)
Function
RC
LMM
Notes
Function Group
Access
Motion variable
R/W
Usage
Program/Immediate
Description
Defines the motor run current as a percentage value from 1 to 100%. The transition from RC (Run Current) to HC
(Hold Current) is impacted by two other commands: HT (Hold Current Delay) and MT (Motor Settling Delay Time).
These two variables are additive, with the sum being the total time to transition from the RC (Run Current) level to
the specified standstill current.
Notes:
For Lexium MDrive products the current is only given in a percentage range as the driver is already sized and
tuned to the integrated motor.
The Lexium Motion Module is a 1.5A RMS standalone integrated driver/controller. The actual drive output current is
derived thus: RC=75 results in a run current level of 1.12 A - 1.5A * 0.75 = 1.12A.
Range
1 to 100
Syntax
HC=<percent>, PR HC
Percent (%)
Units
Default
25%
Code example
Related
RC=75
PR RC
RC (Run Current)
V2.00, 05.2016
EtherNet/IP
5-117
class
instance
attribute
0x66
0x03
Modbus/TCP
0x0029
5 COMMAND DETAILS
5.1.110
RD (Rotation of Direction)
UNINTENDED MOTION
Use of the RD command in Lexium Motion product or Ethernet (Closed Loop models) with
firmware versions 5.007 or earlier may, under certain conditions, result in unintended motion.
Compatibility
LMD(O)
Mnemonic
LMD(C)
Function
RD
Notes
LMM
Function Group
Rotation of Direction
Access
Motion Variable
RW
Usage
Program/Immediate
Description
This variable, when TRUE will reverse the default +/- motor direction reference. Cannot be issued when the axis is
in motion or error 95 will be asserted.
Value
Description
Direction reversed
Range
0/1
Syntax
RD=<0/1>, PR RD
Units
Default
Code example
Related
RD=1
PR RD
1
V2.00, 05.2016
EtherNet/IP
5-118
class
instance
attribute
0x66
0x13
Modbus/TCP
5 COMMAND DETAILS
5.1.111
RS (Resume Program Execution)
Compatibility
LMD(O)
Mnemonic
LMD(C)
Function
RS
Notes
LMM
Function Group
Program Instruction
Access
Usage
Immediate
Description
Resumes and executing program that has been paused using the PS (Pause Program Execution) command.
If the pause was issued during a move, the move will restart with the configured acceleration profile.
RS
Syntax
Code example
RS
Related
E (End Program)
EX (Execute Program)
PG (Program Mode)
V2.00, 05.2016
EtherNet/IP
5-119
Modbus/TCP
5 COMMAND DETAILS
5.1.112
RT (Return From Subroutine)
Compatibility
LMD(O)
Mnemonic
LMD(C)
Function
RT
Notes
LMM
Function Group
Program Instruction
Access
Usage
Program
Description
Defines the end of a subroutine. This instruction is required and will be the final instruction in the subroutine
executed by the CL or OE instruction. When used, it will return to the program address immediately following the
instruction which executed the subroutine.
RT
Syntax
Code example
RT
Related
CL (Call Subroutine)
V2.00, 05.2016
EtherNet/IP
5-120
Modbus/TCP
5 COMMAND DETAILS
5.1.113
S (Save to FLASH)
Compatibility
LMD(O)
Mnemonic
LMD(C)
LMM
Function
Notes
Function Group
System Instruction
Access
Usage
RW
Program/Immediate
Description
Saves all variables and flags currently in working memory (RAM) to nonvolatile memory (NVM). The previous
values in NVM are completely overwritten with the new values.
When the user modifies variables and flags, they are changed in working memory (RAM) only. If the S instruction is
not executed before power is removed from the control module, all modifications to variables & flags since the last
S will be lost.
Note: sending or requesting data during a save could corrupt communications. If a save is performed during the
execution of a motion command, trips may be delayed.
Use of the S command during a move (MA or MR) will generate an error 73, the save will not occur.
TIP:
Programs may be automatically saved on load by adding an S after the final PG. The line following the S should
have a comment line to guarantee the <CR/LF> after the save.
Syntax
Code example
Related
E
PG
S
'keep this line
V2.00, 05.2016
EtherNet/IP
5-121
Modbus/TCP
0x0076
5 COMMAND DETAILS
5.1.114
SA (Step Angle)
Compatibility
LMD(O)
Mnemonic
LMD(C)
Function
SA
Notes
LMM
Function Group
Motion Variable
LMM only
Access
RW
Usage
Program/Immediate
Description
Step angle is a floating point variable to configure the step angle of the motor for the Lexium Motion Module only.
The setting is represented by the equation: Motorcts = MS * (360/SA)
Ex:
MS = 256
SA = 0.9
MtrCts = 256 * (360 / 0.9) = 102400
Common step angles for Hybrid stepper motors are shown in the table below
Angle
Steps/rev
0.45
800
0.72
500
0.9
400
1.8
200
1.875
192
180
2.5
144
3.6
100
72
Range
See Table
Syntax
SA=<angle>, PR SA
Units
Degrees
Default
1.8
Code example
Related
SA=0.9
PR SA
0.900000
EtherNet/IP
5-122
Modbus/TCP
5 COMMAND DETAILS
5.1.115
SC (System Configuration Test)
Compatibility
LMD(O)
Mnemonic
LMD(C)
Function
SC
Notes
LMM
Function Group
System instruction
Access
RW
Usage
Program/Immediate
Description
Tests the encoder direction and resolution by moving the motor shaft 1/2 revolution (180 degrees).
Ensure the shaft is disconnected from load and free to move unhindered prior to running this test.
A misconfigured encoder will return an error.
SC 1
Syntax
Code example
SC 1
Related
V2.00, 05.2016
EtherNet/IP
5-123
class
instance
attribute
0x6A
0x0D
Modbus/TCP
0x00A1
5 COMMAND DETAILS
5.1.116
SF (Stall Factor)
Compatibility
Mnemonic
LMD(O)
LMD(C)
Function
SF
Notes
LMM
Function Group
Encoder Variable
Usage
Program/Immediate
Description
If the encoder is enabled (EE = 1) and encoder position differs from the commanded position by more than the
specified factor, a motor stall error is asserted. If SM is set to 0, then the motor will be stopped when a stall is
detected. If SM=1, the motor will not be stopped upon detection of a stall. ST will return an Error 86 on stall.
Range
0 to 65000
Syntax
SF=<counts>, PR SF
Encoder counts
Units
Default
15
Code example
Related
SF=20
PR SF
20
EE (Encoder Enable)
PM (Position Maintenance)
ST (Stall Flag)
V2.00, 05.2016
EtherNet/IP
5-124
class
instance
attribute
0x69
0x07
Modbus/TCP
0x0077
5 COMMAND DETAILS
5.1.117
SL (Slew at Velocity)
Compatibility
LMD(O)
Mnemonic
LMD(C)
Function
SL
Notes
LMM
Function Group
Motion Instruction
Access
RW
Usage
Program/Immediate
Description
Slews the axis at the commanded velocity in steps per second. The axis will accelerate at the rate specified by the
A (Acceleration) variable.
Note that the maximum slew velocity is independent of the maximum velocity specified by the VM variable. If SL
0 is issued after a MA/MR, motion has to come to a stop before issuing another motion command. This can be
accomplished automatically with an H, <HOLD>, in user program mode.
Range
Syntax
SL <velocity.
Units
Code example
Related
SL 20000
PR V
20000
MA (Move Absolute)
MR (Move Relative)
VI (Initial Velocity)
V2.00, 05.2016
EtherNet/IP
5-125
class
instance
attribute
0x66
0x0E
Modbus/TCP
0x0078
5 COMMAND DETAILS
5.1.118
SM (Stall Detect Mode)
Compatibility
LMD(O)
Mnemonic
LMD(C)
Function
SM
Notes
LMM
Function Group
Encoder Variable
Usage
Program/Immediate
Description
Specifies the action which will be taken by the device when a stall is detected. When set to 0 (default) the motion
will be stopped upon a stall detection. When SM=1, the motor will try to continue the move. In either case ST (Stall
Flag) will be set.
The functionality of SM when used with Position Maintenance (PM) is listed below:
Param
Description
The method for position maintenance will depend on the setting of the SM (Stall Detect Mode) variable:
PM=
1
SM=
Position maintenance
Position maintenance occurs provided position is within the setting of SF (Stall Factor)
Range
00/1
Syntax
SM=<0/1>, PR SM
Units
Default
Code example
Related
SM=1
PR SM
1
EE (Encoder Enable)
PM (Position Maintenance)
ST (Stall Flag)
V2.00, 05.2016
EtherNet/IP
5-126
class
instance
attribute
0x69
0x08
Modbus/TCP
0x007A
5 COMMAND DETAILS
5.1.119
SN (Serial Number)
Compatibility
Mnemonic
LMD(O)
LMD(C)
Function
SN
Notes
LMM
Function Group
Access
Keyword
RO
Usage
Program/Immediate
Description
Allows user to read the deviece serial number using the PR (Print) statement.
PR SN
Syntax
Code example
PR SN
Related
PN (Part Number)
VR (Version)
V2.00, 05.2016
EtherNet/IP
5-127
class
instance
attribute
0x65
0x0A
Modbus/TCP
5 COMMAND DETAILS
5.1.120
ST (Stall Flag)
Compatibility
LMD(O)
Mnemonic
LMD(C)
Function
ST
Notes
LMM
Function Group
Stall Flag
Encoder Flag
Usage
Program/Immediate
Description
The stall flag is set active (1) when the motor stalls. An Error 86 will also be asserted.
It is important to note that the Stall Flag must be manually reset to 0 (ST-0) clearing the error state will not clear the
stall flag. The product will respond to motion commands while the ST flag is active. A subroutine triggered by the
OE (One Error) instruction containing
Encoder functions must be enabled (EE=1)
Param
Description
Axis is stalled
Range
0/1
Syntax
ST=<0/1>, PR ST
Units
Default
Code example
Related
ST=0
PR ST
0
EE (Encoder Enable)
OE (On Error)
SF (Stall Factor)
SM (Stall Mode)
V2.00, 05.2016
EtherNet/IP
5-128
class
instance
attribute
0x69
0x09
Modbus/TCP
0x007B
5 COMMAND DETAILS
5.1.121
SU (Execute Program on Startup)
! DANGER
Compatibility
Mnemonic
LMD(O)
LMD(C)
Function
SU
LMM
Notes
Function Group
Execute on Startup
Factory Label
Access
RW
Usage
Program/Immediate
Description
The Start up label will cause any program labeled SU to automatically execute on power-up.
LB SU
Syntax
Code example
LB SU
Related
V2.00, 05.2016
EtherNet/IP
5-129
Modbus/TCP
5 COMMAND DETAILS
5.1.122
TA (Trip on hMT Status)
LMD(O)
Compatibility
Mnemonic
LMD(C)
LMM
Function
TA
Function Group
Notes
Access
Trip Variable
RW
Usage
Program/Immediate
Description
Executes a subroutine address or label on the trip. The trip can be set to occurs on any or all of three conditions:
calibration done, hybrid active, locked rotor or lead/lag limit reached conditions.
Param
Description
Off
Calibration done
hMTechnology active
Locked roto
16
The conditions are additive, eg. TA=3 will trip on calibration complete and hybrid active status.
There is no error generation when enabling trip on locked rotor, lag limit or lead limit.
Range
0-7
Syntax
TA=<label/address>,<0-7>
Units
Default
Code example
TA=4, k6
Related
TE (Trip Enable)
V2.00, 05.2016
EtherNet/IP
5-130
Modbus/TCP
5 COMMAND DETAILS
5.1.123
TC (Trip on Capture)
Compatibility
Mnemonic
LMD(O)
LMD(C)
Function
TC
Notes
LMM
Function Group
Trip Capture
Trip Variable
Access
RW
Usage
Program/Immediate
Description
Sets the Capture input trip for input 1. Sets one parameter for trip address. The TE command (Trip Enable/
Disable TC) is reset when trip occurs. TE must be re-enabled in the main program prior to the next trip if it is to be
repeated. The Trip subroutine must use a RETURN (RT) to exit the subroutine, use of a BRANCH will cause stack
errors..
TC=<label/address>
Syntax
Code example
TC=K1
Related
IS (Input Setup)
TE (Trip Enable)
V2.00, 05.2016
EtherNet/IP
5-131
Modbus/TCP
5 COMMAND DETAILS
5.1.124
TD (Torque Direction)
LMD(O)
Compatibility
Mnemonic
LMD(C)
LMM
Function
TD
Notes
Function Group
hMT Variable
Usage
RW
Program/Immediate
Description
Sets torque direction to + or
Param
0
1
Description
Minus (CCW facing shaft)
Plus (CW facing shaft) (default)
Range
0/1
Syntax
TD=<0/1>, PR TD
Units
Default
Code example
Related
TD=0
PR TD
1
AS (hMT Mode)
TQ (Torque)
TS (Torque Speed)
V2.00, 05.2016
EtherNet/IP
5-132
class
instance
attribute
0x6A
0x0E
Modbus/TCP
0x00A5
5 COMMAND DETAILS
5.1.125
TE (Trip Enable)
Compatibility
Mnemonic
LMD(O)
LMD(C)
Function
TE
Notes
LMM
Function Group
Access
Variable
Usage
RW
Program/Immediate
Description
The trip functions may be combined by adding trip numbers. For example TE=3 will trip on input or on position,
TE=127 enables all trips. When multiple trips are used only the activated trip function needs to be re-enabled, the
other trips will still be enabled.
Param
Description
Compatibility
Disabled (default)
All
All
All
All
16
All
32
64
All
NOTES: A trip must be defined prior to being enabled. Enabling an undefined trip will throw an Error 27: Trip not
defined
Range
0 - 127
Syntax
TE=<param> | PR TE
Units
Default
0 (disabled)
Code example
Related
TE=127
PR TE
127
IS (Input Setup)
TC (Trip Capture)
TI (Trip on Input)
TP (Trip on Position)
TT (Trip on Time)
V2.00, 05.2016
EtherNet/IP
5-133
Modbus/TCP
5 COMMAND DETAILS
5.1.126
TI (Trip on Input)
Compatibility
Mnemonic
TI
LMD(O)
LMD(C)
Function
LMM
Notes
Function Group
Trip on Input
Trip Variable
Access
RW
Usage
Program/Immediate
Description
Sets up an input event (Trip) for the specified input. There are two parameters for the TI variable. The first specifies
which input line to monitor. The second specifies the subroutine that should be executed when the input goes
to true. The Trip subroutine must use a RETURN (RT) to exit the subroutine, use of a BRANCH will cause stack
errors
The TE is reset when a Trip occurs. TE must be re-enabled prior to the next Trip if it is to be repeated.
Syntax
TI <input>,<label/address>
Code example
TI 1,Q1
TE=1
Related
IS (Input Setup)
TC (Trip Capture)
TI (Trip on Input)
TP (Trip on Position)
TT (Trip on Time)
V2.00, 05.2016
EtherNet/IP
5-134
Modbus/TCP
5 COMMAND DETAILS
5.1.127
TM (Trip on Main Power Loss)
Compatibility
Mnemonic
LMD(O)
LMD(C)
Function
TM
Notes
LMM
Function Group
Trip Variable
Access
RW
Usage
Program/Immediate
Description
Sets up an event (trip) to run a subroutine if main power is lost. In order for this to be used the auxiliary power
supply must be powered and connected.
The TE (Trip Enable which Enables/Disables TP) is reset when a Trip occurs. TE must be re-enabled in the main
program prior to the next Trip if it is to be repeated. The Trip subroutine must use a RETURN (RT) to exit the
subroutine, use of a BRANCH will cause stack errors.
Trips should be set BEFORE motion commands in the program.
TM=<label/address>
Syntax
Code example
TM=Q1
TE=64
Related
TE (Trip Enable)
V2.00, 05.2016
EtherNet/IP
5-135
Modbus/TCP
5 COMMAND DETAILS
5.1.128
TP (Trip on Position)
Compatibility
Mnemonic
TP
LMD(O)
LMD(C)
Notes
LMM
Function
Function Group
Trip on Position
Trip Variable
Access
RW
Usage
Program/Immediate
Description
Sets up an event (trip) for the specified position. There are two parameters for the TP variable. The first specifies
the position which will cause the event. The second specifies the subroutine that should be executed when the
position is detected.
The TE (Trip Enable which Enables/Disables TP) is reset when a Trip occurs. TE must be re-enabled in the main
program prior to the next Trip if it is to be repeated. The Trip subroutine must use a RETURN (RT) to exit the
subroutine, use of a BRANCH will cause stack errors.
Trips should be set BEFORE motion commands in the program.
Syntax
TP=<position>,<label/address>
Code example
TP=51200, Q1
TE=2
Related
P (Position Counter)
TE (Trip Enable)
V2.00, 05.2016
EtherNet/IP
5-136
Modbus/TCP
5 COMMAND DETAILS
5.1.129
TQ (Torque Percent)
Compatibility
Mnemonic
LMD(O)
LMD(C)
Notes
LMM
Function
TQ
Function Group
Read/Set Torque
hMT Variable
Access
RW
Usage
Program/Immediate
Description
Sets the maximum out put torque of the motor to a percentage.
Range
1 100
Syntax
TQ=<percent> | PR TQ
% (percent)
Units
Default
25
Code example
Related
TQ=50
PR TQ
50
AS (hMT Setting)
TD (Torque Direction)
TS (Torque Speed)
V2.00, 05.2016
EtherNet/IP
5-137
class
instance
attribute
0x6A
0x0F
Modbus/TCP
0x00A6
5 COMMAND DETAILS
5.1.130
TR (Trip on Relative Position)
Compatibility
Mnemonic
TR
LMD(O)
LMD(C)
Function
Notes
LMM
Function Group
Access
Trip Variables
Usage
RW
Program/Immediate
Description
Sets up an event (trip) for the specified relative position. There are three parameters for the TR variable.
The first specifies the position which will cause the event.
The second specifies the subroutine that should be executed when the position is detected, if no subroutine
address or label is specified then the High Speed Trip Output will activate. The Trip subroutine must use a
RETURN (RT) to exit the subroutine, use of a BRANCH will cause stack errors
The third parameter specifies the number of times the trip will repeat. If 0 (default) the trip will repeat infinite times,
other wise the range is 1- 65000
The TE (Trip Enable which Enables/Disables TR) is reset after repeating the number of relative trips specified.
TE must be re-enabled in the main program prior to the next series of Trip on Relative if it is to be repeated. For
exampl, if TR=10000,0,25, Output 3 will trip 25 times in succession at 100,000 counts relative to the last position.
Following these 25 trips the trip must be re-enabled (TE=16).
Trips should be set BEFORE motion commands in the program.
Note: Output 1 must be configured as a trip output (Os=3,28,0)
Note that TR will always use motor counts unless the encoder is enabled (EE=1).
Note: The maximum rate of trip is 20 kHz. Exceeding this may cause communications errors
Note that only a single position trip type may be used at a time. TR cannot be used simultaneously with TP
Syntax
TR=<postition>,<label/address>, <repeat>
Code example
TR=512000,Q1,15
TE=16
Related
TE (Trip Enable)
TP (Trip on Position)
V2.00, 05.2016
EtherNet/IP
5-138
Modbus/TCP
5 COMMAND DETAILS
5.1.131
TS (Torque Speed)
Compatibility
Mnemonic
TS
LMD(O)
LMD(C)
Notes
LMM
Function
Function Group
hMT Variable
Access
RW
Usage
Program/Immediate
Description
Defines the system speed for Torque mode (AS=3). This configuration variable will only take effect if hMT is in
torque mode.
Note that the value for TS may be changed while the axis is in motion, though changing velocity during a torque
move may throw an Error 106: Reached Lead Limit count.
Range
46,512 2560000
Syntax
TS=<steps/sec>
steps/sec
Units
Default
Code example
Related
TS=51200
PR TS
51200
AS (hMTechnology Mode)
TD (Torque Direction)
TQ (Torque Percent)
V2.00, 05.2016
EtherNet/IP
5-139
class
instance
attribute
0x6A
0x10
Modbus/TCP
0x00A7
5 COMMAND DETAILS
5.1.132
TT (Trip on Time)
Compatibility
Mnemonic
TT
LMD(O)
LMD(C)
LMM
Function
Notes
Function Group
Trip on time
Access
Trip Variable
RW
Usage
Program/Immediate
Description
Sets up a trip based on time. The first parameter is time in mSec. The second parameter specifies the subroutine
that should be executed when the time is expired. The Trip subroutine must use a RETURN (RT) to exit the
subroutine, use of a BRANCH will cause stack errors
Range
1 to 65535
Syntax
TT=<time>,<label/address>
Units
milliseconds
Default
Code example
TT=10000,Q1
TE=8
Related
TE (Trip Enable)
V2.00, 05.2016
EtherNet/IP
5-140
Modbus/TCP
5 COMMAND DETAILS
5.1.133
UG (Firmware Upgrade)
Compatibility
Mnemonic
UG
LMD(O)
LMD(C)
Notes
LMM
Function
Function Group
Upgrade Firmware
Access
RW
Usage
Program/Immediate
Description
The upgrade command and code will be automatically entered by the Upgrader Utility in the Motion Control
Interface or SEM Terminal software programs.
Once initiated, the firmware Upgrade MUST be completed.
Syntax
UG 2656102
Code example
UG 2956102
Related
VR (Version)
V2.00, 05.2016
EtherNet/IP
5-141
class
instance
attribute
0x66
0x0E
Modbus/TCP
5 COMMAND DETAILS
5.1.134
UV (Read User Variable)
Compatibility
Mnemonic
UV
LMD(O)
LMD(C)
Function
Function Group
Notes
LMM
Access
Keyword
RO
Usage
Program/Immediate
Description
Keyword used with the PR (Print) command to read the value of all user defined variables. The keyword will return
the user variables, the scope, either global or local, and the value.
The response will come in the form of [var] = [Global/Local] [value] or example Q1 = G 25
Syntax
PR UV
Code example
VA Q1=25
PR UV
Q1 = G 25
Related
PR (Print)
V2.00, 05.2016
EtherNet/IP
5-142
Modbus/TCP
5 COMMAND DETAILS
5.1.135
V (Read Axis Velocity)
Compatibility
Mnemonic
LMD(O)
LMD(C)
Function
Notes
LMM
Function Group
Keyword
Access
Usage
RO
Program/Immediate
Description
Keyword used with the PR (Print) command to read the current velocity of the axis velocity. The value of V is
signed based on the direction of motion.
NOTE: V will not return an accurate value if hMTechnology is active. In Torque Mode, (AS=3), V will return a zero
value.
Syntax
Code example
VA Q1=25
PR UV
Q1 = G 25
Related
MA (Move Absolute)
MR (Move Relative)
VI (Initial Velocity)
VM (Maximum Velocity)
SL (Slew at Velocity)
V2.00, 05.2016
EtherNet/IP
5-143
Modbus/TCP
0x0085
5 COMMAND DETAILS
5.1.136
VA (Define User Variable)
Compatibility
Mnemonic
VA
LMD(O)
LMD(C)
Function
Function Group
Notes
LMM
Access
Keyword
Usage
RO
Program/Immediate
Description
The VA instruction creates a user variable with a 1 or 2 character name. Can optionally set value assigned to that
variable.
The restrictions for this command are:
1.
A variable cannot be named after a Lexium MCode Instruction, Variable or Flag or Keyword
2.
The first character must be alpha, the second character may be alpha-numeric.
3.
4.
Syntax
VA<char><char>=<value>
Code example
VA Q1=25
PR Q1
25
Related
V2.00, 05.2016
EtherNet/IP
5-144
Modbus/TCP
0x0085
5 COMMAND DETAILS
5.1.137
VC (Velocity Changing)
Compatibility
Mnemonic
LMD(O)
LMD(C)
Function
VC
Notes
LMM
Function Group
Status Flag
Access
RW
Usage
Program/Immediate
Description
The read-only motion flag will be at an active state (1) when the velocity of the motor is changing, either
accelerating or decelerating.
Param
0
1
Description
Minus (CCW facing shaft)
Plus (CW facing shaft) (default)
Range
0/1
Syntax
PR VC | {BR/CL} <label/address>,VC=<state>
Units
Default
Code example
Related
PR VC
0
CL Q1, VC=1
OS (Output Setup)
V2.00, 05.2016
EtherNet/IP
5-145
class
instance
attribute
0x66
0x10
Modbus/TCP
0x0088
5 COMMAND DETAILS
5.1.138
VF (hMT Velocity Filter)
Compatibility
Mnemonic
LMD(O)
LMD(C)
Function
VF
Notes
LMM
Function Group
hMT Variable
Access
RW
Usage
Program/Immediate
Description
VF takes a value of 0 to 1000. It can be defined as 0 = no filtering and 1000 = most filtering.
Because the Torque Velocity is computed and the encoder is sampled every mSec there can be fluctuation in the
result. The filtering compensates for this fluctuation.
Range
0 to 1000
Syntax
VF=<counts> | PR VF
counts
Units
Default
Code example
Related
VF=500
PR VF
500
AS (hMTecnology Mode)
TQ (Torque Percent)
TS (Torque Speed)
V2.00, 05.2016
EtherNet/IP
5-146
class
instance
attribute
0x6A
0x11
Modbus/TCP
0x00A7
5 COMMAND DETAILS
5.1.139
VI (Initial Velocity)
Compatibility
Mnemonic
VI
LMD(O)
LMD(C)
Function
Notes
LMM
Function Group
Motion Variable
Access
RW
Usage
Program/Immediate
Description
Initial velocity for all motion commands. The factory default value is 1000 clock pulses (steps) per second.
The initial velocity for a stepper should be set to avoid the low speed resonance frequency and must be set lower
than the pull in torque of the motor. It must also be set to a value lower than VM (Max. Velocity).
Range
1 to (VM 1)
Syntax
VI=<velocity> | PR VI
Units
steps/sec (EE=0)
counts/sec (EE-1)
Default
1000 (EE=0)
40 (EE-1)
Code example
Related
VI=5000
PR VI
5000
A (Acceleration)
D (Deceleration)
VM (Max Velocity)
V2.00, 05.2016
EtherNet/IP
5-147
class
instance
attribute
0x66
0x11
Modbus/TCP
0x0089 - 0x008A
5 COMMAND DETAILS
5.1.140
VM (Maximum Velocity)
Compatibility
LMD(O)
Mnemonic
LMD(C)
Function
VM
Notes
LMM
Function Group
Access
Motion Variable
RW
Usage
Program/Immediate
Description
The VM variable specifies the maximum velocity in steps/counts per second that the axis will reach during a move
command.
The maximum setting of VM is dependant on the setting of the Microstep Resolution and is equal to MS*10000.
VM must be greater than VI.
Changes to VM made during motion will not take effect until the current move completes.
Range
(VI + 1) to (MS*10000)
Syntax
VM=<velocity> | PR VM
Units
steps/sec (EE=0)
Default
counts/sec (EE-1)
786000 (EE=0)
307200 (EE-1)
Code example
Related
VM=500000
PR VM
5000000
A (Acceleration)
D (Deceleration)
VI (Initial Velocity)
V2.00, 05.2016
EtherNet/IP
5-148
class
instance
attribute
0x66
0x12
Modbus/TCP
0x008B
5 COMMAND DETAILS
5.1.141
VR (Version)
Compatibility
Mnemonic
VR
LMD(O)
LMD(C)
Notes
LMM
Function
Function Group
Identification Keyword
Access
RO
Usage
Program/Immediate
Description
Keyword used with PR (Print) to read the firmware and hardware versions of the core code.
The keyword will return two values, the first is the device Controller firmware (field upgradable), the second is the
FPGA hardware version (factory upgrade only).
Syntax
PR VR
Code example
PR VR
LMMCM 6.002, Hw: 3.2
Related
UG (Upgrade)
V2.00, 05.2016
EtherNet/IP
5-149
class
instance
attribute
0x65
0x0B
Modbus/TCP
5 COMMAND DETAILS
5.1.142
VT (Read Voltage)
Compatibility
LMD(O)
Mnemonic
LMD(C)
Function
VT
Notes
LMM
Function Group
Read Voltage
Status Keyword
Access
RO
Usage
Program/Immediate
Description
The VT keyword is used in conjunction with the PR (Print) instruction to read the status and voltage of the device.
Status
Aux V
+VDC
Notes
In range
In range
Out of range/
Unused
In range
In range
Out of range
Out of range
Out of range
An optional parameter may be used to read the voltage and status of a specific voltage:
Param
1)
2)
+VDC
Description
<blank>
PR VT, <param>
Syntax
Code example
LMM
PR VT
1, 23
LMD
PR VT
0, 23,36
Related
IT (Internal Temperature)
V2.00, 05.2016
EtherNet/IP
5-150
class
instance
attribute
0x65
0x0C
Modbus/TCP
5 COMMAND DETAILS
5.1.143
WT (Warning Temperature)
Compatibility
Mnemonic
LMD(O)
LMD(C)
Function
WT
Notes
LMM
Function Group
System Variable
Access
RW
Usage
Program/Immediate
Description
The Warning Temperature variable allows the user to set a threshold temperature at which the device will assert an
error 71 to the terminal screen if the set temperature is exceeded.
Note that this is a single setting that will set the warning level for bother temperature sensors. If either reaches the
set threshold the error code will be asserted
Range
0-84
Syntax
WT=<temperature> | PR WT
Units
Default
80
Code example
Related
WT=75
PR WT
75
IT (Internal Temperature)
V2.00, 05.2016
EtherNet/IP
5-151
class
instance
attribute
0x64
0x05
Modbus/TCP
5 COMMAND DETAILS
5.2
LMD(O)
Symbol
LMD(C)
Function
Notes
LMM
Function Group
Addition
Basic Math
Description
Adds the contents of variables
<sum target>=<augend>+<addend>+...
Syntax
Code example
VA Q1=25
VA Q2=30
VA Q3=40
R1=Q1+Q2+Q3
PR R1
95
Symbol
LMD(O)
LMD(C)
Function
LMM
Notes
Function Group
Subtraction
Basic Math
Description
Subtracts the contents of two variables
Syntax
<difference target>=<menuend>-<subtrahend>
V2.00, 05.2016
Code example
5-152
VA Q1=25
VA Q2=30
R1=Q2-Q1
PR R1
5
5 COMMAND DETAILS
Symbol
LMD(O)
LMD(C)
Notes
LMM
Function
Function Group
Multiplication
Basic Math
Description
Multiplies the contents of two variables
Syntax
<product target>=<multiplicand>*<multiplier>
Code example
VA Q1=25
VA Q2=30
R1=Q1*Q2
PR R1
750
Symbol
LMD(O)
LMD(C)
Notes
LMM
Function
Function Group
Division
Basic Math
Description
Divides the contents of one variable with another variables
Note that if you are dividing integer values and require a more precise quotient, the quotient may be
stored in F1-F8 (Floating Point Registers).
Syntax
<quotient target>=<dividend>/<divisor>
V2.00, 05.2016
Code example
5-153
VA Q1=25
VA Q2=30
F1=Q2/Q1
PR F1
1.200000
5 COMMAND DETAILS
LMD(O)
Symbol
LMD(C)
LMM
Function
Notes
Function Group
Equal
Comparison operator
Description
Set a variable equal to another variable or number, comparison operator for BR (Branch) and CL (Call Subroutine)
program operations
Syntax
Code example
VA Q1=25
A=Q1
CL X1,I1=1
Symbol
<>
LMD(O)
Function
Not Equal
LMD(C)
LMM
Notes
Function Group
Comparison operator
Description
Test if two variables are not equal.
Syntax
[BR/CL] <label/address>,<var/flg/io><><var/flg/num>
Code example
V2.00, 05.2016
CL X1,Q1<>25
5-154
5 COMMAND DETAILS
Symbol
<=
LMD(O)
LMD(C)
LMM
Function
Notes
Function Group
Less Than
Comparison operator
Description
Tests if Variable is less than a second variable
Syntax
[BR/CL] <label/address>,<var/flg/io><<var/flg/num>
Code example
CL X1,Q1<=25
Symbol
<=
LMD(O)
LMD(C)
LMM
Function
Notes
Function Group
Comparison operator
Description
Tests if Variable is less than or equal to a second variable
Syntax
[BR/CL] <label/address>,<var/flg/io><=<var/flg/num>
Code example
V2.00, 05.2016
CL X1,Q1<=25
5-155
5 COMMAND DETAILS
Symbol
>
LMD(O)
LMD(C)
Notes
LMM
Function
Function Group
Greater than
Comparison operator
Description
Tests if Variable is greater than to a second variable
Syntax
[BR/CL] <label/address>,<var/flg/io>><var/flg/num>
Code example
CL X1,Q1>25
Symbol
>=
LMD(O)
LMD(C)
Function
Notes
LMM
Function Group
Comparison operator
Description
Tests if Variable is greater than or equal to a second variable.
Syntax
[BR/CL] <label/address>,<var/flg/io>>=<var/flg/num>
Code example
V2.00, 05.2016
CL X1,Q1>=25
5-156
5 COMMAND DETAILS
Symbol
LMD(O)
LMD(C)
Function
&
Notes
LMM
Function Group
AND
Logic operator
Description
Performs a Logic AND operation on two variables.
<target var>=<var/flg>&<var/flg/num>
Syntax
Code example
R1=25
R2=30
R3=R1&R2
PR R3
30
5.2.12 OR ( | )
Compatibility
Symbol
LMD(O)
LMD(C)
Function
Notes
LMM
Function Group
OR
Logic operator
Description
Logic OR operation between two variables.
<target var>=<var/flg>I<var/flg/num>
Syntax
V2.00, 05.2016
Code example
5-157
R1=25
R2=30
R3=R1|R2
PR R3
25
5 COMMAND DETAILS
5.2.13 XOR ( ^ )
Compatibility
LMD(O)
Symbol
LMD(C)
Function
Notes
LMM
Function Group
XOR
Logic operator
Description
Logic XOR operation between two variables.
<target var>=<var/flg>^<var/flg/num>
Syntax
Code example
R1=25
R2=30
R3=R1^R2
PR R3
25
5.2.14 NOT ( ! )
Compatibility
LMD(O)
Symbol
LMD(C)
Function
Notes
LMM
Function Group
NOT
Logic operator
Description
Logic NOT operation.
<target var>=<var/flg>!<var/flg/num>
Syntax
V2.00, 05.2016
Code example
5-158
R1=25
R2=30
R3=!R1
PR R3
-26
5 COMMAND DETAILS
Symbol
AB
LMD(O)
LMD(C)
Notes
LMM
Function
Firmware 6.00.00+
Function Group
Absolute Value
Advanced Math/Trigonometry
Description
Preforms an Absolute on the specified register.
Syntax
Code example
MA -51200
PR P
F1=AB P
PR F1
51200.00000
-51200
5.2.16 CS (Cosine)
Compatibility
Symbol
CS
LMD(O)
LMD(C)
Notes
LMM
Function
Firmware 6.00.00+
Function Group
Cosine
Advanced Math/Trigonometry
Description
Preforms an cosine on the specified register.
Syntax
V2.00, 05.2016
Code example
5-159
VA Q1=51200
F1=CS Q1
Store cosine of Q1 in F1
PR F1
-0.106072
5 COMMAND DETAILS
Symbol
C_
LMD(O)
LMD(C)
Notes
LMM
Function
Firmware 6.00.00+
Function Group
Arc Cosine
Advanced Math/Trigonometry
Description
Preforms an arc cosine on the specified register.
Syntax
Code example
Continues example from 5.2.4.2 CS (Cosine)
VA Q1=51200
F1=CS Q1
Store cosine of Q1 in F1
PR F1
-0.106072
PR F2
1.677068
F2=C_ F1
Symbol
LO
LMD(O)
LMD(C)
Notes
LMM
Function
Firmware 6.00.00+
Function Group
Logarithm Base 2
Advanced Math/Trigonometry
Description
Preforms an logarithm (base 2) on the specified register.
Syntax
V2.00, 05.2016
Code example
5-160
VA Q1=51200
F1=LO Q1
PR F1
10.843495
5 COMMAND DETAILS
LMD(O)
Symbol
LMD(C)
Function
L_
Notes
LMM
Firmware 6.00.00+
Function Group
Logarithm Base 10
Advanced Math/Trigonometry
Description
Preforms an logarithm (base 10) on the specified register.
Syntax
Code example
VA Q1=51200
F1=L_ Q1
PR F1
4.709270
5.2.20 PI (3.141592654)
Compatibility
LMD(O)
Symbol
LMD(C)
Function
PI
Notes
LMM
Firmware 6.00.00+
Function Group
PI (3.141592654)
Advanced Math/Trigonometry
Description
Holds the value of PI.
Syntax
<target fpreg>=<reg/var><math>PI
V2.00, 05.2016
Code example
5-161
VA Q1=51200
F1=Q1*PI
PR F1
160849.543885
5 COMMAND DETAILS
Syntax
Code example
VA Q1=51200
F1=SI Q1
Store Sine of Q1 in F1
PR F1
-0.994358
Symbol
LMD(O)
LMD(C)
Function
S_
Notes
LMM
Firmware 6.00.00+
Function Group
Arc Sine
Advanced Math/Trigonometry
Description
Calculates the arc sine of the specified register.
Syntax
Code example
VA Q1=51200
F1=SI Q1
Store Sine of Q1 in F1
PR F1
-0.994358
F2=S_ F1
PR F2
V2.00, 05.2016
-1.464524
5-162
5 COMMAND DETAILS
LMD(O)
Symbol
LMD(C)
Function
SQ
Notes
LMM
Firmware 6.00.00+
Function Group
Square Root
Advanced Math/Trigonometry
Description
Calculates the square root of the specified register.
Syntax
Code example
VA Q1=51200
F1=SQ Q1
PR F1
226.274170
5.2.24 TG (Tangent)
Compatibility
Symbol
TG
LMD(O)
LMD(C)
Notes
LMM
Function
Firmware 6.00.00+
Function Group
Tangent
Advanced Math/Trigonometry
Description
Calculates the tangent of the specified register.
Syntax
V2.00, 05.2016
Code example
5-163
VA Q1=51200
F1=TG Q1
Store Tangent of Q1 in F1
PR F1
9.374376
5 COMMAND DETAILS
Symbol
T_
LMD(O)
LMD(C)
Notes
LMM
Function
Firmware 6.00.00+
Function Group
Arc Tangent
Advanced Math/Trigonometry
Description
Calculates the arc tangent of the specified register.
Syntax
V2.00, 05.2016
Code example
5-164
VA Q1=51200
F1=T_ Q1
Store Tangent of Q1 in F1
PR F1
1.570777
6 Supporting Software
SUPPORTING SOFTWARE
The software associated withLexium Motion product products is contained within the Lexium Software Suite. This software package is available for download at the Schneider Electric Motion USA web site at
http://motion.schneider-electric.com.
The modules applicable are:
1. Motion Control Interface:
IP address
Subnet mask
Gateway address
V2.00, 05.2016
http://motion.schneider-electric.com
6-1
6 Supporting Software
V2.00, 05.2016
6-2
7 PROGRAMING NOTES
This section will cover the following areas of Lexium MCode programming and applications in detail.
7.1
{}
V2.00, 05.2016
7.1.1
7-1
7 PROGRAMING NOTES
Dependent on how the echo mode (EM) is set in conjunction with party
mode (PY) and check sum (CK), the device will respond differently. The
following tables illustrate the various responses based on how the EM,
PY and CK parameters are set.
Parameter Setting
Transmission
Initial Response
(command)
The last
Echoed back one
CET (0D) (0A)> character sent is
character at a time as
the prompt >
the character is entered.
The last
character sent
is LF
No response
except to PR and
L commands
CET command
(0D) (0A)
Queued
response. The
last character
sent is the LF
V2.00, 05.2016
Table 7.1 Response to echo mode - party and check sum are zero (0)
7-2
Final
Response
Notes
(command)
Echoed back one
character at a time
as the character is
entered.
The last
character
sent is the
prompt >
The last
character
sent is LF
Parameter Setting
Transmission
Initial Response
(DN) (command)
(0A)
(DN) (command)
(0A)
7 PROGRAMING NOTES
(DN) (command)
(0A)
(DN) (command)
(0A)
No response
except to
PR and L
commands
CET command
(0D) (0A)
Queued
response.
The last
character
sent is the LF
Table 7.2 Response to echo mode - party is one (1) and check sum is zero (0)
Parameter Setting
Transmission
Initial Response
(DN) (command)
(0A)
(DN) (command)
(0A)
(DN) (command)
(0A)
(DN) (command)
(0A)
Final Response
Notes
(command)
Echoed back one
character at a time
as the character is
entered.
The last
character
sent is the
prompt >
The last
character
sent is LF
No response
except to
PR and L
commands
CET command
(0D) (0A)
Queued
response.
The last
character
sent is the
LF
Table 7.3 Response to echo mode - party is zero (0) and check sum is one (1)
Transmission
Initial Response
Final
Response
Notes
(DN) (command)
(CS) (0A)
(command)
Echoed back one
character at a time
as the character is
entered.
CET (ACK) or
(NAK)>
The last
character
sent is the
prompt >
(DN) (command)
(CS) (0A)
CET (ACK) or
(NAK)>
The last
character
sent is ACK
or NAK
(DN) (command)
(CS) (0A)
No response
except to
PR and L
commands
V2.00, 05.2016
Parameter Setting
7-3
7 PROGRAMING NOTES
(DN) (command)
(CS) (0A)
CET
command
(CS) (ACK)
(NAK)
Queued
response.
The last
character
sent is ACK
or NAK
Table 7.4: Response to echo mode - party and check sum are one (1)
7.1.2
2)
All characters (ascii values) are added to check sum, including the
device name DN (if PY=1), to the end of the command, but not
including terminator.
3)
4)
Terminator sent.
Note: Any combination of upper/lower case may be used. In this example, if a lower case <mr> were to be used, the decimal values will
change to 109 and 114. Subsequently the result check s u m v a l u e w i l l
ch a n g e . (Po ssi b l e e n tri e s: MR , mr, Mr, mR .) (M = 77, R
=8 2 , m = 109, r = 114) (See ASCII table in Section 9 of this document.)
77 82 32 49
Decimal value of M, R, <space> and 1
4D 52 20 31
Hex
77+82+32+49 = 240
Add decimal values together
1111 0000 = 240 Change 240 decimal to binary
0000 1111 1s complement (invert binary)
0001 0000 Add 1 [2s complement]
1000 0000 OR result with 128 (Hex 80)
1001 0000 144
Result Check Sum value
Once the result is reached, add the check sum value (144 in this example) to your string by typing: MRr 1(alt key + 0144) (use the symbol
of 0144 in your string by holding down the alt key and typing 0144).
You must type the numbers from the numlock key pad to the right of the
keyboard. The numbers at the top of the keyboard will not work.
1) Check sum set to zero.
2) All characters are added to check sum.
V2.00, 05.2016
7-4
7 PROGRAMING NOTES
7.1.3
Assuming there are three devices set up in party mode as shown in the
sample codes above.
To print the position type: aPR p and press CTRL+J. The position of device a will be printed.
To move device b type: bMR 10000 and press CTRL+J. Device b will move 10000 steps.
To move all three devices at the same time type: *MR 10000
and press CTRL+J. All devices will move 10000 steps.
7.2
7.2.1
V2.00, 05.2016
NEMA size 17
7-5
1 analog input.
7 PROGRAMING NOTES
7.2.2
Examples
7.2.3
Example:
V2.00, 05.2016
7-6
7 PROGRAMING NOTES
Input Functions
1 analog input.
Function
Description
Line
Type
Active
General
Purpose
14
0/1
Home
14
0/1
Limit +
14
0/1
Limit
14
0/1
G0
14
0/1
Soft Stop
14
0/1
Pause
14
0/1
Jog +
14
0/1
Jog
14
0/1
Reset
14
11
0/1
Capture
Capture input will operate with the Trip Capture (TC) trip to
run a subroutine when active. Only applicable to input 1.
Capture function not available on the NEMA 17 (42 mm)
Lexium Motion product models.
12
0/1
V2.00, 05.2016
7-7
7 PROGRAMING NOTES
7.2.4
Examples
Output Functions
Output functions may be programmed to be a general purpose user output with the following functions. Shaded areas apply only to units with
an internal encoder installed.
Function
Description
Line
Type
Active
General Purpose
User
13
16
0/1
Moving
13
17
0/1
Software error
13
18
0/1
Stall
13
19
0/1
Velocity Changing
13
20
0/1
Locked Rotor
13
21
0/1
Moving to
Position
13
23
0/1
Hybrid Active
13
24
0/1
Make Up Active
13
25
0/1
Trip
28
Attention
13
29
0/1
V2.00, 05.2016
7-8
7 PROGRAMING NOTES
7.2.5
V2.00, 05.2016
For the code sample, the load will be an LED. The motor is configured
such that the LED will be lit while the motor is at constant velocity. Set
input 1 up to be a soft stop input using a switch in a sinking configuration this will soft stop the motor.
IS=1,5,1
set input 1 to Soft Stop, active when
HIGH
OS=1,20,0
set output 1 as a Velocity Changing
activeLOW
SL 2000000 slew the motor at 200000 steps/sec
7-9
While the motor is accelerating the LED will be dark, but will light up
when the motor reaches a constant velocity. When the Soft Stop switch
is depressed the motor will begin to decelerate, the LED will go dark
again while velocity is changing.
7 PROGRAMING NOTES
******Program******
PG 100 Enter program at address 100
MR 2000000
O1=1
Enter EX 100 to execute the program, the motion will occur and the
output will set high.
The inputs may read as a group using the IN keyword. This will display
as a decimal between 0 to 15 representing the 4 bit binary number ( The
IN keyword will function on the 42mm (NEMA 17) devices but will only
read inputs 1 - 3. Inputs should be configured as user inputs
(IS = <line>,0).
PR IN
V2.00, 05.2016
OT=5
101
7-10
7 PROGRAMING NOTES
7.2.6
Sample Usage
***********Main Program**************
IS=5,9,0
set analog to read voltage (0 to
+5VDC)
PG 100
start prog. address 100
LB A1
label program A1
CL A2, I5<500
Call Sub A2, If I5 is less than
500
CL A3, I5>524
Call Sub A3, If I5 is greater
than 524
BR A1
loop to A1
***********Subroutines**************
LB A2
MA 2000
Move
H
ceases
RT
label subroutine A2
Absolute 2000 steps
Hold program execution until motion
return from subroutine
LB A3
label subroutine A3
MA -2000
Move Absolute -2000 steps
H
Hold program execution until motion
ceases
RT
return from subroutine
E End
V2.00, 05.2016
PG
7-11
Exit program
7 PROGRAMING NOTES
7.3
7.3.1
Motor steps
All Lexium MCode examples assume 200 step motors. They rotate at
1.8 per clock pulse. 200 steps would equal 1 revolution.
Microsteps divide the 200 motor steps into smaller steps to improve
smoothness and resolution of the Lexium MCode compatible device.
Using the default setting of 256 for MS, the 200 motor steps are increased to 51200 microsteps. One motor revolution requires 51200
microsteps with the ms set at 256. If you were to set MS to 128, one
revolution of the motor would now require 25600 microsteps.
7.3.3
Move Command
The move absolute (MA) and the move relative (MR) commands are
programmed in microsteps or if the encoder is enabled, encoder
counts. If the ms was set at 256 and you were to program a move of
51200 microsteps, the motor would turn one full revolution. If the ms
was set to 128, one full revolution of the motor would be 25600 microsteps (128 x 200). If you programmed a move of 51200, the motor
would turn 2 full revolutions.
7.3.4
7.3.5
Linear movement
You have a rack and pinion or a ball screw to move a linear axis. The
rack and pinion or ball screw moves the linear axis 0.1 inches for each
revolution. You need to move 7.5 inches.
V2.00, 05.2016
7-12
7 PROGRAMING NOTES
Assuming an MS of 256 (51200 Microsteps) is programmed, 51200 Microsteps x 75 revolutions requires a move of 3840000 microsteps.
Knowing the values of the variables as well as the required move, you
can calculate the actual time it takes to move the axis the required distance. This is done with a trapezoidal profile as shown below.
VM=768000
VI=1000
t1= .767
294528
Microsteps
t2= 4.233
3250944
Microsteps
t3= .767
294528
Microsteps
Ttotal = 5.767
There are several steps required to determine the actual axis speed.
They are all based on the Trapezoidal Profile above.
Known Values and Parameters:
VM...........................768000 Steps/Sec.
VI.................................1000 Steps/Sec.
A..........................1000000 Steps/Sec2.
D.........................1000000 Steps/Sec2.
MA/MR..................3840000 Microsteps
Determine the Acceleration (A) and Deceleration (D) times (t1 and t3).
Since the Deceleration (D) value is also 1000000 Steps/Sec. the Deceleration time (t3) will be the same as the Acceleration time (t1).
(t1 and t3)=
VM - VI
A
OR
768000 - 1000
1000000
= 0.767 Seconds
VM + VI
2
x t1
= 294911 steps
V2.00, 05.2016
7-13
OR
768000 + 1000
2
x 0.767
7 PROGRAMING NOTES
3250944
768000
= 4.233 Seconds
768000
V2.00, 05.2016
51200
7-14
x 0.1 x 60 = 90 IPM
7 PROGRAMING NOTES
7.3.6
The shaft will rotate 1 full revolution for every 2.5 revolutions of
the motor.
270
2.5"
1.0"
Motor pulley
1.875 Revolutions
Shaft pulley
0.75 Revolution
110
1.5"
4"
Motor pulley
V2.00, 05.2016
Rotary table
7-15
7 PROGRAMING NOTES
In the example above, the belt driven rotary table must be turned 110
at 3 RPM. How should the device be set up?
Bear in mind that all the numbers are approximate due to rounding.
Mechanical ratio between the motor and the rotary table is 2.666:1. That
is, the motor must rotate 2.666 revolutions for the table to rotate 1 revolution and the table will rotate 2.666 times slower than the motor.
In order to move the table 110 the motor must move 293.3.
110 x 2.66 = 293.3
= 142.222 steps
In order to rotate the table at 3 RPM the motor must turn at 8 RPM.
3 RPM x 2.666 = 8 RPM
If you were to set VM at 51200 and MS set at 256 the motor will rotate 1
full revolution (51200 steps) in 1 second or 1 RPS. In order to rotate at
8 RPM, the motor must rotate at 0.13333 RPS.
8
60
= 0.133333 RPS
VM = 6827
V2.00, 05.2016
7-16
7 PROGRAMING NOTES
7.3.7
1
Channel A
Channel B
Example:
If you were to program motion using the SL (Slew) command the motor
would rotate at a counts per second rate based on the programmed
value.
Example:
An SL (Slew) rate of 14000 counts was programed. The motor will rotate
at 14000 counts/sec., 3.5 RPS, or 210 RPM.
14000 4000 = 3.5 RPS 60 = 210 RPM
V2.00, 05.2016
7-17
7 PROGRAMING NOTES
V2.00, 05.2016
DB - Encoder Deadband
7-18
7 PROGRAMING NOTES
SF - Stall Factor
ST - Stall Flag
PM - Position Maintenance
V2.00, 05.2016
When motion is complete, the device will switch from motor run current (RC) to motor hold current (HC). The hold current is set at a lower
percentage than the run current (rc). However, the hold current must be
sufficient to overcome an outside force such as driving a vertical slide
which maintains a load on the motor at all times. Actual hold current
7-19
7 PROGRAMING NOTES
values will vary depending on the application and the load on the motor
when it is at rest.
The motor hold current delay time (HT) is a variable that delays the
change from run current (RC) to hold current (HC) at the end of a move.
The end of the move is triggered by the device when it has completed
outputting the correct number of steps. Depending on the application,
including velocity, deceleration, load and inertia, the device may lag behind a few counts. The ht will allow the device to finish its move before
applying the lower HC.
A stepping motor may ring or oscillate in minuscule amounts at the
completion of a move until it satisfies the target position. The amount of
this ringing is dependent on the application including velocity, deceleration, inertia, friction and load. The motor settling delay time (MT)
allows the motor to stop ringing before checking the position count. If
the device tried to check the position count during this ringing, it would
assume a position error and try to correct an already moving motor and
possibly cause ringing of a larger magnitude and longevity. Typically,
the MT is set between 50 and 100 milliseconds. It is recommended that
there is always a Motor Settling Time programmed any time you are in
EE=1 mode.
V2.00, 05.2016
Note: If MT has no value, the motor may hunt and never satisfy the position check.
7-20
8 HMTECHNOLOGY
NOTICE
This section only applies to Lexium MDrive Motion Control
and Lexium MDrive Ethernet Closed Loop products.
8.1
hmTechnology overview
hMTechnology is a proprietary closed loop control technology that,
when applied to step motors, prevents the loss of synchronization due to
transient or continued overload, extreme acceleration or deceleration, or
excessive slew speed.
8.1.1
Glossary of Terms
Because hMT is a unique technology, some of the terms used to describe its operation are defined:
Control bounds establish the rotor/stator lead and lag relationship. Control bounds may be set to one of 4 parameters ranging from 1.1 to 1.7
motor full steps. When hMT is active, the technology will maintain the
relationship within those boundaries, eliminating motor stalls.
8.1.1.3 Lag
The amount (in full motor steps) that the rotor lags the stator. Lag conditions are caused by loading on the motor shaft, as during transient loading or rapid acceleration.
V2.00, 05.2016
8.1.1.4 Lead
The amount (in full motor steps) that the rotor leads the stator. Lead
conditions are caused by an overhauling load, as during periods of rapid
deceleration.
8-1
hMT continually tracks the position lead or lag error, and may use it to
correct position.
8.1.1.8 Position make-up
When active, the position make-up can correct for position errors occurring due to transient loads. The lost steps may be interleaved with
incoming steps, or reinserted into the profile at the end of a move.
8.1.1.9 Variable current control
When active, variable current control will control the motor current as
such to maintain the torque and speed on the load to what is required
by the profile. This leads to reduced motor heating and greater system
efficiency.
8.1.2
hMTechnology Basics
hMTechnology is the core control technology that enables the multimode functionality of the Lexium MDrive by overcoming many of the
limitations inherent in stepper systems. Two major limitations addressed by this technology are:
Synchronized motion in a stepper motor requires that the lead/lag relationship between the rotor and stator be within +/- 2 motor full steps.
As this relationship drifts toward the 2 step point the torque available to
the load is reduced, with maximum constant torque available at the <=
1 full step point.
Conditions that can cause the stepper motor to lose synchronization
and stall are:
V2.00, 05.2016
8-2
Deceleration is too rapid to hold the load within the +/- 2 full step
range.
LAG
1.1
Stall zone
1.3
1.5
1.7
LEAD
Stall zone
1.3
1.5
1.7
Running current, the current level in use when the shaft is moving
2)
Holding or reduction current, the current level in use when the shaft
is at rest.
Variable current control uses hMT to accurately measure and track the
rotor -stator relationship and apply current as needed, such as during acceleration or deceleration, then reducing the current to the level
required to move the load when the axis is at velocity. This can lead to
greater power efficiency and cooler running motor.
8.1.2.3 Position make-up
When active, the position make-up function stores the difference between commended pulses and actual motor steps in a register. At the
completion of the move the lead or lag pulses will be reinserted into the
profile and moved to the commanded position at one of two velocity
presets.
8.1.3
V2.00, 05.2016
The motor phase current of the drive is influenced by the following factors:
8-3
Hold current
HC=[1...100%]
IACTUAL
ICTRL
RC
HC
V2.00, 05.2016
8-4
8.2
The selected mode will have a major effect on how the device will operate during a move.
The hMT operating mode may also be changed either programmatically
or immediately provided a move is not in progress.
8.2.1
RS485
Ethernet
COM
MPU
Velocity
Generator
Encoder
Motor
Bridge
Current
Control
Bridge
In bypass mode, the current control will be fixed at the set run RC (Run
Current) and hold HC (Hold Current) current percent levels.
V2.00, 05.2016
8-5
8.2.2
Compare
logic
Rotor actual
position
Stator commanded
position
RS485
Ethernet
COM
MPU
Velocity
Generator
Encoder
Motor
Bridge
Current
Control
V2.00, 05.2016
8-6
Bridge
8.2.3
Thermal
Shutdown
80
70
60
50
20%
40
30
20
hMT Mode 0
10
hMT Mode 2
0
0
20
40
60
80
100
120
140
Time (minutes)
Figure 8.5 hMT Mode 2 - Variable current mode thermal performance
With hMT in variable current mode the device will use less power and
run cooler, depending on load and duty cycle.
V2.00, 05.2016
Common encoder functions such as stall detection and position maintenance are disabled when variable current mode is selected.
8-7
8.2.4
8.3
Position Make-up
Make-up mode is active when ever hMTechnology is on in fixed (AS=1) or
variable (AS=2) current mode. Make-up compensates for position errors
resultant from a disturbance during a move by reinserting missed steps into
a motion profile as conditions allow. The MU mode selected defines how
that compensation occurs.
MU=0: Make-up happens without regard to time. In this mode missed
steps are added to the motion profile to end the move at the commanded position. The speed at which the error compensation occurs
is determined by the point in which the disturbance leading to the error
occurs.
Should the disturbance occur at during acceleration or at velocity, steps
are added at the set maximum velocity (VM). Should the disturbance
occur during deceleration, the axis will creep into position at the set
initial velocity (VI).
VM
Velocity
A
B
VI
Time
Commanded position
V2.00, 05.2016
MU=1: Make-up occurs as the load allows with regard to the timing of
the move. In this mode error compensation occurs by missed steps
being inserted into the profile. The hMT algorithm will interleave steps
into the move attempting to complete the motion profile on time. Missed
steps are reinserted when the lead/lag relationship of the rotor and stator is <=1.1 motor full steps.
8-8
VM + MF
(Max)
up to MF
VM
Velocity
VI
B
Time
8.4
Locked Rotor
A locked rotor is defined as no rotor movement while at the maximum allowed lag for a specified period of time, after which a LR (Locked Rotor)
condition is activated and an Error code asserted. When lag becomes equal
to the bounds, a timer starts to count down. Upon reaching zero, a locked
rotor will be indicated by the assertion of a status flag. The timer reloads on
any encoder movement. The timer timeout period is user selectable from
2mS to 65.5 seconds using the LT (Locked Rotor Timeout) variable.
When configured as a step/direction drive or in speed control mode, a
locked rotor will also cause an internal fault disabling the motor bridges. The
bridges may be re-enabled by cycling power, cycling the enable input, or via
software command.
V2.00, 05.2016
In torque mode, a locked rotor does not disable the bridges. The locked rotor flag can be used to indicate the rotor has been stopped at the specified
torque for a pre-set amount of time.
8-9
V2.00, 05.2016
8.5
8-10
101
102
103
104
Locked rotor. The Locked Rotor flag will also be active (LR=1). Clear by issuing a CF
(Clear Locked Rotor Fault).
105
106
107
108
109
110
Make-up disabled.
111
9 Sample Programs
SAMPLE PROGRAMS
All the sample programs from this section may be downloaded from the
web site at http://motion.schneider-electric.com in *.ixt ((Motion Control
Programmer) format.
> DOWNLOAD NOW
9.1
Move on an input
[VARIABLES]
This block contains the global variable and system
configuration information.
Is=1,0,0
Ms=256
Vi=200000
Vm=2500000
A=1000000
D=A
Hc=2
Rc=75
P=0
[PROGRAMS]
The program block for this application sets the event
that triggers the subroutine call when input 1 is active
and loops when I1=inactive
PG 1
LB Ga
Program execution label
P=0
LB G1
Loop back label
CL Kb,I1=1
H 10
BR G1
E
V2.00, 05.2016
9-1
9 Sample Programs
9.2
V2.00, 05.2016
PG
S
Keep this line to save program on load
[END]
9-2
9.3
9 Sample Programs
Binary mask
This program will demonstrate ability to execute various subroutines
depending on the binary value of inputs 1-3 while masking all i/o above
input 3.
Use the file binary_mask.ixt in the sample_programs.zip file
[VARIABLES]
Define I/O configuration
Is=1,0,0
Is=2,0,0
Is=3,0,0
Is=4,0,0
Os=1,16,0
Set up system variables
Vi=20000
Vm=1000000
A=500000
D=A
Hc=20
Rc=75
[PROGRAMS]
The main program block is labeled SU a keyword which
will execute the program on power up.
PG 1
LB Su
P=0
The block G1 will cally various subroutines based upon
the wieght of the inputs which is stored in register R1
LB G1
R1=In
R1=R1 & 7
O1=0
CL K0,R1 =
CL K1,R1 =
CL K2,R1 =
CL K3,R1 =
CL K4,R1 =
CL K5,R1 =
CL K6,R1 =
CL K7,R1 =
H 10
BR G1
E
0
1
2
3
4
5
6
7
[SUBROUTINES]
These 8 routines will rotate the motor
1 time for each input bit and repeat
the input wieght changes
V2.00, 05.2016
LB K0
PR Logic 000
MR R1*51200
H
O1=1
H 2000
RT
LB K1
PR Logic 001
MR R1*51200
H
H 200
RT
9-3
9 Sample Programs
LB K2
PR logic 010
MR R1*51200
H
H 200
RT
LB K3
PR Logic 011
MR R1*51200
H
H 200
RT
LB K4
PR Logic 100
MR R1*51200
H
H 200
RT
LB K5
PR Logic 101
MR R1*51200
H
H 200
RT
LB K6
PR Logic 110
MR R1*51200
H
H 200
RT
LB K7
PR Logic 111
MR R1*51200
H
H 200
RT
PG
S
Keep this line to save program on load
[END]
V2.00, 05.2016
9-4
9.4
9 Sample Programs
Closed Loop
This program illustrates closed loop control with an On Error (OE)
routine which will perform math functions on the counters to display the
position error.
Use the file closed_loop_on_error.ixt in the sample_programs.zip file
[VARIABLES]
Rc=80
Mt=50
HMT off and encoder functions enabled and configured
As = 0
Ee=1
Sf=15
Sm=0
motion variables are scaled to encoder counts instead of
microsteps
A=20000
D=A
Vi=2048
Vm=15000
user variable created to hold move count
VA Q1
[PROGRAMS]
program block Ga sets the on error handle routine to
call K1
PG 1
LB Ga
OE K1
P=0
program block Gb contains the motion loop which will run
100 times
LB Gb
MR 51200
H
H 500
MR -51200
H
H 500
IC Q1
BR Gb,Q1<100
CL K1
E
V2.00, 05.2016
[SUBROUTINES]
Subroutine K1 sets the response for the on-error
handler. It will perform some math to determine the
position error in encoder counts, as well as display the
error # if one occurs.
LB k1
R3=C1/25
R1=R3 - C2
PR Counts error = ,R1
PR Error = ,Er
Er=0
H 20
RT
PG
S
Keep this line to save program on load
[END]
9-5
9 Sample Programs
9.5
V2.00, 05.2016
LB X4
PR Enter rotation direction (0) neg. (1) pos.
IV K2
LB X2
BR X2, If=1
H 50
BR Y1,K2=0
BR Y2, K2=1
PR Invalid Entry
BR X4
9-6
9 Sample Programs
MR K3*K1
H
BR X6
V2.00, 05.2016
[END]
LB Z2
PR Program Ended
E
PG
S
Keep this line to save program on load
9-7
9 Sample Programs
9.6
1
G1
H 1000
PR C1 ,C1
PR C2 ,C2
Pm=1
PR Position counter: C1
PR Encoder counter: C2
H 5000
HM 1
H
P=0
V2.00, 05.2016
9-8
9.7
9 Sample Programs
Input trip
This program demonstrates the use input trips. TheLexium Motion product will perform a short 1 revolution move in each direction repeating
four times when input 1 is toggled.
When using a mechanical switch, remember to set the input filtering to
avoid erroneous trips.
IMPORTANT! Trip Rules:
1. Trip must be enabled using Te=<num> following the trip definition.
2. Only a single input trip may be defined in a program.
3. Trip must be re-enabled to re-execute trip.
Use the file trip_on_input.ixt in the sample_programs.zip file.
Lexium Motion Module DEMO PROGRAM
Last modified 12/13/12
[VARIABLES]
VA Q1
D1=255
[PROGRAMS]
Program will run a motion
profile on an input toggle
PG 1
LB G1
Ti = 1, X1
Te = 1
LB G2
Q1 = 0
BR G2
E
V2.00, 05.2016
Motion profile
LB X1
IC Q1
MR 51200
H
MR -51200
H
BR X1, Q1 < 4
Te = 1
RT
E
PG
End of Program
S
Keep this line to save program on load
9-9
9 Sample Programs
9.8
V2.00, 05.2016
PG 1
LB Su
Er = 0
C2=0
Q1 = 0
O2 = 0
PR Move motor to position 1
PR Toggle switch 1 when ready
LB X1
BR X1, I1 = 0
Q1 = C2
PR Q1
LB X2
BR X2, I1 = 1
PR Move motor to position 2
PR Toggle switch 1 when ready
LB X3
BR X3, I1 = 0
Q2 = C2
PR Q2
LB X4
BR X4,I1=1
PR Toggle Sw 2 to start cycle
LB X5
BR X5, I2 = 0
LB X6
MA Q1
H
PR P
H 250
MA Q2
H
PR P
H 250
BR X5
E
PG
End of Program
S
Keep this line to save program on load
9-10
9.9
9 Sample Programs
Z2
BR Z3,R1<R4
R1 = R1 * 625
R3 = R1 * R2
LB Z3
R3=0
RT
V2.00, 05.2016
E
PG
S
Keep this line to save program on load
9-11
9 Sample Programs
9.10
V2.00, 05.2016
[SUBROUTINES]
on error routine
LB X1
PR Error! Er
LB Y1
BR Y2,Er <> 86
PR Stall
LB Y2
Er=0
E
PG
End of Program
S
Keep this line to save program on load
9-12
9.11
9 Sample Programs
1
2
3
4
5
6
7
8
9
10
V=33RPM
V=66RPM
V=100RPM
V=66RPM
V=33RPM
V=-33RPM
V=-66RPM
V=-100RPM
V=-66RPM
V=-33RPM
STEPS
1
2
3
4
5
6
7
8
9
10
____
____|
|____
___|
|___
_|______________________|____________________________
__Ds
|___
____|
|____
____|
|____|
V2.00, 05.2016
[VARIABLES]
VA Sp=33*51200/60 Step 1 speed 33 RPM * 51200 Stp/rev
/60 s/m
VA Ds=50000 Length of first step.
[PROGRAMS]
PG 1
R1=0
P=0
set position counter to 0
LB Aa
PR
PR Starting Step 1
P=,P,
V=,V
Tp Ds,X1
Te=2
Vm=Sp
Step 1 speed 33 RPM * 51200 Stp/rev /60
s/m
MA Ds*9,0,1
LB G1
BR G1,R1=0
R1=0
BR Aa
E
9-13
9 Sample Programs
[SUBROUTINES]
Each sub will move a dist at a velocity
then redefine and re-enable the trip
Step 2 speed 66 RPM * 51200 Stp/rev /60 s/m
LB X1
PR Starting Step 2
P=,P,
V=,V
Vm= Sp*2
MA Ds*9,0,1
Tp Ds*3,X2
Te=2
RT
Step 3 speed 100 RPM * 51200 Stp/rev /60 s/m
LB X2
PR Starting Step 3
P=,P, V=,V
Vm= Sp*3
MA Ds*9,0,1
Tp Ds*6,X3
Te=2
RT
Step 4 speed 66 RPM * 51200 Stp/rev /60 s/m
LB X3
PR
Starting Step 4
P=,P, V=,V
Vm= Sp*2
MA Ds*9,0,1
Tp Ds*8,X4
Te=2
RT
Step 5 speed 33 RPM * 51200 Stp/rev /60 s/m
LB X4
PR
Starting Step 5
P=,P, V=,V
Vm= Sp
MA Ds*9 ,0,1
Tp Ds*9,X5
Te=2
RT
Step 6 speed 33 RPM * 51200 Stp/rev /60 s/m
LB X5
PR
Starting Step 6
P=,P, V=,V
Vm= Sp
MA 0,0,1
Tp Ds*8,X6
Te=2
RT
Step 7 speed 66 RPM * 51200 Stp/rev /60 s/m
LB X6
PR
Starting Step 7
P=,P, V=,V
Vm= Sp*2
MA 0,0,1
Tp Ds*6,X7
Te=2
RT
V2.00, 05.2016
9-14
9 Sample Programs
V2.00, 05.2016
PG
S
Keep this line.
9-15
9 Sample Programs
V2.00, 05.2016
9-16
10
10 Error Codes
ERROR CODES
A question mark <?> displayed as a cursor indicates an error. To determine what the error is, type <pr er> in the terminal window. The device
will respond with an error number displayed in the terminal window. The
error number may then be referenced to this list.
0
No Error
no error
I/O Errors
1
OUT 1 fault
OUT 2 fault
10
11
12
not used
V2.00, 11.2015
Data Errors
20
21
22
23
24
25
26
27
28
29
30
31
32
10-1
10 Error Codes
33
34
35
36
37
38
39
Program Errors
40
41
Program Running
42
43
44
Program Locked
45
46
47
48
Communication Errors
60
61
62
63
65
66
V2.00, 11.2015
System Errors
10-2
70
71
72
73
74
75
76
MakeUp Frequency is out of range. Must be >= 92 and <= 3000 RPM.
77
78
79
10 Error Codes
Motion Errors
80
81
82
83
84
85
MOVEs not allowed while HOMING and HOME not allowed while MOVING
86
Stall Detected
87
88
89
90
91
92
Position Error
93
94
95
96
97
98
99
HMTechnology Errors
Config Test Done - Encoder Res Mismatch
101
102
103
104
105
106
107
108
109
110
111
V2.00, 11.2015
100
10-3
10 Error Codes
10.2
no error
I/O Errors
1
OUT 1 fault
OUT 2 fault
10
11
12
13
14
not used
Data Errors
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
V2.00, 11.2015
Program Errors
10-4
40
41
Program Running
42
43
44
Program Locked
45
46
47
48
10 Error Codes
Communication Errors
60
61
62
63
65
66
System Errors
70
71
72
73
74
75
76
MakeUp Frequency is out of range. Must be >= 92 and <= 3000 RPM.
77
79
Motion Errors
HOME Sw. not defined
81
82
83
84
85
MOVEs not allowed while HOMING and HOME not allowed while MOVING
86
Stall Detected
90
91
92
Position Error
93
94
95
96
97
98
99
V2.00, 11.2015
80
10-5
10 Error Codes
V2.00, 11.2015
10-6
Index
INDEX
Symbols
+ (Addition) 3-4, 4-6
& (AND - Bitwise) 3-4, 4-6
* (Division) 3-4, 4-6
=(Equal to) 3-4, 4-6
> (Greater than) 3-4, 4-6
>= (Greater than/equal to) 3-4, 4-6
< (Less than) 3-4, 4-6
<= (Less than/equal to) 3-4, 4-6
* (Multiplication) 3-4, 4-6
! (NOT - Bitwise) 3-4, 4-6
<> (Not Equal) 3-4, 4-6
| (OR - Bitwise) 3-4, 4-6
- (Subtraction) 3-4, 4-6
^ (XOR - Bitwise) 3-4, 4-6
A
A (Acceleration) 3-7, 4-1, 5-1
AB (Absolute) 3-4, 5-157
Absolute Value 4-6
Addition (+) 5-150
AF (hMT Status) 4-5, 5-2
AJ (Acceleration Jerk) 4-1, 5-1, 5-3
AL (List All Parameters) 4-1, 5-4
Analog input 1-1
AND ( & ) 5-155
Ao (Attention output) 3-11
AO (Attention Output Mask) 4-1, 5-5, 5-38
AS (hMT Mode) 4-5, 5-6, 5-19
AS (hMT mode select) 3-11
AT (Acceleration Type) 4-1, 5-1, 5-7
Attention output 3-11
V2.00, 05.2016
B
Basic math functions 5-150
BD (BAUD Rate) 4-4, 5-8
BE (Backlashe Enable) 4-1, 5-9
BE (Backlash Enable) 5-11
BL (Backlash Amount) 4-1, 5-10, 5-11
BM (Backlash Mode) 4-1, 5-11
BP (Break Point) 4-1, 5-13
C
C1 (Step Counter) 4-1, 5-16, 5-18
C2 (Encoder Counter) 4-1, 5-18, 5-39
Capture input 3-9
C_ (Arc Cosine) 3-4, 4-6, 5-158
CB (Control Bounds) 4-5, 5-19
CE (Software Reset Enable) 4-1, 5-20
CF (Clear Locked Rotor) 4-5, 5-21
CK (Checksum Enable) 5-22
CK (Checksum Mode) 4-4
CL (Call Subroutine) 3-13, 4-1, 5-23
Comments 3-5
Comparison operators 5-152
CP (Clear program memory) 3-12
CP (Clear Program Memory) 4-1, 5-24
CS (Cosine 5-157
CS (Cosine) 3-4, 4-6
CTRL+C (Software reset) 3-9, 3-12, 4-1
CW (Clock Width) 4-1, 5-25
D
D1-D4 (Input Filter) 4-1, 5-26, 5-27
D5 (Analog Input Filter) 4-1, 5-27
DB (Encoder Deaband) 5-107
DB (Encoder Deadband) 4-1, 5-29
DC (Decrement Variable) 4-1, 5-30
D (Deceleration) 3-7, 4-1, 5-28
DE (Drive Enable/Disable) 4-2, 5-31
DG (Disable Global Response) 4-4, 5-32
Division (/) 5-151
DJ (Deceleration Jerk) 4-2, 5-28, 5-33
DN (Device Name) 4-4, 5-34
DT (Deceleration Type) 4-2, 5-28, 5-35
E
EE (Encoder Enable) 3-7, 3-11, 4-2, 5-1, 5-28, 5-37
Index
F
F<1-8> (Floating Point Register) 3-4
F1-F8 (Floating Point Registers) 4-2, 5-44, 5-157
Factory defined variables 3-2
FC (Filter Capture) 5-45
FC (Filter Capture Input) 4-2
FD (Factory Defaults) 5-46
FD (Restore facory defaults) 3-12
FD (Restore Factory Defaults) 4-2, 5-24
Flags 3-3
FL (Following Mode Enable) 5-47
Floating point calculations 3-4
FM (Filter Motion) 5-48
Following Mode Enable 4-2
FS (Shaft Flat) 4-2
FS (Shaft Flat Setting) 5-49, 5-53
G
G0 input 3-9
General purpose input 3-9
General purpose output 3-11
General safety instructions 2-3
Global variables 3-3
Greater Than (>) 5-154
Greater Than or Equal (>) 5-154
V2.00, 05.2016
H
Hazard Categories 2-2
HC (Motor Hold Current) 4-2, 5-52, 5-56
HF (Home to Offset) 4-2, 5-49, 5-51, 5-53, 5-54, 5-55
H (Hold program execution) 3-8, 3-13
ii
I
I<1-4> (Read Input 1-4) 4-2, 5-57
I<1-4> (Read input state) 3-10
I5 (Read Analog Input) 4-2, 5-58
I6 (Read Encode Index) 4-2, 5-59
IC (Increment Variable) 4-2, 5-61
IF (Variable Input Pending) 4-2, 5-62
IN (Read all inputs as decimal) 3-10
IN (Read Inputs as BCD) 4-2, 5-63
Intended Use 2-1
I/O instructions 3-1, 3-9
IP (Initialize Parameters) 4-2, 5-64
IS<1-4> (Input 1-4 Setup) 3-9, 4-2, 5-47, 5-55
IS <1-4> (Input Setup IN1-IN4) 5-65
IS <5> (Analog Input Setup) 5-67
IS<5>(Analog Input Setup) 4-2
IS <6> (Encoder Index Setup) 5-68
IT (Internal Temperature) 4-2, 5-69
IV (Input to Variable) 4-2, 5-70
J
JE (Jog enable) 3-9
JE (Jog Enable) 4-2, 5-71
Jog minus (-) input 3-9
Jog plus (+) input 3-9
K
Keywords 3-3
L
LB (Declare user label) 3-12, 4-2, 5-73
LD (Lead Limit) 4-5, 5-74
Less Than (<) 5-153
Less Than or Equal (<=) 5-153
Lexium MDrive Ethernet TCP/IP 1-1
M
Make-up active output 3-11
MA (Move Absolute) 3-8, 4-3, 5-51, 5-83, 5-85
Math functions 3-4
MD (Motion Mode) 4-3, 5-85, 5-88
MF (Makeup Frequency) 4-5, 5-86
Modbus/TCP 1-2
Motion instructions 3-7
3-1
Moving output 3-11
Moving to position output 3-11
MP (Moving to Position) 4-3, 5-87
MR (Move Relative) 3-8, 4-3, 5-51, 5-85, 5-88
MS (Microstep Resolution) 3-6, 4-3, 5-39, 5-90
MT (Motor Settling Delay) 4-3, 5-52, 5-56, 5-92, 5-115
Multiplication (*) 5-151
MU (Position Makeup) 5-107
MU (Position Makeup Mode) 4-5, 5-93
MV (Moving) 4-3, 5-94
V2.00, 05.2016
N
NE (Numeric Enable/Disable) 4-3, 5-85, 5-95
NOT ( ! ) 5-156
Not Equal (<>) 5-152
Index
O
O <1 - 3> (Write Output) 3-11, 4-3, 5-96, 5-99
OE (On Error Handler) 4-3, 5-38, 5-41, 5-97
OF (Output Fault) 4-3, 5-98
Operational modes 3-1
Immediate mode 3-1
Program mode 3-1
OR ( | ) 5-155
OS (Output Setup) 3-11, 4-3, 5-99
OT (Set Output Total) 4-3, 5-101
OT (Write all Outputs) 3-11
P
Party Mode 5-20, 5-32
Pause/resume program input 3-9
PC (Captured Position) 4-3, 5-103
PF (Print Format) 4-3, 5-44, 5-104
PG (Program Mode) 3-12, 4-3, 5-105
PI (3.141592654) 3-4, 4-6, 5-159
PM (Position Maintenance) 4-3, 5-29
PN (Part Number) 4-3, 5-108
P (Position) 3-6
P (Position Counter) 4-3, 5-88, 5-102
Profinet IO 1-2
Program instructions 3-2, 3-12
Programming aids 3-5
Program structuring 3-4
PR (Print) 3-10, 3-14, 4-3, 5-109
PS (Pause Program) 3-9, 4-3, 5-110
PW (PWM Mask) 4-5, 5-111
PY (Party Mode Enable) 4-4, 5-20, 5-32, 5-112
Q
QD (Device Queued) 4-4
QD (Queued) 5-113
Qualification of personnel 2-1
R
R<1-4> (User Registers) 3-4, 4-3, 5-44, 5-114
RC (Motor Run Current) 4-3, 5-52, 5-56, 5-115
RD (Reverse Direction) 4-3, 5-116
Reset input 3-9
RS (Resume Program) 4-3, 5-117, 5-118
RT (Return from subroutine) 3-14
RT (Return from Subroutine) 4-3
S
S_ (Arc Sine) 3-4, 4-6, 5-160
SA (Step Angle) 4-5, 5-90, 5-120
iii
Index
T
T_ (Arc Tangent) 3-4, 4-6, 5-162
TA (Tangent) 3-4
TA (Trip on hMT Status) 5-128
TC (Trip on Capture) 3-9, 4-4, 5-129
TD (Torque Direction) 4-5, 5-130
TE (Trip Enable) 4-4, 5-131
TG (Tangent) 4-6, 5-161
TI (Trip on Input) 4-4, 5-132
TM (Trip on Main Power Loss) 4-4, 5-133
TP (Trip on Position) 4-4, 5-134
TQ (Torque Percent) 4-5, 5-135
trigonometric functions 5-157
Trip output 3-11
TR (Trip on Relative) 4-4, 5-136
TS (Torque Speed) 4-5, 5-137
TT (Trip on Time) 4-4, 5-138
U
UG (Upgrade Firmware) 4-4, 5-139
UG (Upgrade Mode) 5-8
User defined variables 3-2
User labels 3-5
UV (User Variables) 4-4, 5-140
V2.00, 05.2016
V
VA (Declare User Variable) 3-4, 3-14, 4-4, 5-142
V (Current Velocity) 4-4
iv
W
WT (Warning Temperature) 4-4, 5-149
X
XOR ( ^ ) 5-156
WARRANTY
Reference the web site at www.motion.schneider-electric.com for the latest warranty and product information.
Owing to changes in standards and equipment, the characteristics given in the text and images
in this document are not binding until they have been confirmed with us.
Print: Schneider Electric Motion USA
Photos: Schneider Electric Motion USA
Date : 05 / 2016