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

Configures a Sealevel I/O module's programmable IO bit presets.

Parameters
[in]handleValid handle returned by SM_Open().
[in]configContains the presets ('on' or 'off') of the programmable IO.
Return values
>0Successful completion. Bytes successfully written.
-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.

This method provides a simpler, easier way to interface to the programmable IO Sealevel I/O modules. 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. For those banks configured as outputs, the module must know the state of the IO on power-up or on direction change (from input to output).

The format of the config parameter should be a packed set of twelve (12) bytes, with each bit representing a bit in a bank of 12 8-bit programmable IO points. The configuration bytes are arranged such that the first byte configures the bit presets for IO 1-8 (LSB to MSB) of bank 1, the second byte configures IO 1-8 of bank 2, etc. In each bytes case, a bitwise '0' indicates the corresponding IO should be preset as 'off', and a bitwise '1' indicates an 'on' state. The following illustrates the format:

Note
This function has currently no effect on SeaDAC Lite modules.
dot_inline_dotgraph_22.png
 
 
Generated on Mon Nov 26 2018.