Back to Sealevel      

int CSeaMaxW32::Write ( slave_address_t  slave_id,
seaio_type_t  type,
address_loc_t  starting_address,
address_range_t  range,
unsigned char *  data 
) [inherited]

Performs a Modbus write on an opened SeaI/O module and returns the data by reference.

Deprecated:
Version 2.x - Version 5.0
Parameters:
[in] slave_id Slave ID of the target module
[in] type Type of read to complete
[in] starting_address Address to begin reading
[in] range Number of I/O points to read
[out] data Data pointer
Return values:
>=0 Success - the number of valid data bytes in the buffer.
-14 A Modbus read exception has occured - the first byte of the data buffer contains the exception.
-22 A null pointer has been supplied where a pointer to a data buffer was expected.
-9 The specified communication is not current established.
-18 Can not write data to the outbound connection - connection error.
-19 The SeaI/O module did not respond.
-34 Attempting to write to more IO points than are available.
-27 Illegal data value.
Write performs a Modbus write on an opened SeaI/O module and returns the data by reference.

The actual Modbus write type is specified by the 'type' argument. Since Modbus is actually base one, the starting location should be no less than one. Likewise, the range indicates how many consecutive inputs should be read.

The final parameter, 'data', is a pointer to a buffer in which to store the returned data - specifically, an array of bytes. Consult the provided code examples for model specific information.

 
 
Generated on 15 Dec 2008.