///////////////////////////////////////////////////////////////////////////
//
//  NAME
//    mccl.h - motion control command language mnemonics & flags
//
//  DESCRIPTION
//    Include this header file in your source code to provide mnemonics
//    for MCCL commands, status registers, and memory locations. These
//    mnemonics make programming with pmccmd() and pmcrpy() easier. This
//    file is NOT required for general MCAPI programming.
//
//    #include "mccl.h"
//
//  RELEASE HISTORY
//    Copyright (c) 1995-2012 by Precision Micro Control Corp. All
//    rights reserved.
//
//    $Id: mccl.h 750 2012-12-15 02:18:03Z brian $
//
//    Version 2.1a      22-Feb-99      Programmer: R. Brian Gaynor
//      - Added latch channel mnemonic
//      - Added enhanced DCX-AT200 mnemonics
//
//    Version 2.1b       7-May-99      Programmer: R. Brian Gaynor
//      - No changes
//
//    Version 2.1c      25-Jun-99      Programmer: R. Brian Gaynor
//      - No changes
//
//    Version 2.20      17-Jan-00      Programmer: R. Brian Gaynor
//      - Updated DCX-AT200/DCX-AT300 mnemonics
//
//    Version 2.21       6-Mar-00      Programmer: R. Brian Gaynor
//      - No changes
//
//    Version 2.22      31-Mar-00      Programmer: R. Brian Gaynor
//      - Added the DC2 AG and RD mnemonics.
//
//    Version 2.23      16-May-00      Programmer: R. Brian Gaynor
//      - No changes
//
//    Version 3.0.0      1-Mar-01      Programmer: R. Brian Gaynor
//      - No changes
//
//    Version 3.0.1      1-May-01       Programmer: Brian Gaynor
//      - No changes
//
//    Version 3.0.2      6-Jun-01       Programmer: Brian Gaynor
//      - No changes
//
//    Version 3.1.0     19-Sep-01       Programmer: Brian Gaynor
//      - Added capture, compare, and digital filter mnemonics
//      - Added new constants to control controller specific mnemonics,
//        #define one of the constants below before including this file to
//        include mnemonics specific to that controller:
//
//        USE_DC2       - for the DC2-PC or DC2-STN controllers
//        USE_DCXPC100  - for the DCX-PC100 controller
//
//    Version 3.2.0     11-Jan-02       Programmer: Brian Gaynor
//      - Added commutation, integral mode, edge latch mnemonics
//
//    Version 3.2.1     26-Apr-02       Programmer: Brian Gaynor
//      - No changes
//
//    Version 3.3.0		15-Jan-03		Programmer: Brian Gaynor
//      - Fixed mnemonic for  Output Deadband command on DCX series
//        controllers - was OD (wrong), now OB
//
//    Version 3.4.0		 2-Jun-03		Programmer: Brian Gaynor
//      - Added mnemonic for encoder fault enable (EE)
//
//    Version 3.4.1		31-Oct-03		Programmer: Brian Gaynor
//      - No changes
//
//    Version 3.4.2		 5-Jul-04		Programmer: Brian Gaynor
//      - No changes
//
//    Version 3.5.0		19-Nov-04		Programmer: Brian Gaynor
//      - Added new priority (NP) opcode
//      - Added pwm time constant (PK) opcode
//      - Made fail delay (FD = 204) conditional for PC100 only, added
//        format double (FD = 261) for AT200 and later
//
//    Version 3.5.1		 1-Feb-05		Programmer: Brian Gaynor
//      - No changes
//
//    Version 3.5.2		24-Feb-05		Programmer: Brian Gaynor
//      - No changes
//
//    Version 4.0.0		16-Jan-06		Programmer: Brian Gaynor
//      - Added format text (FT) opcode.
//      - Added information dislpay (ID) opcode as MC_ID (just plain ID
//        is too likely to cause conflicts).
//      - Made OD (DC2 output deadband) constant DC2 only (with #ifdef).
//
//    Version 4.0.1		27-Mar-06		Programmer: Brian Gaynor
//      - No changes
//
//    Version 4.0.2		21-Apr-06		Programmer: Brian Gaynor
//      - No changes
//
//    Version 4.0.3		17-Nov-06		Programmer: Brian Gaynor
//      - No changes
//
//    Version 4.0.4		16-May-07		Programmer: Brian Gaynor
//      - No changes
//
//    Version 4.0.5		13-Jul-07		Programmer: Brian Gaynor
//      - No changes
//
//    Version 4.1.0		 1-Dec-08		Programmer: Brian Gaynor
//      - Added mnemonic for Set Offset (SO) command that is used to set
//        the MFX-ETH digital pots (bug #100153).
//      - Added mnemonic for Jog Channel (JC) command used to set analog 
//        channel for jogging on MFX-ETH.
//      - Added mnemonics for trajectory rate setting feature of the
//        MultiFlex ETH - YL, YM, and YH.
//
//    Version 4.1.1		14-Jul-09		Programmer: Brian Gaynor
//      - No changes
//
//    Version 4.1.2		25-Sep-09		Programmer: Brian Gaynor
//      - No changes
//
//    Version 4.2.0		 1-Apr-10		Programmer: Brian Gaynor
//      - No changes
//
//    Version 4.3.0		19-Dec-12		Programmer: Brian Gaynor
//      - No changes
//
///////////////////////////////////////////////////////////////////////////

