22 AI8_RT_NUMBER_OF_CHANNELS,
23 AI8_CHANNEL_5 = AI8_RT_NUMBER_OF_CHANNELS,
27 AI8_NUMBER_OF_CHANNELS
30 #define AI8_MODE_MEASURE (0x00)
31 #define AI8_MODE_CALIBRATE (0x40)
32 #define AI8_MODE_MASK (0xC0)
34 #define AI8_CHANNELS_ALL (0x00)
35 #define AI8_CHANNELS_1_4 (0x00)
36 #define AI8_CHANNELS_5_6 (0x08)
37 #define AI8_CHANNELS_MASK (0x08)
39 #define AI8_BUILD_LEVEL_MASK (0x07)
46 AI8_CMD_CAL_SET_RANGE,
47 AI8_CMD_CAL_SET_CAL_POINT,
48 AI8_CMD_CAL_RESET_CAL_FILTER,
51 AI8_CMD_CAL_WRITE_STATUS
57 AI8_MV_STATUS_OVER_RANGE,
58 AI8_MV_STATUS_UNDER_RANGE,
59 AI8_MV_STATUS_RANGING,
60 AI8_MV_STATUS_INVALID_CONFIG,
61 AI8_MV_STATUS_HARDWARE_ERROR,
62 AI8_MV_STATUS_BAD_FACTORY_CAL,
63 AI8_MV_STATUS_BAD_USER_CAL,
64 AI8_MV_STATUS_BREAK_DETECT,
65 AI8_MV_STATUS_2_WIRE_OHMS,
66 AI8_MV_STATUS_CALIBRATING
72 AI8_AUX_STATUS_OUT_OF_RANGE,
73 AI8_AUX_STATUS_HARDWARE_ERROR,
74 AI8_AUX_STATUS_BAD_CAL,
75 AI8_AUX_STATUS_RANGING,
76 AI8_AUX_STATUS_CALIBRATING
80 #define AI8_RANGE_OFF (0x00)
81 #define AI8_RANGE_20MA (0x10)
82 #define AI8_RANGE_80MV (0x20)
83 #define AI8_RANGE_500_OHM_THREE_WIRE (0x30)
84 #define AI8_RANGE_5000_OHM_THREE_WIRE (0x40)
85 #define AI8_RANGE_500_OHM_TWO_WIRE (0x50)
86 #define AI8_RANGE_5000_OHM_TWO_WIRE (0x60)
87 #define AI8_RANGE_UNSUPPORTED (0xF0)
88 #define AI8_RANGE_MASK (0xF0)
90 #define AI8_SENSOR_BREAK_OFF (0x00)
91 #define AI8_SENSOR_BREAK_ON (0x04)
92 #define AI8_SENSOR_BREAK_MASK (0x0C)
94 #define AI8_USER_CAL_OFF (0x00)
95 #define AI8_USER_CAL_ON (0x01)
96 #define AI8_USER_CAL_MASK (0x03)
99 #define AIC_AI8_MV_RANGE_LOW (-80.0)
100 #define AIC_AI8_MV_RANGE_HIGH (80.0)
101 #define AIC_AI8_V_RANGE_LOW (0.0)
102 #define AIC_AI8_V_RANGE_HIGH (1000.0)
103 #define AIC_AI8_MA_RANGE_LOW (-20.0)
104 #define AIC_AI8_MA_RANGE_HIGH (20.0)
105 #define AIC_AI8_OHM_RANGE_LOW (0.0)
106 #define AIC_AI8_OHM_RANGE_HIGH (500.0)
107 #define AIC_AI8_HOHM_RANGE_LOW (0.0)
108 #define AIC_AI8_HOHM_RANGE_HIGH (5000.0)
120 static unsigned short moduleToDevice(
unsigned char module);
130 virtual void setCommand(
131 unsigned char z_mode,
132 unsigned char z_cmd) = 0;
134 virtual void setCommandData(
135 unsigned char z_channel,
136 unsigned char z_number,
137 unsigned char z_value) = 0;
141 void setConfigChecksum();
143 void clearAllCommandData(
144 unsigned char z_channel);
146 void setChannelConfig(
147 unsigned char z_channel,
148 unsigned char z_config);
150 void startCalibration(
151 unsigned char z_channel,
152 unsigned char z_enable,
153 unsigned char z_calType);
155 void setCalibrationRange(
156 unsigned char z_channel,
157 unsigned char z_range);
159 void setCalibrationPoint(
160 unsigned char z_channel,
161 unsigned char z_calPointIndex,
162 float z_actualCalValue,
165 virtual float getChannelMeasuredValue(
166 unsigned char z_channel) = 0;
168 virtual EioAIMeasuredValueStatus getChannelStatus(
169 unsigned char z_channel) = 0;
171 EioAIMeasuredValueStatus mapChannelStatus(Ai8ChannelStatus z_status);
173 virtual float getChannelAuxValue(
174 unsigned char z_channel) = 0;
176 virtual EioAIAuxStatus getChannelAuxStatus(
177 unsigned char z_channel) = 0;
179 EioAIAuxStatus mapAuxStatus(Ai8AuxStatus z_status);
181 #ifdef SIMULATE_MODULE_REPLY
182 virtual unsigned char* getTestReply() = 0;
186 unsigned char m_moduleType;
187 unsigned char m_channels;
188 unsigned char m_range[AI8_NUMBER_OF_CHANNELS];
196 unsigned char z_module,
197 EioModuleType z_moduleType);
202 unsigned char z_mode,
203 unsigned char z_cmd);
206 unsigned char z_channel,
207 unsigned char z_number,
208 unsigned char z_value);
211 float getChannelMeasuredValue(
212 unsigned char z_channel);
214 EioAIMeasuredValueStatus getChannelStatus(
215 unsigned char z_channel);
217 float getChannelAuxValue(
218 unsigned char z_channel);
220 EioAIAuxStatus getChannelAuxStatus(
221 unsigned char z_channel);
223 #ifdef SIMULATE_MODULE_REPLY
224 unsigned char* getTestReply();
228 unsigned char getChannelBaseIndex(
unsigned char z_channel);
230 #ifdef SIMULATE_MODULE_REPLY
231 static unsigned char mv_ma_test_reply[];
232 static unsigned char ohm_test_reply[];
243 unsigned char z_module,
244 EioModuleType z_moduleType,
245 unsigned char z_channels);
250 unsigned char z_mode,
251 unsigned char z_cmd);
254 unsigned char z_channel,
255 unsigned char z_number,
256 unsigned char z_value);
259 float getChannelMeasuredValue(
260 unsigned char z_channel);
262 EioAIMeasuredValueStatus getChannelStatus(
263 unsigned char z_channel);
265 float getChannelAuxValue(
266 unsigned char z_channel);
268 EioAIAuxStatus getChannelAuxStatus(
269 unsigned char z_channel);
271 #ifdef SIMULATE_MODULE_REPLY
272 unsigned char* getTestReply(){
return ma_test_reply;};
277 unsigned char getChannelBaseIndex(
unsigned char z_channel);
279 unsigned char getNibble(
unsigned char z_index,
unsigned char *z_pBuf);
281 #ifdef SIMULATE_MODULE_REPLY
282 static unsigned char ma_test_reply[];
Definition: ai8_ssm.h:192
Definition: ai8_ssm.h:239
Definition: ai8_ssm.h:113
Definition: ai8_ssm.h:124