©Sealevel Systems, Inc.
8004e Manual
12
SL9207 2/2017
Programming the DIO-32.PCI
Sealevel’s SeaI/O Classic software is provided to assist in the development of reliable applications for the
Sealevel Systems family of PCI and PCI Express digital I/O adapters. The SeaI/O Classic software is included
on the CD that shipped with the board. The software contains driver functions for use in accessing the I/O
as well as helpful samples and utilities.
PROGRAMMING FOR WINDOWS
The SeaI/O Classic API (Application Programmer Interface) provides a variety of useful high-level function
calls implemented in a Windows dynamic link library (DLL). The API is defined in the help file
(Start/Programs/SeaIO/SeaIO Help) under “Application Programmers Interface”. This help file also includes
detailed information dealing with installation / removal of the software and information about latency, logic
states, and device configuration.
For C language programmers we recommend using the API to access the DIO-32.PCI. If you are
programming in Visual Basic 6 or earlier, using the ActiveX control included with SeaI/O is advised.
SAMPLES AND UTILITIES
A variety of sample programs and utilities (both executable and source code) are included with SeaI/O.
Further documentation on these samples can be found by selecting “Start/Programs/SeaIO/Sample
Application Description”. Information about where the files are physically stored on your disk is also
included in this same file.
PROGRAMMING FOR LINUX
SeaI/O for Linux consists of two major parts: a kernel module and a library. The kernel module is a simple
IO pass-through device, allowing the library to handle the more sophisticated functions provided to SeaI/O
users. It is provided in a ‘tarball’ format and can easily be compiled and included in the kernel build.
INPUT PORTS
Ports A and B are 8 bit input ports connected to optically isolated input sensors. Each sensor can be used to
interface a voltage input and then sense whether the voltage is on or off. Each sensor is isolated (with
respect to a common ground) from every other sensor, and also isolated with respect to the host PC
ground. This means that signals such as low-level AC line voltage, e.g. 12 or 24VAC, motor servo voltage,
and control relay signals can be ‘sensed’, or read by the PC, without the risk of damage due to ground
loops or ground faults.
Each sensor input pair has a current limiting resistor that is used to limit the input current to the opto-
isolator. The opto-isolator has two ‘back-to-back’ diodes internally. This allows AC or DC signals to be
sensed, regardless of polarity. When the applied voltage is high enough to cause the LED in the opto-
isolator to turn-on, the output of the opto-isolator goes low (0 volts) and the signal is read as a low logic
level (binary 0) by the PC. When the input signal is too low to turn on the opto-isolator, the output goes
high and the port bit is read by the PC as a high logic level (binary 1). While this is true at the hardware
level, the Microsoft Windows driver gives the application the ability to use Positive or Negative Logic. This
card defaults to Positive Logic and therefore the driver inverts the logic level BEFORE the information is
returned to the application. Therefore, a voltage high enough to cause the LED to turn on will be read by
the application as a logic high level.
The input impedance of each isolated input is approximately 560 ohms (factory default). The opto-isolator
requires approximately 3mA to turn on. The maximum input current is 50mA. There are two things to
consider when selecting the input resistor. The first is turn on voltage for the circuit to sense, and second is
the maximum input voltage. Maximum input voltage must not provide too much power to the input
Artisan Technology Group - Quality Instrumentation ... Guaranteed | (888) 88-SOURCE | www.artisantg.com