#ifndef MCAPI_MCCL_H
#define MCAPI_MCCL_H

//
//  Command opcodes
//
#define AA      133     // accumulator add 
#define AB       10     // abort 
#define AC      140     // accumulator complement 
#define AD      136     // accumulator divide 
#define AE      143     // accumulator exclusive or 
#define AF      235     // auxiliary encoder find index 

#ifdef USE_DC2
  #define AG    183     // arc angle
#else
  #define AG    226     // set acceleration feed-forward gain 
#endif

#define AH      234     // auxiliary encoder define home 
#define AI      131     // load accumulator indirect
#define AL      130     // load accumulator with constanat 
#define AM      135     // accumulator multiply 
#define AN      141     // accumulator and 
#define AO      142     // accumulator or 
#define AP      110     // adjust position
#define AR      132     // copy accumulator to register 
#define AS      134     // Accumulator Subtract 
#define AT      233     // Auxiliary encoder Tell position 
#define AV      139     // Accumulator eValuate 
#define AX      180     // arc center x
#define AY      181     // arc center y
#define AZ      236     // auxiliary encoder tell index 
#define BC      324     // begin compare
#define BD      208     // backlash distance
#define BF      207     // backlash off
#define BK      121     // break 
#define BM       59     // binary mode
#define BN      206     // backlash on
#define BR       30     // baud rate 
#define CA      180     // arc center absolute 
#define CB      328     // capture begin
#define CC       70     // current count 
#define CD      193     // contour increment distance 
#define CE      311     // close file
#define CF       31     // channel off 
#define CG      329     // capture count
#define CH       66     // channel high true 
#define CI       32     // channel in 
#define CL       67     // channel low true 
#define CM       27     // set contouring mode 
#define CN       33     // channel on 
#define CP      192     // contour path 
#define CR      181     // arc center relative 
#define CS       71     // checksum 
#define CT       34     // channel out 
#define CX       28     // contouring count

#ifdef USE_DC2
  #define DA    219     // position capture display & arm
#else
  #define DA    219     // display recorded auxiliary position
#endif

#define DB      118     // set deadband 
#define DD      256     // display recorded status
#define DE      127     // debug (dump memory)
#define DF      107     // do if channel off 
#define DG      227     // set deceleration feed-forward gain 
#define DH       35     // define home 
#define DI       36     // direction 
#define DL      271     // directory list
#define DM       60     // decimal mode 
#define DN      106     // do if channel on 
#define DO      214     // display recorded optimal position
#define DQ      189     // display torque
#define DR      213     // display recorded actual position
#define DS      117     // deceleration set 
#define DT      197     // at target delay 
#define DY      190     // position capture delay
#define EA      187     // end angle absolute
#define EE      217     // encoder fault enable
#define EF       37     // echo off 
#define EI      124     // enable interrupts
#define EL      228     // edge latch
#define EM        1     // execute macro
#define EN       38     // echo on 
#define ER      188     // end angle relative
#define ES      229     // encoder scaling
#define ET      251     // escape task 
#define FC       64     // full current 

#ifdef USE_DCXPC100
  #define FD    204     // fail delay
#else
  #define FD    261     // format double
#endif 
 
