Didoctl (Dido Input/Output Operation) - Hitachi CE50-10 Instruction Manual

Table of Contents

Advertisement

USER_GREEN, USER_RED, or USER_OFF
If the USER_INFO argument is specified, one of these values is returned according to the the current status of the
AP lamp.
G.2 didoctl (DIDO input/output operation)
This interface allows the user to operate DI input and DO output.
(1) Compiling
To compile the program in the development environment, enter as follows:
$ sudo cc -I/hitachi/usr/include -o xxx xxx.c -L/hitachi/lib64 -lecextio
• xxx: Specify the object file name.
• xxx.c: Specify the source file name.
For details about include files and libraries that are to be specified when compiling the program, see Table 5‒10: Files
for application development by using the unique functions of CE50-10.
(2) Reference
(a) Format
#include <stdio.h>
#include <ecextioctl.h>
int
didoctl(int board, int cmd, int *buf)
(b) Description
DI inputs data to the unit and DO outputs data from the unit. The value specified for the cmd argument determines
whether access is made to DI or DO. This interface accesses all DI or DO channels by a single call. Four DI channels
or ten DO channels can be accessed.
The standard access time for DI or DO is approximately 5 milliseconds or less in a normal state. If DI or DO does not
return a response for 10 milliseconds, a timeout is detected and the processing terminates abnormally. At this time, the
error code ETIMEDOUT is returned.
(c) Arguments
board
Specify the access target I/O board number. For the CE50-10, specify BOARD_NO1, which is defined in
ecextioctl.h.
If a value other than BOARD_NO1 is specified, processing terminates abnormally, the return value is -1, and
EINVAL is returned for the error number (errno).
cmd
Specify the processing details.
• DIO_READ: Access DI and input data to the unit.
• DIO_WRITE: Access DO and output data from the unit.
Note that DIO_READ and DIO_WRITE are defined in ecextioctl.h.
buf
When you specify DIO_READ for cmd, specify the address of the area in which input data is to be stored.
When you specify DIO_WRITE for cmd, specify the address of the area in which output data is to be stored.
The following shows the format of the area specified for buf.
G. Library Interface Reference
171

Advertisement

Table of Contents
loading

Table of Contents