Functional SeaMAX Modbus Interface

Functions

int SeaDacGetPIO (SeaMaxLin *SeaMaxPointer, unsigned char *data)
 Read the entire PIO space of a SeaDAC Lite module. More...
 
int SeaDacSetPIO (SeaMaxLin *SeaMaxPointer, unsigned char *data)
 Write the entire PIO space of a SeaDAC Lite module. More...
 
int SeaDacSetPIODirection (SeaMaxLin *SeaMaxPointer, unsigned char *data)
 Sets the PIO direction. More...
 
int SeaDacGetPIODirection (SeaMaxLin *SeaMaxPointer, unsigned char *data)
 Reads the PIO direction. More...
 
int SeaDacLinRead (SeaMaxLin *SeaMaxPointer, unsigned char *data, int numBytes)
 Read from a SeaDAC Lite module. This is a multifunction read that can read from a module previously opened. Any SeaIO devices attached to that module can then be read from in one of the following ways. More...
 
int SeaDacLinWrite (SeaMaxLin *SeaMaxPointer, unsigned char *data, int numBytes)
 Write to a SeaDAC Lite module. This is a multifunction write that can write to a module previously opened. Any SeaIO devices attached to that module can then be written to in one of the following ways. More...
 
SeaMaxLinSeaMaxLinCreate ()
 Allocate a seaMaxModule object. This function allocates space for a seaMaxModule object, which holds information necessary for the module to be recognized internally, and returns a pointer to that object. This object is then passed to the other functions to distinguish which seaMaxModule to preform the specified operation on. This must be the first call in your app. More...
 
int SeaMaxLinDestroy (SeaMaxLin *SeaMaxPointer)
 De-allocate a seaMaxModule object. This function releases the resources previously allocated for a SeaIO module. This must be the last call in your program. More...
 
int SeaMaxLinOpen (SeaMaxLin *SeaMaxPointer, char *filename)
 Open a SeaIO module. This function will attempt to open a specified SeaIO module. The method of specification is a string formatted like "sealevel_rtu://dev/[your_serial]" or "sealevel_tcp://x.x.x.x:y" where x's represent ip address and y the port. If you leave out the port, 502 will be used as the default. You may also enter the device's DCHP name like: "sealevel_tcp://Samwise". For SeaDAC Lite modules use sealevel_d2x://xxxx where xxxx=8112 or 8115 etc.. More...
 
int SeaMaxLinClose (SeaMaxLin *SeaMaxPointer)
 Close a SeaIO module. This function will attempt to close a previously opened seaMaxModule and clear any local data. It will also close the connection interface (socket or tty) and clean up any local data. You must call this when you are finished with the module. More...
 
int SeaMaxLinRead (SeaMaxLin *SeaMaxPointer, slave_address_t slaveId, seaio_type_t type, address_loc_t starting_address, address_range_t range, void *data)
 Read from a module. This is a multifunction read that can read from a module previously opened. Any SeaIO devices attached to that module can then be read from in one of the following ways. More...
 
int SeaMaxLinWrite (SeaMaxLin *SeaMaxPointer, slave_address_t slaveId, seaio_type_t type, address_loc_t starting_address, address_range_t range, unsigned char *data)
 Write to a module. This is a multifunction write that can write from a module previously opened. Any SeaIO devices attached to that module can then be written to in one of the following ways. More...
 
int SeaMaxLinIoctl (SeaMaxLin *SeaMaxPointer, slave_address_t slaveId, IOCTL_t which, void *data)
 Multi-function tool to configure and access SeaIO specific features. Ioctl can be used to get and set device parameters and states. More...
 
int SeaMaxLinSetIMDelay (SeaMaxLin *SeaMaxPointer, int delay)
 Set the inter-message delay. This is an effort to optimize the number of messages that can be received. A default of 1ms is used. The delay is expected in ms. More...
 
HANDLE SeaMaxLinGetCommHandle (SeaMaxLin *SeaMaxPointer)
 Get the handle to the actual communication medium. For RTU types it will be a normal file pointer, but TCP will be a socket handle. For this reason, it was decided to only return RTU file pointers. An attempt to get the socket handle will return an ENODEV error. More...
 

Detailed Description

This is a simple C library to aid in the construction, transmission, and reception of Modbus RTU and TCP commands. This library is designed for use with Sealevel SeaIO modules.

 
 
Generated on Tue Sep 19 2017.