#define FE       11     // find edge 
#define FF       51     // fail input off 
#define FG      313     // file get 
#define FI       12     // find index 
#define FL      337     // digital filter load
#define FN       50     // fail input on 
#define FO      270     // format file system
#define FP      312     // file put 
#define FR       39     // set derivative sampling period 
#define FS      314     // file seek
#define FT      260     // format text
#define GA      248     // get analog input reading into accumulator 
#define GB      240     // get byte
#define GC      325     // compare count
#define GD      246     // get device ID
#define GE      169     // go until edge

#ifdef USE_DCXPC100
  #define GF    167     // go until coarse off
#else
  #define GF    338     // get digital filter
#endif

#define GH       13     // go home 
#define GI      168     // go until index
#define GL      242     // get long
#define GM        8     // gain mode 
#define GN      166     // go until coarse on
#define GO       14     // go 
#define GP      315     // file get position
#define GT      250     // generate task 
#define GU      137     // get user axis
#define GW      241     // get word
#define GX      247     // get auxiliary encoder position into accumulator 
#define HC       65     // half current 
#define HE       72     // help 
#define HF       48     // RS232 module handshake off 
#define HL      211     // set motion high limit 
#define HM       61     // hex mode 
#define HN       49     // RS232 module handshake on 
#define HO       15     // home
#define HS      232     // high speed 
#define IA       93     // index arm 
#define IB      165     // if accumulator below (less then) 
#define IC      161     // if bit clear in accumulator 
#define MC_ID   218     // information display
#define IE      162     // if accumulator equal 
#define IF      109     // if channel off then, else skip two 
#define IG      164     // if accumulator greater than 
#define II       68     // if intermediate 
#define IL       40     // set integration limit 
#define IM      114     // input mode

#ifndef _WIN32
  #define IN    108     // if channel on then, else skip two 
#else
  #define MC_IN 108     // if channel on ... - WIN32 safe version
#endif

#define IO      205     // integral option
#define IP       96     // interrupt on absolute position 
#define IR       97     // interrupt on relative position 
#define IS      160     // if bit set in accumulator 
#define IU      163     // if accumulator unequal 
#define IX       95     // if contouring
#define JA       56     // jog acceleration 
#define JB      223     // jog deadband 
#define JC       59     // jog channel (mfx-eth)
#define JD      221     // jog derivative gain
#define JF       58     // jog off 
#define JG      220     // jog gain 
#define JN       57     // jog on 
#define JO      222     // jog offset 
#define JP        6     // jump to command absolute 
#define JR        7     // jump to command relative 
#define JV       55     // jog velocity 
#define LA      330     // load commutation phase shift A
#define LB      331     // load commutation phase shift B

#ifdef USE_DC2
  #define LC     69     // latch channel
#else
  #define LC    322     // load compare
#endif

#ifdef USE_DCXPC100
  #define LD    205     // limit delay
#else
  #define LD    333     // load commutation divisor constant
#endif

#define LE      332     // load commutation prescale constant
#define LF       54     // limit switch off 
#define LI      111     // learn incrementing
#define LL      210     // set motion low limit 
#define LM       52     // limit switch mode 
#define LN       53     // limit switch on
#define LO      274     // load file
#define LP      112     // learn position 
#define LR      334     // load commutation repeat count
#define LS      230     // low speed 
#define LT      113     // learn target 
#define LU      129     // look up
#define MA       16     // move absolute
#define MC        2     // macro command
#define MD        3     // macro definition
#define MF       17     // motor off
#define MI       18     // move incrementing
#define MJ        5     // macro jump
#define MN       19     // motor on 
#define MP       20     // move to point 
#define MR       21     // move relative 
#define MS      231     // medium speed 
#define MV      196     // set minimum velocity 
#define NC      323     // compare increment
#define NF      336     // digital filter off
#define NO      120     // no operation 
#define NP      252     // new priority
#define NS      171     // no syncronization 
#define OA      249     // output analog value from accumulator 
#define OB      195     // output deadband (dcx, dc4)
#define OC      320     // compare output mode
#ifdef USE_DC2
  #define OD    195     // output deadband (dc2)
#endif
#define OF      310     // open file
#define OM      216     // set output mode 
#define OO      203     // output offset
#define OP      321     // compare output period

#ifdef USE_DC2
  #define PA    289     // plotter acceleration
#else
  #define PA    217     // position capture arm
#endif

#define PB      243     // put byte
#define PC      128     // prompt character 

#ifdef USE_DC2
  #define PD    218     // position display
#else
  #define PD    293     // pen down macro
#endif

