int __stdcall SM_GetPIODirection ( SM_HANDLE  handle,
unsigned char *  config 
)

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

Parameters
[in]handleValid handle returned by SM_Open().
[out]configContains the direction (input or output) of the programmable IO.
Return values
>=0Successful completion.
-1Invalid SeaMAX handle.
-2Connection is not established. Check the provided Connection object state.
-3Read error waiting for response. Unknown Modbus exception.
-4Illegal Modbus Function (Modbus Exception 0x01).
-5Illegal Data Address (Modbus Exception 0x02).
-6Illegal Data Value (Modbus Exception 0x03).
-7Modbus CRC was invalid. Possible communications problem.
-10SeaDAC Lite: Invalid model number.
-11SeaDAC Lite: Unknown connection type.
-12SeaDAC Lite: Error communicating with device.

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 parameter, config, must have at least one byte of space allocated for every 8 bits of I/O before calling this function.

Referenced by CSeaMaxW32::Ioctl(), and CSeaMaxW32::Read().

 
 
Generated on Mon Nov 26 2018.