
Technical Description
Sealevel Systems SeaPORTDIO-16 Page 5
Programming
Application Programmers Interface (API)
Most modern operating systems do not allow direct hardware access. The
SeaI/O driver and API have been included to provide control over the hardware
in Windows. The purpose of this section of the manual is to help the customer
with the mapping of the API to the actual I/O and relays for the
SeaPORTDIO-16 specifically. Complete documentation of the API can be
found in the SeaI/O help file.
Serial String
Each device has an eight digit alphanumeric serial string stored in non-volatile
memory. On the Windows platforms, this number is used to give each unit a
separate identity. This identity allows the device to be moved to any USB port
or hub port on your computer while retaining its device number. If a device
becomes damaged and is replaced the new device should be given the same
serial string as the device it is replacing. This string is stored in a EEPROM
along with other critical information. This EEPROM is read during
enumeration. The device should not be unplugged during its enumeration due
to remote possibility that the data in the EEPROM could be corrupted if power
is removed during a read/write cycle to the EEPROM. Enumerator is complete
when the LED is lit.
The control panel utility provides the capability to read or modify this string.
However, setting the same string for two units will cause the second unit
to fail enumeration, and make it invisible to the operating system. Should
this occur, unplug one unit and set the serial string for the other unit to a
different string.
Relative Addressing vs. Absolute Addressing
The SeaI/O API makes a distinction between “absolute” and “relative”
addressing modes. In absolute addressing mode, the Port argument to the API
function acts as a simple byte offset from the base I/O address of the device.
For instance, Port #0 refers to the I/O 0; Port #1 refers to the I/O address 1.
Relative addressing mode, on the other hand, refers to input and output ports in
a logical fashion. With a Port argument of 0 and an API function meant to
output data, the first (0th) output port on the device will be utilized. Likewise,
with a Port argument of 0 and an API function designed to input data, the first
(0th) input port of the device will be utilized.
In all addressing modes, port numbers are zero-indexed; that is, the first port is
port #0, the second port is #1, the third #2, and so on.