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

- Main Page
- Modules
- Data Structures
- Files

Modules | Data Structures | Macros | Typedefs | Enumerations | Functions
Library

## Modules
| Misc
| IOEvent
| IO
| Serial
| Cellular
| Can
| ModbusMaster
| ModbusSlave
| AOPC
| Moxa ActiveOPC Server (AOPC Server)
| TagService
| Moxa TAG Library

## Data Structures
struct | IO_Info
struct | Module_Info
struct | Timestamp

## Macros
#define | USB_VID_MOXA 0x110a
#define | USB_PID_RTU_85M_1602 0x5200
#define | USB_PID_RTU_85M_2600 0x5240
#define | USB_PID_RTU_85M_3800 0x52c0
#define | USB_PID_RTU_85M_3800_CRRC 0x5402
#define | USB_PID_RTU_85M_3810 0x52c1
#define | USB_PID_RTU_85M_3801 0x5300
#define | USB_PID_RTU_85M_3811 0x5301
#define | USB_PID_RTU_85M_6810 0x5340
#define | USB_PID_RTU_85M_6600 0x5380
#define | USB_PID_RTU_AIO_8di_8dio_8ai 0x50e0
#define | USB_PID_RTU_86M_5870D 0x52c2
#define | USB_PID_RTU_86M_4420 0x53a0
#define | USB_PID_RTU_86M_2604D 0x5243
#define | USB_PID_RTU_86M_1832D 0x5201
#define | USB_PID_RTU_86M_2830D 0x5241
#define | USB_PID_RTU_86M_1620D 0x5202
#define | USB_PID_RTU_86M_2821D 0x5242
#define | USB_PID_RTU_85M_5401 0x53e0
#define | USB_PID_RTU_85M_5220 0x53e1
#define | USB_PID_RTU_85M_5142 0x53e2
#define | USB_PID_RTU_85M_5130 0x53e3
#define | USB_PID_RTU_86M_5212U 0x53e5
#define | USB_PID_RTU_86M_5811M 0x53e6
#define | USB_PID_RTU_86M_5814U 0x53e7
#define | USB_PID_RTU_86M_5250 0x53e8
#define | USB_PID_RTU_PW10_15W 0x5400
#define | USB_PID_RTU_PW10_30W 0x5401
#define | USB_PID_RTU_PW20_50W 0x5403
#define | MAX_SLOT 12
#define | MAX_CHANNEL 24
#define | MODULE_SLOT_CPU_POWER 0
#define | MODULE_SLOT_CPU 0

## Typedefs
typedef unsigned long | UINT32
typedef long | INT32
typedef unsigned short | UINT16
typedef short | INT16
typedef unsigned char | UINT8
typedef char | INT8

