00001 #ifndef EMCMOTLOG_H
00002 #define EMCMOTLOG_H
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #include "posemath.h"
00025
00026
00027 #ifndef __GNUC__
00028 #ifndef __attribute__
00029 #define __attribute__(x)
00030 #endif
00031 #endif
00032
00033 static char __attribute__((unused)) emcmotlog_h[] = "$Id: emcmotlog.h,v 1.4 2001/07/31 15:47:45 wshackle Exp $";
00034
00035
00036
00037 #define EMCMOT_LOG_MAX 10000
00038
00039
00040 enum EMCMOT_LOG_TYPE_ENUM {
00041 EMCMOT_LOG_TYPE_AXIS_POS = 1,
00042 EMCMOT_LOG_TYPE_ALL_INPOS = 2,
00043 EMCMOT_LOG_TYPE_ALL_OUTPOS = 3,
00044 EMCMOT_LOG_TYPE_CMD = 4,
00045 EMCMOT_LOG_TYPE_AXIS_VEL = 5,
00046 EMCMOT_LOG_TYPE_ALL_FERROR = 6,
00047 EMCMOT_LOG_TYPE_TRAJ_POS = 7,
00048 EMCMOT_LOG_TYPE_TRAJ_VEL = 8,
00049 EMCMOT_LOG_TYPE_TRAJ_ACC = 9,
00050 EMCMOT_LOG_TYPE_POS_VOLTAGE = 10
00051 };
00052
00053
00054 enum EMCLOG_TRIGGER_TYPE {
00055 EMCLOG_MANUAL_TRIGGER,
00056 EMCLOG_DELTA_TRIGGER,
00057 EMCLOG_OVER_TRIGGER,
00058 EMCLOG_UNDER_TRIGGER
00059 };
00060
00061 enum EMCLOG_TRIGGER_VAR {
00062 EMCLOG_TRIGGER_ON_FERROR,
00063 EMCLOG_TRIGGER_ON_VOLT,
00064 EMCLOG_TRIGGER_ON_POS,
00065 EMCLOG_TRIGGER_ON_VEL
00066 };
00067
00068
00069
00070
00071
00072 typedef struct
00073 {
00074 double time;
00075 double output;
00076 double input;
00077 } EMCMOT_LOG_AXIS_POS_STRUCT;
00078
00079
00080 #define EMCMOT_LOG_NUM_AXES 3
00081 typedef struct
00082 {
00083 double time;
00084 double input[EMCMOT_LOG_NUM_AXES];
00085 } EMCMOT_LOG_ALL_INPOS_STRUCT;
00086
00087
00088 typedef struct
00089 {
00090 double time;
00091 double output[EMCMOT_LOG_NUM_AXES];
00092 } EMCMOT_LOG_ALL_OUTPOS_STRUCT;
00093
00094
00095 typedef struct
00096 {
00097 double time;
00098 int command;
00099 int commandNum;
00100 } EMCMOT_LOG_CMD_STRUCT;
00101
00102
00103 typedef struct
00104 {
00105 double time;
00106 double cmdVel;
00107 double actVel;
00108 } EMCMOT_LOG_AXIS_VEL_STRUCT;
00109
00110
00111 typedef struct
00112 {
00113 double time;
00114 double ferror[EMCMOT_LOG_NUM_AXES];
00115 } EMCMOT_LOG_ALL_FERROR_STRUCT;
00116
00117
00118 typedef struct
00119 {
00120 double time;
00121 PmCartesian pos;
00122 } EMCMOT_LOG_TRAJ_POS_STRUCT;
00123
00124
00125 typedef struct
00126 {
00127 double time;
00128 PmCartesian vel;
00129 double mag;
00130 } EMCMOT_LOG_TRAJ_VEL_STRUCT;
00131
00132
00133 typedef struct
00134 {
00135 double time;
00136 PmCartesian acc;
00137 double mag;
00138 } EMCMOT_LOG_TRAJ_ACC_STRUCT;
00139
00140
00141 typedef struct
00142 {
00143 double time;
00144 double pos;
00145 double voltage;
00146 } EMCMOT_LOG_POS_VOLTAGE_STRUCT;
00147
00148
00149 typedef struct
00150 {
00151 int type;
00152 union {
00153 EMCMOT_LOG_AXIS_POS_STRUCT axisPos;
00154 EMCMOT_LOG_ALL_INPOS_STRUCT allInpos;
00155 EMCMOT_LOG_ALL_OUTPOS_STRUCT allOutpos;
00156 EMCMOT_LOG_CMD_STRUCT cmd;
00157 EMCMOT_LOG_AXIS_VEL_STRUCT axisVel;
00158 EMCMOT_LOG_ALL_FERROR_STRUCT allFerror;
00159 EMCMOT_LOG_TRAJ_POS_STRUCT trajPos;
00160 EMCMOT_LOG_TRAJ_VEL_STRUCT trajVel;
00161 EMCMOT_LOG_TRAJ_ACC_STRUCT trajAcc;
00162 EMCMOT_LOG_POS_VOLTAGE_STRUCT posVoltage;
00163 } item;
00164 } EMCMOT_LOG_STRUCT;
00165
00166
00167 typedef struct
00168 {
00169 int type;
00170 int size;
00171 int start;
00172 int end;
00173 int howmany;
00174 EMCMOT_LOG_STRUCT log[EMCMOT_LOG_MAX];
00175 } EMCMOT_LOG;
00176
00177 extern int emcmotLogInit(EMCMOT_LOG *log, int type, int size);
00178 extern int emcmotLogAdd(EMCMOT_LOG *log, EMCMOT_LOG_STRUCT val);
00179 extern int emcmotLogGet(EMCMOT_LOG *log, EMCMOT_LOG_STRUCT *val);
00180
00181 #endif
00182
00183
00184
00185
00186
00187
00188
00189
00190