Global Types and Enumerations

Listed here are the types, enumerations, and definitions used throughout the SeaMAX library.

SeaMAX Enumerations

DeviceConfig

typedef struct configuration
{
int model;
int commType;
int baudrate;
int parity;
int firmware;
} DeviceConfig;

AnalogConfig

typedef struct analog_configuration
{
short channelMode; // Analog Channel Configuration Flags
char precision; // Number of bits A/D or D/A precision
char exponent; // Two's complement exponent for channel ranges
short minValue; // Minimum range (minValue * (10 ^ exponent))
short maxValue; // Maximum range (maxValue * (10 ^ exponent))
} AnalogConfig;

Baudrates

enum
{
SM_BAUD_INVALID = 0,
SM_BAUD_1200 = 1,
SM_BAUD_2400 = 2,
SM_BAUD_4800 = 3,
SM_BAUD_9600 = 4,
SM_BAUD_14400 = 5,
SM_BAUD_19200 = 6,
SM_BAUD_28800 = 7,
SM_BAUD_38400 = 8,
SM_BAUD_57600 = 9,
SM_BAUD_115200 = 10,
SM_BAUD_230400 = 11,
SM_BAUD_460800 = 12,
SM_BAUD_921600 = 13,
};

Databits

enum
{
SM_DATABITS_5 = 5,
SM_DATABITS_6 = 6,
SM_DATABITS_7 = 7,
SM_DATABITS_8 = 8,
};

Parity

enum
{
SM_PARITY_NONE = 0,
SM_PARITY_ODD = 1,
SM_PARITY_EVEN = 2,
SM_PARITY_MARK = 3,
SM_PARITY_SPACE = 4,
};

Stopbits

enum
{
SM_STOPBITS_1 = 0,
SM_STOPBITS_1_5 = 1,
SM_STOPBITS_2 = 2,
};

Communications Type

enum
{
SM_COMTYPE_RS485 = 0,
SM_COMTYPE_ETHERNET = 1,
SM_COMTYPE_USB = 2,
SM_COMTYPE_RS232 = 3,
SM_COMTYPE_EXPANSION = 4,
SM_COMTYPE_RS422 = 5,
SM_COMTYPE_WIRELESS = 6,
SM_COMTYPE_INTELLIGENT = 7,
SM_COMTYPE_P_O_ETH = 8,
SM_COMTYPE_P_O_USB = 9,
SM_COMTYPE_CELLULAR = 10,
};

Analog to Digital Voltage Reference

enum
{
ANALOG = 0,
GROUND = 1,
AD_REFERENCE = 2,
FLOATING = 3,
DA_CHANNEL_1 = 4,
DA_CHANNEL_2 = 8,
};

Analog to Digital Channel Modes

enum
{
SINGLE_ENDED = 0,
DIFFERENTIAL = 1,
CURRENT_LOOP = 2,
MULTI_MODE = 3,
};

Channel Range Values

enum
{
ZERO_TO_FIVE = 0,
ZERO_TO_TWENTYFOUR_MA = 0,
PLUS_MINUS_FIVE = 1,
ZERO_TO_TEN = 2,
PLUS_MINUS_TEN = 3,
ZERO_TO_FIFTEEN = 2,
PLUS_MINUS_FIFTEEN = 3,
PLUS_MINUS_ONE = 4,
PLUS_MINUS_HALF = 5,
PLUS_MINUS_150MILLI = 6,
INLINE_RESISTOR_200 = 7,
};

Analog Channel Configuration Flags

enum
{
IS_OUTPUT = 0x0001,
IS_INPUT = 0x0002,
IS_SINGLE_ENDED = 0x0004,
IS_DOUBLE_ENDED = 0x0008,
IS_DIFFERENTIAL = 0x000C,
IS_VOLTAGE = 0x0010,
IS_CURRENT = 0x0020,
IS_POWER = 0x0040,
IS_FREQUENCY = 0x0080,
USES_FLOATING_GND = 0x0100,
USES_EXTERNAL_GND = 0x0200,
USES_INTERNAL_GND = 0x0400,
AMP_MODE_0 = 0x0000,
AMP_MODE_1 = 0x1000,
AMP_MODE_2 = 0x2000,
AMP_MODE_3 = 0x3000,
AMP_MODE_4 = 0x4000,
AMP_MODE_5 = 0x5000,
AMP_MODE_6 = 0x6000,
AMP_MODE_7 = 0x7000,
AMP_MODE_8 = 0x8000,
AMP_MODE_9 = 0x9000,
AMP_MODE_10 = 0xA000,
AMP_MODE_11 = 0xB000,
AMP_MODE_12 = 0xC000,
AMP_MODE_13 = 0xD000,
AMP_MODE_14 = 0xE000,
AMP_MODE_15 = 0xF000,
};