## Enumerations
enum | IO_ERR_CODE { IO_ERR_OK = 0, IO_ERR_DEVICE, IO_ERR_CMD, IO_ERR_TYPE, IO_ERR_ITEM, IO_ERR_COPY, IO_ERR_SLOT, IO_ERR_CHANNEL, IO_ERR_ARGUMENT, IO_ERR_RW, IO_ERR_ACTION, IO_ERR_UPDATE, IO_ERR_FAST_AI_BUF_EMPTY, IO_ERR_FAST_AI_BUF_OVERFLOW, IO_ERR_FAST_AI_NO_BUF, IO_ERR_IO_MODULE_REQUEST, IO_ERR_COMMUNICATION_MODULE_REQUEST, IO_ERR_SEMAPHORE_LOCK, IO_ERR_TIMEOUT, IO_ERR_SYSTEM_INFO, IO_ERR_MODULE_INFO, IO_ERR_HOT_PLUG, IO_ERR_DUPLICATE_REGISTER, IO_ERR_IO_EVENT_QUEUE_EMPTY, IO_ERR_CELLULAR_POWER_INDICATOR, IO_ERR_CELLULAR_EMERGENCY_OFF, IO_ERR_CELLULAR_IGT_ON, IO_ERR_POWER, IO_ERR_COMMUNICATION_MODULE_SUPPORT, IO_ERR_AMOUNT }
enum | MODULE_RW_ERR_CODE { MODULE_RW_ERR_OK = 0, MODULE_RW_ERR_DEVICE, MODULE_RW_ERR_SLOT, MODULE_RW_ERR_CMD, MODULE_RW_ERR_ARGUMENT, MODULE_RW_ERR_SYSTEM_INFO, MODULE_RW_ERR_RW, MODULE_RW_ERR_VERSION, MODULE_RW_ERR_TIMEOUT, MODULE_RW_ERR_PACKET, MODULE_RW_ERR_INSUFFICIENT_BUFFER, MODULE_RW_ERR_REQUEST_FAIL, MODULE_RW_ERR_REQUEST_EXCEPTION, MODULE_RW_ERR_BUSY, MODULE_RW_ERR_COMMUNICATION_MODULE_REQUEST, MODULE_RW_ERR_SEMAPHORE_LOCK, MODULE_RW_ERR_HOT_PLUG, MODULE_RW_ERR_TIMESTAMP, MODULE_RW_ERR_TIMESTAMP_NOT_SYNC, MODULE_RW_ERR_IO_PARAM, MODULE_RW_ERR_IO_TYPE, MODULE_RW_ERR_IO_CH, MODULE_RW_ERR_IO_MODE, MODULE_RW_ERR_IO_FILTER, MODULE_RW_ERR_IO_TRIGGER, MODULE_RW_ERR_IO_SIG_WIDTH, MODULE_RW_ERR_IO_PWM, MODULE_RW_ERR_IO_BURNOUT, MODULE_RW_ERR_IO_CALIBRATION, MODULE_RW_ERR_IO_BUF, MODULE_RW_ERR_IO_FAST_AI_BUF_EMPTY, MODULE_RW_ERR_IO_FAST_AI_BUF_OVERFLOW, MODULE_RW_ERR_IO_FAST_AI_NOT_READY, MODULE_RW_ERR_POWER, MODULE_RW_ERR_NO_EXTERNAL_POWER, MODULE_RW_ERR_IO_FPGA, MODULE_RW_ERR_AMOUNT }
enum | AI_TRANSFORM_ERR_CODE { AI_TRANSFORM_ERR_OK = 0, AI_TRANSFORM_ERR_RANGE, AI_TRANSFORM_ERR_VALUE, AI_TRANSFORM_ERR_ARGUMENT, AI_TRANSFORM_ERR_AMOUNT }
enum | AIO_TRANSFORM_ERR_CODE { AIO_TRANSFORM_ERR_OK = 0, AIO_TRANSFORM_ERR_RANGE, AIO_TRANSFORM_ERR_BITSRESOLUTION, AIO_TRANSFORM_ERR_VALUE, AIO_TRANSFORM_ERR_ARGUMENT, AIO_TRANSFORM_ERR_AMOUNT }

## Functions
struct IO_Info | __attribute__ ((packed))

## Detailed Description

## Macro Definition Documentation

#define USB_VID_MOXA 0x110a

#define USB_PID_RTU_85M_1602 0x5200

#define USB_PID_RTU_85M_2600 0x5240

#define USB_PID_RTU_85M_3800 0x52c0

#define USB_PID_RTU_85M_3800_CRRC 0x5402

#define USB_PID_RTU_85M_3810 0x52c1

#define USB_PID_RTU_85M_3801 0x5300

#define USB_PID_RTU_85M_3811 0x5301

#define USB_PID_RTU_85M_6810 0x5340

#define USB_PID_RTU_85M_6600 0x5380

#define USB_PID_RTU_AIO_8di_8dio_8ai 0x50e0

#define USB_PID_RTU_86M_5870D 0x52c2

#define USB_PID_RTU_86M_4420 0x53a0

#define USB_PID_RTU_86M_2604D 0x5243

#define USB_PID_RTU_86M_1832D 0x5201

#define USB_PID_RTU_86M_2830D 0x5241

#define USB_PID_RTU_86M_1620D 0x5202

#define USB_PID_RTU_86M_2821D 0x5242

#define USB_PID_RTU_85M_5401 0x53e0

#define USB_PID_RTU_85M_5220 0x53e1

#define USB_PID_RTU_85M_5142 0x53e2

#define USB_PID_RTU_85M_5130 0x53e3

#define USB_PID_RTU_86M_5212U 0x53e5

#define USB_PID_RTU_86M_5811M 0x53e6

#define USB_PID_RTU_86M_5814U 0x53e7

#define USB_PID_RTU_86M_5250 0x53e8

#define USB_PID_RTU_PW10_15W 0x5400

#define USB_PID_RTU_PW10_30W 0x5401

#define USB_PID_RTU_PW20_50W 0x5403

#define MAX_SLOT 12

#define MAX_CHANNEL 24

#define MODULE_SLOT_CPU_POWER 0

#define MODULE_SLOT_CPU 0

## Typedef Documentation

typedef unsigned long UINT32

typedef long INT32

typedef unsigned short UINT16

typedef short INT16

typedef unsigned char UINT8

typedef char INT8

## Enumeration Type Documentation

enum IO_ERR_CODE

