| ioPAC RTU Controllers C/C++ Sample Code Programming Guide

- Main Page
- Modules
- Data Structures
- Files

- File List
- Globals

libmoxa_rtu.h
Go to the documentation of this file.
1 /*******************************************************************************
2 * Copyright Moxa Inc.
3 *
4 * Moxa Library
5 *
6 * Date Author Comment
7 * 04-10-2013 Eddy Kao Created.
8 ******************************************************************************/
9
19 #ifndef _MOXA_RTU_H
20 #define _MOXA_RTU_H
21
22 #ifdef __cplusplus
23 extern "C"{
24 #endif
25
26 #include <stdio.h>
27 #include <stdlib.h>
28 #include <string.h>
29 #include <stdarg.h>
30 #include <unistd.h>
31 #include <fcntl.h>
32 #include <errno.h>
33 #include <termios.h>
34 #include <time.h>
35 #include <pthread.h>
36 #include <arpa/inet.h>
37 #include <asm/ioctls.h>
38 #include <linux/rtc.h>
39 #include <linux/tty.h>
40 #include <linux/can.h>
41 #include <linux/watchdog.h>
42 #include <netinet/in.h>
43 #include <net/if.h>
44 #include <semaphore.h>
45 #include <mqueue.h>
46 #include<dirent.h>
47 #include <sys/socket.h>
48 #include <sys/stat.h>
49 #include <sys/ioctl.h>
50 #include <sys/types.h>
51 #include <sys/ipc.h>
52 #include <sys/sem.h>
53 #include <sys/time.h>
54 #include<sys/wait.h>
55
61 typedef unsigned long UINT32;
62 typedef long INT32;
63 typedef unsigned short UINT16;
64 typedef short INT16;
65 typedef unsigned char UINT8;
66 typedef char INT8;
67
68 #define USB_VID_MOXA 0x110a //Moxa
69
70 /* I/O Module */
71 #define USB_PID_RTU_85M_1602 0x5200 //16ch, DI
72 #define USB_PID_RTU_85M_2600 0x5240 //16ch, DO
73 #define USB_PID_RTU_85M_3800 0x52c0 //8ch, 4-20mA
74 #define USB_PID_RTU_85M_3800_CRRC 0x5402 //8ch, 0-50mA
75 #define USB_PID_RTU_85M_3810 0x52c1 //8ch, 0-10V
76 #define USB_PID_RTU_85M_3801 0x5300 //8ch, 5KHz 4-2-mA
77 #define USB_PID_RTU_85M_3811 0x5301 //8ch, 5KHz 0-10V
78 #define USB_PID_RTU_85M_6810 0x5340 //8ch, TC
79 #define USB_PID_RTU_85M_6600 0x5380 //6ch, RTD
80 #define USB_PID_RTU_AIO_8di_8dio_8ai 0x50e0 //all-in-one module
81 #define USB_PID_RTU_86M_5870D 0x52c2 //HART 4-20mA
82 #define USB_PID_RTU_86M_4420 0x53a0 //AO
83 #define USB_PID_RTU_86M_2604D 0x5243 //Relay
84 #define USB_PID_RTU_86M_1832D 0x5201 //DI ch-to-ch isolation
85 #define USB_PID_RTU_86M_2830D 0x5241 //DO ch-to-ch isolation
86 #define USB_PID_RTU_86M_1620D 0x5202 //DI wide voltage
87 #define USB_PID_RTU_86M_2821D 0x5242 //DO wide voltage
88
89 /* Communication Module */
90 #define USB_PID_RTU_85M_5401 0x53e0 //Serial
91 #define USB_PID_RTU_85M_5220 0x53e1 //IBIS
92 #define USB_PID_RTU_85M_5142 0x53e2 //HSPA
93 #define USB_PID_RTU_85M_5130 0x53e3 //WIFI
94 #define USB_PID_RTU_86M_5212U 0x53e5 // 2-wire switch
95 #define USB_PID_RTU_86M_5811M 0x53e6 //Managed switch
96 #define USB_PID_RTU_86M_5814U 0x53e7 // 8-port Gigabit PoE switch
97 #define USB_PID_RTU_86M_5250 0x53e8 //CAN Bus
98
99 /* Misc Module */
100 #define USB_PID_RTU_PW10_15W 0x5400
101 #define USB_PID_RTU_PW10_30W 0x5401
102 #define USB_PID_RTU_PW20_50W 0x5403
103
104 #define MAX_SLOT 12
105 #define MAX_CHANNEL 24
106
107 #define MODULE_SLOT_CPU_POWER 0
108 #define MODULE_SLOT_CPU 0
109
110
111 /*********************************************IO*********************************************/
112 typedef enum
113 {
114 IO_ERR_OK = 0,
115 IO_ERR_DEVICE,
116 IO_ERR_CMD,
117 IO_ERR_TYPE,
118 IO_ERR_ITEM,
119 IO_ERR_COPY,
120 IO_ERR_SLOT,
121 IO_ERR_CHANNEL,
122 IO_ERR_ARGUMENT,
123 IO_ERR_RW,
124 IO_ERR_ACTION,
125 IO_ERR_UPDATE,
126 IO_ERR_FAST_AI_BUF_EMPTY,
127 IO_ERR_FAST_AI_BUF_OVERFLOW,
128 IO_ERR_FAST_AI_NO_BUF,
129 IO_ERR_IO_MODULE_REQUEST,
130 IO_ERR_COMMUNICATION_MODULE_REQUEST,
131 IO_ERR_SEMAPHORE_LOCK,
132 IO_ERR_TIMEOUT,
133 IO_ERR_SYSTEM_INFO,
134 IO_ERR_MODULE_INFO,
135 IO_ERR_HOT_PLUG,
136 IO_ERR_DUPLICATE_REGISTER,
137 IO_ERR_IO_EVENT_QUEUE_EMPTY,
138 IO_ERR_CELLULAR_POWER_INDICATOR,
139 IO_ERR_CELLULAR_EMERGENCY_OFF,
140 IO_ERR_CELLULAR_IGT_ON,
141 IO_ERR_POWER,
142 IO_ERR_COMMUNICATION_MODULE_SUPPORT,
143 IO_ERR_AMOUNT
144 } IO_ERR_CODE;
145
146 typedef enum
147 {
148 MODULE_RW_ERR_OK = 0,
149 MODULE_RW_ERR_DEVICE,
150 MODULE_RW_ERR_SLOT,
151 MODULE_RW_ERR_CMD,
152 MODULE_RW_ERR_ARGUMENT,
153 MODULE_RW_ERR_SYSTEM_INFO,
154 MODULE_RW_ERR_RW,
155 MODULE_RW_ERR_VERSION,
156 MODULE_RW_ERR_TIMEOUT,
157 MODULE_RW_ERR_PACKET,
158 MODULE_RW_ERR_INSUFFICIENT_BUFFER,
159 MODULE_RW_ERR_REQUEST_FAIL,
160 MODULE_RW_ERR_REQUEST_EXCEPTION,
161 MODULE_RW_ERR_BUSY,
162 MODULE_RW_ERR_COMMUNICATION_MODULE_REQUEST,
163 MODULE_RW_ERR_SEMAPHORE_LOCK,
164 MODULE_RW_ERR_HOT_PLUG,
165 MODULE_RW_ERR_TIMESTAMP,
166 MODULE_RW_ERR_TIMESTAMP_NOT_SYNC,
167 MODULE_RW_ERR_IO_PARAM,
168 MODULE_RW_ERR_IO_TYPE,
169 MODULE_RW_ERR_IO_CH,
170 MODULE_RW_ERR_IO_MODE,
171 MODULE_RW_ERR_IO_FILTER,
172 MODULE_RW_ERR_IO_TRIGGER,
173 MODULE_RW_ERR_IO_SIG_WIDTH,
174 MODULE_RW_ERR_IO_PWM,
175 MODULE_RW_ERR_IO_BURNOUT,
176 MODULE_RW_ERR_IO_CALIBRATION,
177 MODULE_RW_ERR_IO_BUF,
178 MODULE_RW_ERR_IO_FAST_AI_BUF_EMPTY,
179 MODULE_RW_ERR_IO_FAST_AI_BUF_OVERFLOW,
180 MODULE_RW_ERR_IO_FAST_AI_NOT_READY,
181 MODULE_RW_ERR_POWER,
182 MODULE_RW_ERR_NO_EXTERNAL_POWER,
183 MODULE_RW_ERR_IO_FPGA,
184 MODULE_RW_ERR_AMOUNT
185 } MODULE_RW_ERR_CODE;
186
187 typedef enum
188 {
189 AI_TRANSFORM_ERR_OK = 0,
190 AI_TRANSFORM_ERR_RANGE,
191 AI_TRANSFORM_ERR_VALUE,
192 AI_TRANSFORM_ERR_ARGUMENT,
193 AI_TRANSFORM_ERR_AMOUNT
194 } AI_TRANSFORM_ERR_CODE;
195
196 typedef enum
197 {
198 AIO_TRANSFORM_ERR_OK = 0,
199 AIO_TRANSFORM_ERR_RANGE,
200 AIO_TRANSFORM_ERR_BITSRESOLUTION,
201 AIO_TRANSFORM_ERR_VALUE,
202 AIO_TRANSFORM_ERR_ARGUMENT,
203 AIO_TRANSFORM_ERR_AMOUNT
204 } AIO_TRANSFORM_ERR_CODE;
205
206 struct IO_Info {
207 UINT8 di_channels;
208 UINT8 do_channels;
209 UINT8 dio_channels;
210 UINT8 ai_channels;
211 UINT8 fast_ai_channels;
212 UINT8 ao_channels;
213 UINT8 tc_channels;
214 UINT8 rtd_channels;
215 UINT8 counter_channels;
216 UINT8 pulse_channels;
217 UINT8 relay_channels;
218 } __attribute__((packed));
219
220 struct Module_Info {
221 UINT8 slot;
222 UINT8 unit_id;
223 UINT16 vendor_id;
224 UINT16 product_id;
225 UINT32 serial_number;
226 UINT16 hw_version;
227 UINT16 fw_version;
228 struct IO_Info io_info;
229 } __attribute__((packed));
230
231 struct Timestamp {
232 UINT32 msec;
233 UINT32 sec;
234 UINT32 min;
235 UINT32 hour;
236 UINT32 day;
237 UINT32 mon;
238 UINT32 year;
239 } __attribute__((packed));
240
241 //--------------------------------------------------------------------------------------------------------
250 //ETHERNET ADAPTER TYPE
251 #define ETHERNET_ADAPTER_RJ45 0
252 #define ETHERNET_ADAPTER_M12 1
253 //SWITCH MODE
254 #define SWITCH_DUMP_MODE 0
255 #define SWITCH_VLAN_MODE 1
256
261 #define SRAM_START_ADDRESS 0x0
262 #define SRAM_END_ADDRESS 0x20000 //128KB
263
268 #define FRAM_START_ADDRESS 0x0
269 #define FRAM_END_ADDRESS 0x10000 //64KB
270
286 IO_ERR_CODE MX_RTU_Module_Info_Get(UINT8 slot, struct Module_Info *module_info);
291 IO_ERR_CODE MX_RTU_Total_Slots_Get(UINT32 *num);
296 IO_ERR_CODE MX_RTU_Slot_Inserted_Get(UINT32 *state); //Example: 0x6 -> slot 1 and 2 are inserted
301 IO_ERR_CODE MX_RTU_Ethernet_Adapter_Type_Get(UINT32 *type); //ETHERNET ADAPTER TYPE
306 IO_ERR_CODE MX_RTU_CPU_Switch_Mode_Get(UINT32 *mode);
308
323 IO_ERR_CODE MX_RTU_SRAM_Read(UINT32 start_address, UINT32 length, UINT8 *buf);
330 IO_ERR_CODE MX_RTU_SRAM_Write(UINT32 start_address, UINT32 length, UINT8 *buf);
332
347 IO_ERR_CODE MX_RTU_FRAM_Read(UINT32 start_address, UINT32 length, UINT8 *buf);
354 IO_ERR_CODE MX_RTU_FRAM_Write(UINT32 start_address, UINT32 length, UINT8 *buf);
357 //--------------------------------------------------------------------------------------------------------
367 #define IO_EVENT_QUEUE_MAX 100
368
372 //DI EVENT TRIGGER CONDITION
373 #define DI_EVENT_TOGGLE_L2H 0
374 #define DI_EVENT_TOGGLE_H2L 1
375 #define DI_EVENT_TOGGLE_BOTH 2
376
381 //AI EVENT TRIGGER CONDITION
382 #define AI_TC_RTD_EVENT_GREATER 0
383 #define AI_TC_RTD_EVENT_SMALLER 1
384 #define AI_TC_RTD_EVENT_EQUAL 2
385
403 IO_ERR_CODE MX_RTU_DI_Event_Register(UINT8 slot, UINT8 channel, UINT32 trigger, int *handle); //DI EVENT TRIGGER CONDITION
408 IO_ERR_CODE MX_RTU_DI_Event_Unregister(int handle);
417 IO_ERR_CODE MX_RTU_DI_Event_Get(int handle, UINT32 *status, struct Timestamp *time);
423 IO_ERR_CODE MX_RTU_DI_Event_Set_Trigger(int handle, UINT32 trigger); //DI EVENT TRIGGER CONDITION
429 IO_ERR_CODE MX_RTU_DI_Event_Get_Trigger(int handle, UINT32 *trigger); //DI EVENT TRIGGER CONDITION
435 IO_ERR_CODE MX_RTU_DI_Event_Count(int handle, UINT32 *count);
442 IO_ERR_CODE MX_RTU_DI_Event_Clear(int handle);
448 IO_ERR_CODE MX_RTU_DI_Event_Reset();
450
461 IO_ERR_CODE MX_RTU_DIO_DI_Event_Register(UINT8 slot, UINT8 channel, UINT32 trigger, int *handle); //DI EVENT TRIGGER CONDITION
464 IO_ERR_CODE MX_RTU_DIO_DI_Event_Unregister(int handle);
466 IO_ERR_CODE MX_RTU_DIO_DI_Event_Get(int handle, UINT32 *status, struct Timestamp *time);
468 IO_ERR_CODE MX_RTU_DIO_DI_Event_Set_Trigger(int handle, UINT32 trigger); //DI EVENT TRIGGER CONDITION
470 IO_ERR_CODE MX_RTU_DIO_DI_Event_Get_Trigger(int handle, UINT32 *trigger); //DI EVENT TRIGGER CONDITION
472 IO_ERR_CODE MX_RTU_DIO_DI_Event_Count(int handle, UINT32 *count);
474 IO_ERR_CODE MX_RTU_DIO_DI_Event_Clear(int handle);
476 IO_ERR_CODE MX_RTU_DIO_DI_Event_Reset();
478
496 IO_ERR_CODE MX_RTU_AI_Event_Register(UINT8 slot, UINT8 channel, float value, UINT32 condition, int *handle); //AI EVENT TRIGGER CONDITION
501 IO_ERR_CODE MX_RTU_AI_Event_Unregister(int handle);
510 IO_ERR_CODE MX_RTU_AI_Event_Get(int handle, float *value, struct Timestamp *time);
517 IO_ERR_CODE MX_RTU_AI_Event_Set_Value(int handle, float value, UINT32 condition); //AI EVENT TRIGGER CONDITION
524 IO_ERR_CODE MX_RTU_AI_Event_Get_Value(int handle, float *value, UINT32 *condition); //AI EVENT TRIGGER CONDITION
530 IO_ERR_CODE MX_RTU_AI_Event_Count(int handle, UINT32 *count);
537 IO_ERR_CODE MX_RTU_AI_Event_Clear(int handle);
543 IO_ERR_CODE MX_RTU_AI_Event_Reset(void);
545
563 IO_ERR_CODE MX_RTU_TC_Event_Register(UINT8 slot, UINT8 channel, float value, UINT32 condition, int *handle); //AI EVENT TRIGGER CONDITION
568 IO_ERR_CODE MX_RTU_TC_Event_Unregister(int handle);
577 IO_ERR_CODE MX_RTU_TC_Event_Get(int handle, float *value, struct Timestamp *time);
584 IO_ERR_CODE MX_RTU_TC_Event_Set_Value(int handle, float value, UINT32 condition); //AI EVENT TRIGGER CONDITION
591 IO_ERR_CODE MX_RTU_TC_Event_Get_Value(int handle, float *value, UINT32 *condition); //AI EVENT TRIGGER CONDITION
597 IO_ERR_CODE MX_RTU_TC_Event_Count(int handle, UINT32 *count);
604 IO_ERR_CODE MX_RTU_TC_Event_Clear(int handle);
610 IO_ERR_CODE MX_RTU_TC_Event_Reset(void);
612
630 IO_ERR_CODE MX_RTU_RTD_Event_Register(UINT8 slot, UINT8 channel, float value, UINT32 condition, int *handle); //AI EVENT TRIGGER CONDITION
635 IO_ERR_CODE MX_RTU_RTD_Event_Unregister(int handle);
644 IO_ERR_CODE MX_RTU_RTD_Event_Get(int handle, float *value, struct Timestamp *time);
651 IO_ERR_CODE MX_RTU_RTD_Event_Set_Value(int handle, float value, UINT32 condition); //AI EVENT TRIGGER CONDITION
658 IO_ERR_CODE MX_RTU_RTD_Event_Get_Value(int handle, float *value, UINT32 *condition); //AI EVENT TRIGGER CONDITION
664 IO_ERR_CODE MX_RTU_RTD_Event_Count(int handle, UINT32 *count);
671 IO_ERR_CODE MX_RTU_RTD_Event_Clear(int handle);
677 IO_ERR_CODE MX_RTU_RTD_Event_Reset(void);
680 //--------------------------------------------------------------------------------------------------------
711 //DI MODE
712 #define DI_MODE_DI 0
713 #define DI_MODE_COUNTER 1
714 #define DI_MODE_FREQUENCY 2
715
721 //DI COUNTER TRIGGER CONDITION
722 #define DI_TOGGLE_L2H 0
723 #define DI_TOGGLE_H2L 1
724 #define DI_TOGGLE_BOTH 2
725
734 MODULE_RW_ERR_CODE MX_RTU_Module_DI_Value_Get(UINT8 slot, UINT32 *value, struct Timestamp *time);
735
744 MODULE_RW_ERR_CODE MX_RTU_Module_DI_Mode_Get(UINT8 slot, UINT8 start, UINT8 count, UINT8 *buf);
745
758 MODULE_RW_ERR_CODE MX_RTU_Module_DI_Filter_Get(UINT8 slot, UINT8 start, UINT8 count, UINT32 *buf);
759
767 MODULE_RW_ERR_CODE MX_RTU_Module_DI_Counter_Start_Get(UINT8 slot, UINT32 *start);
768
777 MODULE_RW_ERR_CODE MX_RTU_Module_DI_Counter_Trigger_Get(UINT8 slot, UINT8 start, UINT8 count, UINT8 *buf);
778
788 MODULE_RW_ERR_CODE MX_RTU_Module_DI_Counter_Value_Get(UINT8 slot, UINT8 start, UINT8 count, UINT32 *buf, struct Timestamp *time);
789
797 MODULE_RW_ERR_CODE MX_RTU_Module_DI_Counter_Overflow_Get(UINT8 slot, UINT32 *overflow);
798
806 MODULE_RW_ERR_CODE MX_RTU_Module_DI_Frequency_Start_Get(UINT8 slot, UINT32 *start);
807
816 MODULE_RW_ERR_CODE MX_RTU_Module_DI_Frequency_Measurement_Time_Get(UINT8 slot, UINT8 start, UINT8 count, UINT32 *buf);
817
826 MODULE_RW_ERR_CODE MX_RTU_Module_DI_Frequency_Get(UINT8 slot, UINT8 start, UINT8 count, float *buf);
827
834 MODULE_RW_ERR_CODE MX_RTU_Module_DI_Debouncing_Enable_Get(UINT8 slot, UINT32 *enable);
835
843 MODULE_RW_ERR_CODE MX_RTU_Module_DI_Debouncing_Time_Get(UINT8 slot, UINT8 start, UINT8 count, float *buf);
844
851 MODULE_RW_ERR_CODE MX_RTU_Module_DI_Ext_Power_Get(UINT8 slot, UINT32 *value);
852
861 MODULE_RW_ERR_CODE MX_RTU_Module_DI_Mode_Set(UINT8 slot, UINT8 start, UINT8 count, UINT8 *buf);
862
875 MODULE_RW_ERR_CODE MX_RTU_Module_DI_Filter_Set(UINT8 slot, UINT8 start, UINT8 count, UINT32 *buf);
876
884 MODULE_RW_ERR_CODE MX_RTU_Module_DI_Counter_Start_Set(UINT8 slot, UINT32 start);
885
894 MODULE_RW_ERR_CODE MX_RTU_Module_DI_Counter_Trigger_Set(UINT8 slot, UINT8 start, UINT8 count, UINT8 *buf);
895
904 MODULE_RW_ERR_CODE MX_RTU_Module_DI_Counter_Value_Set(UINT8 slot, UINT8 start, UINT8 count, UINT32 *buf);
905
913 MODULE_RW_ERR_CODE MX_RTU_Module_DI_Counter_Overflow_Reset(UINT8 slot, UINT32 overflow);
914
922 MODULE_RW_ERR_CODE MX_RTU_Module_DI_Frequency_Start_Set(UINT8 slot, UINT32 start);
923
932 MODULE_RW_ERR_CODE MX_RTU_Module_DI_Frequency_Measurement_Time_Set(UINT8 slot, UINT8 start, UINT8 count, UINT32 *buf);
933
940 MODULE_RW_ERR_CODE MX_RTU_Module_DI_Debouncing_Enable_Set(UINT8 slot, UINT32 enable);
941
949 MODULE_RW_ERR_CODE MX_RTU_Module_DI_Debouncing_Time_Set(UINT8 slot, UINT8 start, UINT8 count, float *buf);
950
952
953 //--------------------------------------------------------------------------------------------------------
968 //DO MODE
969 #define DO_MODE_DO 0
970 #define DO_MODE_PWM 1
971
977 //DO_DIAGNOSTIC_STATUS
978 #define DO_DIAGNOSTIC_STATUS_NORMAL 0x00
979 #define DO_DIAGNOSTIC_STATUS_ERROR 0x01
980
988 MODULE_RW_ERR_CODE MX_RTU_Module_DO_Value_Get(UINT8 slot, UINT32 *value);
989
997 MODULE_RW_ERR_CODE MX_RTU_Module_DO_Mode_Get(UINT8 slot, UINT8 start, UINT8 count, UINT8 *buf);
998
999 /*
1000 \param[in] slot slot 0: Built-in IO Ports, slot 1 ~ 12: Expansion IO Ports.
1001 \param[in] start The first channel to get.
1002 \param[in] count The number of channels to get.
1003 \param[out] buf The DO PWM <b>LOW</b> signal width for the corresponding channels, Low = On.
1004 \li 85M-2600: One unit = 100us.
1005 \li 86M-2830D: One unit = 500us.
1006 \li ioPAC 5542: One unit = 500us.
1007 \li ioPAC 5542-HSPA: One unit = 500us.
1008 \return \link MODULE_RW_ERR_CODE MODULE_RW_ERR_CODE \endlink
1009 */
1010 MODULE_RW_ERR_CODE MX_RTU_Module_DO_SigW_L_Get(UINT8 slot, UINT8 start, UINT8 count, UINT32 *buf);
1011
1012 /*
1013 \param[in] slot slot 0: Built-in IO Ports, slot 1 ~ 12: Expansion IO Ports.
1014 \param[in] start The first channel to get.
1015 \param[in] count The number of channels to get.
1016 \param[out] buf The DO PWM <b>HIGH</b> signal width for the corresponding channels, High = Off.
1017 \li 85M-2600: One unit = 100us.
1018 \li 86M-2830D: One unit = 500us.
1019 \li ioPAC 5542: One unit = 500us.
1020 \li ioPAC 5542-HSPA: One unit = 500us.
1021 \return \link MODULE_RW_ERR_CODE MODULE_RW_ERR_CODE \endlink
1022 */
1023 MODULE_RW_ERR_CODE MX_RTU_Module_DO_SigW_H_Get(UINT8 slot, UINT8 start, UINT8 count, UINT32 *buf);
1024
1031 MODULE_RW_ERR_CODE MX_RTU_Module_DO_PWM_Start_Get(UINT8 slot, UINT32 *start);
1032
1040 MODULE_RW_ERR_CODE MX_RTU_Module_DO_PWM_Count_Get(UINT8 slot, UINT8 start, UINT8 count, UINT32 *buf);
1041
1050 MODULE_RW_ERR_CODE MX_RTU_Module_DO_PWM_Config_Get(UINT8 slot, UINT8 start, UINT8 count, float *frequency, float *dutyCycle);
1051
1059 MODULE_RW_ERR_CODE MX_RTU_Module_DO_Diagnostic_Status_Get(UINT8 slot, UINT8 start, UINT8 count, UINT8 *buf);
1060
1067 MODULE_RW_ERR_CODE MX_RTU_Module_DO_Value_Set(UINT8 slot, UINT32 value);
1068
1076 MODULE_RW_ERR_CODE MX_RTU_Module_DO_Mode_Set(UINT8 slot, UINT8 start, UINT8 count, UINT8 *buf); //DO MODE
1077
1078 /*
1079 \param[in] slot slot 0: Built-in IO Ports, slot 1 ~ 12: Expansion IO Ports.
1080 \param[in] start The first channel to set.
1081 \param[in] count The number of channels to set.
1082 \param[in] buf The DO PWM <b>LOW</b> signal width for the corresponding channels, Low = On.
1083 \li 85M-2600: One unit = 100us.
1084 \li 86M-2830D: One unit = 500us.
1085 \li ioPAC 5542: One unit = 500us.
1086 \li ioPAC 5542-HSPA: One unit = 500us.
1087 \return \link MODULE_RW_ERR_CODE MODULE_RW_ERR_CODE \endlink
1088 */
1089 MODULE_RW_ERR_CODE MX_RTU_Module_DO_SigW_L_Set(UINT8 slot, UINT8 start, UINT8 count, UINT32 *buf);
1090
1091 /*
1092 \param[in] slot slot 0: Built-in IO Ports, slot 1 ~ 12: Expansion IO Ports.
1093 \param[in] start The first channel to set.
1094 \param[in] count The number of channels to set.
1095 \param[in] buf The DO PWM <b>HIGH</b> signal width for the corresponding channels, High = Off.
1096 \li 85M-2600: One unit = 100us.
1097 \li 86M-2830D: One unit = 500us.
1098 \li ioPAC 5542: One unit = 500us.
1099 \li ioPAC 5542-HSPA: One unit = 500us.
1100 \return \link MODULE_RW_ERR_CODE MODULE_RW_ERR_CODE \endlink
1101 */
1102 MODULE_RW_ERR_CODE MX_RTU_Module_DO_SigW_H_Set(UINT8 slot, UINT8 start, UINT8 count, UINT32 *buf);
1103
1110 MODULE_RW_ERR_CODE MX_RTU_Module_DO_PWM_Start_Set(UINT8 slot, UINT32 start);
1111
1118 MODULE_RW_ERR_CODE MX_RTU_Module_DO_PWM_Stop_Set(UINT8 slot, UINT32 stop);
1119
1127 MODULE_RW_ERR_CODE MX_RTU_Module_DO_PWM_Count_Set(UINT8 slot, UINT8 start, UINT8 count, UINT32 *buf);
1128
1137 MODULE_RW_ERR_CODE MX_RTU_Module_DO_PWM_Config_Set(UINT8 slot, UINT8 start, UINT8 count, float *frequency, float *dutyCycle);
1138
1145 MODULE_RW_ERR_CODE MX_RTU_Module_DO_Diagnostic_Status_Clean_Set(UINT8 slot, UINT32 clean);
1147
1148 //--------------------------------------------------------------------------------------------------------
1163 //RELAY MODE
1164 #define RELAY_MODE_RELAY 0
1165 #define RELAY_MODE_PWM 1
1166
1174 MODULE_RW_ERR_CODE MX_RTU_Module_Relay_Value_Get(UINT8 slot, UINT32 *value);
1175
1183 MODULE_RW_ERR_CODE MX_RTU_Module_Relay_Mode_Get(UINT8 slot, UINT8 start, UINT8 count, UINT8 *buf);
1184
1185 /*
1186 \param[in] slot slot 0: Built-in IO Ports, slot 1 ~ 12: Expansion IO Ports.
1187 \param[in] start The first channel to get.
1188 \param[in] count The number of channels to get.
1189 \param[out] buf The RELAY PWM <b>LOW</b> signal width for the corresponding channels, Low = On.
1190 \li ioPAC 8500/8600: One unit = 1.5sec.
1191 \return \link MODULE_RW_ERR_CODE MODULE_RW_ERR_CODE \endlink
1192 */
1193 MODULE_RW_ERR_CODE MX_RTU_Module_Relay_SigW_L_Get(UINT8 slot, UINT8 start, UINT8 count, UINT32 *buf);
1194
1195 /*
1196 \param[in] slot slot 0: Built-in IO Ports, slot 1 ~ 12: Expansion IO Ports.
1197 \param[in] start The first channel to get.
1198 \param[in] count The number of channels to get.
1199 \param[out] buf The RELAY PWM <b>HIGH</b> signal width for the corresponding channels, High = Off.
1200 \li ioPAC 8500/8600: One unit = 1.5sec.
1201 \return \link MODULE_RW_ERR_CODE MODULE_RW_ERR_CODE \endlink
1202 */
1203 MODULE_RW_ERR_CODE MX_RTU_Module_Relay_SigW_H_Get(UINT8 slot, UINT8 start, UINT8 count, UINT32 *buf);
1204
1211 MODULE_RW_ERR_CODE MX_RTU_Module_Relay_PWM_Start_Get(UINT8 slot, UINT32 *start);
1212
1220 MODULE_RW_ERR_CODE MX_RTU_Module_Relay_PWM_Count_Get(UINT8 slot, UINT8 start, UINT8 count, UINT32 *buf);
1221
1230 MODULE_RW_ERR_CODE MX_RTU_Module_Relay_PWM_Config_Get(UINT8 slot, UINT8 start, UINT8 count, float *frequency, float *dutyCycle);
1231
1239 MODULE_RW_ERR_CODE MX_RTU_Module_Relay_Total_Count_Get(UINT8 slot, UINT8 start, UINT8 count, UINT32 *buf);
1240
1248 MODULE_RW_ERR_CODE MX_RTU_Module_Relay_Current_Count_Get(UINT8 slot, UINT8 start, UINT8 count, UINT32 *buf);
1249
1256 MODULE_RW_ERR_CODE MX_RTU_Module_Relay_Value_Set(UINT8 slot, UINT32 value);
1257
1265 MODULE_RW_ERR_CODE MX_RTU_Module_Relay_Mode_Set(UINT8 slot, UINT8 start, UINT8 count, UINT8 *buf); //DO MODE
1266
1267 /*
1268 \param[in] slot slot 0: Built-in IO Ports, slot 1 ~ 12: Expansion IO Ports.
1269 \param[in] start The first channel to set.
1270 \param[in] count The number of channels to set.
1271 \param[in] buf The RELAY PWM <b>LOW</b> signal width for the corresponding channels, Low = On.
1272 \li ioPAC 8500/8600: One unit = 1.5sec.
1273 \return \link MODULE_RW_ERR_CODE MODULE_RW_ERR_CODE \endlink
1274 */
1275 MODULE_RW_ERR_CODE MX_RTU_Module_Relay_SigW_L_Set(UINT8 slot, UINT8 start, UINT8 count, UINT32 *buf);
1276
1277 /*
1278 \param[in] slot slot 0: Built-in IO Ports, slot 1 ~ 12: Expansion IO Ports.
1279 \param[in] start The first channel to set.
1280 \param[in] count The number of channels to set.
1281 \param[in] buf The RELAY PWM <b>HIGH</b> signal width for the corresponding channels, High = Off.
1282 \li ioPAC 8500/8600: One unit = 1.5sec.
1283 \return \link MODULE_RW_ERR_CODE MODULE_RW_ERR_CODE \endlink
1284 */
1285 MODULE_RW_ERR_CODE MX_RTU_Module_Relay_SigW_H_Set(UINT8 slot, UINT8 start, UINT8 count, UINT32 *buf);
1286
1293 MODULE_RW_ERR_CODE MX_RTU_Module_Relay_PWM_Start_Set(UINT8 slot, UINT32 start);
1294
1301 MODULE_RW_ERR_CODE MX_RTU_Module_Relay_PWM_Stop_Set(UINT8 slot, UINT32 stop);
1302
1310 MODULE_RW_ERR_CODE MX_RTU_Module_Relay_PWM_Count_Set(UINT8 slot, UINT8 start, UINT8 count, UINT32 *buf);
1311
1320 MODULE_RW_ERR_CODE MX_RTU_Module_Relay_PWM_Config_Set(UINT8 slot, UINT8 start, UINT8 count, float *frequency, float *dutyCycle);
1321
1329 MODULE_RW_ERR_CODE MX_RTU_Module_Relay_Current_Count_Set(UINT8 slot, UINT8 start, UINT8 count, UINT32 *buf);
1330
1332
1333 //--------------------------------------------------------------------------------------------------------
1350 MODULE_RW_ERR_CODE MX_RTU_Module_DIO_Map_Get(UINT8 slot, UINT32 *map);
1357 MODULE_RW_ERR_CODE MX_RTU_Module_DIO_Map_Set(UINT8 slot, UINT32 map);
1358
1366 MODULE_RW_ERR_CODE MX_RTU_Module_DIO_DI_Value_Get(UINT8 slot, UINT32 *value, struct Timestamp *time);
1374 MODULE_RW_ERR_CODE MX_RTU_Module_DIO_DI_Mode_Get(UINT8 slot, UINT8 start, UINT8 count, UINT8 *buf);
1385 MODULE_RW_ERR_CODE MX_RTU_Module_DIO_DI_Filter_Get(UINT8 slot, UINT8 start, UINT8 count, UINT32 *buf);
1392 MODULE_RW_ERR_CODE MX_RTU_Module_DIO_DI_Counter_Start_Get(UINT8 slot, UINT32 *start);
1400 MODULE_RW_ERR_CODE MX_RTU_Module_DIO_DI_Counter_Trigger_Get(UINT8 slot, UINT8 start, UINT8 count, UINT8 *buf);
1409 MODULE_RW_ERR_CODE MX_RTU_Module_DIO_DI_Counter_Value_Get(UINT8 slot, UINT8 start, UINT8 count, UINT32 *buf, struct Timestamp *time);
1416 MODULE_RW_ERR_CODE MX_RTU_Module_DIO_DI_Counter_Overflow_Get(UINT8 slot, UINT32 *overflow);
1417
1424 MODULE_RW_ERR_CODE MX_RTU_Module_DIO_DI_Frequency_Start_Get(UINT8 slot, UINT32 *start);
1425
1433 MODULE_RW_ERR_CODE MX_RTU_Module_DIO_DI_Frequency_Measurement_Time_Get(UINT8 slot, UINT8 start, UINT8 count, UINT32 *buf);
1434
1442 MODULE_RW_ERR_CODE MX_RTU_Module_DIO_DI_Frequency_Get(UINT8 slot, UINT8 start, UINT8 count, float *buf);
1443
1451 MODULE_RW_ERR_CODE MX_RTU_Module_DIO_DI_Mode_Set(UINT8 slot, UINT8 start, UINT8 count, UINT8 *buf);
1462 MODULE_RW_ERR_CODE MX_RTU_Module_DIO_DI_Filter_Set(UINT8 slot, UINT8 start, UINT8 count, UINT32 *buf);
1469 MODULE_RW_ERR_CODE MX_RTU_Module_DIO_DI_Counter_Start_Set(UINT8 slot, UINT32 start);
1477 MODULE_RW_ERR_CODE MX_RTU_Module_DIO_DI_Counter_Trigger_Set(UINT8 slot, UINT8 start, UINT8 count, UINT8 *buf);
1485 MODULE_RW_ERR_CODE MX_RTU_Module_DIO_DI_Counter_Value_Set(UINT8 slot, UINT8 start, UINT8 count, UINT32 *buf);
1492 MODULE_RW_ERR_CODE MX_RTU_Module_DIO_DI_Counter_Overflow_Reset(UINT8 slot, UINT32 overflow);
1493
1500 MODULE_RW_ERR_CODE MX_RTU_Module_DIO_DI_Frequency_Start_Set(UINT8 slot, UINT32 start);
1501
1509 MODULE_RW_ERR_CODE MX_RTU_Module_DIO_DI_Frequency_Measurement_Time_Set(UINT8 slot, UINT8 start, UINT8 count, UINT32 *buf);
1510
1511 /* Same as DO*/
1518 MODULE_RW_ERR_CODE MX_RTU_Module_DIO_DO_Value_Get(UINT8 slot, UINT32 *value);
1526 MODULE_RW_ERR_CODE MX_RTU_Module_DIO_DO_Mode_Get(UINT8 slot, UINT8 start, UINT8 count, UINT8 *buf);
1527 /*
1528 \param[in] slot slot 0: Built-in IO Ports, slot 1 ~ 12: Expansion IO Ports.
1529 \param[in] start The first channel to get.
1530 \param[in] count The number of channels to get.
1531 \param[out] buf The DO PWM <b>LOW</b> signal width for the corresponding channels, Low = On.
1532 \li 85M-2600: One unit = 100us.
1533 \li 86M-2830D: One unit = 500us.
1534 \li ioPAC 5542: One unit = 500us.
1535 \li ioPAC 5542-HSPA: One unit = 500us.
1536 \return \link MODULE_RW_ERR_CODE MODULE_RW_ERR_CODE \endlink
1537 */
1538 MODULE_RW_ERR_CODE MX_RTU_Module_DIO_DO_SigW_L_Get(UINT8 slot, UINT8 start, UINT8 count, UINT32 *buf);
1539 /*
1540 \param[in] slot slot 0: Built-in IO Ports, slot 1 ~ 12: Expansion IO Ports.
1541 \param[in] start The first channel to get.
1542 \param[in] count The number of channels to get.
1543 \param[out] buf The DO PWM <b>HIGH</b> signal width for the corresponding channels, High = Off.
1544 \li 85M-2600: One unit = 100us.
1545 \li 86M-2830D: One unit = 500us.
1546 \li ioPAC 5542: One unit = 500us.
1547 \li ioPAC 5542-HSPA: One unit = 500us.
1548 \return \link MODULE_RW_ERR_CODE MODULE_RW_ERR_CODE \endlink
1549 */
1550 MODULE_RW_ERR_CODE MX_RTU_Module_DIO_DO_SigW_H_Get(UINT8 slot, UINT8 start, UINT8 count, UINT32 *buf);
1557 MODULE_RW_ERR_CODE MX_RTU_Module_DIO_DO_PWM_Start_Get(UINT8 slot, UINT32 *start);
1565 MODULE_RW_ERR_CODE MX_RTU_Module_DIO_DO_PWM_Count_Get(UINT8 slot, UINT8 start, UINT8 count, UINT32 *buf);
1566
1575 MODULE_RW_ERR_CODE MX_RTU_Module_DIO_DO_PWM_Config_Get(UINT8 slot, UINT8 start, UINT8 count, float *frequency, float *dutyCycle);
1576
1577 /* Same as DO*/
1584 MODULE_RW_ERR_CODE MX_RTU_Module_DIO_DO_Value_Set(UINT8 slot, UINT32 value);
1592 MODULE_RW_ERR_CODE MX_RTU_Module_DIO_DO_Mode_Set(UINT8 slot, UINT8 start, UINT8 count, UINT8 *buf);
1593 /*
1594 \param[in] slot slot 0: Built-in IO Ports, slot 1 ~ 12: Expansion IO Ports.
1595 \param[in] start The first channel to set.
1596 \param[in] count The number of channels to set.
1597 \param[in] buf The DO PWM <b>LOW</b> signal width for the corresponding channels, Low = On.
1598 \li ioPAC 8500/8600: One unit = 100us.
1599 \li ioPAC 5542: One unit = 500us.
1600 \li ioPAC 5542-HSPA: One unit = 500us.
1601 \return \link MODULE_RW_ERR_CODE MODULE_RW_ERR_CODE \endlink
1602 */
1603 MODULE_RW_ERR_CODE MX_RTU_Module_DIO_DO_SigW_L_Set(UINT8 slot, UINT8 start, UINT8 count, UINT32 *buf);
1604 /*
1605 \param[in] slot slot 0: Built-in IO Ports, slot 1 ~ 12: Expansion IO Ports.
1606 \param[in] start The first channel to set.
1607 \param[in] count The number of channels to set.
1608 \param[in] buf The DO PWM <b>HIGH</b> signal width for the corresponding channels, High = Off.
1609 \li ioPAC 8500/8600: One unit = 100us.
1610 \li ioPAC 5542: One unit = 500us.
1611 \li ioPAC 5542-HSPA: One unit = 500us.
1612 \return \link MODULE_RW_ERR_CODE MODULE_RW_ERR_CODE \endlink
1613 */
1614 MODULE_RW_ERR_CODE MX_RTU_Module_DIO_DO_SigW_H_Set(UINT8 slot, UINT8 start, UINT8 count, UINT32 *buf);
1621 MODULE_RW_ERR_CODE MX_RTU_Module_DIO_DO_PWM_Start_Set(UINT8 slot, UINT32 start);
1628 MODULE_RW_ERR_CODE MX_RTU_Module_DIO_DO_PWM_Stop_Set(UINT8 slot, UINT32 stop);
1636 MODULE_RW_ERR_CODE MX_RTU_Module_DIO_DO_PWM_Count_Set(UINT8 slot, UINT8 start, UINT8 count, UINT32 *buf);
1637
1646 MODULE_RW_ERR_CODE MX_RTU_Module_DIO_DO_PWM_Config_Set(UINT8 slot, UINT8 start, UINT8 count, float *frequency, float *dutyCycle);
1647
1649 //--------------------------------------------------------------------------------------------------------
1664 //AI RANGE
1665 //#define AI_RANGE_5V 0 //not support
1666 #define AI_RANGE_10V 1
1667 #define AI_RANGE_0_10V 2
1668 #define AI_RANGE_0_20mA 3
1669 #define AI_RANGE_4_20mA 4
1670 #define AI_RANGE_0_50mA 5
1671
1677 //AI STATUS
1678 #define AI_STATUS_BURNOUT 0
1679 #define AI_STATUS_UNDER_RANGE 1
1680 #define AI_STATUS_NORMAL_RANGE 2
1681 #define AI_STATUS_OVER_RANGE 3
1682
1688 //AI enable mode
1689 #define AI_ENABLE_MODE_1ch 0
1690 #define AI_ENABLE_MODE_2ch 1
1691 #define AI_ENABLE_MODE_4ch 2
1692 #define AI_ENABLE_MODE_8ch 3
1693
1702 AI_TRANSFORM_ERR_CODE MX_RTU_AI_Raw_to_Eng(UINT32 range, int rawValue, float *engValue);
1703
1711 AI_TRANSFORM_ERR_CODE MX_RTU_AI_Eng_to_Raw(UINT32 range, float engValue, int *rawValue);
1712
1720 AIO_TRANSFORM_ERR_CODE MX_RTU_AIO_Raw_to_Eng(UINT32 range, UINT32 bitsResolution, int rawValue, float *engValue);
1721
1729 AIO_TRANSFORM_ERR_CODE MX_RTU_AIO_Eng_to_Raw(UINT32 range, UINT32 bitsResolution, float engValue, int *rawValue);
1730
1735 void MX_RTU_AI_Raw_to_Eng_0_10V(int rawValue, float *engValue);
1736
1741 void MX_RTU_AI_Raw_to_Eng_4_20mA(int rawValue, float *engValue);
1742
1751 MODULE_RW_ERR_CODE MX_RTU_Module_AI_Raw_Value_Get(UINT8 slot, UINT8 start, UINT8 count, UINT32 *buf, struct Timestamp *time);
1752
1761 MODULE_RW_ERR_CODE MX_RTU_Module_AI_Eng_Value_Get(UINT8 slot, UINT8 start, UINT8 count, float *buf, struct Timestamp *time);
1762
1770 MODULE_RW_ERR_CODE MX_RTU_Module_AI_Range_Get(UINT8 slot, UINT8 start, UINT8 count, UINT8 *buf); //AI RANGE
1771
1779 MODULE_RW_ERR_CODE MX_RTU_Module_AI_Min_Raw_Get(UINT8 slot, UINT8 start, UINT8 count, UINT32 *buf);
1780
1788 MODULE_RW_ERR_CODE MX_RTU_Module_AI_Max_Raw_Get(UINT8 slot, UINT8 start, UINT8 count, UINT32 *buf);
1789
1797 MODULE_RW_ERR_CODE MX_RTU_Module_AI_Min_Eng_Get(UINT8 slot, UINT8 start, UINT8 count, float *buf);
1798
1806 MODULE_RW_ERR_CODE MX_RTU_Module_AI_Max_Eng_Get(UINT8 slot, UINT8 start, UINT8 count, float *buf);
1807
1816 MODULE_RW_ERR_CODE MX_RTU_Module_AI_Burnout_Value_Get(UINT8 slot, UINT8 start, UINT8 count, float *buf);
1817
1826 MODULE_RW_ERR_CODE MX_RTU_Module_AI_Status_Get(UINT8 slot, UINT8 start, UINT8 count, UINT8 *buf);
1827
1835 MODULE_RW_ERR_CODE MX_RTU_Module_AI_Range_Set(UINT8 slot, UINT8 start, UINT8 count, UINT8 *buf);
1836
1844 MODULE_RW_ERR_CODE MX_RTU_Module_AI_Min_Raw_Reset(UINT8 slot, UINT32 channel);
1845
1853 MODULE_RW_ERR_CODE MX_RTU_Module_AI_Max_Raw_Reset(UINT8 slot, UINT32 channel);
1854
1862 MODULE_RW_ERR_CODE MX_RTU_Module_AI_Min_Eng_Reset(UINT8 slot, UINT32 channel);
1863
1871 MODULE_RW_ERR_CODE MX_RTU_Module_AI_Max_Eng_Reset(UINT8 slot, UINT32 channel);
1872
1881 MODULE_RW_ERR_CODE MX_RTU_Module_AI_Burnout_Value_Set(UINT8 slot, UINT8 start, UINT8 count, float *buf);
1883
1884 //--------------------------------------------------------------------------------------------------------
1897 #define FAST_AI_BATCH_DATA_SIZE 60*1000
1898
1907 MODULE_RW_ERR_CODE MX_RTU_Module_Fast_AI_Raw_Value_Get(UINT8 slot, UINT8 start, UINT8 count, UINT32 *buf, struct Timestamp *time);
1908
1917 MODULE_RW_ERR_CODE MX_RTU_Module_Fast_AI_Eng_Value_Get(UINT8 slot, UINT8 start, UINT8 count, float *buf, struct Timestamp *time);
1918
1926 MODULE_RW_ERR_CODE MX_RTU_Module_Fast_AI_Range_Get(UINT8 slot, UINT8 start, UINT8 count, UINT8 *buf);
1927
1935 MODULE_RW_ERR_CODE MX_RTU_Module_Fast_AI_Min_Raw_Get(UINT8 slot, UINT8 start, UINT8 count, UINT32 *buf);
1936
1944 MODULE_RW_ERR_CODE MX_RTU_Module_Fast_AI_Max_Raw_Get(UINT8 slot, UINT8 start, UINT8 count, UINT32 *buf);
1945
1953 MODULE_RW_ERR_CODE MX_RTU_Module_Fast_AI_Min_Eng_Get(UINT8 slot, UINT8 start, UINT8 count, float *buf);
1954
1962 MODULE_RW_ERR_CODE MX_RTU_Module_Fast_AI_Max_Eng_Get(UINT8 slot, UINT8 start, UINT8 count, float *buf);
1963
1972 MODULE_RW_ERR_CODE MX_RTU_Module_Fast_AI_Burnout_Value_Get(UINT8 slot, UINT8 start, UINT8 count, float *buf);
1973
1982 MODULE_RW_ERR_CODE MX_RTU_Module_Fast_AI_Status_Get(UINT8 slot, UINT8 start, UINT8 count, UINT8 *buf);
1983
1989 MODULE_RW_ERR_CODE MX_RTU_Module_Fast_AI_Enable_Mode_Get(UINT8 slot, UINT32 *mode);
1990
1998 MODULE_RW_ERR_CODE MX_RTU_Module_Fast_AI_Range_Set(UINT8 slot, UINT8 start, UINT8 count, UINT8 *buf);
1999
2007 MODULE_RW_ERR_CODE MX_RTU_Module_Fast_AI_Min_Raw_Reset(UINT8 slot, UINT32 channel);
2008
2016 MODULE_RW_ERR_CODE MX_RTU_Module_Fast_AI_Max_Raw_Reset(UINT8 slot, UINT32 channel);
2017
2025 MODULE_RW_ERR_CODE MX_RTU_Module_Fast_AI_Min_Eng_Reset(UINT8 slot, UINT32 channel);
2026
2034 MODULE_RW_ERR_CODE MX_RTU_Module_Fast_AI_Max_Eng_Reset(UINT8 slot, UINT32 channel);
2035
2044 MODULE_RW_ERR_CODE MX_RTU_Module_Fast_AI_Burnout_Value_Set(UINT8 slot, UINT8 start, UINT8 count, float *buf);
2045
2052 MODULE_RW_ERR_CODE MX_RTU_Module_Fast_AI_Sampling_Rate_Get(UINT8 slot, UINT32 *rate);
2053
2061 MODULE_RW_ERR_CODE MX_RTU_Module_Fast_AI_Buf_Overflow_Get(UINT8 slot, UINT32 *overflow);
2062
2074 MODULE_RW_ERR_CODE MX_RTU_Module_Fast_AI_Batch_Data_Get(UINT8 slot, UINT32 channel, UINT32 fore_interval, UINT32 back_interval, UINT8 *buf, struct Timestamp *time);
2075
2082 MODULE_RW_ERR_CODE MX_RTU_Module_Fast_AI_Batch_Data_Check(UINT8 slot, UINT32 channel, UINT32 *count);
2083
2084
2091 MODULE_RW_ERR_CODE MX_RTU_Module_Fast_AI_Sampling_Rate_Set(UINT8 slot, UINT32 rate);
2092
2099 MODULE_RW_ERR_CODE MX_RTU_Module_Fast_AI_Buf_Overflow_Reset(UINT8 slot, UINT32 overflow);
2100
2106 MODULE_RW_ERR_CODE MX_RTU_Module_Fast_AI_Buf_Reset(UINT8 slot);
2107
2117 MODULE_RW_ERR_CODE MX_RTU_Module_Fast_AI_Trigger_Set(UINT8 slot, UINT32 channel_trigger, UINT32 fore_interval, UINT32 back_interval, UINT32 *required_buf_size);
2118
2126 MODULE_RW_ERR_CODE MX_RTU_Module_Fast_AI_Trigger_Stop_Set(UINT8 slot, UINT32 channel_trigger, struct Timestamp *time);
2127
2133 MODULE_RW_ERR_CODE MX_RTU_Module_Fast_AI_Enable_Mode_Set(UINT8 slot, UINT32 mode);
2134
2136
2137 //--------------------------------------------------------------------------------------------------------
2155 #define ENG_UNIT_CELSIUS 0 // Celsius (degree of C)
2156 #define ENG_UNIT_FAHRENHEIT 1 // Fahrenheit (degree of F)
2157 #define ENG_UNIT_MILLIVOLT 2 // millivolt
2158 #define ENG_UNIT_OHM 3 // ohm
2159
2165 #define BURNOUT_STATUS_NORMAL 0
2166 #define BURNOUT_STATUS_BURNOUT 1
2167
2169
2174 #define TC_TYPE_78_126mV 0 //(+/- 78.126 mV)
2175 #define TC_TYPE_39_062mV 1 //(+/- 39.062 mV)
2176 #define TC_TYPE_19_532mV 2 //(+/- 19.532 mV)
2177 #define TC_TYPE_J 3 //(0 to 750 Celsius degree)
2178 #define TC_TYPE_K 4 //(-200 to 1250 Celsius degree)
2179 #define TC_TYPE_T 5 //(-200 to 350 Celsius degree)
2180 #define TC_TYPE_E 6 //(-200 to 900 Celsius degree)
2181 #define TC_TYPE_R 7 //(-50 to 1600 Celsius degree)
2182 #define TC_TYPE_S 8 //(-50 to 1760 Celsius degree)
2183 #define TC_TYPE_B 9 //(600 to 1700 Celsius degree)
2184 #define TC_TYPE_N 10 //(-200 to 1300 Celsius degree)
2185
2194 MODULE_RW_ERR_CODE MX_RTU_Module_TC_Eng_Value_Get(UINT8 slot, UINT8 start, UINT8 count, float *buf, struct Timestamp *time);
2202 MODULE_RW_ERR_CODE MX_RTU_Module_TC_Type_Get(UINT8 slot, UINT8 start, UINT8 count, UINT8 *buf);
2210 MODULE_RW_ERR_CODE MX_RTU_Module_TC_Unit_Get(UINT8 slot, UINT8 start, UINT8 count, UINT8 *buf);
2218 MODULE_RW_ERR_CODE MX_RTU_Module_TC_Min_Eng_Get(UINT8 slot, UINT8 start, UINT8 count, float *buf);
2226 MODULE_RW_ERR_CODE MX_RTU_Module_TC_Max_Eng_Get(UINT8 slot, UINT8 start, UINT8 count, float *buf);
2234 MODULE_RW_ERR_CODE MX_RTU_Module_TC_Burnout_Status_Get(UINT8 slot, UINT8 start, UINT8 count, UINT8 *buf);
2244 MODULE_RW_ERR_CODE MX_RTU_Module_TC_Offset_Get(UINT8 slot, UINT8 start, UINT8 count, float *buf);
2245
2253 MODULE_RW_ERR_CODE MX_RTU_Module_TC_Type_Set(UINT8 slot, UINT8 start, UINT8 count, UINT8 *buf); //TC TYPE
2261 MODULE_RW_ERR_CODE MX_RTU_Module_TC_Unit_Set(UINT8 slot, UINT8 start, UINT8 count, UINT8 *buf);
2269 MODULE_RW_ERR_CODE MX_RTU_Module_TC_Min_Eng_Reset(UINT8 slot, UINT32 channel_flags);
2277 MODULE_RW_ERR_CODE MX_RTU_Module_TC_Max_Eng_Reset(UINT8 slot, UINT32 channel_flags);
2287 MODULE_RW_ERR_CODE MX_RTU_Module_TC_Offset_Set(UINT8 slot, UINT8 start, UINT8 count, float *buf);
2303 MODULE_RW_ERR_CODE MX_RTU_Module_TC_Calibration_Set(UINT8 slot, UINT8 start, UINT8 count, float *buf);
2305 //--------------------------------------------------------------------------------------------------------
2319 #define RTD_TYPE_2200ohm 0 //(2200 ohm)
2320 #define RTD_TYPE_1250ohm 1 //(1250 ohm)
2321 #define RTD_TYPE_620ohm 2 //(620 ohm)
2322 #define RTD_TYPE_310ohm 3 //(310 ohm)
2323 #define RTD_TYPE_PT50 4 //(-200 to 850 Celsius degree)
2324 #define RTD_TYPE_PT100 5 //(-200 to 850 Celsius degree)
2325 #define RTD_TYPE_PT200 6 //(-200 to 850 Celsius degree)
2326 #define RTD_TYPE_PT500 7 //(-200 to 850 Celsius degree)
2327 #define RTD_TYPE_PT1000 8 //(-200 to 350 Celsius degree)
2328 #define RTD_TYPE_JPT100 9 //(-200 to 640 Celsius degree)
2329 #define RTD_TYPE_JPT200 10 //(-200 to 640 Celsius degree)
2330 #define RTD_TYPE_JPT500 11 //(-200 to 640 Celsius degree)
2331 #define RTD_TYPE_JPT1000 12 //(-200 to 350 Celsius degree)
2332 #define RTD_TYPE_NI100 13 //(-60 to 250 Celsius degree)
2333 #define RTD_TYPE_NI200 14 //(-60 to 250 Celsius degree)
2334 #define RTD_TYPE_NI500 15 //(-60 to 250 Celsius degree)
2335 #define RTD_TYPE_NI1000 16 //(-60 to 150 Celsius degree)
2336 #define RTD_TYPE_NI120 17 //(-80 to 260 Celsius degree)
2337
2346 MODULE_RW_ERR_CODE MX_RTU_Module_RTD_Eng_Value_Get(UINT8 slot, UINT8 start, UINT8 count, float *buf, struct Timestamp *time);
2354 MODULE_RW_ERR_CODE MX_RTU_Module_RTD_Type_Get(UINT8 slot, UINT8 start, UINT8 count, UINT8 *buf); //RTD TYPE
2362 MODULE_RW_ERR_CODE MX_RTU_Module_RTD_Unit_Get(UINT8 slot, UINT8 start, UINT8 count, UINT8 *buf);
2370 MODULE_RW_ERR_CODE MX_RTU_Module_RTD_Min_Eng_Get(UINT8 slot, UINT8 start, UINT8 count, float *buf);
2378 MODULE_RW_ERR_CODE MX_RTU_Module_RTD_Max_Eng_Get(UINT8 slot, UINT8 start, UINT8 count, float *buf);
2386 MODULE_RW_ERR_CODE MX_RTU_Module_RTD_Burnout_Status_Get(UINT8 slot, UINT8 start, UINT8 count, UINT8 *buf);
2396 MODULE_RW_ERR_CODE MX_RTU_Module_RTD_Offset_Get(UINT8 slot, UINT8 start, UINT8 count, float *buf);
2404 MODULE_RW_ERR_CODE MX_RTU_Module_RTD_Type_Set(UINT8 slot, UINT8 start, UINT8 count, UINT8 *buf); //RTD TYPE
2412 MODULE_RW_ERR_CODE MX_RTU_Module_RTD_Unit_Set(UINT8 slot, UINT8 start, UINT8 count, UINT8 *buf);
2420 MODULE_RW_ERR_CODE MX_RTU_Module_RTD_Min_Eng_Reset(UINT8 slot, UINT32 channel_flags);
2428 MODULE_RW_ERR_CODE MX_RTU_Module_RTD_Max_Eng_Reset(UINT8 slot, UINT32 channel_flags);
2438 MODULE_RW_ERR_CODE MX_RTU_Module_RTD_Offset_Set(UINT8 slot, UINT8 start, UINT8 count, float *buf);
2454 MODULE_RW_ERR_CODE MX_RTU_Module_RTD_Calibration_Set(UINT8 slot, UINT8 start, UINT8 count, float *buf);
2456 //--------------------------------------------------------------------------------------------------------
2457
2472 //AO RANGE
2473 //#define AO_RANGE_5V 0 //not support
2474 #define AO_RANGE_10V 1
2475 #define AO_RANGE_0_10V 2
2476 #define AO_RANGE_0_20mA 3
2477 #define AO_RANGE_4_20mA 4
2478
2484 //AO STATUS
2485 #define AO_STATUS_NORMAL 0x00
2486 #define AO_STATUS_OVER_TEMPERATURE 0x01
2487 #define AO_STATUS_CURRENT_OPEN_CIRCUIT 0x04
2488
2494 //AO waveform type
2495 #define AO_WAVEFORM_TYPE_SINE 0
2496 #define AO_WAVEFORM_TYPE_TRIANGLE 1
2497 #define AO_WAVEFORM_TYPE_SQUARE 2
2498
2507 MODULE_RW_ERR_CODE MX_RTU_Module_AO_Enable_Get(UINT8 slot, UINT8 start, UINT8 count, UINT8 *buf);
2508
2516 MODULE_RW_ERR_CODE MX_RTU_Module_AO_Range_Get(UINT8 slot, UINT8 start, UINT8 count, UINT8 *buf); //AO RANGE
2517
2525 MODULE_RW_ERR_CODE MX_RTU_Module_AO_Raw_Value_Get(UINT8 slot, UINT8 start, UINT8 count, UINT32 *buf);
2526
2534 MODULE_RW_ERR_CODE MX_RTU_Module_AO_Eng_Value_Get(UINT8 slot, UINT8 start, UINT8 count, float *buf);
2535
2543 MODULE_RW_ERR_CODE MX_RTU_Module_AO_Status_Get(UINT8 slot, UINT8 start, UINT8 count, UINT8 *buf);
2544
2552 MODULE_RW_ERR_CODE MX_RTU_Module_AO_Waveform_Type_Get(UINT8 slot, UINT8 start, UINT8 count, UINT8 *buf);
2553
2563 MODULE_RW_ERR_CODE MX_RTU_Module_AO_Waveform_Config_Get(UINT8 slot, UINT8 start, UINT8 count, float *frequency, float *amplitude, float*offset);
2564
2572 MODULE_RW_ERR_CODE MX_RTU_Module_AO_Waveform_Count_Get(UINT8 slot, UINT8 start, UINT8 count, UINT32 *buf);
2573
2580 MODULE_RW_ERR_CODE MX_RTU_Module_AO_Waveform_Start_Get(UINT8 slot, UINT32 *start);
2581
2582
2590 MODULE_RW_ERR_CODE MX_RTU_Module_AO_Enable_Set(UINT8 slot, UINT8 start, UINT8 count, UINT8 *buf);
2591
2599 MODULE_RW_ERR_CODE MX_RTU_Module_AO_Range_Set(UINT8 slot, UINT8 start, UINT8 count, UINT8 *buf);
2600
2627 MODULE_RW_ERR_CODE MX_RTU_Module_AO_Raw_Value_Set(UINT8 slot, UINT8 start, UINT8 count, UINT32 *buf);
2628
2636 MODULE_RW_ERR_CODE MX_RTU_Module_AO_Eng_Value_Set(UINT8 slot, UINT8 start, UINT8 count, float *buf);
2637
2647 MODULE_RW_ERR_CODE MX_RTU_Module_AO_Waveform_Type_Set(UINT8 slot, UINT8 start, UINT8 count, UINT8 *buf);
2648
2660 MODULE_RW_ERR_CODE MX_RTU_Module_AO_Waveform_Config_Set(UINT8 slot, UINT8 start, UINT8 count, float *frequency, float *amplitude, float *offset);
2661
2669 MODULE_RW_ERR_CODE MX_RTU_Module_AO_Waveform_Count_Set(UINT8 slot, UINT8 start, UINT8 count, UINT32 *buf);
2670
2679 MODULE_RW_ERR_CODE MX_RTU_Module_AO_Waveform_Start_Set(UINT8 slot, UINT32 start);
2680
2687 MODULE_RW_ERR_CODE MX_RTU_Module_AO_Waveform_Stop_Set(UINT8 slot, UINT32 stop);
2688
2690
2691 /********************************************************************************************/
2693
2694 /********************************************Misc********************************************/
2715 //LED STATE
2716 #define LED_DARK 0
2717 #define LED_GREEN 1
2718 #define LED_RED 2
2719
2724 #define SOFTWARE_WATCHDOG_MIN_TIME 1 // 1 second
2725 #define SOFTWARE_WATCHDOG_MAX_TIME 60 // 60 seconds
2726
2728 typedef enum
2729 {
2730 MISC_ERR_OK = 0,
2731 MISC_ERR_DEVICE,
2732 MISC_ERR_ARGUMENT,
2733 MISC_ERR_RW,
2734 MISC_ERR_ACTION,
2735 MISC_ERR_COPY,
2736 MISC_ERR_TYPE,
2737 MISC_ERR_SEMAPHORE_LOCK,
2738 MISC_ERR_SYSTEM_INFO,
2739 MISC_ERR_NOT_SUPPORT_PRODUCT,
2740 MISC_ERR_AMOUNT
2741 } MISC_ERR_CODE;
2742
2747 struct swtd_setting
2748 {
2749 int enable;
2750 unsigned int time;
2751 };
2753
2754 void MX_RTU_Timestamp_to_Timeval(struct Timestamp *timestamp, struct timeval *tv);
2755
2769 MISC_ERR_CODE MX_RTU_RTC_Get(struct rtc_time *rtc);
2774 MISC_ERR_CODE MX_RTU_RTC_Set(struct rtc_time *rtc);
2776
2789 MISC_ERR_CODE MX_RTU_SWTD_Enable(UINT32 swtdtime);
2794 MISC_ERR_CODE MX_RTU_SWTD_Get_Setting(struct swtd_setting *setting);
2798 MISC_ERR_CODE MX_RTU_SWTD_Disable();
2802 MISC_ERR_CODE MX_RTU_SWTD_Ack();
2804
2817 MISC_ERR_CODE MX_RTU_LED1_Get(UINT8 *state); //LED STATE
2822 MISC_ERR_CODE MX_RTU_LED2_Get(UINT8 *state); //LED STATE
2827 MISC_ERR_CODE MX_RTU_LED1_Set(UINT8 state); //LED STATE
2832 MISC_ERR_CODE MX_RTU_LED2_Set(UINT8 state); //LED STATE
2834
2847 MISC_ERR_CODE MX_RTU_Toggle_Switch_Get(UINT8 *state); //0: Mode1, 1: Mode 2
2849
2862 MISC_ERR_CODE MX_RTU_Rotary_Switch_Mode_Get(UINT32 *mode);
2864
2877 MISC_ERR_CODE MX_RTU_Dual_Power1_Get(UINT8 *state); //0: power disconnect, 1: power connect
2882 MISC_ERR_CODE MX_RTU_Dual_Power2_Get(UINT8 *state); //0: power disconnect, 1: power connect
2888 MODULE_RW_ERR_CODE MX_RTU_Module_Dual_Power1_Get(UINT8 slot, UINT8 *state); //0: power disconnect, 1: power connect
2894 MODULE_RW_ERR_CODE MX_RTU_Module_Dual_Power2_Get(UINT8 slot, UINT8 *state); //0: power disconnect, 1: power connect
2896
2903 UINT32 MX_RTU_API_Version_Get(void); //Example: 0x01000000 -> 1.0.0 , final byte is always 0
2907 UINT32 MX_RTU_API_BuildDate_Get(void); //Example: 0x0d03010e -> 2013.03.01-14:00:00
2911 UINT32 MX_RTU_System_Version_Get(void); //Example: 0x01000000 -> 1.0.0 , final byte is always 0
2915 UINT32 MX_RTU_System_BuildDate_Get(void); //Example: 0x0d03010e -> 2013.03.01-14:00:00
2920 IO_ERR_CODE MX_RTU_System_Hot_Plug_Connect_Get(UINT32 *state); //Example: 0x6 -> slot 1 and 2 are hot-plug connecting
2925 IO_ERR_CODE MX_RTU_System_Hot_Plug_Disconnect_Get(UINT32 *state); //Example: 0x6 -> slot 1 and 2 are hot-plug disconnecting
2931 MODULE_RW_ERR_CODE MX_RTU_Module_FWR_BuildDate_Get(UINT8 slot, UINT32 *date); // Format: (0x)YYMMDDHH
2934 /********************************************************************************************/
2935
2936 /*******************************************Serial********************************************/
2950 //SERIAL MODE
2951 #define RS232_MODE 0
2952 #define RS485_2WIRE_MODE 1
2953 #define RS422_MODE 2
2954 #define RS485_4WIRE_MODE 3
2955
2961 //SERIAL BAUD RATE
2962 #define BAUD_RATE_921600 921600
2963 #define BAUD_RATE_460800 460800
2964 #define BAUD_RATE_230400 230400
2965 #define BAUD_RATE_115200 115200
2966 #define BAUD_RATE_57600 57600
2967 #define BAUD_RATE_38400 38400
2968 #define BAUD_RATE_19200 19200
2969 #define BAUD_RATE_9600 9600
2970 #define BAUD_RATE_4800 4800
2971 #define BAUD_RATE_2400 2400
2972 #define BAUD_RATE_1800 1800
2973 #define BAUD_RATE_1200 1200
2974 #define BAUD_RATE_600 600
2975 #define BAUD_RATE_300 300
2976
2982 //SERIAL DATA BITS
2983 #define SERIAL_DATA_BITS_5 5
2984 #define SERIAL_DATA_BITS_6 6
2985 #define SERIAL_DATA_BITS_7 7
2986 #define SERIAL_DATA_BITS_8 8
2987
2993 //SERIAL PARITY
2994 #define SERIAL_PARITY_NONE 0
2995 #define SERIAL_PARITY_ODD 1
2996 #define SERIAL_PARITY_EVEN 2
2997
3003 //SERIAL STOP BIT
3004 #define SERIAL_STOP_BIT_1 1
3005 #define SERIAL_STOP_BIT_2 2
3006
3012 //SERIAL FLOW CONTROL
3013 #define NO_FLOW_CONTROL 0
3014 #define HW_FLOW_CONTROL 1
3015 #define SW_FLOW_CONTROL 2
3016
3018 #define MX_RTU_SerialRead MX_RTU_SerialBlockRead
3019
3020 #define SERIAL_MAX_OQUEUE_LENGTH 4095
3021
3022 typedef enum
3023 {
3024 PORT1 = 0,
3025 PORT2,
3026 PORT3,
3027 PORT4,
3028 PORT5,
3029 PORT6,
3030 PORT7,
3031 PORT8,
3032 PORT_AMOUNT
3033 } SERIAL_PORT;
3034
3035 typedef enum
3036 {
3037 SERIAL_ERR_OK = 0,
3038 SERIAL_ERR_FD,
3039 SERIAL_ERR_OPEN,
3040 SERIAL_ERR_CLOSE,
3041 SERIAL_ERR_PARAMETER,
3042 SERIAL_ERR_SLOT,
3043 SERIAL_ERR_PORT,
3044 SERIAL_ERR_READ,
3045 SERIAL_ERR_WRITE,
3046 SERIAL_ERR_IOCTL,
3047 SERIAL_ERR_MODE,
3048 SERIAL_ERR_ttyUSB,
3049 SERIAL_ERR_NOT_SUPPORT_PRODUCT,
3050 SERIAL_ERR_SYSTEM_INFO,
3051 SERIAL_ERR_HOT_PLUG,
3052 SERIAL_ERR_FLUSH,
3053 SERIAL_ERR_AMOUNT
3054 } SERIAL_ERR_CODE;
3055
3061 SERIAL_ERR_CODE MX_RTU_SerialOpen( UINT8 slot, SERIAL_PORT port);
3062
3071 SERIAL_ERR_CODE MX_RTU_SerialWrite( UINT8 slot, SERIAL_PORT port, UINT32 len, UINT8* str, UINT32 *write_bytes);
3072
3083 SERIAL_ERR_CODE MX_RTU_SerialNonBlockRead( UINT8 slot, SERIAL_PORT port, UINT32 len, UINT8* buf, UINT32 *read_bytes);
3084
3095 SERIAL_ERR_CODE MX_RTU_SerialBlockRead( UINT8 slot, SERIAL_PORT port, UINT32 len, UINT8* buf, UINT32 *read_bytes);
3096
3102 SERIAL_ERR_CODE MX_RTU_SerialClose( UINT8 slot, SERIAL_PORT port);
3103
3110 SERIAL_ERR_CODE MX_RTU_SerialFlowControl( UINT8 slot, SERIAL_PORT port, UINT8 control); //SERIAL FLOW CONTROL
3111
3118 SERIAL_ERR_CODE MX_RTU_SerialSetSpeed( UINT8 slot, SERIAL_PORT port, UINT32 speed); //SERIAL BAUD RATE
3119
3126 SERIAL_ERR_CODE MX_RTU_SerialSetMode( UINT8 slot, SERIAL_PORT port, UINT8 mode); //SERIAL MODE
3127
3134 SERIAL_ERR_CODE MX_RTU_SerialGetMode( UINT8 slot, SERIAL_PORT port, UINT8 *mode); //SERIAL MODE
3135
3151 SERIAL_ERR_CODE MX_RTU_SerialSetParam( UINT8 slot, SERIAL_PORT port, UINT8 parity, UINT8 databits, UINT8 stopbit); //SERIAL PARITY, SERIAL DATA BITS, SERIAL STOP BIT
3152
3159 SERIAL_ERR_CODE MX_RTU_SerialDataInInputQueue( UINT8 slot, SERIAL_PORT port, UINT32 *bytes);
3160
3169 SERIAL_ERR_CODE MX_RTU_SerialDataInOutputQueue( UINT8 slot, SERIAL_PORT port, UINT32 *bytes);
3170
3178 SERIAL_ERR_CODE MX_RTU_SerialInputQueueFlush(UINT8 slot, SERIAL_PORT port);
3179
3187 SERIAL_ERR_CODE MX_RTU_SerialOutputQueueFlush(UINT8 slot, SERIAL_PORT port);
3188
3195 SERIAL_ERR_CODE MX_RTU_FindFD( UINT8 slot, SERIAL_PORT port, INT32 *fd);
3197 /********************************************************************************************/
3198
3199 /*******************************************Cellular*******************************************/
3213 #define MODEM_BRAND_PH8 1
3214
3215 #define SIZE_PIN 4
3216 #define SIZE_APN 32
3217 #define SIZE_USERNAME 128
3218 #define SIZE_PASSWORD 128
3219 #define SIZE_HOSTNAME 128
3220 #define SIZE_IMEI 17
3221 #define SIZE_IP_ADDR 16
3222
3223 //MODEM BAND
3224 #define MODEM_BAND_PH8_GSM900 1
3225 #define MODEM_BAND_PH8_GSM1800 2
3226 #define MODEM_BAND_PH8_GSM850 4
3227 #define MODEM_BAND_PH8_GSM1900 8
3228 #define MODEM_BAND_PH8_WCDMA2100 16
3229 #define MODEM_BAND_PH8_WCDMA1900 32
3230 #define MODEM_BAND_PH8_WCDMA850 64
3231 #define MODEM_BAND_PH8_WCDMA800 256
3232 #define MODEM_BAND_PH8_WCDMA1700 512
3233 #define MODEM_BAND_PH8_AUTO 895
3234
3235 //MODEM STATE
3236 #define MODEM_STATE_INIT 0
3237 #define MODEM_STATE_READY 1
3238 #define MODEM_STATE_CONNECTING 2
3239 #define MODEM_STATE_CONNECTED 3
3240 #define MODEM_STATE_DISCONNECT 4
3241
3242 //modem error code
3243 typedef enum
3244 {
3245 MODEM_ERR_OK = 0, //successfully
3246 MODEM_ERR_INIT, //not init
3247 MODEM_ERR_PARAM, //invalid parameter
3248 MODEM_ERR_OPEN, //open device error
3249 MODEM_ERR_SIM, //SIM card error
3250 MODEM_ERR_PIN, //PIN code error
3251 MODEM_ERR_BAND, //Set band error
3252 MODEM_ERR_ECHO_OFF, //turn off echo error
3253 MODEM_ERR_CELLULAR_DENIED, //register to cellular network is denied
3254 MODEM_ERR_RESET, //reset modem error
3255 MODEM_ERR_THREAD, //create thread error
3256 MODEM_ERR_APN, //set APN error
3257 MODEM_ERR_CREDENTIAL, //generate PPP credential file error
3258 MODEM_ERR_ATTACH, //attach to 3G network error
3259 MODEM_ERR_IF, //ppp interface is not established
3260 MODEM_ERR_CMD, //err command(wrong state, or previous cmd is executing)
3261 MODEM_ERR_TIMEOUT, //connect to 3G timeout(PPP)
3262 MODEM_ERR_STATE, //invalid cmd state
3263 MODEM_ERR_BREAK, //user break
3264 MODEM_ERR_SEM, //create named semaphore for modem failed
3265 MODEM_ERR_ttyUSB, //can't find ttyUSB of modem
3266 MODEM_ERR_SYSTEM_INFO, //can't get system info
3267 MODEM_ERR_NOT_SUPPORT_PRODUCT, //this product is not support cellular
3268 MODEM_ERR_GPS_SWITCH, //start/stop GPS function err
3269 MODEM_ERR_QUERY_REG, //query modem registration to station err
3270 MODEM_ERR_AMOUNT
3271 } MODEM_ERR_CODE;
3272
3273 typedef struct Check_Info
3274 {
3275 UINT8 autoCheckEnable;
3276 UINT8 pingHostname[SIZE_HOSTNAME];
3277 UINT32 pingIntervalS;
3278 UINT32 pingMaxFail;
3279 }CheckInfo;
3280
3302 MODEM_ERR_CODE MX_RTU_Cellular_Modem_Init(INT8 *pin, UINT32 band); //MODEM BAND
3303
3317 MODEM_ERR_CODE MX_RTU_Cellular_Net_Start(INT8 *apn, INT8 *userName, INT8 *password, CheckInfo* autoCheck);
3318
3325 MODEM_ERR_CODE MX_RTU_Cellular_Net_Stop(void);
3326
3332 MODEM_ERR_CODE MX_RTU_Cellular_Net_IP_Address(UINT8 *ipAddress);
3333
3340 MODEM_ERR_CODE MX_RTU_Cellular_Modem_Reset(void);//do not reset modem while MX_RTU_Cellular_Net_State()!=(MODEM_STATE_DISCONNECT|MODEM_STATE_READY)
3341
3351 INT32 MX_RTU_Cellular_Net_State(void); //MODEM STATE
3352
3358 MODEM_ERR_CODE MX_RTU_Cellular_Modem_RSSI(UINT8 *rssi);
3359
3364 void MX_RTU_Cellular_Modem_IMEI(INT8 *imei);
3365
3370 void MX_RTU_Cellular_Set_Debug(UINT8 debug);
3373 /********************************************GPS********************************************/
3384 typedef struct Gps_Time
3385 {
3386 int year;
3387 int mon;
3388 int day;
3389 int hour;
3390 int min;
3391 int sec;
3392 int hsec;
3393 }GPS_TIME;
3394
3395 typedef struct Gps_Data
3396 {
3397 //GPS info
3398 double lat;
3399 double lon;
3400 int fix;
3401 int satInUse;
3402 int satInView;
3403 GPS_TIME time;
3404 }GPS_DATA;
3405
3411 INT32 MX_RTU_GPS_Start(UINT8 activeAntenna);
3412
3416 INT32 MX_RTU_GPS_Stop(void);
3417
3422 void MX_RTU_GPS_Get_Info(GPS_DATA *gpsData);
3424 /********************************************************************************************/
3425
3426 /********************************************SMS********************************************/
3438 typedef enum
3439 {
3440 SMS_ERR_OK = 0,
3441 SMS_ERR_OPEN, //open modem device fail
3442 SMS_ERR_ERR, //send SMS fail
3443 SMS_ERR_PIN, //maybe it's a pin code err or SIM err
3444 SMS_ERR_PDU, //set modem to PDU mode
3445 SMS_ERR_MODEM, //check modem err
3446 SMS_ERR_LENGTH, //message exceeds the maximum limitation
3447 SMS_ERR_SYSTEM_INFO, //can't get system info
3448 SMS_ERR_NOT_SUPPORT_PRODUCT, //this product is not support sms
3449 SMS_ERR_ISP, //register to ISP station err
3450 SMS_ERR_AMOUNT
3451 } SMS_ERR_CODE;
3452
3461 SMS_ERR_CODE MX_RTU_SMS_Send_GSM_7bits_Default_Alphabet(INT8 *phone, INT8 *pin, INT8 *msg, INT32 msgLength );//maximum message length is 160 bytes
3462
3471 SMS_ERR_CODE MX_RTU_SMS_Send_Ucs2(INT8 *phone, INT8 *pin, INT8 *ucs2Msg, INT8 msgLength);//maximum message length is 140 bytes
3474 /********************************************************************************************/
3475
3476 /*******************************************CAN********************************************/
3487 #define RTU_MAX_CAN_BUS_PORT 2
3488
3489 #define CAN_MAX_PAYLOAD_LEN 8
3490 #define CAN_MAX_PDO_DATA_LEN CAN_MAX_PAYLOAD_LEN
3491 #define CAN_MAX_SDO_DATA_LEN 4
3492
3493 #define CAN_MAX_PDO 4
3494 #define CANOPEN_SLAVE_MAX_SDO 1000
3495 #define CANOPEN_SLAVE_MAX_PDO CAN_MAX_PDO
3496
3497 typedef enum
3498 {
3499 CAN_ERR_OK = 0,
3500 CAN_ERR_SLOT,
3501 CAN_ERR_PORT,
3502 CAN_ERR_PARAM,
3503 CAN_ERR_GET,
3504 CAN_ERR_SET,
3505 CAN_ERR_NOT_SUPPORT_PRODUCT,
3506 CAN_ERR_SYSTEM_INFO,
3507 CAN_ERR_HOT_PLUG,
3508 CAN_ERR_TTYACM_PORT,
3509 CAN_ERR_SOCKETCAN_INDEX,
3510 CAN_ERR_SOCKETCAN_INIT,
3511 CAN_ERR_SOCKET,
3512 CAN_ERR_IOCTL,
3513 CAN_ERR_BIND,
3514 CAN_ERR_NMT_NODE_STATE,
3515 CAN_ERR_HANDLE,
3516 CAN_ERR_DUPLICATE_OPEN,
3517 CAN_ERR_WRITE,
3518 CAN_ERR_READ,
3519 CAN_ERR_SLAVE_NODE_ID,
3520 CAN_ERR_EITHER_NODEGUARDING_OR_HEARTBEAT,
3521 CAN_ERR_NEITHER_NODEGUARDING_NOR_HEARTBEAT,
3522 CAN_ERR_THREAD,
3523 CAN_ERR_RW_TIMEOUT,
3524 CAN_ERR_SDO_RW_ABORT,
3525 CAN_ERR_FNCTL,
3526 CAN_ERR_NO_DATA_RECEIVE,
3527 CAN_ERR_DATA_LENGTH,
3528 CAN_ERR_TAG,
3529 CAN_ERR_SLAVE_NODE_ID_IS_NOT_SET,
3530 CAN_ERR_SLAVE_IS_NOT_LISTENING,
3531 CAN_ERR_SLAVE_SDO_REGISTER_FULL,
3532 CAN_ERR_SLAVE_SDO_DUPLICATE_REGISTER,
3533 CAN_ERR_SLAVE_PDO_REGISTER_FULL,
3534 CAN_ERR_SLAVE_PDO_DUPLICATE_REGISTER,
3535 CAN_ERR_SLAVE_BOTH_SDO_AND_PDO_ARE_NOT_REGISTERED,
3536 CAN_ERR_AMOUNT
3537 } CAN_ERR_CODE;
3538
3539 typedef enum
3540 {
3541 CAN_NODE_START = 0x1,
3542 CAN_NODE_STOP = 0x2,
3543 CAN_NODE_PRE_OPERATIONAL = 0x80,
3544 CAN_NODE_RESET_NODE = 0x81,
3545 CAN_NODE_RESET_COMMUNICATION = 0x82,
3546 CAN_NODE_AMOUNT
3547 } CAN_NODE_STATE;
3548
3549 typedef enum
3550 {
3551 CAN_NMT_ERROR_OK = 0,
3552 CAN_NMT_ERROR_NODE_GUARDING,
3553 CAN_NMT_ERROR_HEARTBEAT,
3554 CAN_NMT_ERROR_AMOUNT
3555 } CAN_NMT_ERROR_STATUS;
3556
3557 typedef enum
3558 {
3559 CAN_NMT_NODE_GUARDING_INITIALISING = 0,
3560 CAN_NMT_NODE_GUARDING_DISCONNECTED,
3561 CAN_NMT_NODE_GUARDING_CONNECTING,
3562 CAN_NMT_NODE_GUARDING_PREPARING,
3563 CAN_NMT_NODE_GUARDING_STOPPED,
3564 CAN_NMT_NODE_GUARDING_OPERATIONAL,
3565 CAN_NMT_NODE_GUARDING_PREOPERATIONAL = 127,
3566 CAN_NMT_NODE_GUARDING_AMOUNT
3567 } CAN_NMT_NODE_GUARDING_STATE;
3568
3569 typedef enum
3570 {
3571 CAN_NMT_HEARTBEAT_BOOTUP = 0,
3572 CAN_NMT_HEARTBEAT_STOPPED = 4,
3573 CAN_NMT_HEARTBEAT_OPERATIONAL = 5,
3574 CAN_NMT_HEARTBEAT_PREOPERATIONAL = 127,
3575 CAN_NMT_HEARTBEAT_AMOUNT
3576 } CAN_NMT_HEARTBEAT_STATE;
3577
3578 struct CAN_Emcy_Message {
3579 UINT32 cobID;
3580 UINT16 emergencyErrorCode;
3581 UINT8 errorRegister;
3582 UINT8 manufacturerSpecificErrorField[5];
3583 } __attribute__((packed));
3584
3589 // CAN_STATUS
3590 #define CAN_STATUS_BUS_OFF 0x00000080 // CAN controller has entered a Bus Off state.
3591 #define CAN_STATUS_EWARN 0x00000040 // CAN controller error level has reached warning level.
3592 #define CAN_STATUS_EPASS 0x00000020 // CAN controller error level has reached error passive level.
3593 #define CAN_STATUS_RXOK 0x00000010 // A message was received successfully since the last read of this status.
3594 #define CAN_STATUS_TXOK 0x00000008 // A message was transmitted successfully since the last read of this status.
3595 #define CAN_STATUS_LEC_MASK 0x00000007 // This is the mask for the CAN Last Error Code (LEC).
3596 #define CAN_STATUS_LEC_NONE 0x00000000 // There was no error.
3597 #define CAN_STATUS_LEC_STUFF 0x00000001 // A bit stuffing error has occurred.
3598 #define CAN_STATUS_LEC_FORM 0x00000002 // A formatting error has occurred.
3599 #define CAN_STATUS_LEC_ACK 0x00000003 // An acknowledge error has occurred.
3600 #define CAN_STATUS_LEC_BIT1 0x00000004 // The bus remained a bit level of 1 for longer than is allowed.
3601 #define CAN_STATUS_LEC_BIT0 0x00000005 // The bus remained a bit level of 0 for longer than is allowed.
3602 #define CAN_STATUS_LEC_CRC 0x00000006 // A CRC error has occurred.
3603
3609 //CAN BAUD RATE
3610 #define CAN_BAUD_RATE_1000K 1000000
3611 #define CAN_BAUD_RATE_800K 800000
3612 #define CAN_BAUD_RATE_500K 500000
3613 #define CAN_BAUD_RATE_250K 250000
3614 #define CAN_BAUD_RATE_125K 125000
3615 #define CAN_BAUD_RATE_100K 100000
3616 #define CAN_BAUD_RATE_50K 50000
3617 #define CAN_BAUD_RATE_20K 20000
3618 #define CAN_BAUD_RATE_10K 10000
3619
3631 CAN_ERR_CODE MX_RTU_CanSetBaudrate(UINT8 slot, UINT8 port, UINT32 baudrate);
3632
3639 CAN_ERR_CODE MX_RTU_CanGetBaudrate(UINT8 slot, UINT8 port, UINT32 *baudrate);
3640
3650 CAN_ERR_CODE MX_RTU_CanSetAccCode(UINT8 slot, UINT8 port, UINT32 accCode);
3651
3658 CAN_ERR_CODE MX_RTU_CanGetAccCode(UINT8 slot, UINT8 port, UINT32 *accCode);
3659
3666 CAN_ERR_CODE MX_RTU_CanSetAccMask(UINT8 slot, UINT8 port, UINT32 accMask);
3667
3674 CAN_ERR_CODE MX_RTU_CanGetAccMask(UINT8 slot, UINT8 port, UINT32 *accMask);
3675
3682 CAN_ERR_CODE MX_RTU_CanGetStatus(UINT8 slot, UINT8 port, UINT32 *status);
3683
3684 //--------------------------------------------------------------------------------------------------------
3685
3686 CAN_ERR_CODE MX_RTU_CanOpen(UINT8 slot, UINT8 port, int *handle);
3687 CAN_ERR_CODE MX_RTU_CanClose(int handle);
3688
3689 //CANopen Master
3690 CAN_ERR_CODE MX_RTU_CanNMTSetState(int handle, UINT32 slaveNodeID, CAN_NODE_STATE state);
3691 CAN_ERR_CODE MX_RTU_CanNMTNodeGuarding(int handle, UINT32 slaveNodeID, UINT16 guardTime, UINT8 lifeTimeFactor);
3692 CAN_ERR_CODE MX_RTU_CanNMTHeartbeat(int handle, UINT32 slaveNodeID, UINT16 producerTime, UINT16 consumerTime);
3693 CAN_ERR_CODE MX_RTU_CanGetNMTError(int handle, UINT32 slaveNodeID, CAN_NMT_ERROR_STATUS *status, CAN_NMT_NODE_GUARDING_STATE *nodeGuardingState);
3694 CAN_ERR_CODE MX_RTU_CanSYNCSend(int handle, UINT32 CobID);
3695 CAN_ERR_CODE MX_RTU_CanCyclicSYNCSend(int handle, UINT32 CobID, UINT16 Timer, UINT32 Times);
3696 CAN_ERR_CODE MX_RTU_CanGetAllEmcyMessage(int handle, UINT32 slaveNodeID, struct CAN_Emcy_Message *Msg, UINT32 *nMsg);
3697 CAN_ERR_CODE MX_RTU_CanSDORead(int handle, UINT32 slaveNodeID, UINT16 index, UINT8 subIndex, UINT8 *rData, UINT32 *rLen, UINT32 *abortCode);
3698 CAN_ERR_CODE MX_RTU_CanSDOWrite(int handle, UINT32 slaveNodeID, UINT16 index, UINT8 subIndex, UINT8 *wData, UINT32 wLen, UINT8 *rData, UINT32 *rLen, UINT32 *abortCode);
3699 CAN_ERR_CODE MX_RTU_CanPDORemote(int handle, UINT8 pdoNumber, UINT32 slaveNodeID, UINT8 *rData, UINT32 *rLen);
3700 CAN_ERR_CODE MX_RTU_CanPDOSend(int handle, UINT8 pdoNumber, UINT32 slaveNodeID, UINT8 *wData, UINT32 wLen);
3701 CAN_ERR_CODE MX_RTU_CanCyclicPDOSend(int handle, UINT8 pdoNumber, UINT32 slaveNodeID, UINT8 *wData, UINT32 wLen, UINT16 Timer, UINT32 Times);
3702
3703 //CANopen Slave
3704 CAN_ERR_CODE MX_RTU_CanSlaveNodeIDSet(int handle, UINT32 slaveNodeID);
3705 CAN_ERR_CODE MX_RTU_CanSlaveNodeIDGet(int handle, UINT32 *slaveNodeID);
3706 CAN_ERR_CODE MX_RTU_CanSlaveSDORegister(int handle, UINT16 index, UINT8 subIndex, UINT8 *tagName);
3707 CAN_ERR_CODE MX_RTU_CanSlavePDORegister(int handle, UINT8 pdoNumber, UINT8 *tagName);
3708 CAN_ERR_CODE MX_RTU_CanSlaveStartListening(int handle); //sending NMT Boot-up message
3709 CAN_ERR_CODE MX_RTU_CanSlaveStopListening(int handle);
3710 CAN_ERR_CODE MX_RTU_CanSlaveNMTStateGet(int handle, CAN_NODE_STATE *state);
3711 CAN_ERR_CODE MX_RTU_CanSlaveEmcyMessageSend(int handle, struct CAN_Emcy_Message *Msg);
3712 CAN_ERR_CODE MX_RTU_CanSlaveSYNCGet(int handle, UINT32 *CobID, UINT32 *nCobID);
3713 CAN_ERR_CODE MX_RTU_CanSlaveHeartbeatGet(int handle, UINT16 *producerTime); //Active: 0x1017 = producerTime
3714 CAN_ERR_CODE MX_RTU_CanSlaveHeartbeatStateGet(int handle, CAN_NMT_HEARTBEAT_STATE *state);
3715 CAN_ERR_CODE MX_RTU_CanSlaveNodeGuardingGet(int handle, UINT16 *guardTime, UINT8 *lifeTimeFactor); //Passive: 0x100C = guardTime, 0x100D = lifeTimeFactor.
3716 CAN_ERR_CODE MX_RTU_CanSlaveNodeGuardingStateGet(int handle, CAN_NMT_NODE_GUARDING_STATE *state);
3717 CAN_ERR_CODE MX_RTU_CanSlaveNodeGuardingStateSet(int handle, CAN_NMT_NODE_GUARDING_STATE state);
3718
3720 /********************************************************************************************/
3721
3722
3723 /****************************************Modbus Master****************************************/
3733 typedef enum
3734 {
3735 MODBUS_MASTER_ERR_OK = 0,
3736 MODBUS_MASTER_ERR_PARAM, //invalid parameters
3737 MODBUS_MASTER_ERR_PORT, //invalid port
3738 MODBUS_MASTER_ERR_OPENED, //port is opened
3739 MODBUS_MASTER_ERR_NOT_OPENED, //port is not opened
3740 MODBUS_MASTER_ERR_UART_OPEN, //open uart device err
3741 MODBUS_MASTER_ERR_UART_CLOSE, //close uart device err
3742 MODBUS_MASTER_ERR_UART_BAUDRATE, //set uart baudrate err
3743 MODBUS_MASTER_ERR_UART_MODE, //set uart 232/422/485 mode err
3744 MODBUS_MASTER_ERR_UART_FORMAT, //set uart data format err
3745 MODBUS_MASTER_ERR_UART_FLOW, //set uart flow control err
3746 MODBUS_MASTER_ERR_UART_WRITE, //write data err
3747 MODBUS_MASTER_ERR_RESP, //invalid modbus RTU response
3748 MODBUS_MASTER_ERR_CRC, //check response CRC error
3749 MODBUS_MASTER_ERR_TIMEOUT, //timeout
3750 MODBUS_MASTER_ERR_SOCKET, //socket error
3751 MODBUS_MASTER_ERR_CONNECT, //failed to connect to modbus server
3752 MODBUS_MASTER_ERR_HANDLE, //out of space for connection handle
3753 MODBUS_MASTER_ERR_EXCEPTION, //modbus standard excpetion occurred
3754 MODBUS_MASTER_ERR_LIB_INIT, //please call MX_RTU_Modbus_Init() first
3755 MODBUS_MASTER_ERR_SYSTEM_INFO, //can't get system info
3756 MODBUS_MASTER_ERR_HOT_PLUG,
3757 MODBUS_MASTER_ERR_KEEPALIVE,
3758 MODBUS_MASTER_ERR_AMOUNT
3759 } MODBUS_MASTER_ERR_CODE;
3760
3761 #define MODBUS_EXCEPTION_CODE_NONE 0x00
3762 #define MODBUS_EXCEPTION_CODE_ILLEGAL_FUNCTION 0x01
3763 #define MODBUS_EXCEPTION_CODE_ILLEGAL_DATA_ADDRESS 0x02
3764 #define MODBUS_EXCEPTION_CODE_ILLEGAL_DATA_VALUE 0x03
3765 #define MODBUS_EXCEPTION_CODE_SLAVE_DEVICE_FAILURE 0x04
3766 #define MODBUS_EXCEPTION_CODE_ACKNOWLEDGE 0x05
3767 #define MODBUS_EXCEPTION_CODE_SLAVE_DEVICE_BUSY 0x06
3768 #define MODBUS_EXCEPTION_CODE_MEMORY_PARITY_ERROR 0x08
3769 #define MODBUS_EXCEPTION_CODE_GATEWAY_PATH_UNAVAILABLE 0x0A
3770 #define MODBUS_EXCEPTION_CODE_GATEWAY_TARGET_DEVICE_FAILED_TO_RESPOND 0x0B
3771
3776 MODBUS_MASTER_ERR_CODE MX_RTU_Modbus_Master_Init(void);
3777
3781 void MX_RTU_Modbus_Master_Uninit(void);
3782
3783 //-------------------RTU-------------------
3793 typedef struct
3794 {
3795 UINT32 baudrate;
3796 INT32 parity;
3797 INT32 databits;
3798 INT32 stopbit;
3799 INT32 mode;
3800 INT32 flowCtrl;
3801 }TTY_PARAM;
3802
3809 MODBUS_MASTER_ERR_CODE MX_RTU_Modbus_Rtu_Master_Open(UINT8 slot, SERIAL_PORT port, TTY_PARAM *param);
3810
3816 MODBUS_MASTER_ERR_CODE MX_RTU_Modbus_Rtu_Master_Close(UINT8 slot, SERIAL_PORT port);
3817
3818 //coil
3829 MODBUS_MASTER_ERR_CODE MX_RTU_Modbus_Rtu_Master_Read_Coils(UINT8 slot, SERIAL_PORT port, UINT8 unitId, UINT16 startAddr , UINT16 coilCount, UINT8 byteCoils[], UINT32 timeoutMs, UINT8 *exceptionCode);
3830
3841 MODBUS_MASTER_ERR_CODE MX_RTU_Modbus_Rtu_Master_Write_Coils(UINT8 slot, SERIAL_PORT port, UINT8 unitId, UINT16 startAddr, UINT16 coilCount, UINT8 byteCoils[], UINT32 timeoutMs, UINT8 *exceptionCode);
3842
3852 MODBUS_MASTER_ERR_CODE MX_RTU_Modbus_Rtu_Master_Write_Coil(UINT8 slot, SERIAL_PORT port, UINT8 unitId, UINT16 addr, UINT8 coil, UINT32 timeoutMs, UINT8 *exceptionCode);
3853
3854 //input discrete
3865 MODBUS_MASTER_ERR_CODE MX_RTU_Modbus_Rtu_Master_Read_Discrete_Inputs(UINT8 slot, SERIAL_PORT port, UINT8 unitId, UINT16 startAddr , UINT16 coilCount, UINT8 byteCoils[], UINT32 timeoutMs, UINT8 *exceptionCode);
3866
3867 //input register
3878 MODBUS_MASTER_ERR_CODE MX_RTU_Modbus_Rtu_Master_Read_Input_Regs(UINT8 slot, SERIAL_PORT port, UINT8 unitId, UINT16 startAddr, UINT16 regCount, UINT16 regs[], UINT32 timeoutMs, UINT8 *exceptionCode);
3879
3880 //holding register
3891 MODBUS_MASTER_ERR_CODE MX_RTU_Modbus_Rtu_Master_Read_Holding_Regs(UINT8 slot, SERIAL_PORT port, UINT8 unitId, UINT16 startAddr, UINT16 regCount, UINT16 regs[], UINT32 timeoutMs, UINT8 *exceptionCode);
3892
3903 MODBUS_MASTER_ERR_CODE MX_RTU_Modbus_Rtu_Master_Write_Holding_Regs(UINT8 slot, SERIAL_PORT port, UINT8 unitId, UINT16 startAddr, UINT16 regCount, UINT16 regs[], UINT32 timeoutMs, UINT8 *exceptionCode);
3904
3914 MODBUS_MASTER_ERR_CODE MX_RTU_Modbus_Rtu_Master_Write_Holding_Reg(UINT8 slot, SERIAL_PORT port, UINT8 unitId, UINT16 addr, UINT16 reg, UINT32 timeoutMs, UINT8 *exceptionCode);
3916 //-------------------TCP-------------------
3934 MODBUS_MASTER_ERR_CODE MX_RTU_Modbus_Tcp_Master_Open(UINT8 ipAddress[], UINT16 tcpPort, UINT32 cTimeoutMs, UINT32 *sHandle);
3935
3940 MODBUS_MASTER_ERR_CODE MX_RTU_Modbus_Tcp_Master_Close(UINT32 sHandle);
3941
3948 MODBUS_MASTER_ERR_CODE MX_RTU_Modbus_Tcp_Master_Ioctl(UINT32 sHandle, UINT8 unitId, UINT32 rwTimeoutMs);
3949 //coil
3957 MODBUS_MASTER_ERR_CODE MX_RTU_Modbus_Tcp_Master_Read_Coils(UINT32 sHandle, UINT16 startAddr , UINT16 coilCount, UINT8 byteCoils[], UINT8 *exceptionCode);
3965 MODBUS_MASTER_ERR_CODE MX_RTU_Modbus_Tcp_Master_Write_Coils(UINT32 sHandle, UINT16 startAddr , UINT16 coilCount, UINT8 byteCoils[], UINT8 *exceptionCode);
3972 MODBUS_MASTER_ERR_CODE MX_RTU_Modbus_Tcp_Master_Write_Coil(UINT32 sHandle, UINT16 addr , UINT8 coil, UINT8 *exceptionCode);
3973 //input discrete inputs
3981 MODBUS_MASTER_ERR_CODE MX_RTU_Modbus_Tcp_Master_Read_Discrete_Inputs(UINT32 sHandle, UINT16 startAddr , UINT16 coilCount, UINT8 byteCoils[], UINT8 *exceptionCode);
3982 //input register
3990 MODBUS_MASTER_ERR_CODE MX_RTU_Modbus_Tcp_Master_Read_Input_Regs(UINT32 sHandle, UINT16 startAddr , UINT16 regCount, UINT16 regs[], UINT8 *exceptionCode);
3991 //holding register
3999 MODBUS_MASTER_ERR_CODE MX_RTU_Modbus_Tcp_Master_Read_Holding_Regs(UINT32 sHandle, UINT16 startAddr , UINT16 regCount, UINT16 regs[], UINT8 *exceptionCode);
4007 MODBUS_MASTER_ERR_CODE MX_RTU_Modbus_Tcp_Master_Write_Holding_Regs(UINT32 sHandle, UINT16 startAddr , UINT16 regCount, UINT16 regs[], UINT8 *exceptionCode);
4014 MODBUS_MASTER_ERR_CODE MX_RTU_Modbus_Tcp_Master_Write_Holding_Reg(UINT32 sHandle, UINT16 addr , UINT16 regValue, UINT8 *exceptionCode);
4017 /********************************************************************************************/
4018
4019
4020 /****************************************Modbus Slave****************************************/
4030 #define MAKE_WORD(a,b) (((UINT16)a<<8) +(UINT16)b)
4031
4032 #define pfnModbusRead int (*pfnModRead)(UINT8 *pData, UINT16 nth, void *pUserData)
4033 #define pfnModbusWrite int (*pfnModWrite)(UINT8 *pData, UINT16 nth, void *pUserData)
4034
4035 #define MODBUS_LISTEN_PORTS 1 //Only one port can be registered
4036 #define MODBUS_MAX_CONNECTION 10 //Maximum connections for each port
4037
4038 #define MODBUS_MAX_MAP_SIZE 3000 //Maximum entries for each Map Type
4039 #define MODBUS_MIN_IDLE_TIMEOUT_SECOND 10
4040
4045 //Exception Code
4046 #define ILLEGAL_FUNCTION 0x01
4047 #define ILLEGAL_DATA_ADDRESS 0x02
4048 #define ILLEGAL_DATA_VALUE 0x03
4049 #define SLAVE_DEVICE_FAILURE 0x04
4050 #define SLAVE_DEVICE_BUSY 0x06
4051
4057 //Return Code
4058 #define RETURN_OK 0
4059 #define RETURN_ERROR_ADDRESS 1
4060 #define RETURN_ERROR_FUNCTION 2
4061 #define RETURN_ERROR_VALUE 3
4062
4068 //Function Code
4069 #define MODBUS_READ_COILS 0x01 //COIL
4070 #define MODBUS_READ_DISCRETE 0x02 //INPUT COIL
4071 #define MODBUS_READ_HOLDINGREGISTERS 0x03 //HOLDING REGISTER
4072 #define MODBUS_READ_INPUTREGISTERS 0x04 //INPUT REGISTER
4073 #define MODBUS_WRITE_COIL 0x05 //COIL
4074 #define MODBUS_WRITE_REGISTER 0x06 //HOLDING REGISTER
4075 #define MODBUS_WRITE_COILS 0x0F //COIL
4076 #define MODBUS_WRITE_REGISTERS 0x10 //HOLDING REGISTER
4077
4083 //MAP TYPE
4084 #define MODBUS_COIL 0x01
4085 #define MODBUS_INPUT_COIL 0x02
4086 #define MODBUS_HOLDING_REGISTER 0x03
4087 #define MODBUS_INPUT_REGISTER 0x04
4088
4090 typedef enum
4091 {
4092 MODBUS_SLAVE_ERR_OK = 0,
4093 MODBUS_SLAVE_ERR_ADDRESS,
4094 MODBUS_SLAVE_ERR_ADDRESS_COLLISION,
4095 MODBUS_SLAVE_ERR_BIND,
4096 MODBUS_SLAVE_ERR_CREATE_SOCKET,
4097 MODBUS_SLAVE_ERR_CREATE_THREAD,
4098 MODBUS_SLAVE_ERR_EXCEPTION,
4099 MODBUS_SLAVE_ERR_EXCEED_MAP_SIZE,
4100 MODBUS_SLAVE_ERR_FUNCTION,
4101 MODBUS_SLAVE_ERR_ILLEGAL_HANDLE,
4102 MODBUS_SLAVE_ERR_IDLE_TIMEOUT,
4103 MODBUS_SLAVE_ERR_ILLEGAL_ACTION,
4104 MODBUS_SLAVE_ERR_LISTEN,
4105 MODBUS_SLAVE_ERR_LISTEN_PORT_OVERFLOW,
4106 MODBUS_SLAVE_ERR_MAP_TYPE,
4107 MODBUS_SLAVE_ERR_MAP_EMPTY,
4108 MODBUS_SLAVE_ERR_MEMORY_LEAK,
4109 MODBUS_SLAVE_ERR_NO_START,
4110 MODBUS_SLAVE_ERR_NO_REGISTER,
4111 MODBUS_SLAVE_ERR_PORT_LISTENING,
4112 MODBUS_SLAVE_ERR_REGISTERED_PORT,
4113 MODBUS_SLAVE_ERR_SIZE,
4114 MODBUS_SLAVE_ERR_SYSTEM_TIMEOUT,
4115 MODBUS_SLAVE_ERR_SET_SOCKET_MODE,
4116 MODBUS_SLAVE_ERR_SET_SOCKET_OPTION,
4117 MODBUS_SLAVE_ERR_NO_CONNECTIONS,
4118 MODBUS_SLAVE_ERR_SYSTEM_INFO,
4119 MODBUS_SLAVE_ERR_AMOUNT
4120 } MODBUS_SLAVE_ERR_CODE;
4121
4122 /***************************************Modbus TCP Slave***************************************/
4134 struct Modbus_TCP_Master_Connection_Info
4135 {
4136 UINT8 accepted_connections; // example: 5 -> five connections right now
4137 char ip[MODBUS_MAX_CONNECTION][17]; // example: ip[4] -> 192.168.127.254. ip[5] ~ ip[9] are invalid.
4138 UINT16 port[MODBUS_MAX_CONNECTION]; // example: port[4] -> 12345. port[5] ~ port[9] are invalid.
4139 } __attribute__((packed));
4140
4145 MODBUS_SLAVE_ERR_CODE MX_RTU_Modbus_Tcp_Slave_Init();
4146
4151 MODBUS_SLAVE_ERR_CODE MX_RTU_Modbus_Tcp_Slave_Uninit();
4152
4160 MODBUS_SLAVE_ERR_CODE MX_RTU_Modbus_Tcp_Slave_Register(UINT16 port, UINT16 map_size, UINT32 idle_timeout_second, UINT32 *sHandle);
4161
4166 MODBUS_SLAVE_ERR_CODE MX_RTU_Modbus_Tcp_Slave_Unregister(UINT32 sHandle);
4167
4174 MODBUS_SLAVE_ERR_CODE MX_RTU_Modbus_Tcp_Slave_Start(UINT32 sHandle);
4175
4182 MODBUS_SLAVE_ERR_CODE MX_RTU_Modbus_Tcp_Slave_Stop(UINT32 sHandle);
4183
4195 MODBUS_SLAVE_ERR_CODE MX_RTU_Modbus_Tcp_Slave_Add_Entry(UINT32 sHandle, UINT8 map_type, UINT16 address, void *pUserData, pfnModbusRead, pfnModbusWrite); //MAP TYPE
4196
4203 MODBUS_SLAVE_ERR_CODE MX_RTU_Modbus_Tcp_Slave_Delete_Entry(UINT32 sHandle, UINT8 map_type, UINT16 address); //MAP TYPE
4204
4210 MODBUS_SLAVE_ERR_CODE MX_RTU_Modbus_Tcp_Slave_Map_Count(UINT32 sHandle, UINT16 *count);
4211
4216 MODBUS_SLAVE_ERR_CODE MX_RTU_Modbus_Tcp_Slave_Map_Dump(UINT32 sHandle);
4217
4223 MODBUS_SLAVE_ERR_CODE MX_RTU_Modbus_Tcp_Slave_Connection_Info(UINT32 sHandle, struct Modbus_TCP_Master_Connection_Info *connection_info);
4224
4226 /***************************************Modbus RTU Slave***************************************/
4241 MODBUS_SLAVE_ERR_CODE MX_RTU_Modbus_Rtu_Slave_Init();
4242
4247 MODBUS_SLAVE_ERR_CODE MX_RTU_Modbus_Rtu_Slave_Uninit();
4248
4258 MODBUS_SLAVE_ERR_CODE MX_RTU_Modbus_Rtu_Slave_Register(UINT8 slot, SERIAL_PORT port, INT32 slaveID, UINT16 map_size, TTY_PARAM *param, UINT32 *handle);
4259
4266 MODBUS_SLAVE_ERR_CODE MX_RTU_Modbus_Rtu_Slave_Unregister(UINT32 handle);
4267 //MODBUS_SLAVE_ERR_CODE MX_RTU_Modbus_Rtu_Slave_Unregister(UINT32 handle, UINT8 slot, SERIAL_PORT port);
4268
4275 MODBUS_SLAVE_ERR_CODE MX_RTU_Modbus_Rtu_Slave_Start(UINT32 handle);
4276
4283 MODBUS_SLAVE_ERR_CODE MX_RTU_Modbus_Rtu_Slave_Stop(UINT32 handle);
4284
4296 MODBUS_SLAVE_ERR_CODE MX_RTU_Modbus_Rtu_Slave_Add_Entry(UINT32 handle, UINT8 map_type, UINT16 address, void *pUserData, pfnModbusRead, pfnModbusWrite);
4297
4304 MODBUS_SLAVE_ERR_CODE MX_RTU_Modbus_Rtu_Slave_Delete_Entry(UINT32 handle, UINT8 map_type, UINT16 address);
4305
4308 /*********************************************************************************************/
4309
4310 /*********************************************AOPC*********************************************/
4322 #define AOPC_DEFAULT_PORT 9900
4323
4324
4325 #define AOPC_MAX_DEV_NAME 59
4326 #define AOPC_MAX_TAG_NAME 30
4327 #define AOPC_MAX_TAG_DESC 16
4328 #define AOPC_MAX_TAG_UNIT 16
4329 #define AOPC_MAX_MULTIVALUES_UPDATE 256
4330
4335 //AOPC tag value type
4336 #define TAG_TYPE_BOOL 1
4337 #define TAG_TYPE_WORD 2
4338 #define TAG_TYPE_INT 3
4339 #define TAG_TYPE_DWORD 4
4340 #define TAG_TYPE_FLOAT 5
4341 #define TAG_TYPE_STRING 6
4342 #define TAG_TYPE_SHORT 7
4343
4349 //AOPC tag access right
4350 #define TAG_ACC_READ 0 //read only
4351 //#define TAG_ACC_WRITE 1 //write only
4352 #define TAG_ACC_READ_WRITE 2 //read/writable
4353
4359 //AOPC tag quality
4360 #define TAG_QUALITY_GOOD 0x0000
4361 #define TAG_QUALITY_BAD 0x8000
4362
4364 typedef struct TagInfo
4365 {
4366 UINT8 strTagName[AOPC_MAX_TAG_NAME+1];
4367 UINT8 strTagDescription[AOPC_MAX_TAG_DESC+1];
4368 UINT8 strTagUnit[AOPC_MAX_TAG_UNIT+1];
4369 UINT8 tagAccessRight; //0:read only, 1:write only, 2:read/writable
4370 UINT16 tagValueType;
4371 UINT16 tagQuality; //(0x0000-0x7FFF:Good, 0x8000-0xFFFF:Bad)
4372 void *tagValue;
4373 UINT8 (*tagCallBack)(UINT8 *tagName, UINT16 tagValueType, UINT8 *tagValue);
4374 }TAG;
4375
4376 typedef enum
4377 {
4378 AOPC_ERR_OK = 0, //successfully
4379 AOPC_ERR_LIB_INIT, //please call MX_RTU_AOPC_Init() first
4380 AOPC_ERR_PARAM, //invalid parameters
4381 AOPC_ERR_SOCKET, //network error
4382 AOPC_ERR_TIMEOUT, //timeout
4383 AOPC_ERR_CONNECT, //connect to AOPC server error
4384 AOPC_ERR_CREATE_THREAD, //create thread error
4385 AOPC_ERR_NO_MEMORY, //alloc memory error
4386 AOPC_ERR_NO_QUEUE, //queue lenght reaches maximum limitation: 65536 items
4387 AOPC_ERR_INTR, //interrupt by signal
4388 AOPC_ERR_FRAME_PENDING, //waiting for a complete frame data
4389 AOPC_ERR_FRAME_ERROR, //frame data format error
4390 AOPC_ERR_SERVER_ERROR, //this is a temp error for API developments
4391 AOPC_ERR_CLOSE, //connection is closed
4392 AOPC_ERR_NO_TAG, //no such tag
4393 AOPC_ERR_EXIST_TAG, //tag exists
4394 AOPC_ERR_NO_WRITE_FUNC, //user does not register a write-callback for this tag
4395 AOPC_ERR_ACCESS, //no write access right
4396 AOPC_ERR_USER_WRITE, //user's wirte callback returns error condition
4397 AOPC_ERR_NOT_SUPPORT, //the function is not supported
4398 AOPC_ERR_NOT_WRITABLE, //the tag is marked writable but the write-callback function is not assigned
4399 AOPC_ERR_FAIL, //generic error
4400 AOPC_ERR_NOT_REGISTERED, //device is not registered yet
4401 AOPC_ERR_INVALID_ATTR, //invalid tag attribute
4402 AOPC_ERR_SYSTEM_INFO, //can't get system info
4403 AOPC_ERR_STR_LEN, //string length exceed 255 bytes
4404 AOPC_ERR_AMOUNT
4405 } AOPC_ERR_CODE;
4406
4411 AOPC_ERR_CODE MX_RTU_AOPC_Init(void);
4412
4416 void MX_RTU_AOPC_Uninit(void);
4417
4427 AOPC_ERR_CODE MX_RTU_AOPC_Connect(UINT8 *deviceName, UINT32 heartBeatS, UINT8 *ipAddress, UINT16 port, UINT32 timeoutMs, UINT32 *sHandle);
4428
4433 AOPC_ERR_CODE MX_RTU_AOPC_Disconnect(UINT32 sHandle);
4434
4440 AOPC_ERR_CODE MX_RTU_AOPC_Reconnect(UINT32 sHandle, UINT32 timeoutMs);
4441
4449 AOPC_ERR_CODE MX_RTU_AOPC_AddTag(UINT32 sHandle, TAG *tagInfo, struct Timestamp *tagTime, UINT32 timeoutMs);
4450
4457 AOPC_ERR_CODE MX_RTU_AOPC_DelTag(UINT32 sHandle, UINT8 *tagName, UINT32 timeoutMs);
4458
4464 AOPC_ERR_CODE MX_RTU_AOPC_DelAllTag(UINT32 sHandle, UINT32 timeoutMs);
4465
4473 AOPC_ERR_CODE MX_RTU_AOPC_UpdateTag(UINT32 sHandle, TAG *tagInfo, struct Timestamp *tagTime, UINT32 timeoutMs);
4474
4483 AOPC_ERR_CODE MX_RTU_AOPC_UpdateValue(UINT32 sHandle, UINT8 *tagName, void *tagValue, struct Timestamp *tagTime, UINT32 timeoutMs);
4484
4494 AOPC_ERR_CODE MX_RTU_AOPC_UpdateMultiValue(UINT32 sHandle, UINT16 nTags, UINT8 **tagName, void **tagValue, struct Timestamp *tagTime, UINT32 timeoutMs);
4495
4502 AOPC_ERR_CODE MX_RTU_AOPC_UpdateHeartbeat(UINT32 sHandle, UINT32 heartbeatS, UINT32 timeoutMs);
4504 /*********************************************************************************************/
4505
4506 /*********************************************TAG*********************************************/
4521 #define TAG_MAX_NAME_SIZE 64
4522
4527 #define TAG_DATA_TYPE_COIL 0
4528 #define TAG_DATA_TYPE_INT8 1
4529 #define TAG_DATA_TYPE_INT16 2
4530 #define TAG_DATA_TYPE_INT32 3
4531 #define TAG_DATA_TYPE_UINT8 4
4532 #define TAG_DATA_TYPE_UINT16 5
4533 #define TAG_DATA_TYPE_UINT32 6
4534 #define TAG_DATA_TYPE_FLOAT 7
4535 #define TAG_DATA_TYPE_STR 8
4536
4542 #define TAG_EVENT_CONDITION_CHANGE 0
4543 #define TAG_EVENT_CONDITION_EDGE 1
4544 #define TAG_EVENT_CONDITION_RAISING_EDGE 2
4545 #define TAG_EVENT_CONDITION_FALLING_EDGE 3
4546 #define TAG_EVENT_CONDITION_GREATER 4
4547 #define TAG_EVENT_CONDITION_SMALLER 5
4548
4550 typedef enum
4551 {
4552 TAG_ERR_OK = 0, //successfully
4553 TAG_ERR_INIT, // Tag init error
4554 TAG_ERR_SEM, //
4555 TAG_ERR_MSGQUEUE, // message queue access err
4556 TAG_ERR_ALLOC, //
4557 TAG_ERR_PARAM, // invalid parameters
4558 TAG_ERR_REG, //
4559 TAG_ERR_DESTROY, //
4560 TAG_ERR_BIND, // bind resource
4561 TAG_ERR_RESET, //
4562 TAG_ERR_AGAIN, //
4563 TAG_ERR_IO, // access IO err
4564 TAG_ERR_READY, // Tag framework has been init
4565 TAG_ERR_NO_TAG, //
4566 TAG_ERR_MSGQUEUE_FULL, // message queue full
4567 TAG_ERR_NOT_SUPPORT, // this usage is not supported
4568 TAG_ERR_EVENT_INIT, // Tag event init error
4569 TAG_ERR_EVENT_REGISTER, // Tag event register error
4570 TAG_ERR_EVENT_SPACE, // Too many events
4571 TAG_ERR_EVENT_HANDLE, // No such event
4572 TAG_ERR_EVENT_EMPTY, // No event occurred
4573 TAG_ERR_AMOUNT
4574 } TAG_ERR_CODE;
4575
4576 //Service and Profile status
4577 typedef enum
4578 {
4579 STATUS_INIT = 0,
4580 STATUS_READY,
4581 STATUS_RUNNING,
4582 STATUS_SUCCESS,
4583 STATUS_FAIL,
4584 STATUS_ERR_AMOUNT
4585 } STATUS_CODE;
4586
4587 typedef struct TAG_INFO_T
4588 {
4589 UINT8 tagName[TAG_MAX_NAME_SIZE];
4590 UINT8 resId[TAG_MAX_NAME_SIZE];
4591 UINT32 tagId;
4592 UINT32 tagSize;
4593 UINT32 dataType;
4594 } TAG_INFO;
4595
4596 typedef struct TAG_EVENT_CONDITION_T
4597 {
4598 UINT32 condition;
4599 float threshold;
4600 float hysteresis;
4601 } TAG_EVENT_CONDITION;
4602
4607 TAG_ERR_CODE MX_RTU_Tag_Init(void);
4608
4613 TAG_ERR_CODE MX_RTU_Tag_Uninit(void);
4614
4619 TAG_ERR_CODE MX_RTU_Tag_List_All(void);
4620
4626 TAG_ERR_CODE MX_RTU_Tag_Get_List(TAG_INFO ***list, UINT32 *quantity);
4627
4633 TAG_ERR_CODE MX_RTU_Tag_Get_Info(UINT8 *tagName, TAG_INFO *info);
4634
4645 TAG_ERR_CODE MX_RTU_Tag_Read(UINT8 *tagName, void *tagValue, UINT32 tagSize, UINT32 *readBytes, struct Timestamp *time);
4646
4653 TAG_ERR_CODE MX_RTU_Tag_Write(UINT8 *tagName, void *tagValue, UINT32 tagSize);
4654
4665 TAG_ERR_CODE MX_RTU_MultiTag_Read(UINT8 *prefixTagName, UINT8 *postfixTagName, UINT16 start, UINT16 count, UINT8 *tagValue, struct Timestamp *tagTimeStamp);
4666
4675 TAG_ERR_CODE MX_RTU_MultiTag_Write(UINT8 *prefixTagName, UINT8 *postfixTagName, UINT16 start, UINT16 count, UINT8 *tagValue);
4676
4683 TAG_ERR_CODE MX_RTU_Tag_Event_Register(UINT8 *tagName, TAG_EVENT_CONDITION *condition, int *handle);
4684
4689 TAG_ERR_CODE MX_RTU_Tag_Event_Unregister(int handle);
4690
4700 TAG_ERR_CODE MX_RTU_Tag_Event_Get(int handle, void *tagValue, struct Timestamp *time);
4701
4708 TAG_ERR_CODE MX_RTU_Tag_Event_Clear(int handle);
4709
4711 /*********************************************************************************************/
4712
4714
4716
4717 #ifdef __cplusplus
4718 }//extern "C"
4719 #endif
4720
4721 #endif
4722
4723
MX_RTU_Module_DO_PWM_Config_Get
MODULE_RW_ERR_CODE MX_RTU_Module_DO_PWM_Config_Get(UINT8 slot, UINT8 start, UINT8 count, float *frequency, float *dutyCycle)
CAN_ERR_NOT_SUPPORT_PRODUCT
Definition: libmoxa_rtu.h:3505
pfnModbusRead
#define pfnModbusRead
Definition: libmoxa_rtu.h:4032
MX_RTU_CanSetAccMask
CAN_ERR_CODE MX_RTU_CanSetAccMask(UINT8 slot, UINT8 port, UINT32 accMask)
IO_Info::pulse_channels
UINT8 pulse_channels
Definition: libmoxa_rtu.h:216
MX_RTU_CanSlaveHeartbeatStateGet
CAN_ERR_CODE MX_RTU_CanSlaveHeartbeatStateGet(int handle, CAN_NMT_HEARTBEAT_STATE *state)
MX_RTU_Modbus_Rtu_Slave_Stop
MODBUS_SLAVE_ERR_CODE MX_RTU_Modbus_Rtu_Slave_Stop(UINT32 handle)
MX_RTU_Slot_Inserted_Get
IO_ERR_CODE MX_RTU_Slot_Inserted_Get(UINT32 *state)
MX_RTU_Module_Fast_AI_Buf_Reset
MODULE_RW_ERR_CODE MX_RTU_Module_Fast_AI_Buf_Reset(UINT8 slot)
MX_RTU_Tag_Event_Clear
TAG_ERR_CODE MX_RTU_Tag_Event_Clear(int handle)
MX_RTU_Module_DIO_DI_Counter_Start_Set
MODULE_RW_ERR_CODE MX_RTU_Module_DIO_DI_Counter_Start_Set(UINT8 slot, UINT32 start)
MX_RTU_Module_DIO_Map_Get
MODULE_RW_ERR_CODE MX_RTU_Module_DIO_Map_Get(UINT8 slot, UINT32 *map)
AOPC_ERR_ACCESS
Definition: libmoxa_rtu.h:4395
MX_RTU_System_Version_Get
UINT32 MX_RTU_System_Version_Get(void)
MX_RTU_SWTD_Disable
MISC_ERR_CODE MX_RTU_SWTD_Disable()
Timestamp::min
UINT32 min
Definition: libmoxa_rtu.h:234
MODULE_RW_ERR_SLOT
Definition: libmoxa_rtu.h:150
MX_RTU_Module_TC_Min_Eng_Get
MODULE_RW_ERR_CODE MX_RTU_Module_TC_Min_Eng_Get(UINT8 slot, UINT8 start, UINT8 count, float *buf)
CAN_ERR_CODE
CAN_ERR_CODE
Definition: libmoxa_rtu.h:3497
Check_Info::pingIntervalS
UINT32 pingIntervalS
Definition: libmoxa_rtu.h:3277
IO_ERR_COMMUNICATION_MODULE_SUPPORT
Definition: libmoxa_rtu.h:142
AI_TRANSFORM_ERR_RANGE
Definition: libmoxa_rtu.h:190
MX_RTU_Module_DO_PWM_Start_Get
MODULE_RW_ERR_CODE MX_RTU_Module_DO_PWM_Start_Get(UINT8 slot, UINT32 *start)
MX_RTU_CanSYNCSend
CAN_ERR_CODE MX_RTU_CanSYNCSend(int handle, UINT32 CobID)
AOPC_ERR_EXIST_TAG
Definition: libmoxa_rtu.h:4393
GPS_TIME
struct Gps_Time GPS_TIME
MX_RTU_AOPC_Disconnect
AOPC_ERR_CODE MX_RTU_AOPC_Disconnect(UINT32 sHandle)
MX_RTU_Module_DI_Mode_Set
MODULE_RW_ERR_CODE MX_RTU_Module_DI_Mode_Set(UINT8 slot, UINT8 start, UINT8 count, UINT8 *buf)
MX_RTU_System_Hot_Plug_Disconnect_Get
IO_ERR_CODE MX_RTU_System_Hot_Plug_Disconnect_Get(UINT32 *state)
AOPC_ERR_NO_MEMORY
Definition: libmoxa_rtu.h:4385
AIO_TRANSFORM_ERR_BITSRESOLUTION
Definition: libmoxa_rtu.h:200
MODEM_ERR_ECHO_OFF
Definition: libmoxa_rtu.h:3252
SERIAL_ERR_FD
Definition: libmoxa_rtu.h:3038
CAN_NMT_HEARTBEAT_OPERATIONAL
Definition: libmoxa_rtu.h:3573
MISC_ERR_DEVICE
Definition: libmoxa_rtu.h:2731
CAN_ERR_SLAVE_BOTH_SDO_AND_PDO_ARE_NOT_REGISTERED
Definition: libmoxa_rtu.h:3535
MX_RTU_Module_TC_Max_Eng_Get
MODULE_RW_ERR_CODE MX_RTU_Module_TC_Max_Eng_Get(UINT8 slot, UINT8 start, UINT8 count, float *buf)
CAN_NMT_HEARTBEAT_PREOPERATIONAL
Definition: libmoxa_rtu.h:3574
MX_RTU_Module_DI_Frequency_Measurement_Time_Get
MODULE_RW_ERR_CODE MX_RTU_Module_DI_Frequency_Measurement_Time_Get(UINT8 slot, UINT8 start, UINT8 count, UINT32 *buf)
PORT1
Definition: libmoxa_rtu.h:3024
MODBUS_SLAVE_ERR_CREATE_THREAD
Definition: libmoxa_rtu.h:4097
MISC_ERR_ARGUMENT
Definition: libmoxa_rtu.h:2732
IO_ERR_SYSTEM_INFO
Definition: libmoxa_rtu.h:133
port
UINT16 port[MODBUS_MAX_CONNECTION]
Definition: libmoxa_rtu.h:4017
MX_RTU_SerialSetMode
SERIAL_ERR_CODE MX_RTU_SerialSetMode(UINT8 slot, SERIAL_PORT port, UINT8 mode)
CAN_ERR_SLAVE_NODE_ID_IS_NOT_SET
Definition: libmoxa_rtu.h:3529
MODULE_RW_ERR_RW
Definition: libmoxa_rtu.h:154
AOPC_MAX_TAG_DESC
#define AOPC_MAX_TAG_DESC
Definition: libmoxa_rtu.h:4327
TAG_ERR_AMOUNT
Definition: libmoxa_rtu.h:4573
SERIAL_ERR_SYSTEM_INFO
Definition: libmoxa_rtu.h:3050
AI_TRANSFORM_ERR_OK
Definition: libmoxa_rtu.h:189
MX_RTU_DI_Event_Get_Trigger
IO_ERR_CODE MX_RTU_DI_Event_Get_Trigger(int handle, UINT32 *trigger)
MX_RTU_Module_RTD_Unit_Set
MODULE_RW_ERR_CODE MX_RTU_Module_RTD_Unit_Set(UINT8 slot, UINT8 start, UINT8 count, UINT8 *buf)
MODBUS_MASTER_ERR_AMOUNT
Definition: libmoxa_rtu.h:3758
MODBUS_SLAVE_ERR_SET_SOCKET_MODE
Definition: libmoxa_rtu.h:4115
MISC_ERR_CODE
MISC_ERR_CODE
Definition: libmoxa_rtu.h:2728
MX_RTU_Module_RTD_Min_Eng_Reset
MODULE_RW_ERR_CODE MX_RTU_Module_RTD_Min_Eng_Reset(UINT8 slot, UINT32 channel_flags)
MX_RTU_Modbus_Tcp_Master_Read_Discrete_Inputs
MODBUS_MASTER_ERR_CODE MX_RTU_Modbus_Tcp_Master_Read_Discrete_Inputs(UINT32 sHandle, UINT16 startAddr, UINT16 coilCount, UINT8 byteCoils[], UINT8 *exceptionCode)
TAG_ERR_BIND
Definition: libmoxa_rtu.h:4560
TAG_INFO
struct TAG_INFO_T TAG_INFO
MX_RTU_Module_DI_Counter_Overflow_Reset
MODULE_RW_ERR_CODE MX_RTU_Module_DI_Counter_Overflow_Reset(UINT8 slot, UINT32 overflow)
swtd_setting::time
unsigned int time
Definition: libmoxa_rtu.h:2750
MX_RTU_Module_AI_Eng_Value_Get
MODULE_RW_ERR_CODE MX_RTU_Module_AI_Eng_Value_Get(UINT8 slot, UINT8 start, UINT8 count, float *buf, struct Timestamp *time)
MX_RTU_SerialSetSpeed
SERIAL_ERR_CODE MX_RTU_SerialSetSpeed(UINT8 slot, SERIAL_PORT port, UINT32 speed)
MX_RTU_Module_DIO_DI_Frequency_Start_Set
MODULE_RW_ERR_CODE MX_RTU_Module_DIO_DI_Frequency_Start_Set(UINT8 slot, UINT32 start)
MX_RTU_CanSetAccCode
CAN_ERR_CODE MX_RTU_CanSetAccCode(UINT8 slot, UINT8 port, UINT32 accCode)
MODBUS_SLAVE_ERR_FUNCTION
Definition: libmoxa_rtu.h:4100
MX_RTU_CanSlaveNMTStateGet
CAN_ERR_CODE MX_RTU_CanSlaveNMTStateGet(int handle, CAN_NODE_STATE *state)
MX_RTU_Module_Dual_Power1_Get
MODULE_RW_ERR_CODE MX_RTU_Module_Dual_Power1_Get(UINT8 slot, UINT8 *state)
AOPC_MAX_TAG_UNIT
#define AOPC_MAX_TAG_UNIT
Definition: libmoxa_rtu.h:4328
MX_RTU_Module_DIO_DI_Counter_Overflow_Reset
MODULE_RW_ERR_CODE MX_RTU_Module_DIO_DI_Counter_Overflow_Reset(UINT8 slot, UINT32 overflow)
MX_RTU_SerialBlockRead
SERIAL_ERR_CODE MX_RTU_SerialBlockRead(UINT8 slot, SERIAL_PORT port, UINT32 len, UINT8 *buf, UINT32 *read_bytes)
MX_RTU_TC_Event_Get_Value
IO_ERR_CODE MX_RTU_TC_Event_Get_Value(int handle, float *value, UINT32 *condition)
MX_RTU_Module_Fast_AI_Sampling_Rate_Get
MODULE_RW_ERR_CODE MX_RTU_Module_Fast_AI_Sampling_Rate_Get(UINT8 slot, UINT32 *rate)
SMS_ERR_OPEN
Definition: libmoxa_rtu.h:3441
MX_RTU_Module_DO_Diagnostic_Status_Clean_Set
MODULE_RW_ERR_CODE MX_RTU_Module_DO_Diagnostic_Status_Clean_Set(UINT8 slot, UINT32 clean)
TTY_PARAM::databits
INT32 databits
Definition: libmoxa_rtu.h:3797
IO_ERR_OK
Definition: libmoxa_rtu.h:114
SERIAL_ERR_IOCTL
Definition: libmoxa_rtu.h:3046
MODBUS_MASTER_ERR_CODE
MODBUS_MASTER_ERR_CODE
Definition: libmoxa_rtu.h:3733
MX_RTU_DIO_DI_Event_Reset
IO_ERR_CODE MX_RTU_DIO_DI_Event_Reset()
Please refer to MX_RTU_DI_Event_Reset .
MX_RTU_DIO_DI_Event_Count
IO_ERR_CODE MX_RTU_DIO_DI_Event_Count(int handle, UINT32 *count)
Please refer to MX_RTU_DI_Event_Count .
TAG_EVENT_CONDITION
struct TAG_EVENT_CONDITION_T TAG_EVENT_CONDITION
MX_RTU_AOPC_UpdateTag
AOPC_ERR_CODE MX_RTU_AOPC_UpdateTag(UINT32 sHandle, TAG *tagInfo, struct Timestamp *tagTime, UINT32 timeoutMs)
MODULE_RW_ERR_CMD
Definition: libmoxa_rtu.h:151
Gps_Time::hour
int hour
Definition: libmoxa_rtu.h:3389
IO_Info::ai_channels
UINT8 ai_channels
Definition: libmoxa_rtu.h:210
IO_ERR_CMD
Definition: libmoxa_rtu.h:116
Gps_Time
Definition: libmoxa_rtu.h:3384
MODEM_ERR_GPS_SWITCH
Definition: libmoxa_rtu.h:3268
MODBUS_SLAVE_ERR_REGISTERED_PORT
Definition: libmoxa_rtu.h:4112
MX_RTU_DI_Event_Set_Trigger
IO_ERR_CODE MX_RTU_DI_Event_Set_Trigger(int handle, UINT32 trigger)
MX_RTU_Module_AI_Status_Get
MODULE_RW_ERR_CODE MX_RTU_Module_AI_Status_Get(UINT8 slot, UINT8 start, UINT8 count, UINT8 *buf)
STATUS_READY
Definition: libmoxa_rtu.h:4580
MODULE_RW_ERR_IO_FAST_AI_BUF_EMPTY
Definition: libmoxa_rtu.h:178
MX_RTU_Module_AO_Waveform_Type_Get
MODULE_RW_ERR_CODE MX_RTU_Module_AO_Waveform_Type_Get(UINT8 slot, UINT8 start, UINT8 count, UINT8 *buf)
MX_RTU_Modbus_Rtu_Slave_Register
MODBUS_SLAVE_ERR_CODE MX_RTU_Modbus_Rtu_Slave_Register(UINT8 slot, SERIAL_PORT port, INT32 slaveID, UINT16 map_size, TTY_PARAM *param, UINT32 *handle)
MODBUS_SLAVE_ERR_SIZE
Definition: libmoxa_rtu.h:4113
SERIAL_ERR_CODE
SERIAL_ERR_CODE
Definition: libmoxa_rtu.h:3035
CAN_ERR_SYSTEM_INFO
Definition: libmoxa_rtu.h:3506
MODBUS_SLAVE_ERR_LISTEN_PORT_OVERFLOW
Definition: libmoxa_rtu.h:4105
MX_RTU_Module_DIO_DO_SigW_H_Get
MODULE_RW_ERR_CODE MX_RTU_Module_DIO_DO_SigW_H_Get(UINT8 slot, UINT8 start, UINT8 count, UINT32 *buf)
ip
char ip[MODBUS_MAX_CONNECTION][17]
Definition: libmoxa_rtu.h:4016
IO_ERR_FAST_AI_BUF_OVERFLOW
Definition: libmoxa_rtu.h:127
TTY_PARAM
Definition: libmoxa_rtu.h:3793
MX_RTU_AI_Event_Clear
IO_ERR_CODE MX_RTU_AI_Event_Clear(int handle)
TTY_PARAM::mode
INT32 mode
Definition: libmoxa_rtu.h:3799
TTY_PARAM::parity
INT32 parity
Definition: libmoxa_rtu.h:3796
MX_RTU_Cellular_Net_IP_Address
MODEM_ERR_CODE MX_RTU_Cellular_Net_IP_Address(UINT8 *ipAddress)
MX_RTU_Module_AO_Waveform_Count_Set
MODULE_RW_ERR_CODE MX_RTU_Module_AO_Waveform_Count_Set(UINT8 slot, UINT8 start, UINT8 count, UINT32 *buf)
MX_RTU_Module_DI_Counter_Trigger_Get
MODULE_RW_ERR_CODE MX_RTU_Module_DI_Counter_Trigger_Get(UINT8 slot, UINT8 start, UINT8 count, UINT8 *buf)
MX_RTU_Module_Fast_AI_Enable_Mode_Get
MODULE_RW_ERR_CODE MX_RTU_Module_Fast_AI_Enable_Mode_Get(UINT8 slot, UINT32 *mode)
SERIAL_ERR_SLOT
Definition: libmoxa_rtu.h:3042
Modbus_TCP_Master_Connection_Info::accepted_connections
UINT8 accepted_connections
Definition: libmoxa_rtu.h:4136
MX_RTU_AOPC_Init
AOPC_ERR_CODE MX_RTU_AOPC_Init(void)
This API must be called at first.
AOPC_ERR_AMOUNT
Definition: libmoxa_rtu.h:4404
IO_ERR_FAST_AI_BUF_EMPTY
Definition: libmoxa_rtu.h:126
MODBUS_SLAVE_ERR_MAP_EMPTY
Definition: libmoxa_rtu.h:4107
TAG_ERR_ALLOC
Definition: libmoxa_rtu.h:4556
MX_RTU_TC_Event_Get
IO_ERR_CODE MX_RTU_TC_Event_Get(int handle, float *value, struct Timestamp *time)
MODEM_ERR_ttyUSB
Definition: libmoxa_rtu.h:3265
MX_RTU_SMS_Send_GSM_7bits_Default_Alphabet
SMS_ERR_CODE MX_RTU_SMS_Send_GSM_7bits_Default_Alphabet(INT8 *phone, INT8 *pin, INT8 *msg, INT32 msgLength)
MX_RTU_Module_Relay_SigW_H_Get
MODULE_RW_ERR_CODE MX_RTU_Module_Relay_SigW_H_Get(UINT8 slot, UINT8 start, UINT8 count, UINT32 *buf)
MX_RTU_Module_Relay_Value_Get
MODULE_RW_ERR_CODE MX_RTU_Module_Relay_Value_Get(UINT8 slot, UINT32 *value)
CAN_NODE_START
Definition: libmoxa_rtu.h:3541
SERIAL_ERR_AMOUNT
Definition: libmoxa_rtu.h:3053
MX_RTU_AI_Event_Unregister
IO_ERR_CODE MX_RTU_AI_Event_Unregister(int handle)
MX_RTU_GPS_Start
INT32 MX_RTU_GPS_Start(UINT8 activeAntenna)
CAN_NMT_NODE_GUARDING_STATE
CAN_NMT_NODE_GUARDING_STATE
Definition: libmoxa_rtu.h:3557
MISC_ERR_COPY
Definition: libmoxa_rtu.h:2735
MX_RTU_DI_Event_Clear
IO_ERR_CODE MX_RTU_DI_Event_Clear(int handle)
CAN_NMT_NODE_GUARDING_OPERATIONAL
Definition: libmoxa_rtu.h:3564
MODEM_ERR_CREDENTIAL
Definition: libmoxa_rtu.h:3257
MX_RTU_Module_Fast_AI_Max_Raw_Reset
MODULE_RW_ERR_CODE MX_RTU_Module_Fast_AI_Max_Raw_Reset(UINT8 slot, UINT32 channel)
MODBUS_MASTER_ERR_UART_FORMAT
Definition: libmoxa_rtu.h:3744
STATUS_SUCCESS
Definition: libmoxa_rtu.h:4582
SMS_ERR_MODEM
Definition: libmoxa_rtu.h:3445
CAN_Emcy_Message::errorRegister
UINT8 errorRegister
Definition: libmoxa_rtu.h:3581
IO_ERR_IO_MODULE_REQUEST
Definition: libmoxa_rtu.h:129
CAN_ERR_GET
Definition: libmoxa_rtu.h:3503
MX_RTU_Module_RTD_Unit_Get
MODULE_RW_ERR_CODE MX_RTU_Module_RTD_Unit_Get(UINT8 slot, UINT8 start, UINT8 count, UINT8 *buf)
PORT_AMOUNT
Definition: libmoxa_rtu.h:3032
AOPC_ERR_SYSTEM_INFO
Definition: libmoxa_rtu.h:4402
MX_RTU_Cellular_Net_State
INT32 MX_RTU_Cellular_Net_State(void)
MX_RTU_Module_DO_PWM_Count_Set
MODULE_RW_ERR_CODE MX_RTU_Module_DO_PWM_Count_Set(UINT8 slot, UINT8 start, UINT8 count, UINT32 *buf)
MX_RTU_Module_Fast_AI_Batch_Data_Check
MODULE_RW_ERR_CODE MX_RTU_Module_Fast_AI_Batch_Data_Check(UINT8 slot, UINT32 channel, UINT32 *count)
MX_RTU_Module_TC_Eng_Value_Get
MODULE_RW_ERR_CODE MX_RTU_Module_TC_Eng_Value_Get(UINT8 slot, UINT8 start, UINT8 count, float *buf, struct Timestamp *time)
SERIAL_ERR_PARAMETER
Definition: libmoxa_rtu.h:3041
MX_RTU_Module_AO_Raw_Value_Get
MODULE_RW_ERR_CODE MX_RTU_Module_AO_Raw_Value_Get(UINT8 slot, UINT8 start, UINT8 count, UINT32 *buf)
MX_RTU_CanSlavePDORegister
CAN_ERR_CODE MX_RTU_CanSlavePDORegister(int handle, UINT8 pdoNumber, UINT8 *tagName)
Gps_Data::satInUse
int satInUse
Definition: libmoxa_rtu.h:3401
MX_RTU_AIO_Raw_to_Eng
AIO_TRANSFORM_ERR_CODE MX_RTU_AIO_Raw_to_Eng(UINT32 range, UINT32 bitsResolution, int rawValue, float *engValue)
CAN_ERR_HANDLE
Definition: libmoxa_rtu.h:3515
TAG_ERR_EVENT_REGISTER
Definition: libmoxa_rtu.h:4569
MODULE_RW_ERR_POWER
Definition: libmoxa_rtu.h:181
MX_RTU_Module_AO_Eng_Value_Set
MODULE_RW_ERR_CODE MX_RTU_Module_AO_Eng_Value_Set(UINT8 slot, UINT8 start, UINT8 count, float *buf)
MX_RTU_Module_DIO_DO_Value_Set
MODULE_RW_ERR_CODE MX_RTU_Module_DIO_DO_Value_Set(UINT8 slot, UINT32 value)
MX_RTU_Modbus_Rtu_Master_Read_Coils
MODBUS_MASTER_ERR_CODE MX_RTU_Modbus_Rtu_Master_Read_Coils(UINT8 slot, SERIAL_PORT port, UINT8 unitId, UINT16 startAddr, UINT16 coilCount, UINT8 byteCoils[], UINT32 timeoutMs, UINT8 *exceptionCode)
SERIAL_ERR_HOT_PLUG
Definition: libmoxa_rtu.h:3051
TAG_ERR_RESET
Definition: libmoxa_rtu.h:4561
Timestamp::mon
UINT32 mon
Definition: libmoxa_rtu.h:237
IO_Info::do_channels
UINT8 do_channels
Definition: libmoxa_rtu.h:208
MX_RTU_Modbus_Rtu_Slave_Add_Entry
MODBUS_SLAVE_ERR_CODE MX_RTU_Modbus_Rtu_Slave_Add_Entry(UINT32 handle, UINT8 map_type, UINT16 address, void *pUserData, pfnModbusRead, pfnModbusWrite)
MX_RTU_Module_Fast_AI_Range_Set
MODULE_RW_ERR_CODE MX_RTU_Module_Fast_AI_Range_Set(UINT8 slot, UINT8 start, UINT8 count, UINT8 *buf)
MODULE_RW_ERR_IO_CH
Definition: libmoxa_rtu.h:169
TAG_EVENT_CONDITION_T
Definition: libmoxa_rtu.h:4596
MODEM_ERR_ATTACH
Definition: libmoxa_rtu.h:3258
MX_RTU_Module_Fast_AI_Min_Raw_Get
MODULE_RW_ERR_CODE MX_RTU_Module_Fast_AI_Min_Raw_Get(UINT8 slot, UINT8 start, UINT8 count, UINT32 *buf)
MX_RTU_Modbus_Tcp_Slave_Init
MODBUS_SLAVE_ERR_CODE MX_RTU_Modbus_Tcp_Slave_Init()
This API must be called at first.
STATUS_CODE
STATUS_CODE
Definition: libmoxa_rtu.h:4577
MX_RTU_AI_Eng_to_Raw
AI_TRANSFORM_ERR_CODE MX_RTU_AI_Eng_to_Raw(UINT32 range, float engValue, int *rawValue)
MX_RTU_SMS_Send_Ucs2
SMS_ERR_CODE MX_RTU_SMS_Send_Ucs2(INT8 *phone, INT8 *pin, INT8 *ucs2Msg, INT8 msgLength)
MX_RTU_Module_DO_Value_Get
MODULE_RW_ERR_CODE MX_RTU_Module_DO_Value_Get(UINT8 slot, UINT32 *value)
MX_RTU_SerialDataInInputQueue
SERIAL_ERR_CODE MX_RTU_SerialDataInInputQueue(UINT8 slot, SERIAL_PORT port, UINT32 *bytes)
IO_ERR_CELLULAR_POWER_INDICATOR
Definition: libmoxa_rtu.h:138
CAN_Emcy_Message::cobID
UINT32 cobID
Definition: libmoxa_rtu.h:3579
MX_RTU_Module_RTD_Type_Set
MODULE_RW_ERR_CODE MX_RTU_Module_RTD_Type_Set(UINT8 slot, UINT8 start, UINT8 count, UINT8 *buf)
MX_RTU_CanCyclicSYNCSend
CAN_ERR_CODE MX_RTU_CanCyclicSYNCSend(int handle, UINT32 CobID, UINT16 Timer, UINT32 Times)
MX_RTU_Modbus_Rtu_Master_Read_Holding_Regs
MODBUS_MASTER_ERR_CODE MX_RTU_Modbus_Rtu_Master_Read_Holding_Regs(UINT8 slot, SERIAL_PORT port, UINT8 unitId, UINT16 startAddr, UINT16 regCount, UINT16 regs[], UINT32 timeoutMs, UINT8 *exceptionCode)
MX_RTU_RTD_Event_Register
IO_ERR_CODE MX_RTU_RTD_Event_Register(UINT8 slot, UINT8 channel, float value, UINT32 condition, int *handle)
TTY_PARAM::baudrate
UINT32 baudrate
Definition: libmoxa_rtu.h:3795
TAG_EVENT_CONDITION_T::hysteresis
float hysteresis
Definition: libmoxa_rtu.h:4600
MX_RTU_Modbus_Rtu_Master_Write_Holding_Reg
MODBUS_MASTER_ERR_CODE MX_RTU_Modbus_Rtu_Master_Write_Holding_Reg(UINT8 slot, SERIAL_PORT port, UINT8 unitId, UINT16 addr, UINT16 reg, UINT32 timeoutMs, UINT8 *exceptionCode)
AOPC_ERR_CONNECT
Definition: libmoxa_rtu.h:4383
MX_RTU_Module_DO_PWM_Start_Set
MODULE_RW_ERR_CODE MX_RTU_Module_DO_PWM_Start_Set(UINT8 slot, UINT32 start)
MX_RTU_Module_Dual_Power2_Get
MODULE_RW_ERR_CODE MX_RTU_Module_Dual_Power2_Get(UINT8 slot, UINT8 *state)
AOPC_ERR_LIB_INIT
Definition: libmoxa_rtu.h:4379
MODBUS_MAX_CONNECTION
#define MODBUS_MAX_CONNECTION
Definition: libmoxa_rtu.h:4036
MODBUS_SLAVE_ERR_CREATE_SOCKET
Definition: libmoxa_rtu.h:4096
MX_RTU_Tag_Read
TAG_ERR_CODE MX_RTU_Tag_Read(UINT8 *tagName, void *tagValue, UINT32 tagSize, UINT32 *readBytes, struct Timestamp *time)
STATUS_INIT
Definition: libmoxa_rtu.h:4579
MX_RTU_Module_DO_PWM_Config_Set
MODULE_RW_ERR_CODE MX_RTU_Module_DO_PWM_Config_Set(UINT8 slot, UINT8 start, UINT8 count, float *frequency, float *dutyCycle)
MX_RTU_Module_RTD_Offset_Get
MODULE_RW_ERR_CODE MX_RTU_Module_RTD_Offset_Get(UINT8 slot, UINT8 start, UINT8 count, float *buf)
MX_RTU_Module_Relay_PWM_Start_Get
MODULE_RW_ERR_CODE MX_RTU_Module_Relay_PWM_Start_Get(UINT8 slot, UINT32 *start)
MODBUS_SLAVE_ERR_SET_SOCKET_OPTION
Definition: libmoxa_rtu.h:4116
PORT5
Definition: libmoxa_rtu.h:3028
IO_ERR_CELLULAR_IGT_ON
Definition: libmoxa_rtu.h:140
CAN_ERR_THREAD
Definition: libmoxa_rtu.h:3522
MX_RTU_AOPC_Reconnect
AOPC_ERR_CODE MX_RTU_AOPC_Reconnect(UINT32 sHandle, UINT32 timeoutMs)
MX_RTU_Module_Fast_AI_Min_Eng_Get
MODULE_RW_ERR_CODE MX_RTU_Module_Fast_AI_Min_Eng_Get(UINT8 slot, UINT8 start, UINT8 count, float *buf)
MX_RTU_MultiTag_Read
TAG_ERR_CODE MX_RTU_MultiTag_Read(UINT8 *prefixTagName, UINT8 *postfixTagName, UINT16 start, UINT16 count, UINT8 *tagValue, struct Timestamp *tagTimeStamp)
IO_Info::rtd_channels
UINT8 rtd_channels
Definition: libmoxa_rtu.h:214
MX_RTU_Cellular_Net_Start
MODEM_ERR_CODE MX_RTU_Cellular_Net_Start(INT8 *apn, INT8 *userName, INT8 *password, CheckInfo *autoCheck)
MX_RTU_LED1_Get
MISC_ERR_CODE MX_RTU_LED1_Get(UINT8 *state)
MX_RTU_Module_DO_SigW_H_Get
MODULE_RW_ERR_CODE MX_RTU_Module_DO_SigW_H_Get(UINT8 slot, UINT8 start, UINT8 count, UINT32 *buf)
Module_Info::hw_version
UINT16 hw_version
Definition: libmoxa_rtu.h:226
MX_RTU_Cellular_Modem_IMEI
void MX_RTU_Cellular_Modem_IMEI(INT8 *imei)
MX_RTU_GPS_Get_Info
void MX_RTU_GPS_Get_Info(GPS_DATA *gpsData)
MX_RTU_Module_AO_Raw_Value_Set
MODULE_RW_ERR_CODE MX_RTU_Module_AO_Raw_Value_Set(UINT8 slot, UINT8 start, UINT8 count, UINT32 *buf)
MX_RTU_Modbus_Tcp_Slave_Map_Count
MODBUS_SLAVE_ERR_CODE MX_RTU_Modbus_Tcp_Slave_Map_Count(UINT32 sHandle, UINT16 *count)
MX_RTU_Module_DO_Mode_Set
MODULE_RW_ERR_CODE MX_RTU_Module_DO_Mode_Set(UINT8 slot, UINT8 start, UINT8 count, UINT8 *buf)
MODBUS_MASTER_ERR_UART_WRITE
Definition: libmoxa_rtu.h:3746
MX_RTU_Modbus_Master_Init
MODBUS_MASTER_ERR_CODE MX_RTU_Modbus_Master_Init(void)
This API must be called at first.
INT16
short INT16
Definition: libmoxa_rtu.h:64
TAG_ERR_PARAM
Definition: libmoxa_rtu.h:4557
MODEM_ERR_OK
Definition: libmoxa_rtu.h:3245
MX_RTU_Module_DIO_DI_Counter_Start_Get
MODULE_RW_ERR_CODE MX_RTU_Module_DIO_DI_Counter_Start_Get(UINT8 slot, UINT32 *start)
MODEM_ERR_CMD
Definition: libmoxa_rtu.h:3260
MX_RTU_Module_Fast_AI_Max_Eng_Reset
MODULE_RW_ERR_CODE MX_RTU_Module_Fast_AI_Max_Eng_Reset(UINT8 slot, UINT32 channel)
MX_RTU_CanSDORead
CAN_ERR_CODE MX_RTU_CanSDORead(int handle, UINT32 slaveNodeID, UINT16 index, UINT8 subIndex, UINT8 *rData, UINT32 *rLen, UINT32 *abortCode)
MX_RTU_AOPC_UpdateHeartbeat
AOPC_ERR_CODE MX_RTU_AOPC_UpdateHeartbeat(UINT32 sHandle, UINT32 heartbeatS, UINT32 timeoutMs)
MX_RTU_Module_Relay_PWM_Count_Get
MODULE_RW_ERR_CODE MX_RTU_Module_Relay_PWM_Count_Get(UINT8 slot, UINT8 start, UINT8 count, UINT32 *buf)
UINT16
unsigned short UINT16
Definition: libmoxa_rtu.h:63
IO_Info::tc_channels
UINT8 tc_channels
Definition: libmoxa_rtu.h:213
MODBUS_MASTER_ERR_NOT_OPENED
Definition: libmoxa_rtu.h:3739
MODBUS_MASTER_ERR_HOT_PLUG
Definition: libmoxa_rtu.h:3756
CAN_ERR_PARAM
Definition: libmoxa_rtu.h:3502
MODULE_RW_ERR_IO_TYPE
Definition: libmoxa_rtu.h:168
Module_Info::product_id
UINT16 product_id
Definition: libmoxa_rtu.h:224
MX_RTU_Modbus_Tcp_Master_Write_Coils
MODBUS_MASTER_ERR_CODE MX_RTU_Modbus_Tcp_Master_Write_Coils(UINT32 sHandle, UINT16 startAddr, UINT16 coilCount, UINT8 byteCoils[], UINT8 *exceptionCode)
MX_RTU_SWTD_Enable
MISC_ERR_CODE MX_RTU_SWTD_Enable(UINT32 swtdtime)
MODEM_ERR_APN
Definition: libmoxa_rtu.h:3256
Gps_Time::year
int year
Definition: libmoxa_rtu.h:3386
MX_RTU_CanSetBaudrate
CAN_ERR_CODE MX_RTU_CanSetBaudrate(UINT8 slot, UINT8 port, UINT32 baudrate)
MX_RTU_Tag_Event_Unregister
TAG_ERR_CODE MX_RTU_Tag_Event_Unregister(int handle)
MX_RTU_Module_DIO_DI_Counter_Value_Set
MODULE_RW_ERR_CODE MX_RTU_Module_DIO_DI_Counter_Value_Set(UINT8 slot, UINT8 start, UINT8 count, UINT32 *buf)
MODBUS_MASTER_ERR_KEEPALIVE
Definition: libmoxa_rtu.h:3757
MX_RTU_Module_Relay_Mode_Set
MODULE_RW_ERR_CODE MX_RTU_Module_Relay_Mode_Set(UINT8 slot, UINT8 start, UINT8 count, UINT8 *buf)
MODEM_ERR_SYSTEM_INFO
Definition: libmoxa_rtu.h:3266
MODBUS_SLAVE_ERR_ILLEGAL_ACTION
Definition: libmoxa_rtu.h:4103
SMS_ERR_ERR
Definition: libmoxa_rtu.h:3442
MX_RTU_Module_DIO_DI_Mode_Set
MODULE_RW_ERR_CODE MX_RTU_Module_DIO_DI_Mode_Set(UINT8 slot, UINT8 start, UINT8 count, UINT8 *buf)
MX_RTU_DIO_DI_Event_Get
IO_ERR_CODE MX_RTU_DIO_DI_Event_Get(int handle, UINT32 *status, struct Timestamp *time)
Please refer to MX_RTU_DI_Event_Get .
manufacturerSpecificErrorField
UINT8 manufacturerSpecificErrorField[5]
Definition: libmoxa_rtu.h:3475
CAN_NODE_PRE_OPERATIONAL
Definition: libmoxa_rtu.h:3543
MX_RTU_Module_DO_PWM_Count_Get
MODULE_RW_ERR_CODE MX_RTU_Module_DO_PWM_Count_Get(UINT8 slot, UINT8 start, UINT8 count, UINT32 *buf)
Gps_Time::hsec
int hsec
Definition: libmoxa_rtu.h:3392
MODEM_ERR_IF
Definition: libmoxa_rtu.h:3259
MX_RTU_CanGetStatus
CAN_ERR_CODE MX_RTU_CanGetStatus(UINT8 slot, UINT8 port, UINT32 *status)
IO_ERR_HOT_PLUG
Definition: libmoxa_rtu.h:135
MX_RTU_Module_DIO_DO_SigW_L_Get
MODULE_RW_ERR_CODE MX_RTU_Module_DIO_DO_SigW_L_Get(UINT8 slot, UINT8 start, UINT8 count, UINT32 *buf)
MX_RTU_Module_DI_Value_Get
MODULE_RW_ERR_CODE MX_RTU_Module_DI_Value_Get(UINT8 slot, UINT32 *value, struct Timestamp *time)
Gps_Time::day
int day
Definition: libmoxa_rtu.h:3388
MX_RTU_SerialClose
SERIAL_ERR_CODE MX_RTU_SerialClose(UINT8 slot, SERIAL_PORT port)
MODBUS_MASTER_ERR_LIB_INIT
Definition: libmoxa_rtu.h:3754
MX_RTU_Module_RTD_Burnout_Status_Get
MODULE_RW_ERR_CODE MX_RTU_Module_RTD_Burnout_Status_Get(UINT8 slot, UINT8 start, UINT8 count, UINT8 *buf)
CAN_ERR_SDO_RW_ABORT
Definition: libmoxa_rtu.h:3524
AOPC_ERR_SERVER_ERROR
Definition: libmoxa_rtu.h:4390
CAN_NMT_ERROR_NODE_GUARDING
Definition: libmoxa_rtu.h:3552
MX_RTU_TC_Event_Clear
IO_ERR_CODE MX_RTU_TC_Event_Clear(int handle)
PORT7
Definition: libmoxa_rtu.h:3030
MX_RTU_Module_AI_Min_Raw_Reset
MODULE_RW_ERR_CODE MX_RTU_Module_AI_Min_Raw_Reset(UINT8 slot, UINT32 channel)
MX_RTU_TC_Event_Set_Value
IO_ERR_CODE MX_RTU_TC_Event_Set_Value(int handle, float value, UINT32 condition)
IO_ERR_RW
Definition: libmoxa_rtu.h:123
AOPC_ERR_NOT_WRITABLE
Definition: libmoxa_rtu.h:4398
TagInfo::tagAccessRight
UINT8 tagAccessRight
Definition: libmoxa_rtu.h:4369
MX_RTU_Module_DIO_DO_PWM_Config_Get
MODULE_RW_ERR_CODE MX_RTU_Module_DIO_DO_PWM_Config_Get(UINT8 slot, UINT8 start, UINT8 count, float *frequency, float *dutyCycle)
MX_RTU_API_Version_Get
UINT32 MX_RTU_API_Version_Get(void)
MX_RTU_Module_DI_Counter_Value_Set
MODULE_RW_ERR_CODE MX_RTU_Module_DI_Counter_Value_Set(UINT8 slot, UINT8 start, UINT8 count, UINT32 *buf)
MX_RTU_AOPC_Connect
AOPC_ERR_CODE MX_RTU_AOPC_Connect(UINT8 *deviceName, UINT32 heartBeatS, UINT8 *ipAddress, UINT16 port, UINT32 timeoutMs, UINT32 *sHandle)
MX_RTU_Tag_Get_Info
TAG_ERR_CODE MX_RTU_Tag_Get_Info(UINT8 *tagName, TAG_INFO *info)
MX_RTU_Module_AI_Range_Get
MODULE_RW_ERR_CODE MX_RTU_Module_AI_Range_Get(UINT8 slot, UINT8 start, UINT8 count, UINT8 *buf)
MX_RTU_Module_AI_Min_Eng_Reset
MODULE_RW_ERR_CODE MX_RTU_Module_AI_Min_Eng_Reset(UINT8 slot, UINT32 channel)
MX_RTU_Modbus_Tcp_Slave_Register
MODBUS_SLAVE_ERR_CODE MX_RTU_Modbus_Tcp_Slave_Register(UINT16 port, UINT16 map_size, UINT32 idle_timeout_second, UINT32 *sHandle)
MX_RTU_Module_Relay_Total_Count_Get
MODULE_RW_ERR_CODE MX_RTU_Module_Relay_Total_Count_Get(UINT8 slot, UINT8 start, UINT8 count, UINT32 *buf)
MX_RTU_Module_AI_Max_Raw_Reset
MODULE_RW_ERR_CODE MX_RTU_Module_AI_Max_Raw_Reset(UINT8 slot, UINT32 channel)
MISC_ERR_SYSTEM_INFO
Definition: libmoxa_rtu.h:2738
MX_RTU_Modbus_Tcp_Master_Close
MODBUS_MASTER_ERR_CODE MX_RTU_Modbus_Tcp_Master_Close(UINT32 sHandle)
MX_RTU_Module_DI_Ext_Power_Get
MODULE_RW_ERR_CODE MX_RTU_Module_DI_Ext_Power_Get(UINT8 slot, UINT32 *value)
SERIAL_ERR_OK
Definition: libmoxa_rtu.h:3037
MX_RTU_Module_Fast_AI_Status_Get
MODULE_RW_ERR_CODE MX_RTU_Module_Fast_AI_Status_Get(UINT8 slot, UINT8 start, UINT8 count, UINT8 *buf)
IO_Info::counter_channels
UINT8 counter_channels
Definition: libmoxa_rtu.h:215
MX_RTU_CanSlaveNodeIDSet
CAN_ERR_CODE MX_RTU_CanSlaveNodeIDSet(int handle, UINT32 slaveNodeID)
AOPC_ERR_STR_LEN
Definition: libmoxa_rtu.h:4403
MODBUS_SLAVE_ERR_SYSTEM_INFO
Definition: libmoxa_rtu.h:4118
MX_RTU_API_BuildDate_Get
UINT32 MX_RTU_API_BuildDate_Get(void)
MX_RTU_Tag_List_All
TAG_ERR_CODE MX_RTU_Tag_List_All(void)
Listing all of the tags.
MX_RTU_AI_Raw_to_Eng
AI_TRANSFORM_ERR_CODE MX_RTU_AI_Raw_to_Eng(UINT32 range, int rawValue, float *engValue)
MX_RTU_AOPC_DelAllTag
AOPC_ERR_CODE MX_RTU_AOPC_DelAllTag(UINT32 sHandle, UINT32 timeoutMs)
MX_RTU_Module_AO_Status_Get
MODULE_RW_ERR_CODE MX_RTU_Module_AO_Status_Get(UINT8 slot, UINT8 start, UINT8 count, UINT8 *buf)
slot
UINT8 slot
Definition: libmoxa_rtu.h:67
MX_RTU_Module_DIO_DO_PWM_Count_Set
MODULE_RW_ERR_CODE MX_RTU_Module_DIO_DO_PWM_Count_Set(UINT8 slot, UINT8 start, UINT8 count, UINT32 *buf)
MX_RTU_Module_DI_Debouncing_Time_Get
MODULE_RW_ERR_CODE MX_RTU_Module_DI_Debouncing_Time_Get(UINT8 slot, UINT8 start, UINT8 count, float *buf)
SMS_ERR_SYSTEM_INFO
Definition: libmoxa_rtu.h:3447
MX_RTU_Module_TC_Max_Eng_Reset
MODULE_RW_ERR_CODE MX_RTU_Module_TC_Max_Eng_Reset(UINT8 slot, UINT32 channel_flags)
CAN_NMT_ERROR_AMOUNT
Definition: libmoxa_rtu.h:3554
MODBUS_MASTER_ERR_UART_OPEN
Definition: libmoxa_rtu.h:3740
TAG_ERR_DESTROY
Definition: libmoxa_rtu.h:4559
CAN_ERR_HOT_PLUG
Definition: libmoxa_rtu.h:3507
MX_RTU_SerialOpen
SERIAL_ERR_CODE MX_RTU_SerialOpen(UINT8 slot, SERIAL_PORT port)
AIO_TRANSFORM_ERR_CODE
AIO_TRANSFORM_ERR_CODE
Definition: libmoxa_rtu.h:196
MODBUS_MASTER_ERR_SYSTEM_INFO
Definition: libmoxa_rtu.h:3755
MODBUS_MASTER_ERR_PARAM
Definition: libmoxa_rtu.h:3736
CAN_ERR_SET
Definition: libmoxa_rtu.h:3504
SERIAL_ERR_NOT_SUPPORT_PRODUCT
Definition: libmoxa_rtu.h:3049
MX_RTU_CanSlaveNodeIDGet
CAN_ERR_CODE MX_RTU_CanSlaveNodeIDGet(int handle, UINT32 *slaveNodeID)
GPS_DATA
struct Gps_Data GPS_DATA
TagInfo::tagValue
void * tagValue
Definition: libmoxa_rtu.h:4372
MX_RTU_Module_AI_Min_Raw_Get
MODULE_RW_ERR_CODE MX_RTU_Module_AI_Min_Raw_Get(UINT8 slot, UINT8 start, UINT8 count, UINT32 *buf)
MX_RTU_Module_DO_PWM_Stop_Set
MODULE_RW_ERR_CODE MX_RTU_Module_DO_PWM_Stop_Set(UINT8 slot, UINT32 stop)
MX_RTU_Module_TC_Offset_Get
MODULE_RW_ERR_CODE MX_RTU_Module_TC_Offset_Get(UINT8 slot, UINT8 start, UINT8 count, float *buf)
MX_RTU_Modbus_Rtu_Master_Write_Holding_Regs
MODBUS_MASTER_ERR_CODE MX_RTU_Modbus_Rtu_Master_Write_Holding_Regs(UINT8 slot, SERIAL_PORT port, UINT8 unitId, UINT16 startAddr, UINT16 regCount, UINT16 regs[], UINT32 timeoutMs, UINT8 *exceptionCode)
MX_RTU_Modbus_Tcp_Master_Write_Holding_Regs
MODBUS_MASTER_ERR_CODE MX_RTU_Modbus_Tcp_Master_Write_Holding_Regs(UINT32 sHandle, UINT16 startAddr, UINT16 regCount, UINT16 regs[], UINT8 *exceptionCode)
MX_RTU_System_Hot_Plug_Connect_Get
IO_ERR_CODE MX_RTU_System_Hot_Plug_Connect_Get(UINT32 *state)
MX_RTU_CanSlaveNodeGuardingStateGet
CAN_ERR_CODE MX_RTU_CanSlaveNodeGuardingStateGet(int handle, CAN_NMT_NODE_GUARDING_STATE *state)
SERIAL_ERR_WRITE
Definition: libmoxa_rtu.h:3045
MODEM_ERR_BREAK
Definition: libmoxa_rtu.h:3263
MX_RTU_Module_AI_Burnout_Value_Set
MODULE_RW_ERR_CODE MX_RTU_Module_AI_Burnout_Value_Set(UINT8 slot, UINT8 start, UINT8 count, float *buf)
MODBUS_MASTER_ERR_HANDLE
Definition: libmoxa_rtu.h:3752
CAN_ERR_AMOUNT
Definition: libmoxa_rtu.h:3536
MX_RTU_Modbus_Rtu_Slave_Start
MODBUS_SLAVE_ERR_CODE MX_RTU_Modbus_Rtu_Slave_Start(UINT32 handle)
MX_RTU_Module_DIO_DI_Frequency_Measurement_Time_Set
MODULE_RW_ERR_CODE MX_RTU_Module_DIO_DI_Frequency_Measurement_Time_Set(UINT8 slot, UINT8 start, UINT8 count, UINT32 *buf)
MX_RTU_Tag_Init
TAG_ERR_CODE MX_RTU_Tag_Init(void)
This API must be called at first.
MX_RTU_LED1_Set
MISC_ERR_CODE MX_RTU_LED1_Set(UINT8 state)
CAN_ERR_SLAVE_PDO_DUPLICATE_REGISTER
Definition: libmoxa_rtu.h:3534
IO_Info::ao_channels
UINT8 ao_channels
Definition: libmoxa_rtu.h:212
MX_RTU_Module_TC_Offset_Set
MODULE_RW_ERR_CODE MX_RTU_Module_TC_Offset_Set(UINT8 slot, UINT8 start, UINT8 count, float *buf)
MX_RTU_CPU_Switch_Mode_Get
IO_ERR_CODE MX_RTU_CPU_Switch_Mode_Get(UINT32 *mode)
MX_RTU_Module_Relay_PWM_Stop_Set
MODULE_RW_ERR_CODE MX_RTU_Module_Relay_PWM_Stop_Set(UINT8 slot, UINT32 stop)
CAN_ERR_FNCTL
Definition: libmoxa_rtu.h:3525
MX_RTU_Module_Fast_AI_Min_Raw_Reset
MODULE_RW_ERR_CODE MX_RTU_Module_Fast_AI_Min_Raw_Reset(UINT8 slot, UINT32 channel)
MX_RTU_CanSlaveNodeGuardingGet
CAN_ERR_CODE MX_RTU_CanSlaveNodeGuardingGet(int handle, UINT16 *guardTime, UINT8 *lifeTimeFactor)
MX_RTU_SRAM_Write
IO_ERR_CODE MX_RTU_SRAM_Write(UINT32 start_address, UINT32 length, UINT8 *buf)
MX_RTU_AOPC_DelTag
AOPC_ERR_CODE MX_RTU_AOPC_DelTag(UINT32 sHandle, UINT8 *tagName, UINT32 timeoutMs)
MODEM_ERR_CODE
MODEM_ERR_CODE
Definition: libmoxa_rtu.h:3243
TAG_ERR_EVENT_EMPTY
Definition: libmoxa_rtu.h:4572
CAN_NMT_ERROR_OK
Definition: libmoxa_rtu.h:3551
MX_RTU_Modbus_Tcp_Slave_Map_Dump
MODBUS_SLAVE_ERR_CODE MX_RTU_Modbus_Tcp_Slave_Map_Dump(UINT32 sHandle)
CAN_NODE_STATE
CAN_NODE_STATE
Definition: libmoxa_rtu.h:3539
MX_RTU_LED2_Get
MISC_ERR_CODE MX_RTU_LED2_Get(UINT8 *state)
MX_RTU_Module_TC_Burnout_Status_Get
MODULE_RW_ERR_CODE MX_RTU_Module_TC_Burnout_Status_Get(UINT8 slot, UINT8 start, UINT8 count, UINT8 *buf)
MODULE_RW_ERR_SEMAPHORE_LOCK
Definition: libmoxa_rtu.h:163
IO_ERR_SLOT
Definition: libmoxa_rtu.h:120
MX_RTU_CanSlaveSYNCGet
CAN_ERR_CODE MX_RTU_CanSlaveSYNCGet(int handle, UINT32 *CobID, UINT32 *nCobID)
MX_RTU_Module_Fast_AI_Enable_Mode_Set
MODULE_RW_ERR_CODE MX_RTU_Module_Fast_AI_Enable_Mode_Set(UINT8 slot, UINT32 mode)
MODULE_RW_ERR_IO_FILTER
Definition: libmoxa_rtu.h:171
MX_RTU_Modbus_Tcp_Master_Ioctl
MODBUS_MASTER_ERR_CODE MX_RTU_Modbus_Tcp_Master_Ioctl(UINT32 sHandle, UINT8 unitId, UINT32 rwTimeoutMs)
IO_ERR_SEMAPHORE_LOCK
Definition: libmoxa_rtu.h:131
MX_RTU_Module_AO_Waveform_Count_Get
MODULE_RW_ERR_CODE MX_RTU_Module_AO_Waveform_Count_Get(UINT8 slot, UINT8 start, UINT8 count, UINT32 *buf)
MODULE_RW_ERR_REQUEST_EXCEPTION
Definition: libmoxa_rtu.h:160
MX_RTU_CanSDOWrite
CAN_ERR_CODE MX_RTU_CanSDOWrite(int handle, UINT32 slaveNodeID, UINT16 index, UINT8 subIndex, UINT8 *wData, UINT32 wLen, UINT8 *rData, UINT32 *rLen, UINT32 *abortCode)
MX_RTU_Cellular_Modem_RSSI
MODEM_ERR_CODE MX_RTU_Cellular_Modem_RSSI(UINT8 *rssi)
CAN_NMT_NODE_GUARDING_AMOUNT
Definition: libmoxa_rtu.h:3566
MX_RTU_Module_DIO_DI_Frequency_Start_Get
MODULE_RW_ERR_CODE MX_RTU_Module_DIO_DI_Frequency_Start_Get(UINT8 slot, UINT32 *start)
TAG_ERR_SEM
Definition: libmoxa_rtu.h:4554
MX_RTU_Module_AI_Burnout_Value_Get
MODULE_RW_ERR_CODE MX_RTU_Module_AI_Burnout_Value_Get(UINT8 slot, UINT8 start, UINT8 count, float *buf)
SERIAL_ERR_PORT
Definition: libmoxa_rtu.h:3043
SERIAL_ERR_OPEN
Definition: libmoxa_rtu.h:3039
MX_RTU_Module_Relay_Current_Count_Get
MODULE_RW_ERR_CODE MX_RTU_Module_Relay_Current_Count_Get(UINT8 slot, UINT8 start, UINT8 count, UINT32 *buf)
SMS_ERR_CODE
SMS_ERR_CODE
Definition: libmoxa_rtu.h:3438
MX_RTU_Modbus_Rtu_Master_Close
MODBUS_MASTER_ERR_CODE MX_RTU_Modbus_Rtu_Master_Close(UINT8 slot, SERIAL_PORT port)
MX_RTU_SWTD_Ack
MISC_ERR_CODE MX_RTU_SWTD_Ack()
Check_Info::pingMaxFail
UINT32 pingMaxFail
Definition: libmoxa_rtu.h:3278
IO_ERR_DUPLICATE_REGISTER
Definition: libmoxa_rtu.h:136
CAN_NMT_ERROR_HEARTBEAT
Definition: libmoxa_rtu.h:3553
TAG_INFO_T
Definition: libmoxa_rtu.h:4587
MX_RTU_FRAM_Write
IO_ERR_CODE MX_RTU_FRAM_Write(UINT32 start_address, UINT32 length, UINT8 *buf)
AOPC_MAX_TAG_NAME
#define AOPC_MAX_TAG_NAME
Definition: libmoxa_rtu.h:4326
SMS_ERR_PIN
Definition: libmoxa_rtu.h:3443
MX_RTU_Modbus_Tcp_Slave_Uninit
MODBUS_SLAVE_ERR_CODE MX_RTU_Modbus_Tcp_Slave_Uninit()
This API must be called at the end.
MODBUS_MASTER_ERR_UART_BAUDRATE
Definition: libmoxa_rtu.h:3742
MX_RTU_Module_Relay_PWM_Start_Set
MODULE_RW_ERR_CODE MX_RTU_Module_Relay_PWM_Start_Set(UINT8 slot, UINT32 start)
TAG_ERR_NO_TAG
Definition: libmoxa_rtu.h:4565
MX_RTU_TC_Event_Count
IO_ERR_CODE MX_RTU_TC_Event_Count(int handle, UINT32 *count)
MODBUS_SLAVE_ERR_ADDRESS
Definition: libmoxa_rtu.h:4093
MX_RTU_Module_AO_Waveform_Type_Set
MODULE_RW_ERR_CODE MX_RTU_Module_AO_Waveform_Type_Set(UINT8 slot, UINT8 start, UINT8 count, UINT8 *buf)
MODULE_RW_ERR_IO_PARAM
Definition: libmoxa_rtu.h:167
MX_RTU_Rotary_Switch_Mode_Get
MISC_ERR_CODE MX_RTU_Rotary_Switch_Mode_Get(UINT32 *mode)
MX_RTU_Module_DI_Counter_Value_Get
MODULE_RW_ERR_CODE MX_RTU_Module_DI_Counter_Value_Get(UINT8 slot, UINT8 start, UINT8 count, UINT32 *buf, struct Timestamp *time)
MX_RTU_CanSlaveSDORegister
CAN_ERR_CODE MX_RTU_CanSlaveSDORegister(int handle, UINT16 index, UINT8 subIndex, UINT8 *tagName)
CAN_NMT_ERROR_STATUS
CAN_NMT_ERROR_STATUS
Definition: libmoxa_rtu.h:3549
MX_RTU_Module_DIO_Map_Set
MODULE_RW_ERR_CODE MX_RTU_Module_DIO_Map_Set(UINT8 slot, UINT32 map)
CAN_ERR_OK
Definition: libmoxa_rtu.h:3499
AI_TRANSFORM_ERR_ARGUMENT
Definition: libmoxa_rtu.h:192
MODULE_RW_ERR_COMMUNICATION_MODULE_REQUEST
Definition: libmoxa_rtu.h:162
CAN_ERR_SOCKETCAN_INDEX
Definition: libmoxa_rtu.h:3509
MODULE_RW_ERR_OK
Definition: libmoxa_rtu.h:148
IO_ERR_COMMUNICATION_MODULE_REQUEST
Definition: libmoxa_rtu.h:130
MISC_ERR_OK
Definition: libmoxa_rtu.h:2730
MX_RTU_Module_Relay_Value_Set
MODULE_RW_ERR_CODE MX_RTU_Module_Relay_Value_Set(UINT8 slot, UINT32 value)
MX_RTU_Module_DI_Counter_Start_Set
MODULE_RW_ERR_CODE MX_RTU_Module_DI_Counter_Start_Set(UINT8 slot, UINT32 start)
MX_RTU_Modbus_Tcp_Slave_Stop
MODBUS_SLAVE_ERR_CODE MX_RTU_Modbus_Tcp_Slave_Stop(UINT32 sHandle)
TAG_INFO_T::tagId
UINT32 tagId
Definition: libmoxa_rtu.h:4591
MX_RTU_Module_DIO_DI_Frequency_Get
MODULE_RW_ERR_CODE MX_RTU_Module_DIO_DI_Frequency_Get(UINT8 slot, UINT8 start, UINT8 count, float *buf)
MODULE_RW_ERR_VERSION
Definition: libmoxa_rtu.h:155
MISC_ERR_ACTION
Definition: libmoxa_rtu.h:2734
MX_RTU_Module_RTD_Max_Eng_Reset
MODULE_RW_ERR_CODE MX_RTU_Module_RTD_Max_Eng_Reset(UINT8 slot, UINT32 channel_flags)
MODULE_RW_ERR_CODE
MODULE_RW_ERR_CODE
Definition: libmoxa_rtu.h:146
MODULE_RW_ERR_AMOUNT
Definition: libmoxa_rtu.h:184
MX_RTU_AIO_Eng_to_Raw
AIO_TRANSFORM_ERR_CODE MX_RTU_AIO_Eng_to_Raw(UINT32 range, UINT32 bitsResolution, float engValue, int *rawValue)
CAN_NMT_NODE_GUARDING_CONNECTING
Definition: libmoxa_rtu.h:3561
MX_RTU_Module_DIO_DO_SigW_H_Set
MODULE_RW_ERR_CODE MX_RTU_Module_DIO_DO_SigW_H_Set(UINT8 slot, UINT8 start, UINT8 count, UINT32 *buf)
MX_RTU_Module_AI_Min_Eng_Get
MODULE_RW_ERR_CODE MX_RTU_Module_AI_Min_Eng_Get(UINT8 slot, UINT8 start, UINT8 count, float *buf)
IO_Info::dio_channels
UINT8 dio_channels
Definition: libmoxa_rtu.h:209
Gps_Data::time
GPS_TIME time
Definition: libmoxa_rtu.h:3403
Check_Info
Definition: libmoxa_rtu.h:3273
MX_RTU_SerialGetMode
SERIAL_ERR_CODE MX_RTU_SerialGetMode(UINT8 slot, SERIAL_PORT port, UINT8 *mode)
MODEM_ERR_BAND
Definition: libmoxa_rtu.h:3251
IO_Info::relay_channels
UINT8 relay_channels
Definition: libmoxa_rtu.h:217
MX_RTU_Module_TC_Type_Set
MODULE_RW_ERR_CODE MX_RTU_Module_TC_Type_Set(UINT8 slot, UINT8 start, UINT8 count, UINT8 *buf)
MX_RTU_Module_AO_Range_Set
MODULE_RW_ERR_CODE MX_RTU_Module_AO_Range_Set(UINT8 slot, UINT8 start, UINT8 count, UINT8 *buf)
MODBUS_SLAVE_ERR_LISTEN
Definition: libmoxa_rtu.h:4104
CAN_ERR_SOCKET
Definition: libmoxa_rtu.h:3511
UINT32
unsigned long UINT32
Definition: libmoxa_rtu.h:61
MX_RTU_CanGetNMTError
CAN_ERR_CODE MX_RTU_CanGetNMTError(int handle, UINT32 slaveNodeID, CAN_NMT_ERROR_STATUS *status, CAN_NMT_NODE_GUARDING_STATE *nodeGuardingState)
AI_TRANSFORM_ERR_CODE
AI_TRANSFORM_ERR_CODE
Definition: libmoxa_rtu.h:187
Timestamp::day
UINT32 day
Definition: libmoxa_rtu.h:236
MODEM_ERR_PIN
Definition: libmoxa_rtu.h:3250
MODBUS_MASTER_ERR_OPENED
Definition: libmoxa_rtu.h:3738
AOPC_ERR_CREATE_THREAD
Definition: libmoxa_rtu.h:4384
MX_RTU_Module_Relay_PWM_Count_Set
MODULE_RW_ERR_CODE MX_RTU_Module_Relay_PWM_Count_Set(UINT8 slot, UINT8 start, UINT8 count, UINT32 *buf)
MX_RTU_DIO_DI_Event_Get_Trigger
IO_ERR_CODE MX_RTU_DIO_DI_Event_Get_Trigger(int handle, UINT32 *trigger)
Please refer to MX_RTU_DI_Event_Get_Trigger .
MX_RTU_Module_DO_Value_Set
MODULE_RW_ERR_CODE MX_RTU_Module_DO_Value_Set(UINT8 slot, UINT32 value)
Gps_Data::lat
double lat
Definition: libmoxa_rtu.h:3398
AOPC_ERR_FRAME_ERROR
Definition: libmoxa_rtu.h:4389
MX_RTU_Modbus_Tcp_Slave_Unregister
MODBUS_SLAVE_ERR_CODE MX_RTU_Modbus_Tcp_Slave_Unregister(UINT32 sHandle)
SERIAL_ERR_FLUSH
Definition: libmoxa_rtu.h:3052
IO_ERR_TIMEOUT
Definition: libmoxa_rtu.h:132
Module_Info::vendor_id
UINT16 vendor_id
Definition: libmoxa_rtu.h:223
MODULE_RW_ERR_IO_BUF
Definition: libmoxa_rtu.h:177
CAN_ERR_PORT
Definition: libmoxa_rtu.h:3501
TAG_MAX_NAME_SIZE
#define TAG_MAX_NAME_SIZE
Definition: libmoxa_rtu.h:4521
MX_RTU_Module_Fast_AI_Max_Raw_Get
MODULE_RW_ERR_CODE MX_RTU_Module_Fast_AI_Max_Raw_Get(UINT8 slot, UINT8 start, UINT8 count, UINT32 *buf)
CAN_NMT_NODE_GUARDING_PREPARING
Definition: libmoxa_rtu.h:3562
MX_RTU_Modbus_Tcp_Slave_Delete_Entry
MODBUS_SLAVE_ERR_CODE MX_RTU_Modbus_Tcp_Slave_Delete_Entry(UINT32 sHandle, UINT8 map_type, UINT16 address)
CAN_Emcy_Message
Definition: libmoxa_rtu.h:3578
MX_RTU_Module_DIO_DO_Mode_Set
MODULE_RW_ERR_CODE MX_RTU_Module_DIO_DO_Mode_Set(UINT8 slot, UINT8 start, UINT8 count, UINT8 *buf)
MODEM_ERR_SIM
Definition: libmoxa_rtu.h:3249
CAN_Emcy_Message::emergencyErrorCode
UINT16 emergencyErrorCode
Definition: libmoxa_rtu.h:3580
Gps_Time::sec
int sec
Definition: libmoxa_rtu.h:3391
IO_ERR_TYPE
Definition: libmoxa_rtu.h:117
MODULE_RW_ERR_REQUEST_FAIL
Definition: libmoxa_rtu.h:159
MX_RTU_Module_DIO_DO_PWM_Count_Get
MODULE_RW_ERR_CODE MX_RTU_Module_DIO_DO_PWM_Count_Get(UINT8 slot, UINT8 start, UINT8 count, UINT32 *buf)
CheckInfo
struct Check_Info CheckInfo
SMS_ERR_ISP
Definition: libmoxa_rtu.h:3449
MX_RTU_System_BuildDate_Get
UINT32 MX_RTU_System_BuildDate_Get(void)
MX_RTU_Module_Relay_Current_Count_Set
MODULE_RW_ERR_CODE MX_RTU_Module_Relay_Current_Count_Set(UINT8 slot, UINT8 start, UINT8 count, UINT32 *buf)
MISC_ERR_NOT_SUPPORT_PRODUCT
Definition: libmoxa_rtu.h:2739
CAN_ERR_BIND
Definition: libmoxa_rtu.h:3513
MX_RTU_Module_Fast_AI_Sampling_Rate_Set
MODULE_RW_ERR_CODE MX_RTU_Module_Fast_AI_Sampling_Rate_Set(UINT8 slot, UINT32 rate)
INT8
char INT8
Definition: libmoxa_rtu.h:66
CAN_ERR_SLAVE_SDO_REGISTER_FULL
Definition: libmoxa_rtu.h:3531
MX_RTU_Module_Fast_AI_Min_Eng_Reset
MODULE_RW_ERR_CODE MX_RTU_Module_Fast_AI_Min_Eng_Reset(UINT8 slot, UINT32 channel)
AOPC_ERR_TIMEOUT
Definition: libmoxa_rtu.h:4382
MX_RTU_AI_Event_Reset
IO_ERR_CODE MX_RTU_AI_Event_Reset(void)
MX_RTU_DI_Event_Count
IO_ERR_CODE MX_RTU_DI_Event_Count(int handle, UINT32 *count)
MODBUS_SLAVE_ERR_CODE
MODBUS_SLAVE_ERR_CODE
Definition: libmoxa_rtu.h:4090
MX_RTU_Toggle_Switch_Get
MISC_ERR_CODE MX_RTU_Toggle_Switch_Get(UINT8 *state)
MX_RTU_Module_DIO_DO_Value_Get
MODULE_RW_ERR_CODE MX_RTU_Module_DIO_DO_Value_Get(UINT8 slot, UINT32 *value)
MODBUS_MASTER_ERR_UART_CLOSE
Definition: libmoxa_rtu.h:3741
AOPC_ERR_CLOSE
Definition: libmoxa_rtu.h:4391
MX_RTU_Module_AO_Range_Get
MODULE_RW_ERR_CODE MX_RTU_Module_AO_Range_Get(UINT8 slot, UINT8 start, UINT8 count, UINT8 *buf)
CAN_NMT_NODE_GUARDING_STOPPED
Definition: libmoxa_rtu.h:3563
MX_RTU_Module_DO_Diagnostic_Status_Get
MODULE_RW_ERR_CODE MX_RTU_Module_DO_Diagnostic_Status_Get(UINT8 slot, UINT8 start, UINT8 count, UINT8 *buf)
MX_RTU_CanGetBaudrate
CAN_ERR_CODE MX_RTU_CanGetBaudrate(UINT8 slot, UINT8 port, UINT32 *baudrate)
MX_RTU_FRAM_Read
IO_ERR_CODE MX_RTU_FRAM_Read(UINT32 start_address, UINT32 length, UINT8 *buf)
IO_ERR_FAST_AI_NO_BUF
Definition: libmoxa_rtu.h:128
MX_RTU_CanNMTNodeGuarding
CAN_ERR_CODE MX_RTU_CanNMTNodeGuarding(int handle, UINT32 slaveNodeID, UINT16 guardTime, UINT8 lifeTimeFactor)
TagInfo::tagQuality
UINT16 tagQuality
Definition: libmoxa_rtu.h:4371
IO_ERR_CODE
IO_ERR_CODE
Definition: libmoxa_rtu.h:112
MX_RTU_RTD_Event_Unregister
IO_ERR_CODE MX_RTU_RTD_Event_Unregister(int handle)
MX_RTU_Cellular_Modem_Init
MODEM_ERR_CODE MX_RTU_Cellular_Modem_Init(INT8 *pin, UINT32 band)
MX_RTU_Dual_Power2_Get
MISC_ERR_CODE MX_RTU_Dual_Power2_Get(UINT8 *state)
MX_RTU_Module_TC_Unit_Set
MODULE_RW_ERR_CODE MX_RTU_Module_TC_Unit_Set(UINT8 slot, UINT8 start, UINT8 count, UINT8 *buf)
PORT6
Definition: libmoxa_rtu.h:3029
MX_RTU_Module_DIO_DO_PWM_Start_Set
MODULE_RW_ERR_CODE MX_RTU_Module_DIO_DO_PWM_Start_Set(UINT8 slot, UINT32 start)
MX_RTU_Modbus_Rtu_Master_Write_Coils
MODBUS_MASTER_ERR_CODE MX_RTU_Modbus_Rtu_Master_Write_Coils(UINT8 slot, SERIAL_PORT port, UINT8 unitId, UINT16 startAddr, UINT16 coilCount, UINT8 byteCoils[], UINT32 timeoutMs, UINT8 *exceptionCode)
IO_Info
Definition: libmoxa_rtu.h:206
PORT3
Definition: libmoxa_rtu.h:3026
CAN_NMT_HEARTBEAT_STATE
CAN_NMT_HEARTBEAT_STATE
Definition: libmoxa_rtu.h:3569
CAN_ERR_READ
Definition: libmoxa_rtu.h:3518
CAN_ERR_SLOT
Definition: libmoxa_rtu.h:3500
MX_RTU_AOPC_Uninit
void MX_RTU_AOPC_Uninit(void)
This API must be called at the end.
MX_RTU_Module_TC_Min_Eng_Reset
MODULE_RW_ERR_CODE MX_RTU_Module_TC_Min_Eng_Reset(UINT8 slot, UINT32 channel_flags)
AOPC_ERR_SOCKET
Definition: libmoxa_rtu.h:4381
MX_RTU_Module_AO_Waveform_Start_Set
MODULE_RW_ERR_CODE MX_RTU_Module_AO_Waveform_Start_Set(UINT8 slot, UINT32 start)
MX_RTU_Module_Fast_AI_Trigger_Stop_Set
MODULE_RW_ERR_CODE MX_RTU_Module_Fast_AI_Trigger_Stop_Set(UINT8 slot, UINT32 channel_trigger, struct Timestamp *time)
MODULE_RW_ERR_TIMESTAMP_NOT_SYNC
Definition: libmoxa_rtu.h:166
MX_RTU_Module_DIO_DI_Filter_Get
MODULE_RW_ERR_CODE MX_RTU_Module_DIO_DI_Filter_Get(UINT8 slot, UINT8 start, UINT8 count, UINT32 *buf)
MX_RTU_Module_DI_Filter_Get
MODULE_RW_ERR_CODE MX_RTU_Module_DI_Filter_Get(UINT8 slot, UINT8 start, UINT8 count, UINT32 *buf)
MX_RTU_AOPC_AddTag
AOPC_ERR_CODE MX_RTU_AOPC_AddTag(UINT32 sHandle, TAG *tagInfo, struct Timestamp *tagTime, UINT32 timeoutMs)
MX_RTU_AI_Event_Count
IO_ERR_CODE MX_RTU_AI_Event_Count(int handle, UINT32 *count)
MODEM_ERR_QUERY_REG
Definition: libmoxa_rtu.h:3269
SMS_ERR_PDU
Definition: libmoxa_rtu.h:3444
TTY_PARAM::stopbit
INT32 stopbit
Definition: libmoxa_rtu.h:3798
Check_Info::autoCheckEnable
UINT8 autoCheckEnable
Definition: libmoxa_rtu.h:3275
AIO_TRANSFORM_ERR_ARGUMENT
Definition: libmoxa_rtu.h:202
MODBUS_SLAVE_ERR_BIND
Definition: libmoxa_rtu.h:4095
MX_RTU_Module_AO_Waveform_Config_Get
MODULE_RW_ERR_CODE MX_RTU_Module_AO_Waveform_Config_Get(UINT8 slot, UINT8 start, UINT8 count, float *frequency, float *amplitude, float *offset)
MX_RTU_Module_DIO_DO_Mode_Get
MODULE_RW_ERR_CODE MX_RTU_Module_DIO_DO_Mode_Get(UINT8 slot, UINT8 start, UINT8 count, UINT8 *buf)
CAN_ERR_SLAVE_PDO_REGISTER_FULL
Definition: libmoxa_rtu.h:3533
MX_RTU_Modbus_Tcp_Master_Open
MODBUS_MASTER_ERR_CODE MX_RTU_Modbus_Tcp_Master_Open(UINT8 ipAddress[], UINT16 tcpPort, UINT32 cTimeoutMs, UINT32 *sHandle)
MODBUS_SLAVE_ERR_MEMORY_LEAK
Definition: libmoxa_rtu.h:4108
MX_RTU_SerialWrite
SERIAL_ERR_CODE MX_RTU_SerialWrite(UINT8 slot, SERIAL_PORT port, UINT32 len, UINT8 *str, UINT32 *write_bytes)
CAN_NMT_HEARTBEAT_STOPPED
Definition: libmoxa_rtu.h:3572
MX_RTU_DIO_DI_Event_Unregister
IO_ERR_CODE MX_RTU_DIO_DI_Event_Unregister(int handle)
Please refer to MX_RTU_DI_Event_Unregister .
MODULE_RW_ERR_TIMESTAMP
Definition: libmoxa_rtu.h:165
AOPC_ERR_OK
Definition: libmoxa_rtu.h:4378
Gps_Data::lon
double lon
Definition: libmoxa_rtu.h:3399
MX_RTU_Module_DIO_DO_PWM_Config_Set
MODULE_RW_ERR_CODE MX_RTU_Module_DIO_DO_PWM_Config_Set(UINT8 slot, UINT8 start, UINT8 count, float *frequency, float *dutyCycle)
MX_RTU_SerialFlowControl
SERIAL_ERR_CODE MX_RTU_SerialFlowControl(UINT8 slot, SERIAL_PORT port, UINT8 control)
CAN_NODE_RESET_COMMUNICATION
Definition: libmoxa_rtu.h:3545
AIO_TRANSFORM_ERR_AMOUNT
Definition: libmoxa_rtu.h:203
IO_ERR_ACTION
Definition: libmoxa_rtu.h:124
SERIAL_ERR_ttyUSB
Definition: libmoxa_rtu.h:3048
MX_RTU_Ethernet_Adapter_Type_Get
IO_ERR_CODE MX_RTU_Ethernet_Adapter_Type_Get(UINT32 *type)
MODBUS_SLAVE_ERR_NO_START
Definition: libmoxa_rtu.h:4109
MX_RTU_Module_RTD_Offset_Set
MODULE_RW_ERR_CODE MX_RTU_Module_RTD_Offset_Set(UINT8 slot, UINT8 start, UINT8 count, float *buf)
MODULE_RW_ERR_IO_FAST_AI_NOT_READY
Definition: libmoxa_rtu.h:180
MODBUS_SLAVE_ERR_OK
Definition: libmoxa_rtu.h:4092
MX_RTU_LED2_Set
MISC_ERR_CODE MX_RTU_LED2_Set(UINT8 state)
MX_RTU_Module_AO_Waveform_Config_Set
MODULE_RW_ERR_CODE MX_RTU_Module_AO_Waveform_Config_Set(UINT8 slot, UINT8 start, UINT8 count, float *frequency, float *amplitude, float *offset)
MX_RTU_Module_DIO_DI_Mode_Get
MODULE_RW_ERR_CODE MX_RTU_Module_DIO_DI_Mode_Get(UINT8 slot, UINT8 start, UINT8 count, UINT8 *buf)
MX_RTU_Module_DIO_DI_Frequency_Measurement_Time_Get
MODULE_RW_ERR_CODE MX_RTU_Module_DIO_DI_Frequency_Measurement_Time_Get(UINT8 slot, UINT8 start, UINT8 count, UINT32 *buf)
TAG_EVENT_CONDITION_T::threshold
float threshold
Definition: libmoxa_rtu.h:4599
MX_RTU_Module_DI_Frequency_Start_Set
MODULE_RW_ERR_CODE MX_RTU_Module_DI_Frequency_Start_Set(UINT8 slot, UINT32 start)
TAG_ERR_AGAIN
Definition: libmoxa_rtu.h:4562
MX_RTU_Module_RTD_Max_Eng_Get
MODULE_RW_ERR_CODE MX_RTU_Module_RTD_Max_Eng_Get(UINT8 slot, UINT8 start, UINT8 count, float *buf)
MODULE_RW_ERR_PACKET
Definition: libmoxa_rtu.h:157
CAN_ERR_NO_DATA_RECEIVE
Definition: libmoxa_rtu.h:3526
MODULE_RW_ERR_IO_MODE
Definition: libmoxa_rtu.h:170
AOPC_ERR_INTR
Definition: libmoxa_rtu.h:4387
MODBUS_SLAVE_ERR_PORT_LISTENING
Definition: libmoxa_rtu.h:4111
MODULE_RW_ERR_IO_FPGA
Definition: libmoxa_rtu.h:183
MX_RTU_SWTD_Get_Setting
MISC_ERR_CODE MX_RTU_SWTD_Get_Setting(struct swtd_setting *setting)
TAG_ERR_OK
Definition: libmoxa_rtu.h:4552
MX_RTU_Total_Slots_Get
IO_ERR_CODE MX_RTU_Total_Slots_Get(UINT32 *num)
MISC_ERR_TYPE
Definition: libmoxa_rtu.h:2736
MX_RTU_Module_DI_Debouncing_Enable_Set
MODULE_RW_ERR_CODE MX_RTU_Module_DI_Debouncing_Enable_Set(UINT8 slot, UINT32 enable)
IO_ERR_MODULE_INFO
Definition: libmoxa_rtu.h:134
swtd_setting::enable
int enable
Definition: libmoxa_rtu.h:2749
MX_RTU_DIO_DI_Event_Set_Trigger
IO_ERR_CODE MX_RTU_DIO_DI_Event_Set_Trigger(int handle, UINT32 trigger)
Please refer to MX_RTU_DI_Event_Set_Trigger .
MODBUS_MASTER_ERR_EXCEPTION
Definition: libmoxa_rtu.h:3753
MX_RTU_Module_AO_Eng_Value_Get
MODULE_RW_ERR_CODE MX_RTU_Module_AO_Eng_Value_Get(UINT8 slot, UINT8 start, UINT8 count, float *buf)
AOPC_ERR_NOT_SUPPORT
Definition: libmoxa_rtu.h:4397
MX_RTU_CanNMTSetState
CAN_ERR_CODE MX_RTU_CanNMTSetState(int handle, UINT32 slaveNodeID, CAN_NODE_STATE state)
MX_RTU_Modbus_Rtu_Master_Read_Input_Regs
MODBUS_MASTER_ERR_CODE MX_RTU_Modbus_Rtu_Master_Read_Input_Regs(UINT8 slot, SERIAL_PORT port, UINT8 unitId, UINT16 startAddr, UINT16 regCount, UINT16 regs[], UINT32 timeoutMs, UINT8 *exceptionCode)
MX_RTU_SerialSetParam
SERIAL_ERR_CODE MX_RTU_SerialSetParam(UINT8 slot, SERIAL_PORT port, UINT8 parity, UINT8 databits, UINT8 stopbit)
MX_RTU_CanSlaveStartListening
CAN_ERR_CODE MX_RTU_CanSlaveStartListening(int handle)
Gps_Data
Definition: libmoxa_rtu.h:3395
CAN_NODE_STOP
Definition: libmoxa_rtu.h:3542
CAN_ERR_IOCTL
Definition: libmoxa_rtu.h:3512
MISC_ERR_SEMAPHORE_LOCK
Definition: libmoxa_rtu.h:2737
MX_RTU_Module_AI_Max_Raw_Get
MODULE_RW_ERR_CODE MX_RTU_Module_AI_Max_Raw_Get(UINT8 slot, UINT8 start, UINT8 count, UINT32 *buf)
TAG_ERR_EVENT_INIT
Definition: libmoxa_rtu.h:4568
MX_RTU_RTD_Event_Get_Value
IO_ERR_CODE MX_RTU_RTD_Event_Get_Value(int handle, float *value, UINT32 *condition)
MISC_ERR_RW
Definition: libmoxa_rtu.h:2733
MX_RTU_CanOpen
CAN_ERR_CODE MX_RTU_CanOpen(UINT8 slot, UINT8 port, int *handle)
MODULE_RW_ERR_NO_EXTERNAL_POWER
Definition: libmoxa_rtu.h:182
MX_RTU_AI_Event_Register
IO_ERR_CODE MX_RTU_AI_Event_Register(UINT8 slot, UINT8 channel, float value, UINT32 condition, int *handle)
MX_RTU_Module_DI_Counter_Overflow_Get
MODULE_RW_ERR_CODE MX_RTU_Module_DI_Counter_Overflow_Get(UINT8 slot, UINT32 *overflow)
MX_RTU_Module_Fast_AI_Eng_Value_Get
MODULE_RW_ERR_CODE MX_RTU_Module_Fast_AI_Eng_Value_Get(UINT8 slot, UINT8 start, UINT8 count, float *buf, struct Timestamp *time)
MX_RTU_Module_DIO_DO_SigW_L_Set
MODULE_RW_ERR_CODE MX_RTU_Module_DIO_DO_SigW_L_Set(UINT8 slot, UINT8 start, UINT8 count, UINT32 *buf)
AOPC_ERR_FRAME_PENDING
Definition: libmoxa_rtu.h:4388
TAG
struct TagInfo TAG
MX_RTU_Module_AI_Range_Set
MODULE_RW_ERR_CODE MX_RTU_Module_AI_Range_Set(UINT8 slot, UINT8 start, UINT8 count, UINT8 *buf)
MODBUS_MASTER_ERR_PORT
Definition: libmoxa_rtu.h:3737
MX_RTU_Module_AO_Enable_Set
MODULE_RW_ERR_CODE MX_RTU_Module_AO_Enable_Set(UINT8 slot, UINT8 start, UINT8 count, UINT8 *buf)
MX_RTU_RTC_Set
MISC_ERR_CODE MX_RTU_RTC_Set(struct rtc_time *rtc)
MX_RTU_Module_Fast_AI_Buf_Overflow_Get
MODULE_RW_ERR_CODE MX_RTU_Module_Fast_AI_Buf_Overflow_Get(UINT8 slot, UINT32 *overflow)
MX_RTU_SRAM_Read
IO_ERR_CODE MX_RTU_SRAM_Read(UINT32 start_address, UINT32 length, UINT8 *buf)
MODEM_ERR_CELLULAR_DENIED
Definition: libmoxa_rtu.h:3253
SMS_ERR_LENGTH
Definition: libmoxa_rtu.h:3446
MX_RTU_Module_DI_Debouncing_Enable_Get
MODULE_RW_ERR_CODE MX_RTU_Module_DI_Debouncing_Enable_Get(UINT8 slot, UINT32 *enable)
MX_RTU_AI_Raw_to_Eng_4_20mA
void MX_RTU_AI_Raw_to_Eng_4_20mA(int rawValue, float *engValue)
MODULE_RW_ERR_IO_FAST_AI_BUF_OVERFLOW
Definition: libmoxa_rtu.h:179
MX_RTU_Module_DI_Debouncing_Time_Set
MODULE_RW_ERR_CODE MX_RTU_Module_DI_Debouncing_Time_Set(UINT8 slot, UINT8 start, UINT8 count, float *buf)
MODULE_RW_ERR_IO_CALIBRATION
Definition: libmoxa_rtu.h:176
MX_RTU_Module_RTD_Min_Eng_Get
MODULE_RW_ERR_CODE MX_RTU_Module_RTD_Min_Eng_Get(UINT8 slot, UINT8 start, UINT8 count, float *buf)
MX_RTU_TC_Event_Register
IO_ERR_CODE MX_RTU_TC_Event_Register(UINT8 slot, UINT8 channel, float value, UINT32 condition, int *handle)
MX_RTU_Modbus_Tcp_Master_Read_Input_Regs
MODBUS_MASTER_ERR_CODE MX_RTU_Modbus_Tcp_Master_Read_Input_Regs(UINT32 sHandle, UINT16 startAddr, UINT16 regCount, UINT16 regs[], UINT8 *exceptionCode)
MODBUS_SLAVE_ERR_MAP_TYPE
Definition: libmoxa_rtu.h:4106
PORT2
Definition: libmoxa_rtu.h:3025
MX_RTU_Cellular_Net_Stop
MODEM_ERR_CODE MX_RTU_Cellular_Net_Stop(void)
MX_RTU_Module_TC_Calibration_Set
MODULE_RW_ERR_CODE MX_RTU_Module_TC_Calibration_Set(UINT8 slot, UINT8 start, UINT8 count, float *buf)
MODULE_RW_ERR_IO_PWM
Definition: libmoxa_rtu.h:174
MODULE_RW_ERR_ARGUMENT
Definition: libmoxa_rtu.h:152
Timestamp
Definition: libmoxa_rtu.h:231
MX_RTU_Module_DIO_DI_Counter_Value_Get
MODULE_RW_ERR_CODE MX_RTU_Module_DIO_DI_Counter_Value_Get(UINT8 slot, UINT8 start, UINT8 count, UINT32 *buf, struct Timestamp *time)
AIO_TRANSFORM_ERR_OK
Definition: libmoxa_rtu.h:198
CAN_NODE_RESET_NODE
Definition: libmoxa_rtu.h:3544
MODBUS_SLAVE_ERR_SYSTEM_TIMEOUT
Definition: libmoxa_rtu.h:4114
AI_TRANSFORM_ERR_AMOUNT
Definition: libmoxa_rtu.h:193
MX_RTU_AOPC_UpdateValue
AOPC_ERR_CODE MX_RTU_AOPC_UpdateValue(UINT32 sHandle, UINT8 *tagName, void *tagValue, struct Timestamp *tagTime, UINT32 timeoutMs)
MX_RTU_DIO_DI_Event_Register
IO_ERR_CODE MX_RTU_DIO_DI_Event_Register(UINT8 slot, UINT8 channel, UINT32 trigger, int *handle)
Please refer to MX_RTU_DI_Event_Register .
SMS_ERR_NOT_SUPPORT_PRODUCT
Definition: libmoxa_rtu.h:3448
IO_ERR_COPY
Definition: libmoxa_rtu.h:119
PORT4
Definition: libmoxa_rtu.h:3027
MX_RTU_Module_DI_Counter_Trigger_Set
MODULE_RW_ERR_CODE MX_RTU_Module_DI_Counter_Trigger_Set(UINT8 slot, UINT8 start, UINT8 count, UINT8 *buf)
MX_RTU_Module_Relay_SigW_H_Set
MODULE_RW_ERR_CODE MX_RTU_Module_Relay_SigW_H_Set(UINT8 slot, UINT8 start, UINT8 count, UINT32 *buf)
MX_RTU_Modbus_Rtu_Slave_Unregister
MODBUS_SLAVE_ERR_CODE MX_RTU_Modbus_Rtu_Slave_Unregister(UINT32 handle)
Gps_Time::min
int min
Definition: libmoxa_rtu.h:3390
MX_RTU_Module_TC_Unit_Get
MODULE_RW_ERR_CODE MX_RTU_Module_TC_Unit_Get(UINT8 slot, UINT8 start, UINT8 count, UINT8 *buf)
MODBUS_SLAVE_ERR_ADDRESS_COLLISION
Definition: libmoxa_rtu.h:4094
__attribute__
typedef __attribute__
CAN_ERR_NEITHER_NODEGUARDING_NOR_HEARTBEAT
Definition: libmoxa_rtu.h:3521
MX_RTU_Module_DIO_DI_Counter_Trigger_Set
MODULE_RW_ERR_CODE MX_RTU_Module_DIO_DI_Counter_Trigger_Set(UINT8 slot, UINT8 start, UINT8 count, UINT8 *buf)
TAG_ERR_NOT_SUPPORT
Definition: libmoxa_rtu.h:4567
CAN_ERR_SOCKETCAN_INIT
Definition: libmoxa_rtu.h:3510
MX_RTU_Module_Fast_AI_Max_Eng_Get
MODULE_RW_ERR_CODE MX_RTU_Module_Fast_AI_Max_Eng_Get(UINT8 slot, UINT8 start, UINT8 count, float *buf)
IO_ERR_DEVICE
Definition: libmoxa_rtu.h:115
MX_RTU_Module_DI_Filter_Set
MODULE_RW_ERR_CODE MX_RTU_Module_DI_Filter_Set(UINT8 slot, UINT8 start, UINT8 count, UINT32 *buf)
MX_RTU_Module_AI_Max_Eng_Reset
MODULE_RW_ERR_CODE MX_RTU_Module_AI_Max_Eng_Reset(UINT8 slot, UINT32 channel)
MX_RTU_Modbus_Rtu_Slave_Uninit
MODBUS_SLAVE_ERR_CODE MX_RTU_Modbus_Rtu_Slave_Uninit()
This API must be called at the end.
MX_RTU_Module_DIO_DI_Counter_Overflow_Get
MODULE_RW_ERR_CODE MX_RTU_Module_DIO_DI_Counter_Overflow_Get(UINT8 slot, UINT32 *overflow)
MX_RTU_DI_Event_Unregister
IO_ERR_CODE MX_RTU_DI_Event_Unregister(int handle)
MODBUS_SLAVE_ERR_EXCEPTION
Definition: libmoxa_rtu.h:4098
MX_RTU_Module_DI_Frequency_Start_Get
MODULE_RW_ERR_CODE MX_RTU_Module_DI_Frequency_Start_Get(UINT8 slot, UINT32 *start)
TAG_ERR_IO
Definition: libmoxa_rtu.h:4563
MX_RTU_CanPDORemote
CAN_ERR_CODE MX_RTU_CanPDORemote(int handle, UINT8 pdoNumber, UINT32 slaveNodeID, UINT8 *rData, UINT32 *rLen)
CAN_ERR_SLAVE_NODE_ID
Definition: libmoxa_rtu.h:3519
MX_RTU_RTD_Event_Count
IO_ERR_CODE MX_RTU_RTD_Event_Count(int handle, UINT32 *count)
CAN_NMT_HEARTBEAT_AMOUNT
Definition: libmoxa_rtu.h:3575
MX_RTU_Module_DI_Frequency_Measurement_Time_Set
MODULE_RW_ERR_CODE MX_RTU_Module_DI_Frequency_Measurement_Time_Set(UINT8 slot, UINT8 start, UINT8 count, UINT32 *buf)
MX_RTU_Tag_Event_Get
TAG_ERR_CODE MX_RTU_Tag_Event_Get(int handle, void *tagValue, struct Timestamp *time)
MODULE_RW_ERR_DEVICE
Definition: libmoxa_rtu.h:149
CAN_NMT_NODE_GUARDING_DISCONNECTED
Definition: libmoxa_rtu.h:3560
MX_RTU_RTD_Event_Reset
IO_ERR_CODE MX_RTU_RTD_Event_Reset(void)
MX_RTU_Modbus_Rtu_Slave_Init
MODBUS_SLAVE_ERR_CODE MX_RTU_Modbus_Rtu_Slave_Init()
This API must be called at first.
MX_RTU_Module_Fast_AI_Range_Get
MODULE_RW_ERR_CODE MX_RTU_Module_Fast_AI_Range_Get(UINT8 slot, UINT8 start, UINT8 count, UINT8 *buf)
MX_RTU_Module_DIO_DI_Counter_Trigger_Get
MODULE_RW_ERR_CODE MX_RTU_Module_DIO_DI_Counter_Trigger_Get(UINT8 slot, UINT8 start, UINT8 count, UINT8 *buf)
MX_RTU_Module_DIO_DI_Value_Get
MODULE_RW_ERR_CODE MX_RTU_Module_DIO_DI_Value_Get(UINT8 slot, UINT32 *value, struct Timestamp *time)
MX_RTU_Modbus_Tcp_Slave_Add_Entry
MODBUS_SLAVE_ERR_CODE MX_RTU_Modbus_Tcp_Slave_Add_Entry(UINT32 sHandle, UINT8 map_type, UINT16 address, void *pUserData, pfnModbusRead, pfnModbusWrite)
MX_RTU_Module_DI_Mode_Get
MODULE_RW_ERR_CODE MX_RTU_Module_DI_Mode_Get(UINT8 slot, UINT8 start, UINT8 count, UINT8 *buf)
TagInfo::tagValueType
UINT16 tagValueType
Definition: libmoxa_rtu.h:4370
STATUS_FAIL
Definition: libmoxa_rtu.h:4583
MX_RTU_CanSlaveStopListening
CAN_ERR_CODE MX_RTU_CanSlaveStopListening(int handle)
MX_RTU_DIO_DI_Event_Clear
IO_ERR_CODE MX_RTU_DIO_DI_Event_Clear(int handle)
Please refer to MX_RTU_DI_Event_Clear .
MX_RTU_Tag_Write
TAG_ERR_CODE MX_RTU_Tag_Write(UINT8 *tagName, void *tagValue, UINT32 tagSize)
Gps_Data::fix
int fix
Definition: libmoxa_rtu.h:3400
MX_RTU_Module_DIO_DO_PWM_Start_Get
MODULE_RW_ERR_CODE MX_RTU_Module_DIO_DO_PWM_Start_Get(UINT8 slot, UINT32 *start)
TagInfo
Definition: libmoxa_rtu.h:4364
SERIAL_ERR_MODE
Definition: libmoxa_rtu.h:3047
TAG_ERR_CODE
TAG_ERR_CODE
Definition: libmoxa_rtu.h:4550
TAG_INFO_T::tagSize
UINT32 tagSize
Definition: libmoxa_rtu.h:4592
MODBUS_SLAVE_ERR_AMOUNT
Definition: libmoxa_rtu.h:4119
MX_RTU_Tag_Get_List
TAG_ERR_CODE MX_RTU_Tag_Get_List(TAG_INFO ***list, UINT32 *quantity)
MX_RTU_CanCyclicPDOSend
CAN_ERR_CODE MX_RTU_CanCyclicPDOSend(int handle, UINT8 pdoNumber, UINT32 slaveNodeID, UINT8 *wData, UINT32 wLen, UINT16 Timer, UINT32 Times)
IO_ERR_CELLULAR_EMERGENCY_OFF
Definition: libmoxa_rtu.h:139
Gps_Data::satInView
int satInView
Definition: libmoxa_rtu.h:3402
MODEM_ERR_NOT_SUPPORT_PRODUCT
Definition: libmoxa_rtu.h:3267
AI_TRANSFORM_ERR_VALUE
Definition: libmoxa_rtu.h:191
MX_RTU_MultiTag_Write
TAG_ERR_CODE MX_RTU_MultiTag_Write(UINT8 *prefixTagName, UINT8 *postfixTagName, UINT16 start, UINT16 count, UINT8 *tagValue)
MODBUS_MASTER_ERR_SOCKET
Definition: libmoxa_rtu.h:3750
MX_RTU_AI_Event_Get
IO_ERR_CODE MX_RTU_AI_Event_Get(int handle, float *value, struct Timestamp *time)
MODBUS_SLAVE_ERR_EXCEED_MAP_SIZE
Definition: libmoxa_rtu.h:4099
MX_RTU_Module_Relay_SigW_L_Set
MODULE_RW_ERR_CODE MX_RTU_Module_Relay_SigW_L_Set(UINT8 slot, UINT8 start, UINT8 count, UINT32 *buf)
IO_Info::fast_ai_channels
UINT8 fast_ai_channels
Definition: libmoxa_rtu.h:211
MODBUS_SLAVE_ERR_NO_REGISTER
Definition: libmoxa_rtu.h:4110
MX_RTU_TC_Event_Reset
IO_ERR_CODE MX_RTU_TC_Event_Reset(void)
MX_RTU_SerialOutputQueueFlush
SERIAL_ERR_CODE MX_RTU_SerialOutputQueueFlush(UINT8 slot, SERIAL_PORT port)
MX_RTU_Module_FWR_BuildDate_Get
MODULE_RW_ERR_CODE MX_RTU_Module_FWR_BuildDate_Get(UINT8 slot, UINT32 *date)
MX_RTU_SerialInputQueueFlush
SERIAL_ERR_CODE MX_RTU_SerialInputQueueFlush(UINT8 slot, SERIAL_PORT port)
MODBUS_MASTER_ERR_CRC
Definition: libmoxa_rtu.h:3748
IO_ERR_POWER
Definition: libmoxa_rtu.h:141
TAG_ERR_INIT
Definition: libmoxa_rtu.h:4553
TAG_ERR_EVENT_SPACE
Definition: libmoxa_rtu.h:4570
MX_RTU_Modbus_Rtu_Master_Open
MODBUS_MASTER_ERR_CODE MX_RTU_Modbus_Rtu_Master_Open(UINT8 slot, SERIAL_PORT port, TTY_PARAM *param)
TAG_INFO_T::dataType
UINT32 dataType
Definition: libmoxa_rtu.h:4593
MODULE_RW_ERR_SYSTEM_INFO
Definition: libmoxa_rtu.h:153
AOPC_ERR_NO_TAG
Definition: libmoxa_rtu.h:4392
MX_RTU_SerialNonBlockRead
SERIAL_ERR_CODE MX_RTU_SerialNonBlockRead(UINT8 slot, SERIAL_PORT port, UINT32 len, UINT8 *buf, UINT32 *read_bytes)
SERIAL_PORT
SERIAL_PORT
Definition: libmoxa_rtu.h:3022
MX_RTU_Module_RTD_Calibration_Set
MODULE_RW_ERR_CODE MX_RTU_Module_RTD_Calibration_Set(UINT8 slot, UINT8 start, UINT8 count, float *buf)
MODBUS_MASTER_ERR_UART_MODE
Definition: libmoxa_rtu.h:3743
MODEM_ERR_TIMEOUT
Definition: libmoxa_rtu.h:3261
TTY_PARAM::flowCtrl
INT32 flowCtrl
Definition: libmoxa_rtu.h:3800
MX_RTU_Modbus_Master_Uninit
void MX_RTU_Modbus_Master_Uninit(void)
This API must be called at the end.
IO_ERR_AMOUNT
Definition: libmoxa_rtu.h:143
MX_RTU_CanSlaveNodeGuardingStateSet
CAN_ERR_CODE MX_RTU_CanSlaveNodeGuardingStateSet(int handle, CAN_NMT_NODE_GUARDING_STATE state)
AIO_TRANSFORM_ERR_VALUE
Definition: libmoxa_rtu.h:201
MX_RTU_Module_DIO_DO_PWM_Stop_Set
MODULE_RW_ERR_CODE MX_RTU_Module_DIO_DO_PWM_Stop_Set(UINT8 slot, UINT32 stop)
MX_RTU_Module_DO_SigW_L_Get
MODULE_RW_ERR_CODE MX_RTU_Module_DO_SigW_L_Get(UINT8 slot, UINT8 start, UINT8 count, UINT32 *buf)
MODBUS_MASTER_ERR_UART_FLOW
Definition: libmoxa_rtu.h:3745
MX_RTU_TC_Event_Unregister
IO_ERR_CODE MX_RTU_TC_Event_Unregister(int handle)
TAG_ERR_MSGQUEUE
Definition: libmoxa_rtu.h:4555
TAG_ERR_REG
Definition: libmoxa_rtu.h:4558
MX_RTU_Modbus_Tcp_Slave_Start
MODBUS_SLAVE_ERR_CODE MX_RTU_Modbus_Tcp_Slave_Start(UINT32 sHandle)
MODEM_ERR_PARAM
Definition: libmoxa_rtu.h:3247
CAN_NMT_HEARTBEAT_BOOTUP
Definition: libmoxa_rtu.h:3571
CAN_NODE_AMOUNT
Definition: libmoxa_rtu.h:3546
SIZE_HOSTNAME
#define SIZE_HOSTNAME
Definition: libmoxa_rtu.h:3219
MX_RTU_CanNMTHeartbeat
CAN_ERR_CODE MX_RTU_CanNMTHeartbeat(int handle, UINT32 slaveNodeID, UINT16 producerTime, UINT16 consumerTime)
CAN_ERR_DATA_LENGTH
Definition: libmoxa_rtu.h:3527
MODBUS_SLAVE_ERR_ILLEGAL_HANDLE
Definition: libmoxa_rtu.h:4101
AOPC_ERR_FAIL
Definition: libmoxa_rtu.h:4399
MX_RTU_Module_Fast_AI_Burnout_Value_Set
MODULE_RW_ERR_CODE MX_RTU_Module_Fast_AI_Burnout_Value_Set(UINT8 slot, UINT8 start, UINT8 count, float *buf)
MX_RTU_CanSlaveEmcyMessageSend
CAN_ERR_CODE MX_RTU_CanSlaveEmcyMessageSend(int handle, struct CAN_Emcy_Message *Msg)
MX_RTU_DI_Event_Reset
IO_ERR_CODE MX_RTU_DI_Event_Reset()
MODULE_RW_ERR_TIMEOUT
Definition: libmoxa_rtu.h:156
MX_RTU_Module_AI_Raw_Value_Get
MODULE_RW_ERR_CODE MX_RTU_Module_AI_Raw_Value_Get(UINT8 slot, UINT8 start, UINT8 count, UINT32 *buf, struct Timestamp *time)
CAN_ERR_TAG
Definition: libmoxa_rtu.h:3528
MX_RTU_Module_TC_Type_Get
MODULE_RW_ERR_CODE MX_RTU_Module_TC_Type_Get(UINT8 slot, UINT8 start, UINT8 count, UINT8 *buf)
MODULE_RW_ERR_INSUFFICIENT_BUFFER
Definition: libmoxa_rtu.h:158
MX_RTU_Module_Relay_Mode_Get
MODULE_RW_ERR_CODE MX_RTU_Module_Relay_Mode_Get(UINT8 slot, UINT8 start, UINT8 count, UINT8 *buf)
MX_RTU_AI_Raw_to_Eng_0_10V
void MX_RTU_AI_Raw_to_Eng_0_10V(int rawValue, float *engValue)
MX_RTU_Module_DIO_DI_Filter_Set
MODULE_RW_ERR_CODE MX_RTU_Module_DIO_DI_Filter_Set(UINT8 slot, UINT8 start, UINT8 count, UINT32 *buf)
CAN_ERR_TTYACM_PORT
Definition: libmoxa_rtu.h:3508
MX_RTU_CanClose
CAN_ERR_CODE MX_RTU_CanClose(int handle)
MODBUS_MASTER_ERR_CONNECT
Definition: libmoxa_rtu.h:3751
MX_RTU_RTD_Event_Clear
IO_ERR_CODE MX_RTU_RTD_Event_Clear(int handle)
AOPC_ERR_CODE
AOPC_ERR_CODE
Definition: libmoxa_rtu.h:4376
MODEM_ERR_SEM
Definition: libmoxa_rtu.h:3264
MODEM_ERR_OPEN
Definition: libmoxa_rtu.h:3248
MODBUS_MASTER_ERR_TIMEOUT
Definition: libmoxa_rtu.h:3749
MX_RTU_AOPC_UpdateMultiValue
AOPC_ERR_CODE MX_RTU_AOPC_UpdateMultiValue(UINT32 sHandle, UINT16 nTags, UINT8 **tagName, void **tagValue, struct Timestamp *tagTime, UINT32 timeoutMs)
MX_RTU_AI_Event_Set_Value
IO_ERR_CODE MX_RTU_AI_Event_Set_Value(int handle, float value, UINT32 condition)
MODEM_ERR_THREAD
Definition: libmoxa_rtu.h:3255
SMS_ERR_AMOUNT
Definition: libmoxa_rtu.h:3450
MX_RTU_Modbus_Tcp_Master_Write_Coil
MODBUS_MASTER_ERR_CODE MX_RTU_Modbus_Tcp_Master_Write_Coil(UINT32 sHandle, UINT16 addr, UINT8 coil, UINT8 *exceptionCode)
Module_Info
Definition: libmoxa_rtu.h:220
MX_RTU_Module_Fast_AI_Raw_Value_Get
MODULE_RW_ERR_CODE MX_RTU_Module_Fast_AI_Raw_Value_Get(UINT8 slot, UINT8 start, UINT8 count, UINT32 *buf, struct Timestamp *time)
Timestamp::sec
UINT32 sec
Definition: libmoxa_rtu.h:233
MODBUS_SLAVE_ERR_IDLE_TIMEOUT
Definition: libmoxa_rtu.h:4102
CAN_ERR_WRITE
Definition: libmoxa_rtu.h:3517
MX_RTU_Module_DO_SigW_H_Set
MODULE_RW_ERR_CODE MX_RTU_Module_DO_SigW_H_Set(UINT8 slot, UINT8 start, UINT8 count, UINT32 *buf)
MX_RTU_Module_Fast_AI_Trigger_Set
MODULE_RW_ERR_CODE MX_RTU_Module_Fast_AI_Trigger_Set(UINT8 slot, UINT32 channel_trigger, UINT32 fore_interval, UINT32 back_interval, UINT32 *required_buf_size)
CAN_ERR_SLAVE_SDO_DUPLICATE_REGISTER
Definition: libmoxa_rtu.h:3532
MISC_ERR_AMOUNT
Definition: libmoxa_rtu.h:2740
MX_RTU_CanPDOSend
CAN_ERR_CODE MX_RTU_CanPDOSend(int handle, UINT8 pdoNumber, UINT32 slaveNodeID, UINT8 *wData, UINT32 wLen)
IO_ERR_UPDATE
Definition: libmoxa_rtu.h:125
AOPC_ERR_USER_WRITE
Definition: libmoxa_rtu.h:4396
MX_RTU_Module_AO_Enable_Get
MODULE_RW_ERR_CODE MX_RTU_Module_AO_Enable_Get(UINT8 slot, UINT8 start, UINT8 count, UINT8 *buf)
MX_RTU_Module_Info_Get
IO_ERR_CODE MX_RTU_Module_Info_Get(UINT8 slot, struct Module_Info *module_info)
MX_RTU_Modbus_Rtu_Slave_Delete_Entry
MODBUS_SLAVE_ERR_CODE MX_RTU_Modbus_Rtu_Slave_Delete_Entry(UINT32 handle, UINT8 map_type, UINT16 address)
MODULE_RW_ERR_BUSY
Definition: libmoxa_rtu.h:161
MODULE_RW_ERR_HOT_PLUG
Definition: libmoxa_rtu.h:164
MX_RTU_Module_DO_Mode_Get
MODULE_RW_ERR_CODE MX_RTU_Module_DO_Mode_Get(UINT8 slot, UINT8 start, UINT8 count, UINT8 *buf)
MODEM_ERR_RESET
Definition: libmoxa_rtu.h:3254
MX_RTU_Module_DI_Frequency_Get
MODULE_RW_ERR_CODE MX_RTU_Module_DI_Frequency_Get(UINT8 slot, UINT8 start, UINT8 count, float *buf)
MX_RTU_Modbus_Tcp_Slave_Connection_Info
MODBUS_SLAVE_ERR_CODE MX_RTU_Modbus_Tcp_Slave_Connection_Info(UINT32 sHandle, struct Modbus_TCP_Master_Connection_Info *connection_info)
AOPC_ERR_NO_WRITE_FUNC
Definition: libmoxa_rtu.h:4394
MX_RTU_Module_Relay_SigW_L_Get
MODULE_RW_ERR_CODE MX_RTU_Module_Relay_SigW_L_Get(UINT8 slot, UINT8 start, UINT8 count, UINT32 *buf)
MX_RTU_SerialDataInOutputQueue
SERIAL_ERR_CODE MX_RTU_SerialDataInOutputQueue(UINT8 slot, SERIAL_PORT port, UINT32 *bytes)
Module_Info::fw_version
UINT16 fw_version
Definition: libmoxa_rtu.h:227
Timestamp::hour
UINT32 hour
Definition: libmoxa_rtu.h:235
CAN_ERR_RW_TIMEOUT
Definition: libmoxa_rtu.h:3523
MX_RTU_Tag_Uninit
TAG_ERR_CODE MX_RTU_Tag_Uninit(void)
This API must be called at the end.
MX_RTU_DI_Event_Get
IO_ERR_CODE MX_RTU_DI_Event_Get(int handle, UINT32 *status, struct Timestamp *time)
Timestamp::year
UINT32 year
Definition: libmoxa_rtu.h:238
AOPC_ERR_NO_QUEUE
Definition: libmoxa_rtu.h:4386
MX_RTU_Modbus_Rtu_Master_Read_Discrete_Inputs
MODBUS_MASTER_ERR_CODE MX_RTU_Modbus_Rtu_Master_Read_Discrete_Inputs(UINT8 slot, SERIAL_PORT port, UINT8 unitId, UINT16 startAddr, UINT16 coilCount, UINT8 byteCoils[], UINT32 timeoutMs, UINT8 *exceptionCode)
MODEM_ERR_AMOUNT
Definition: libmoxa_rtu.h:3270
CAN_NMT_NODE_GUARDING_INITIALISING
Definition: libmoxa_rtu.h:3559
PORT8
Definition: libmoxa_rtu.h:3031
MX_RTU_Cellular_Modem_Reset
MODEM_ERR_CODE MX_RTU_Cellular_Modem_Reset(void)
MX_RTU_Module_DO_SigW_L_Set
MODULE_RW_ERR_CODE MX_RTU_Module_DO_SigW_L_Set(UINT8 slot, UINT8 start, UINT8 count, UINT32 *buf)
MODEM_ERR_INIT
Definition: libmoxa_rtu.h:3246
CAN_ERR_SLAVE_IS_NOT_LISTENING
Definition: libmoxa_rtu.h:3530
MODBUS_MASTER_ERR_RESP
Definition: libmoxa_rtu.h:3747
MX_RTU_Modbus_Tcp_Master_Read_Coils
MODBUS_MASTER_ERR_CODE MX_RTU_Modbus_Tcp_Master_Read_Coils(UINT32 sHandle, UINT16 startAddr, UINT16 coilCount, UINT8 byteCoils[], UINT8 *exceptionCode)
INT32
long INT32
Definition: libmoxa_rtu.h:62
Modbus_TCP_Master_Connection_Info
Definition: libmoxa_rtu.h:4134
SERIAL_ERR_READ
Definition: libmoxa_rtu.h:3044
AIO_TRANSFORM_ERR_RANGE
Definition: libmoxa_rtu.h:199
Module_Info::unit_id
UINT8 unit_id
Definition: libmoxa_rtu.h:222
IO_ERR_ITEM
Definition: libmoxa_rtu.h:118
MX_RTU_CanGetAccCode
CAN_ERR_CODE MX_RTU_CanGetAccCode(UINT8 slot, UINT8 port, UINT32 *accCode)
MX_RTU_Dual_Power1_Get
MISC_ERR_CODE MX_RTU_Dual_Power1_Get(UINT8 *state)
MX_RTU_Module_AO_Waveform_Start_Get
MODULE_RW_ERR_CODE MX_RTU_Module_AO_Waveform_Start_Get(UINT8 slot, UINT32 *start)
CAN_NMT_NODE_GUARDING_PREOPERATIONAL
Definition: libmoxa_rtu.h:3565
STATUS_ERR_AMOUNT
Definition: libmoxa_rtu.h:4584
TAG_EVENT_CONDITION_T::condition
UINT32 condition
Definition: libmoxa_rtu.h:4598
MX_RTU_CanGetAccMask
CAN_ERR_CODE MX_RTU_CanGetAccMask(UINT8 slot, UINT8 port, UINT32 *accMask)
MX_RTU_Module_Fast_AI_Buf_Overflow_Reset
MODULE_RW_ERR_CODE MX_RTU_Module_Fast_AI_Buf_Overflow_Reset(UINT8 slot, UINT32 overflow)
SERIAL_ERR_CLOSE
Definition: libmoxa_rtu.h:3040
CAN_ERR_NMT_NODE_STATE
Definition: libmoxa_rtu.h:3514
AOPC_ERR_INVALID_ATTR
Definition: libmoxa_rtu.h:4401
MX_RTU_RTC_Get
MISC_ERR_CODE MX_RTU_RTC_Get(struct rtc_time *rtc)
UINT8
unsigned char UINT8
Definition: libmoxa_rtu.h:65
MODBUS_SLAVE_ERR_NO_CONNECTIONS
Definition: libmoxa_rtu.h:4117
Gps_Time::mon
int mon
Definition: libmoxa_rtu.h:3387
pfnModbusWrite
#define pfnModbusWrite
Definition: libmoxa_rtu.h:4033
MX_RTU_GPS_Stop
INT32 MX_RTU_GPS_Stop(void)
AOPC_ERR_NOT_REGISTERED
Definition: libmoxa_rtu.h:4400
Module_Info::slot
UINT8 slot
Definition: libmoxa_rtu.h:221
MODBUS_MASTER_ERR_OK
Definition: libmoxa_rtu.h:3735
MX_RTU_DI_Event_Register
IO_ERR_CODE MX_RTU_DI_Event_Register(UINT8 slot, UINT8 channel, UINT32 trigger, int *handle)
MX_RTU_AI_Event_Get_Value
IO_ERR_CODE MX_RTU_AI_Event_Get_Value(int handle, float *value, UINT32 *condition)
MX_RTU_Tag_Event_Register
TAG_ERR_CODE MX_RTU_Tag_Event_Register(UINT8 *tagName, TAG_EVENT_CONDITION *condition, int *handle)
IO_ERR_IO_EVENT_QUEUE_EMPTY
Definition: libmoxa_rtu.h:137
MODULE_RW_ERR_IO_SIG_WIDTH
Definition: libmoxa_rtu.h:173
TAG_ERR_MSGQUEUE_FULL
Definition: libmoxa_rtu.h:4566
MX_RTU_CanGetAllEmcyMessage
CAN_ERR_CODE MX_RTU_CanGetAllEmcyMessage(int handle, UINT32 slaveNodeID, struct CAN_Emcy_Message *Msg, UINT32 *nMsg)
swtd_setting
Definition: libmoxa_rtu.h:2747
MX_RTU_Module_RTD_Type_Get
MODULE_RW_ERR_CODE MX_RTU_Module_RTD_Type_Get(UINT8 slot, UINT8 start, UINT8 count, UINT8 *buf)
MX_RTU_Module_RTD_Eng_Value_Get
MODULE_RW_ERR_CODE MX_RTU_Module_RTD_Eng_Value_Get(UINT8 slot, UINT8 start, UINT8 count, float *buf, struct Timestamp *time)
MX_RTU_FindFD
SERIAL_ERR_CODE MX_RTU_FindFD(UINT8 slot, SERIAL_PORT port, INT32 *fd)
CAN_ERR_EITHER_NODEGUARDING_OR_HEARTBEAT
Definition: libmoxa_rtu.h:3520
TAG_ERR_EVENT_HANDLE
Definition: libmoxa_rtu.h:4571
MX_RTU_Module_Fast_AI_Batch_Data_Get
MODULE_RW_ERR_CODE MX_RTU_Module_Fast_AI_Batch_Data_Get(UINT8 slot, UINT32 channel, UINT32 fore_interval, UINT32 back_interval, UINT8 *buf, struct Timestamp *time)
MX_RTU_RTD_Event_Set_Value
IO_ERR_CODE MX_RTU_RTD_Event_Set_Value(int handle, float value, UINT32 condition)
MODULE_RW_ERR_IO_TRIGGER
Definition: libmoxa_rtu.h:172
MX_RTU_Module_Fast_AI_Burnout_Value_Get
MODULE_RW_ERR_CODE MX_RTU_Module_Fast_AI_Burnout_Value_Get(UINT8 slot, UINT8 start, UINT8 count, float *buf)
Timestamp::msec
UINT32 msec
Definition: libmoxa_rtu.h:232
AOPC_ERR_PARAM
Definition: libmoxa_rtu.h:4380
MX_RTU_RTD_Event_Get
IO_ERR_CODE MX_RTU_RTD_Event_Get(int handle, float *value, struct Timestamp *time)
MX_RTU_Modbus_Tcp_Master_Write_Holding_Reg
MODBUS_MASTER_ERR_CODE MX_RTU_Modbus_Tcp_Master_Write_Holding_Reg(UINT32 sHandle, UINT16 addr, UINT16 regValue, UINT8 *exceptionCode)
MX_RTU_Module_AI_Max_Eng_Get
MODULE_RW_ERR_CODE MX_RTU_Module_AI_Max_Eng_Get(UINT8 slot, UINT8 start, UINT8 count, float *buf)
IO_ERR_CHANNEL
Definition: libmoxa_rtu.h:121
MX_RTU_Modbus_Rtu_Master_Write_Coil
MODBUS_MASTER_ERR_CODE MX_RTU_Modbus_Rtu_Master_Write_Coil(UINT8 slot, SERIAL_PORT port, UINT8 unitId, UINT16 addr, UINT8 coil, UINT32 timeoutMs, UINT8 *exceptionCode)
TAG_ERR_READY
Definition: libmoxa_rtu.h:4564
MX_RTU_Module_Relay_PWM_Config_Get
MODULE_RW_ERR_CODE MX_RTU_Module_Relay_PWM_Config_Get(UINT8 slot, UINT8 start, UINT8 count, float *frequency, float *dutyCycle)
MX_RTU_Module_DI_Counter_Start_Get
MODULE_RW_ERR_CODE MX_RTU_Module_DI_Counter_Start_Get(UINT8 slot, UINT32 *start)
MX_RTU_Timestamp_to_Timeval
void MX_RTU_Timestamp_to_Timeval(struct Timestamp *timestamp, struct timeval *tv)
CAN_ERR_DUPLICATE_OPEN
Definition: libmoxa_rtu.h:3516
MODULE_RW_ERR_IO_BURNOUT
Definition: libmoxa_rtu.h:175
IO_Info::di_channels
UINT8 di_channels
Definition: libmoxa_rtu.h:207
MX_RTU_Modbus_Tcp_Master_Read_Holding_Regs
MODBUS_MASTER_ERR_CODE MX_RTU_Modbus_Tcp_Master_Read_Holding_Regs(UINT32 sHandle, UINT16 startAddr, UINT16 regCount, UINT16 regs[], UINT8 *exceptionCode)
MX_RTU_CanSlaveHeartbeatGet
CAN_ERR_CODE MX_RTU_CanSlaveHeartbeatGet(int handle, UINT16 *producerTime)
SMS_ERR_OK
Definition: libmoxa_rtu.h:3440
MX_RTU_Cellular_Set_Debug
void MX_RTU_Cellular_Set_Debug(UINT8 debug)
MODEM_ERR_STATE
Definition: libmoxa_rtu.h:3262
io_info
struct IO_Info io_info
Definition: libmoxa_rtu.h:74
IO_ERR_ARGUMENT
Definition: libmoxa_rtu.h:122
MX_RTU_Module_Relay_PWM_Config_Set
MODULE_RW_ERR_CODE MX_RTU_Module_Relay_PWM_Config_Set(UINT8 slot, UINT8 start, UINT8 count, float *frequency, float *dutyCycle)
MX_RTU_Module_AO_Waveform_Stop_Set
MODULE_RW_ERR_CODE MX_RTU_Module_AO_Waveform_Stop_Set(UINT8 slot, UINT32 stop)
Module_Info::serial_number
UINT32 serial_number
Definition: libmoxa_rtu.h:225
STATUS_RUNNING
Definition: libmoxa_rtu.h:4581