MXIO Software Development Kit
C++ Sample Code Programming Guide
 All Classes Files Functions Variables Typedefs Macros Groups Pages
MXIO_V3_2500.h
Go to the documentation of this file.
1 /*******************************************************************************
2  * Copyright Moxa Inc.
3  *
4  * Moxa MXIO Library
5  *
6  * Date Author Comment
7  * 12-08-2015 Daniel Chang Created.
8  ******************************************************************************/
9 
19 #ifndef __MXIO_V3_2500_H__
20 #define __MXIO_V3_2500_H__
21 
22 //------------------------------------------------------------------
28 //-----------------------------------------------------------------
29 #ifndef __MX_FWR
30 #include <windows.h>
31 
32 #ifdef MXIO_V3_EXPORTS
33 #define MXIO_V3_API __declspec(dllexport)
34 #else
35 #define MXIO_V3_API __declspec(dllimport)
36 #endif
37 
38 //-----------------------------------------------------------------
39 #ifndef FD_SETSIZE
40  #define FD_SETSIZE 1024
41 #endif
42 #ifndef UINT8
43  #define UINT8 unsigned char
44 #endif
45 #ifndef UINT16
46  #define UINT16 unsigned short
47 #endif
48 #ifndef UINT32
49  #define UINT32 unsigned int
50 #endif
51 
52 //--------------------------------------------------------------------
57 typedef void (CALLBACK *pfnREADCALLBACK)(WORD wBlockQuantity, int *pRecvReadBlockData, void *pParam);
58 typedef void (CALLBACK *pfnWRITECALLBACK)(WORD wBlockQuantity, int *pRecvWriteBlockData, void *pParam);
59 typedef void (CALLBACK *pfnCLEARCALLBACK)(WORD wBlockQuantity, int *pRecvClearBlockData, void *pParam);
61 #endif
62 //--------------------------------------------------------------------
69 #define MXIO_V3_MAX_BLOCK_SIZE 1
70 #define MXIO_V3_MAX_TOTAL_CH 500
71 
72 #define MXIO_V3_AGENT_PORT 10124
73 #define MXIO_V3_DEFAULT_CDA_PORT 9400
74 
75 #define MXIO_V3_IP_ADDRESS_LENGTH 16
76 #define MXIO_V3_MAC_ADDRESS_LENGTH 6
77 #define MXIO_V3_SERVER_NAME_LENGTH 256
78 #define MXIO_V3_DESCRIPTION_LENGTH 256
79 #define MXIO_ACCOUNT_NAME_LENGTH 30
80 #define MXIO_ACCOUNT_PASSWORD_LENGTH 30
81 
83 //-----
88 #define MXIO_V3_OK 0x0000
89 #define MXIO_V3_ERR_INVALID_REQ 0x8000 //invalid request format
90 #define MXIO_V3_ERR_ACCESS_FS 0x8001 //failed to access file system
91 #define MXIO_V3_ERR_RESTART 0x8002 //failed to restart device
92 #define MXIO_V3_ERR_RESET 0x8003 //failed to reset device to default
93 #define MXIO_V3_ERR_SET_TIME 0x8004 //failed to set device system time
94 #define MXIO_V3_ERR_SET_IO 0x8005 //failed to set I/O
95 #define MXIO_V3_ERR_FWR_UPGRADE 0x8006 //failed to update firmware
96 #define MXIO_V3_ERR_RESP_SYS_CONFIG 0x8007 //failed to update system configuration
97 #define MXIO_V3_ERR_CALIBRATION 0x8008 //failed to calibrate TC/RTD channel
98 #define MXIO_V3_ERR_SET_FWR_FILE_INFO 0x8009 //mismatched firmware file and device model
99 #define MXIO_V3_ERR_INPUT_OVER_RANGE 0x800A //Input Data Length over range
100 #define MXIO_V3_ERR_OUTPUT_OVER_RANGE 0x800B //Output Data Length over range
101 #define MXIO_V3_ERR_SET_NETWORK 0x800C
102 #define MXIO_V3_ERR_FILE_NOT_EXIST 0x800D //file not exist
103 
104 #define MXIO_V3_ERR_ACCOUNT_ACCESS_RIGHT 0x8010 //Verify: Connection not verified or current account has no access right
105 #define MXIO_V3_ERR_ACCOUNT_VERIFY_FAIL 0x8011 //Verify: Input Wrong (not exist) User name or password
106 
107 //For Network Interface
108 #define MXIO_V3_ERR_ENUM_NET_INTERFACE_FAIL 0x8050
109 #define MXIO_V3_ERR_SELECT_NET_INTERFACE_FAIL 0x8051
110 
111 //for support new MXIO Agent Error code
112 #define MXIO_V3_ERR_INVALID_HANDLE 0x8080
113 #define MXIO_V3_ERR_BLOCK_QUANTITY 0x8081
114 #define MXIO_V3_ERR_TOTAL_BLOCK_SIZE 0x8082
115 #define MXIO_V3_ERR_PARSE_XML_FAIL 0x8083
116 
117 #define MXIO_V3_ERR_FUNCTION_NOT_SUPPORT 0x8100
118 #define MXIO_V3_ERR_IN_DEPLOY_PROCESS_MODE 0x8101
119 
120 #define MXIO_V3_ERR_REACH_MXIO_LIMIT_CONNECTION 0x8110
121 
122 #define MXIO_V3_ILLEGAL_FUNCTION 0x8201
123 #define MXIO_V3_ILLEGAL_DATA_ADDRESS 0x8202
124 #define MXIO_V3_ILLEGAL_DATA_VALUE 0x8203
125 #define MXIO_V3_SLAVE_DEVICE_FAILURE 0x8204
126 #define MXIO_V3_SLAVE_DEVICE_BUSY 0x8206
127 
128 #define MXIO_V3_EIO_TIME_OUT 0x8210
129 #define MXIO_V3_EIO_INIT_SOCKETS_FAIL 0x8211
130 #define MXIO_V3_EIO_CREATING_SOCKET_ERROR 0x8212
131 #define MXIO_V3_EIO_RESPONSE_BAD 0x8213
132 #define MXIO_V3_EIO_SOCKET_DISCONNECT 0x8214
133 #define MXIO_V3_PROTOCOL_TYPE_ERROR 0x8215
134 #define MXIO_V3_EIO_PASSWORD_INCORRECT 0x8216
135 
136 #define MXIO_V3_PRODUCT_NOT_SUPPORT 0x8217
137 #define MXIO_V3_HANDLE_ERROR 0x8218
138 #define MXIO_V3_SLOT_OUT_OF_RANGE 0x8219
139 #define MXIO_V3_CHANNEL_OUT_OF_RANGE 0x8220
140 #define MXIO_V3_COIL_TYPE_ERROR 0x8221
141 #define MXIO_V3_REGISTER_TYPE_ERROR 0x8222
142 #define MXIO_V3_FUNCTION_NOT_SUPPORT 0x8223
143 #define MXIO_V3_OUTPUT_VALUE_OUT_OF_RANGE 0x8224
144 #define MXIO_V3_INPUT_VALUE_OUT_OF_RANGE 0x8225
145 #define MXIO_V3_SLOT_NOT_EXIST 0x8226
146 #define MXIO_V3_FIRMWARE_NOT_SUPPORT 0x8227
147 #define MXIO_V3_CREATE_MUTEX_FAIL 0x8228
148 #define MXIO_V3_MEMORY_TOO_SMALL 0x8229
149 
150 //-----
155 //Error code for Block
156 #define MXIO_V3_BLOCK_OK 0x0000
157 #define MXIO_V3_BLOCK_ERR_SIZE 0x0001
158 #define MXIO_V3_BLOCK_ERR_SLOT 0x0002
159 #define MXIO_V3_BLOCK_ERR_TYPE 0x0003
160 #define MXIO_V3_BLOCK_ERR_SUBTYPE 0x0004
161 #define MXIO_V3_BLOCK_ERR_FUNCTION 0x0005
162 #define MXIO_V3_BLOCK_ERR_START_OBJ 0x0006
163 #define MXIO_V3_BLOCK_ERR_TOTAL_OBJ 0x0007
164 
165 
170 //Error code for Channel
171 #define MXIO_V3_CH_OK 0x00
172 #define MXIO_V3_CH_ERR_LOCKED 0x01
173 #define MXIO_V3_CH_ERR_READ_ONLY 0x02
174 #define MXIO_V3_CH_ERR_SUBTYPE 0x03
175 #define MXIO_V3_CH_ERR_DATA_TYPE 0x04
176 #define MXIO_V3_CH_ERR_DATA 0x05
177 #define MXIO_V3_CH_ERR_DISABLE 0x06
178 #define MXIO_V3_CH_ERR_BOOLEAN_ONLY 0x07
179 #define MXIO_V3_CH_ERR_WRITE_FAIL 0x08
180 
181 //----------------------------------------------------------
186 #define MXIO_AI_BURNOUT_STATUS_NORMAL 0
187 #define MXIO_AI_BURNOUT_STATUS_BURNOUT 1
188 #define MXIO_AI_BURNOUT_STATUS_OVER_RANGE 2
189 #define MXIO_AI_BURNOUT_STATUS_UNDER_RANGE 3
190 
191 
196 #define MXIO_TEMPERATURE_UNIT_C 0
197 #define MXIO_TEMPERATURE_UNIT_F 1
198 #define MXIO_TEMPERATURE_UNIT_MILLIVOLT 2
199 #define MXIO_TEMPERATURE_UNIT_RESISTANCE 3
200 
201 
206 #define MXIO_COUNTER_ACTIVE_MODE_RISING_EDGE 0
207 #define MXIO_COUNTER_ACTIVE_MODE_FALLING_EDGE 1
208 #define MXIO_COUNTER_ACTIVE_MODE_BOTH 2
209 
210 //----------------------------------------------------------
217 //-----
218 #define IOTYPE_DI 0x000
219 //-----
220 #define IOTYPE_DO 0x100
221 //-----
222 #define IOTYPE_DIO 0x200
223 //-----
224 #define IOTYPE_RELAY 0x300
225 //-----
226 #define IOTYPE_AI 0x400
227 //-----
228 #define IOTYPE_AO 0x500
229 //-----
230 #define IOTYPE_TC 0x600
231 //-----
232 #define IOTYPE_RTD 0x700
233 //-----
234 #define IOTYPE_IR_WORD 0x800
235 //-----
236 #define IOTYPE_SERIALTAG 0x900
237 //-----
238 #define IOTYPE_SYS_SYSTEM 0xA00
239 //-----
240 #define IOTYPE_VC 0xB00
241 //-----
242 #define IOTYPE_IR_FLOAT 0xC00
243 //-----
244 #define IOTYPE_SYS_IO_MODE 0xD00
245 //-----
247 //-----------------------------------------------------------------
258 #define IOFUNC_DI_CH_NAME 0 //R
259 #define IOFUNC_DI_CH_MODE 1 //R
260 #define IOFUNC_DI_CH_FILTER_US 2 //R
262 
263 //-----
264 
269 #define IOFUNC_DI_DI_CH_VALUE 1000 //R
271 
272 //-----
273 
281 #define IOFUNC_DI_COUNTER_CH_INITIAL_VALUE 2000 //R
282 #define IOFUNC_DI_COUNTER_CH_POWER_ON_STATUS 2001 //R
283 #define IOFUNC_DI_COUNTER_CH_ACTIVE_MODE 2002 //R //(TRIGGER TYPE)
284 #define IOFUNC_DI_COUNTER_CH_SCALING_ENABLE 2003 //R
285 #define IOFUNC_DI_COUNTER_CH_SCALING_SLOPE 2004 //R
286 #define IOFUNC_DI_COUNTER_CH_SCALING_OFFSET 2005 //R
287 #define IOFUNC_DI_COUNTER_CH_SCALING_INTERVAL_SEC 2006 //R
288 #define IOFUNC_DI_COUNTER_CH_VALUE 2007 //R/W
289 #define IOFUNC_DI_COUNTER_CH_START_STOP 2008 //R/W
290 #define IOFUNC_DI_COUNTER_CH_RESET 2009 //C
291 
292 //-----
293 
298 #define IOFUNC_DO_CH_NAME 0 //R
299 #define IOFUNC_DO_CH_MODE 1 //R
300 
301 //-----
302 
309 #define IOFUNC_DO_DO_CH_POWER_ON_STATUS 1000 //R
310 #define IOFUNC_DO_DO_CH_POWER_ON_DELAY_SEC 1001 //R
311 #define IOFUNC_DO_DO_CH_SAFE_MODE_STATUS 1002 //R
312 #define IOFUNC_DO_DO_CH_VALUE 1003 //R/W
313 
314 //-----
315 
322 #define IOFUNC_DO_PULSE_CH_COUNT 2000 //R
323 #define IOFUNC_DO_PULSE_CH_ON_WIDTH_US 2001 //R
324 #define IOFUNC_DO_PULSE_CH_OFF_WIDTH_US 2002 //R
325 #define IOFUNC_DO_PULSE_CH_POWER_ON_STATUS 2003 //R
326 #define IOFUNC_DO_PULSE_CH_POWER_ON_DELAY_SEC 2004 //R
327 #define IOFUNC_DO_PULSE_CH_SAFE_MODE_STATUS 2005 //R
328 #define IOFUNC_DO_PULSE_CH_STATUS 2006 //R/W //Start/Stop
329 
330 //-----
336 #define IOFUNC_DIO_CH_NAME 0 //R
337 #define IOFUNC_DIO_CH_MODE 1 //R
338 #define IOFUNC_DIO_CH_FILTER_US 2 //R
340 
341 //-----
342 
347 #define IOFUNC_DIO_DI_CH_VALUE 1000 //R
348 
349 //-----
350 
358 #define IOFUNC_DIO_COUNTER_CH_INITIAL_VALUE 2000 //R
359 #define IOFUNC_DIO_COUNTER_CH_POWER_ON_STATUS 2001 //R
360 #define IOFUNC_DIO_COUNTER_CH_ACTIVE_MODE 2002 //R //(TRIGGER TYPE)
361 #define IOFUNC_DIO_COUNTER_CH_SCALING_ENABLE 2003 //R
362 #define IOFUNC_DIO_COUNTER_CH_SCALING_SLOPE 2004 //R
363 #define IOFUNC_DIO_COUNTER_CH_SCALING_OFFSET 2005 //R
364 #define IOFUNC_DIO_COUNTER_CH_SCALING_INTERVAL_SEC 2006 //R
365 #define IOFUNC_DIO_COUNTER_CH_VALUE 2007 //R/W
366 #define IOFUNC_DIO_COUNTER_CH_START_STOP 2008 //R/W
367 #define IOFUNC_DIO_COUNTER_CH_RESET 2009 //C
368 
369 //-----
370 
377 #define IOFUNC_DIO_DO_CH_POWER_ON_STATUS 3000 //R
378 #define IOFUNC_DIO_DO_CH_POWER_ON_DELAY_SEC 3001 //R
379 #define IOFUNC_DIO_DO_CH_SAFE_MODE_STATUS 3002 //R
380 #define IOFUNC_DIO_DO_CH_VALUE 3003 //R/W
381 
382 //-----
383 
390 #define IOFUNC_DIO_PULSE_CH_COUNT 4000 //R
391 #define IOFUNC_DIO_PULSE_CH_ON_WIDTH_US 4001 //R
392 #define IOFUNC_DIO_PULSE_CH_OFF_WIDTH_US 4002 //R
393 #define IOFUNC_DIO_PULSE_CH_POWER_ON_STATUS 4003 //R
394 #define IOFUNC_DIO_PULSE_CH_POWER_ON_DELAY_SEC 4004 //R
395 #define IOFUNC_DIO_PULSE_CH_SAFE_MODE_STATUS 4005 //R
396 #define IOFUNC_DIO_PULSE_CH_STATUS 4006 //R/W //Start/Stop
397 
398 //-----
404 #define IOFUNC_RELAY_CH_NAME 0 //R
405 #define IOFUNC_RELAY_CH_MODE 1 //R
406 #define IOFUNC_RELAY_CH_CURRENT_COUNT 2 //R/C
407 #define IOFUNC_RELAY_CH_TOTAL_COUNT 3 //R
408 
409 //-----
410 
417 #define IOFUNC_RELAY_RELAY_CH_POWER_ON_STATUS 1000 //R
418 #define IOFUNC_RELAY_RELAY_CH_POWER_ON_DELAY_SEC 1001 //R
419 #define IOFUNC_RELAY_RELAY_CH_SAFE_MODE_STATUS 1002 //R
420 #define IOFUNC_RELAY_RELAY_CH_VALUE 1003 //R/W
421 
422 //-----
423 
431 #define IOFUNC_RELAY_PULSE_CH_COUNT 2000 //R
432 #define IOFUNC_RELAY_PULSE_CH_ON_WIDTH_MS 2001 //R
433 #define IOFUNC_RELAY_PULSE_CH_OFF_WIDTH_MS 2002 //R
434 #define IOFUNC_RELAY_PULSE_CH_POWER_ON_STATUS 2003 //R
435 #define IOFUNC_RELAY_PULSE_CH_POWER_ON_DELAY_SEC 2004 //R
436 #define IOFUNC_RELAY_PULSE_CH_SAFE_MODE_STATUS 2005 //R
437 #define IOFUNC_RELAY_PULSE_CH_STATUS 2006 //R/W //Start/Stop
438 
439 //-----
449 #define IOFUNC_AI_CH_NAME 0 //R
450 #define IOFUNC_AI_CH_MODE 1 //R
451 #define IOFUNC_AI_CH_SCALING_SLOPE 2 //R
452 #define IOFUNC_AI_CH_SCALING_OFFSET 3 //R
453 #define IOFUNC_AI_CH_SCALING_UNIT 4 //R
454 #define IOFUNC_AI_CH_BURNOUT_VALUE 5 //R
455 #define IOFUNC_AI_CH_SCALED_VALUE 6 //R
456 #define IOFUNC_AI_CH_MINIMUM_VALUE 7 //R/C
457 #define IOFUNC_AI_CH_MAXIMUM_VALUE 8 //R/C
458 #define IOFUNC_AI_CH_BURNOUT_STATUS 9 //R
459 #define IOFUNC_AI_CH_RAW_VALUE 10 //R
460 #define IOFUNC_AI_CH_BURNOUT_SCALED_VALUE 11 //R
461 
462 //-----
463 
471 #define IOFUNC_AO_CH_NAME 0 //R
472 #define IOFUNC_AO_CH_MODE 1 //R
473 #define IOFUNC_AO_CH_SCALING_SLOPE 2 //R
474 #define IOFUNC_AO_CH_SCALING_OFFSET 3 //R
475 #define IOFUNC_AO_CH_SCALING_UNIT 4 //R
476 #define IOFUNC_AO_CH_POWER_ON_VALUE 5 //R
477 #define IOFUNC_AO_CH_SAFE_MODE_STATUS 6 //R
478 #define IOFUNC_AO_CH_SCALED_VALUE 7 //R/W
479 #define IOFUNC_AO_CH_RAW_VALUE 8 //R/W
480 
481 //-----
482 
490 #define IOFUNC_TC_CH_NAME 0 //R
491 #define IOFUNC_TC_CH_MODE 1 //R
492 #define IOFUNC_TC_CH_TEMPERATURE_UNIT 2 //R
493 #define IOFUNC_TC_CH_SCALING_SLOPE 3 //R
494 #define IOFUNC_TC_CH_SCALING_OFFSET 4 //R
495 #define IOFUNC_TC_CH_VALUE_FLOAT 5 //R
496 #define IOFUNC_TC_CH_MINIMUM_VALUE 6 //R/C
497 #define IOFUNC_TC_CH_MAXIMUM_VALUE 7 //R/C
498 #define IOFUNC_TC_MULTIPLIED_ENGINEERING_VALUE 8 //R
499 
500 //-----
501 
509 #define IOFUNC_RTD_CH_NAME 0 //R
510 #define IOFUNC_RTD_CH_MODE 1 //R
511 #define IOFUNC_RTD_CH_TEMPERATURE_UNIT 2 //R
512 #define IOFUNC_RTD_CH_SCALING_SLOPE 3 //R
513 #define IOFUNC_RTD_CH_SCALING_OFFSET 4 //R
514 #define IOFUNC_RTD_CH_VALUE_FLOAT 5 //R
515 #define IOFUNC_RTD_CH_MINIMUM_VALUE 6 //R/C
516 #define IOFUNC_RTD_CH_MAXIMUM_VALUE 7 //R/C
517 #define IOFUNC_RTD_MULTIPLIED_ENGINEERING_VALUE 8 //R
518 
519 //-----
520 
527 #define IOFUNC_IR_CH_NAME 0 //R
528 #define IOFUNC_IR_CH_INITIAL_VALUE 1 //R
529 #define IOFUNC_IR_CH_VALUE 2 //R/W
530 
531 //-----
532 
539 #define IOFUNC_FIR_CH_NAME 0 //R
540 #define IOFUNC_FIR_CH_INITIAL_VALUE 1 //R
541 #define IOFUNC_FIR_CH_VALUE 2 //R/W
543 
544 //-----
545 
552 #define IOFUNC_SERIAL_TAG_CH_NAME 0 //R
553 #define IOFUNC_SERIAL_TAG_CH_VALUE 1 //R/W
555 
556 //-----
557 
561 #define IOFUNC_SYS_DATE 0 //R
562 #define IOFUNC_SYS_TIME 1 //R
563 #define IOFUNC_SYS_LAN_IP 2 //R
564 #define IOFUNC_SYS_SERVER_NAME 3 //R
565 #define IOFUNC_SYS_FWR_VERSION 4 //R
566 #define IOFUNC_SYS_LIVE_TIME_SEC 5 //R
567 #define IOFUNC_SYS_MODEL_NAME 6 //R
568 #define IOFUNC_SYS_SAFE_MODE_FLAG 7 //R
569 #define IOFUNC_SYS_SAFE_MODE_COMM_WATCHDOG_TIMEOUT_SEC 8 //R
570 #define IOFUNC_SYS_SAFE_MODE_AUTO_CLEAN_FLAG 9 //R
571 #define IOFUNC_SYS_POWER_VOLTAGE 10 //R
572 #define IOFUNC_SYS_MODBUS_CONNECTION_FAIL_FLAG 11 //R
573 #define IOFUNC_SYS_CELLULAR_IP 12 //R
574 #define IOFUNC_SYS_SLOT_COUNT 13 //R
575 #define IOFUNC_SYS_SLOT_NAME 14 //R
576 
577 //-----
578 
582 #define IOFUNC_SYS_ALL_CH_MODE_DI 0 //R
583 #define IOFUNC_SYS_ALL_CH_MODE_DO 1 //R
584 #define IOFUNC_SYS_ALL_CH_MODE_RELAY 2 //R
585 #define IOFUNC_SYS_ALL_CH_MODE_DIO 3 //R
586 #define IOFUNC_SYS_ALL_CH_MODE_AI 4 //R
587 #define IOFUNC_SYS_ALL_CH_MODE_AO 5 //R
588 #define IOFUNC_SYS_ALL_CH_MODE_TC 6 //R
589 #define IOFUNC_SYS_ALL_CH_MODE_RTD 7 //R
590 #define IOFUNC_SYS_ALL_CH_MODE_SERIAL_TAG 8 //R
591 #define IOFUNC_SYS_ALL_CH_MODE_VC 9 //R
592 #define IOFUNC_SYS_ALL_CH_MODE_WIR 10 //R
593 #define IOFUNC_SYS_ALL_CH_MODE_FIR 11 //R
595 
596 //-----
597 
601 #define IOFUNC_VC_CH_NAME 0 //R
602 #define IOFUNC_VC_CH_VALUE 1 //R
603 
604 
605 
606 //-----
611 #define DATA_TYPE_UNKNOWN 0
612 #define DATA_TYPE_BYTE 1
613 #define DATA_TYPE_WORD 2
614 #define DATA_TYPE_DWORD 3
615 #define DATA_TYPE_INT 4
616 #define DATA_TYPE_FLOAT 5
617 #define DATA_TYPE_STRING 6
618 #define DATA_TYPE_DATE 7
619 #define DATA_TYPE_TIME 8
620 #define DATA_TYPE_BINARY 9
621 
622 
623 //-----------------------------------------------------------------
624 
625 // define: Channel Info
633 //-----
634 #define CHINFO_DI_DI 0x001
635 #define CHINFO_DI_COUNTER 0x002
636 //-----
637 #define CHINFO_DO_DO 0x101
638 #define CHINFO_DO_PULSE 0x102
639 //-----
640 #define CHINFO_DIO_DI 0x201
641 #define CHINFO_DIO_COUNTER 0x202
642 #define CHINFO_DIO_DO 0x203
643 #define CHINFO_DIO_PULSE 0x204
644 //-----
645 #define CHINFO_RELAY_RELAY 0x301
646 #define CHINFO_RELAY_PULSE 0x302
647 //-----
648 #define CHINFO_AI_DISABLED 0x400
649 #define CHINFO_AI_150mV 0x401
650 #define CHINFO_AI_500mV 0x402
651 #define CHINFO_AI_5V 0x403
652 #define CHINFO_AI_10V 0x404
653 #define CHINFO_AI_0_20mA 0x405
654 #define CHINFO_AI_4_20mA 0x406
655 #define CHINFO_AI_0_10V 0x407
656 #define CHINFO_AI_4_20mA_BurnOut 0x408
657 //-----
658 #define CHINFO_AO_DISABLED 0x500
659 #define CHINFO_AO_4_20mA 0x501
660 #define CHINFO_AO_0_10V 0x502
661 //-----
662 #define CHINFO_TC_DISABLED 0x600
663 #define CHINFO_TC_J_TYPE 0x601
664 #define CHINFO_TC_K_TYPE 0x602
665 #define CHINFO_TC_T_TYPE 0x603
666 #define CHINFO_TC_E_TYPE 0x604
667 #define CHINFO_TC_R_TYPE 0x605
668 #define CHINFO_TC_S_TYPE 0x606
669 #define CHINFO_TC_B_TYPE 0x607
670 #define CHINFO_TC_N_TYPE 0x608
671 #define CHINFO_TC_VOL_78126 0x609
672 #define CHINFO_TC_VOL_39062 0x60A
673 #define CHINFO_TC_VOL_19532 0x60B
674 //-----
675 #define CHINFO_RTD_DISABLED 0x700
676 #define CHINFO_RTD_PT100 0x701
677 #define CHINFO_RTD_PT200 0x702
678 #define CHINFO_RTD_PT500 0x703
679 #define CHINFO_RTD_PT1000 0x704
680 #define CHINFO_RTD_JPT100 0x705
681 #define CHINFO_RTD_JPT200 0x706
682 #define CHINFO_RTD_JPT500 0x707
683 #define CHINFO_RTD_JPT1000 0x708
684 #define CHINFO_RTD_NI100 0x709
685 #define CHINFO_RTD_NI200 0x70A
686 #define CHINFO_RTD_NI500 0x70B
687 #define CHINFO_RTD_NI1000 0x70C
688 #define CHINFO_RTD_RES_310 0x70D
689 #define CHINFO_RTD_RES_620 0x70E
690 #define CHINFO_RTD_RES_1250 0x70F
691 #define CHINFO_RTD_RES_2200 0x710
692 #define CHINFO_RTD_PT50 0x711
693 #define CHINFO_RTD_NI120 0x712
694 //-----
695 #define CHINFO_IR_WORD 0x801
696 //-----
697 #define CHINFO_SERIALTAG_BYTE 0x901
698 #define CHINFO_SERIALTAG_WORD 0x902
699 #define CHINFO_SERIALTAG_DWORD 0x903
700 #define CHINFO_SERIALTAG_INT 0x904
701 #define CHINFO_SERIALTAG_FLOAT 0x905
702 //-----
703 #define CHINFO_VC_MAXIMUM 0xB01
704 #define CHINFO_VC_MINIMUM 0xB02
705 #define CHINFO_VC_AVERAGE 0xB03
706 #define CHINFO_VC_ACCUMULATION 0xB04
707 #define CHINFO_VC_INSTANTANEOUS 0xB05
708 #define CHINFO_VC_INCREMENTAL 0xB06
709 //-----
710 #define CHINFO_IR_FLOAT 0xC01
711 //-----
713 
714 #ifndef __MX_FWR
715 //-----------------------------------------------------------------
717 {
718 public:
719  #pragma pack(1)
720  //===============================
722  {
723  WORD wUniqueID;
727  WORD wModHWId;
729 
730  //===============================
731  typedef struct _MX_VERSION
732  {
733  BYTE Major;
734  BYTE Minor;
735  BYTE Beta;
736  WORD Revision;
737  } MX_VERSION;
738 
739  //===============================
740  typedef struct _MX_DATE
741  {
742  WORD Year;
743  BYTE Month;
744  BYTE Day;
745  } MX_DATE;
746 
747  //============================
748  typedef struct _MX_TIME
749  {
750  BYTE Hour;
751  BYTE Min;
752  BYTE Sec;
753  } MX_TIME;
754 
755  //============================
756  typedef struct _MX_CMD_BLOCK_HEADER
757  {
758  WORD wIOType;
759  WORD wFunction;
761  WORD wStartObj; // 0-511
762  WORD wTotalObj; // 1-512
764 
765  //============================
766  typedef struct _MX_RECV_BLOCK_HEADER
767  {
768  WORD wIOType;
769  WORD wFunction;
771  WORD wResult; // Current Block Cmd Result
772  WORD wTotalObj; // Total Object Quantity or String Length
774 
775  //============================
776  typedef struct _MX_CLEAR_OBJ_DATA
777  {
781 
782  //============================
784  {
785  int iHConnection; // Device Connection ID
789 
790  //============================
791  typedef struct _RW_BINARY_VALUE
792  {
793  WORD wLength; // Read: MAX_READ_SIZE(512), WRITE: 1-512
794  BYTE *szData;
796 
797  //============================
799  {
800  BYTE bytValue;
801  WORD wValue;
802  DWORD dwValue;
803  int iValue;
804  float fValue;
805  char *szValue; // for String
809  };
810 
811  //============================
812  typedef struct _MX_RW_OBJ_DATA
813  {
818  //============================
819  typedef struct _MX_WRITE_BLOCK_DATA
820  {
824 
825  //============================
826  typedef struct _MX_READ_BLOCK_DATA
827  {
830 
831  //============================
832  typedef struct _MX_WRITE_OBJ_DATA
833  {
837 
838  //============================
840  {
841  int iHConnection; // Device Connection ID
845  //============================
847  {
848  int iHConnection; // Device Connection ID
852  //============================
853  typedef struct _MX_ACCOUNT_DATA
854  {
858  //============================
859  typedef struct _MX_MAC_ADDRESS
860  {
863 
864  //============================
865  #pragma pack()
866 public:
868  virtual ~CMXIO_V3_2500(void) {};
876  virtual void MXIO_GetDllVersion(MX_VERSION *pMxVersion) = 0;
880  virtual void MXIO_GetDllBuildDate(MX_DATE *pMxDate) = 0;
882 
886  virtual int MXIO_Init() = 0;
887  virtual int MXIO_Exit() = 0;
889 
901  virtual int MXIO_ListCDADevice(char *szIP, WORD wPort, DWORD dwTimeOut, WORD *wDevCount) = 0;
907  virtual int MXIO_GetCDADeviceInfo(WORD wDevCount, MX_STRU_CDA_DEVICE_INFO pCDADeviceInfo[]) = 0;
909 
923  virtual int MXIO_Connect(char *szIP, WORD wPort, DWORD dwTimeOut, CMXIO_V3_2500::MX_MAC_ADDRESS *pMxMACAddr, MX_ACCOUNT_DATA *AccountData, int *hConnection) = 0;
928  virtual int MXIO_Disconnect(int hConnection) = 0;
933  virtual int MXIO_Restart(int hConnection) = 0;
946  virtual int MXIO_Read(int hConnection, WORD wBlockQuantity, CMXIO_V3_2500::MX_READ_BLOCK_DATA *pReadBlockData, pfnREADCALLBACK pfnProc, void *pParam) = 0;
955  virtual int MXIO_Write(int hConnection, WORD wBlockQuantity, CMXIO_V3_2500::MX_WRITE_BLOCK_DATA *pWriteBlockData, pfnWRITECALLBACK pfnProc, void *pParam) = 0;
964  virtual int MXIO_Clear(int hConnection, WORD wBlockQuantity, CMXIO_V3_2500::MX_CLEAR_BLOCK_DATA *pClearBlockData, pfnCLEARCALLBACK pfnProc, void *pParam) = 0;
966 };
967 
968 typedef CMXIO_V3_2500 *(*PFNCREATEMXIO_V3_2500)();
969 typedef void *(*PFNDESTROYMXIO_V3_2500)(CMXIO_V3_2500 *pMXIO_V3_2500);
970 
972 extern "C" MXIO_V3_API void DestroyMXIO_2500(CMXIO_V3_2500 *pMXIO_V3_2500);
973 //-----------------------------------------------------------------
974 #endif
975 
976 #endif