1. Introduction

The CIO- PDISO16 is a digital I/O board that has 2*8 relay channels and 2*8 digital inputs. It is designed for control and sensing applications where a few points of high voltage need to be sensed or controlled. The 16 outputs are electromechanical relays. The contacts are rated at 6A @ 120V A. C. or 28V D. C., resistive load. The relays are controlled by writing to two 8 -bit ports. The state of the relays may be determined by a read from the control port address. There are 16 individual, optically isolated (500V) inputs that may be read back as two 8- bit bytes. The inputs are not polarity sensitive and may be driven by either A. C. (50 - 1000 Hz) or D. C. in the range 5V - 24V. Programming is accomplished by writes and reads to the 8- bit ports. Each bit indicates the state of an input or controls an output. Pdiso16 is the RTLinux device driver written by Integrated Real Time Systems (IRTS). The driver has been implemented as a Linux loadable module for RTLinux 2.2a (2.2.14 Linux kernel). This document explains the functionalities of the pdiso16 device driver and the programmer's C-interface library for it.

http://www.computerboards.com

The pdiso16 device driver main features are :

A RTLinux thread can use the pdiso16 device driver through the posixio API. Thus, calling well known open(), close(), read(), write() and ioctl() functions from a rt-thread, the user can access all the resources of the pdiso16 board.

A Linux user space process can access the pdiso16 device driver using 2 RT-FIFO: one to send instructions, the other to receive a response or acknowledgment. It just have to use the communication structure described in the com.h header file: Message_struct. The response or acknowledgment to its answers are also sent in such a structure.

Note that the process have to use specialized command codes and ioctl() command constants to communicate with the device driver.

User can set/read any relay state using the read() write() functions. The port number is specified by a call to ioctl() function with the CHANGE_PORT command and the PORT1/PORT2 argument. A precise channel can be accessed through logical opérations.

Note that the LSB of the byte is always associated with the lowest channel of the group.

User can set/read all 16 channels' state using the read() write() functions. This mode can be specified by a call to ioctl() function with the BOTH_PORTS command.

Note that the LSB of the byte is always associated with the lowest channel of the group, the lowest byte is associated with PORT1 and the higher with PORT2 (!).

User can read any differential digital input channel's state using an ioctl() call with the DIGITAL_INPUT command. Result is returned in the arg field of the ioctl() function. User can ask a single port or a word-wise reading using the same ioctl() commands : CHANGE_PORT or BOTH_PORTS.

Note that the LSB of the byte is always associated with the lowest channel of the group, the lowest byte is associated with PORT1 and the higher with PORT2 (!).

Next Previous Contents         Home