#define PE      281     // plot enable
#define PF      280     // plot file
#define PH      115     // set phasing 
#define PI      291     // plotter initialize macro
#define PK      204     // pwm time constant
#define PL      245     // put long
#define PM       23     // position mode 
#define PP      237     // profile parabolic
#define PQ      290     // plot quick velocity
#define PR      212     // position recording
#define PS      238     // profile s-curve 
#define PT      239     // profile trapezoidal 
#define PU      292     // pen up macro
#define PV      288     // plotter velocity
#define PW      244     // put word
#define PX      282     // plotter x axis
#define PY      283     // plotter y axis
#define QM        9     // torque mode 
#define RA      131     // accumulator load with register 
#define RB      150     // read accumulator Byte 

#ifdef USE_DCXPC100
  #define RC     41     // reset counter 
#else
  #define RC    277     // restore configuration 
#endif

#ifdef USE_DC2
  #define RD    182     // arc radius
#else
  #define RD    147     // read accumulator double (64 bit floating point) 
#endif

#define RF      273     // remove file
#define RI      191     // position record interval
#define RL      152     // read accumulator long 
#define RM        4     // reset macros 
#define RP      100     // repeat 
#define RR      182     // arc radius
#define RT       42     // reset system 
#define RV      146     // read accumulator float (32 bit floating point) 
#define RW      151     // read accumulator word 
#define RX      184     // radius x
#define RY      185     // radius y
#define SA       43     // set acceleration 
#define SB      122     // select bank
#define SC      276     // save configuration 
#define SD       44     // set derivative gain 
#define SE       25     // stop on error 
#define SF       62     // step full 
#define SG       45     // set gain 
#define SH       63     // step Half 
#define SI       46     // set integral gain 
#define SL      144     // accumulator shift left 
#define SM       26     // set master 
#define SN      170     // syncroniztion on 
#define SO      300     // set offset of MFX-ETH digital pots
#define SP      294     // select pen macro
#define SQ      116     // set torque 
#define SR      145     // accumulator shift right 
#define SS       29     // set slave ratio 
#define ST       22     // stop 
#define SV       47     // set velocity 
#define TA       73     // tell a/d 
#define TB       91     // tell breakpoint position 
#define TC       74     // tell channel 
#define TD       75     // tell derivative gain 
#define TE       76     // tell error
#define TF       77     // tell following error 
#define TG       78     // tell position gain 
#define TI       79     // tell integral gain 
#define TK       92     // tell velocity constant 
#define TL       80     // tell integration limit 
#define TM       81     // tell macros 
#define TO       89     // tell optimal 
#define TP       82     // tell position 
#define TQ      209     // tell torque 
#define TR       87     // tell register 
#define TS       83     // tell status 
#define TT       84     // tell target 
#define TV       85     // tell velocity 
#define TX       88     // tell contouring count 
#define TY      272     // type file
#define TZ       90     // tell index 
#define UA      156     // use axis
#define UC      159     // user command
#define UK      215     // set user output constant 
#define UL      158     // user load
#define UO      179     // set user offset 
#define UR      177     // set user rate conversion 
#define US      175     // set user scale 
#define UT      178     // set user time conversion 
#define UZ      176     // set user zero 
#define VA      173     // vector acceleration 
#define VD      174     // vector deceleration 
#define VE       86     // tell version 
#define VG      119     // set velocity gain 
#define VM       24     // velocity mode 
#define VO      224     // set velocity override 
#define VV      172     // vector velocity 
#define WA      101     // wait (time) 
#define WB      153     // write accumulator byte 
#define WD      149     // write accumulator double (64 bit floating point) 
#define WE      102     // wait edge 
#define WF      103     // wait for channel off 
#define WI       94     // wait for index 
#define WL      155     // write accumulator long 
#define WN      104     // wait for channel on 
#define WP       98     // wait for absolute position 
#define WR       99     // wait for relative position 
#define WS      105     // wait for stop 
#define WT      198     // wait for target 
#define WV      148     // write accumulator float (32 bit floating point) 
#define WW      154     // write accumulator word 
#define XF      126     // set xoff character 
#define XN      125     // set xon character 
#define XO      286     // plotter x offset
#define XS      284     // plotter x scale
#define YF      335     // digital filter on
#define YH      257     // trajectory rate high
#define YL      259     // trajectory rate low
#define YM      258     // trajectory rate medium
#define YO      287     // plotter y offset
#define YS      285     // plotter y scale
#define ZF      339     // zero digital filter

#endif			// MCAPI_MCCL_H
