Back to Sealevel      

int SM_GetPIODirection ( SM_HANDLE  handle,
unsigned char *  config 
)

Retrieves a Sealevel I/O module's programmable IO direction.

Parameters:
[in] handle Valid handle returned by SM_Open().
[out] config Contains the direction (input or output) of the programmable IO.
Return values:
>=0 Successful completion.
-1 Invalid SeaMAX handle.
-2 Connection is not established. Check the provided Connection object state.
-3 Read error waiting for response. Unkown Modbus exception.
-4 Illegal Modbus Function (Modbus Exception 0x01).
-5 Illegal Data Address (Modbus Exception 0x02).
-6 Illegal Data Value (Modbus Exception 0x03).
-7 Modbus CRC was invalid. Possible communications problem.
-10 SeaDAC Lite: Invalid model number.
-11 SeaDAC Lite: Unknown connection type.
The SeaI/O 462 & 463 modules offer 96-bits of programmable IO in 12 banks, each of which may be configured as a bank of 8 inputs or 8 outputs.

The format of the config parameter should be one byte for every 8 bits of programmable I/O, each byte representing banks 1 - 12. A non-zero byte indicates that the corresponding bank of PIO should be a bank of 8 inputs, zero indicating 8 outputs. For example, a non-zero value in config[3] would indicate that bank 4 should be a bank of inputs.

Warning:
The paramater, config, must have at least one byte of space allocated for every 8 bits of I/O before calling this function.

 
 
Generated on 18 Sep 2007.