Application Note

MCode: Configuring Lexium MDrive Outputs


The output setup (Os) command is used to set the functionality of the outputs. The parameters define the output point to be configured, the desired functionality, and the active control state high or low.


  • Getting Started
  • MCode OS
  • Programmable I/O

Applicable Product

  • Lexium MDrive


  1. +5 to +24 VDC I/O supply
  2. Output devices
  3. Cabling: 22 AWG shielded twisted pairs for I/O, Shielded twisted pair for power, AWG determined by length and current.

Resource Files

20 VCHANGE: velocity changing indicates the axis is accelerating or decelerating. 21 LOCKED ROTOR: indicates the rotor is in a locked state [Closed loop models only]. 23 MOVINGPOS: indicates the axis is moving to a specified position. 24 HMT ACTIVE: indicates when HMT is active [Closed loop models only]. 25 MAKE UP ACTIVE: indicates when HMT is making up steps [Closed loop models only]. 26 ENC A: Encoder channel A output applies to output 1 only. Os=1,26,<0/1> [Closed loop models only]. 27 ENC B: Encoder channel B output applies to output 2 only. Os=2,27,<0/1> [Closed loop models only]. 28 TRIP OUT, applies to output 3 only, active low only. Os=3,28,0 29 ATTENTION indicates a status or statuses as configured by the AO variable. Active State Description 0 Active when LOW (default) 1 Active when HIGH

General output usage commands

An I/O instruction results in the change of parameters or the state of an input or output. The syntax for these commands are as follows: type the command then an equal sign, then the data. Example:

Mnemonic Function Usage example Description
Individual I/O point control commands
O<output> Set the logic state of an individual output O3=1 Set output 3 HIGH (1)
Binary coded decimal (BCD) commands
OT=<0-7> Set the logic state of all outputs OT=7 Set outputs 1 – 3 HIGH
Note On NEMA17 models this command in not applicable