Enumerator
IO_ERR_OK | 0
IO_ERR_DEVICE | 1
IO_ERR_CMD | 2
IO_ERR_TYPE | 3
IO_ERR_ITEM | 4
IO_ERR_COPY | 5
IO_ERR_SLOT | 6
IO_ERR_CHANNEL | 7
IO_ERR_ARGUMENT | 8
IO_ERR_RW | 9
IO_ERR_ACTION | 10
IO_ERR_UPDATE | 11
IO_ERR_FAST_AI_BUF_EMPTY | 12
IO_ERR_FAST_AI_BUF_OVERFLOW | 13
IO_ERR_FAST_AI_NO_BUF | 14
IO_ERR_IO_MODULE_REQUEST | 15
IO_ERR_COMMUNICATION_MODULE_REQUEST | 16
IO_ERR_SEMAPHORE_LOCK | 17
IO_ERR_TIMEOUT | 18
IO_ERR_SYSTEM_INFO | 19
IO_ERR_MODULE_INFO | 20
IO_ERR_HOT_PLUG | 21
IO_ERR_DUPLICATE_REGISTER | 22
IO_ERR_IO_EVENT_QUEUE_EMPTY | 23
IO_ERR_CELLULAR_POWER_INDICATOR | 24
IO_ERR_CELLULAR_EMERGENCY_OFF | 25
IO_ERR_CELLULAR_IGT_ON | 26
IO_ERR_POWER | 27
IO_ERR_COMMUNICATION_MODULE_SUPPORT | 28
IO_ERR_AMOUNT | 29

enum MODULE_RW_ERR_CODE

Enumerator
MODULE_RW_ERR_OK | 0
MODULE_RW_ERR_DEVICE | 1
MODULE_RW_ERR_SLOT | 2
MODULE_RW_ERR_CMD | 3
MODULE_RW_ERR_ARGUMENT | 4
MODULE_RW_ERR_SYSTEM_INFO | 5
MODULE_RW_ERR_RW | 6
MODULE_RW_ERR_VERSION | 7
MODULE_RW_ERR_TIMEOUT | 8
MODULE_RW_ERR_PACKET | 9
MODULE_RW_ERR_INSUFFICIENT_BUFFER | 10
MODULE_RW_ERR_REQUEST_FAIL | 11
MODULE_RW_ERR_REQUEST_EXCEPTION | 12
MODULE_RW_ERR_BUSY | 13
MODULE_RW_ERR_COMMUNICATION_MODULE_REQUEST | 14
MODULE_RW_ERR_SEMAPHORE_LOCK | 15
MODULE_RW_ERR_HOT_PLUG | 16
MODULE_RW_ERR_TIMESTAMP | 17
MODULE_RW_ERR_TIMESTAMP_NOT_SYNC | 18
MODULE_RW_ERR_IO_PARAM | 19
MODULE_RW_ERR_IO_TYPE | 20
MODULE_RW_ERR_IO_CH | 21
MODULE_RW_ERR_IO_MODE | 22
MODULE_RW_ERR_IO_FILTER | 23
MODULE_RW_ERR_IO_TRIGGER | 24
MODULE_RW_ERR_IO_SIG_WIDTH | 25
MODULE_RW_ERR_IO_PWM | 26
MODULE_RW_ERR_IO_BURNOUT | 27
MODULE_RW_ERR_IO_CALIBRATION | 28
MODULE_RW_ERR_IO_BUF | 29
MODULE_RW_ERR_IO_FAST_AI_BUF_EMPTY | 30
MODULE_RW_ERR_IO_FAST_AI_BUF_OVERFLOW | 31
MODULE_RW_ERR_IO_FAST_AI_NOT_READY | 32
MODULE_RW_ERR_POWER | 33
MODULE_RW_ERR_NO_EXTERNAL_POWER | 34
MODULE_RW_ERR_IO_FPGA | 35
MODULE_RW_ERR_AMOUNT | 36

enum AI_TRANSFORM_ERR_CODE

Enumerator
AI_TRANSFORM_ERR_OK | 0
AI_TRANSFORM_ERR_RANGE | 1
AI_TRANSFORM_ERR_VALUE | 2
AI_TRANSFORM_ERR_ARGUMENT | 3
AI_TRANSFORM_ERR_AMOUNT | 4

enum AIO_TRANSFORM_ERR_CODE

Enumerator
AIO_TRANSFORM_ERR_OK | 0
AIO_TRANSFORM_ERR_RANGE | 1
AIO_TRANSFORM_ERR_BITSRESOLUTION | 2
AIO_TRANSFORM_ERR_VALUE | 3
AIO_TRANSFORM_ERR_ARGUMENT | 4
AIO_TRANSFORM_ERR_AMOUNT | 5

## Function Documentation

struct IO_Info __attribute__ | ( | (packed) |  | ) |