SeaMAX Ethernet Enumerations

Network Types

enum
{
NETWORK_INFRASTRUCTURE = 0,
NETWORK_ADHOC = 1,
};

Wireless Security Type

enum
{
SECURITY_NONE = 0,
SECURITY_WEP_OPEN_64 = 1,
SECURITY_WEP_SHARED_64 = 2,
SECURITY_WEP_OPEN_128 = 3,
SECURITY_WEP_SHARED_128 = 4,
SECURITY_WPA_TKIP = 5,
SECURITY_WPA2_AES = 6,
SECURITY_UNKNOWN = 0xFF,
};

Wireless Key Type

enum
{
HEX_KEY = 0,
PASSPHRASE_KEY = 1,
};

Security Type

enum
{
UNSECURED = 0,
AES_128 = 1,
AES_256 = 2,
};

Error Code

enum ErrorCodes
{
SM_SUCCESS = 0, // Success
SM_HANDLE_INVALID_ERR = 1, // Invalid SeaMAX handle
SM_WIN32_ERR = 2, // Win32 Error. See GetLastWin32Error()
SM_FTDI_ERR = 3, // FTDI Error. See GetLastFTDI32Error()
SM_PARAM_INVALID_ERR = 4, // A parameter was out of range.
SM_NOT_CONNECTED_ERR = 5, // A connection is not established.
SM_MODBUS_ILLEGAL_FUNC_01_ERR = 6, // Illegal Modbus Function (Modbus exception 0x01)
SM_MODBUS_ILLEGAL_ADDR_02_ERR = 7, // Illegal Data Address (Modbus exception 0x02)
SM_MODBUS_ILLEGAL_DATA_03_ERR = 8, // Illegal Data Value (Modbus exception 0x03)
SM_MODBUS_UNKOWN_ERR = 9, // Unkown Modbus error
SM_CRC_ERR = 10, // CRC Error, possible communications problem
SM_WRITE_ERR = 11, // Error writing message
SM_TIMEOUT_ERR = 12, // Read timeout occurred
SM_CMD_NOT_SUPPORTED_ERR = 13, // Command not supported by this device
SM_MUTEX_ERR = 14, // Could not acquire a valid mutex
SM_NO_MODULES_FOUND_ERR = 15, // No modules have been found. See SME_SearchForModules() or SDL_SearchForDevices()
SM_END_DISC_MODULES_ERR = 16, // End of discovered modules
SM_MODULE_NOT_FOUND_ERR = 17, // Could not locate named module
SM_SET_SERIAL_PARAM_ERR = 18, // Could not set serial parameters
SM_NON_SERIAL_ERR = 19, // Current connection is non-serial
SM_INVALID_RESPONSE_ERR = 20, // Invalid response from device
SM_DEVICE_NOT_SUPPORTED_ERR = 21, // Device not supported or unable to read device ID.
SM_BIND_SOCKET_ERR = 22, // Error binding to socket
SM_FREE_SOCKET_ERR = 23, // Could not acquire free socket
SM_HOST_ADDRESS_ERR = 24, // Could not resolve host address
SM_GET_CONFIG_ERR = 25, // Error getting current configuration
SM_NET_INTERFACES_ERR = 26, // Error obtaining a list of local network interfaces
SM_BROADCAST_ERR = 27, // Error sending broadcast message over interface
SM_SET_CONNECTION_PARAMS_ERR = 28, // Error setting connection parameters
SM_CBX_DLL_ERR = 29, // Unable to load cbx_enc_2_1.dll
SM_THREAD_NOT_STARTED_ERR = 30, // NotifyOnInputChange thread not started
SM_THREAD_UNKNOWN_ERR = 31, // Unknown error on NotifyOnInputChange thread
SM_THREAD_CANCELLED_ERR = 32, // NotifyOnInputChange thread has been cancelled
SM_THREAD_PENDING_ERR = 33, // NotifyOnInputChange request already pending
SM_THREAD_INPUT_CHANGED = 34, // NotifyOnInputChange input changed
SM_THREAD_READ_FAILED = 35, // NotifyOnInputChange read failed: non-terminal error
};
 
 
Generated on Mon Nov 26 2018.