Figure G‒1: Format of the area specified for buf
(d) Return values
0
Normal termination
-1
Abnormal termination. One of the following codes is returned for the error number (
errno
).
Table G‒1: Codes for the error number (errno)
Code
Description
EINVAL
The value specified for
cmd
is neither
DIO_READ
nor
DIO_WRITE
. Alternatively, the value
specified for
board
is not
BOARD_NO1
.
When
DIO_WRITE
is specified, the data for bit 10 to bit 31 in the area specified for
buf
is not
output to
DO
. Therefore, the specification content is not checked.
EFAULT
NULL is specified for the area specified for
buf
.
ENXIO
An attempt to open the device to be used within the library failed. Alternatively, an error occurred
in the IPC (shared memory) in the library. Restart the unit.
EIO
When DO was accessed, a hardware error was detected by writing and reading back the register.
Message KXDO002-W, KXDO003-W, or KXDO004-W is output.
ETIMEDOUT
A timeout was detected during access to DI or DO. A message KXDI001-W or KXDO001-W is
output.
(e) Notes
•
For the value specified for the
buf
argument, whether NULL is specified is checked but whether the specified
area is accessible is not checked. Therefore, you must allocate the data storage area and specify the address of that
area. If the specified area is not accessible or is too small, a program error might occur. If a program error occurs,
the application program (process) that called the library terminates abnormally.
•
If the external power supply of DO is lost due to a power failure or any other failure, DO data is not output but
didoctl
terminates normally. CE50-10 is unable to detect incorrect DO data output caused by a failure in an
external power supply.
(f) Coding example
#include <stdio.h>
#include <stdlib.h>
#include <errno.h>
#include <ecextioctl.h>
int main()
{
int ret, board, cmd, bufdata;
board = BOARD_NO1;
cmd = DIO_READ; /* Read DI data. */
bufdata = 0;
G. Library Interface Reference
172
Summary of Contents for CE50-10
Page 1: ...Hitachi Industrial Edge Computer CE50 10 Instruction Manual CC 65 0171 ...
Page 10: ......
Page 23: ...Figure 1 6 Attaching mounting brackets 4 1 Installing the CE50 10 7 ...
Page 26: ......
Page 38: ......
Page 42: ...4 2 5 Connection diagram Figure 4 2 Connection diagram 4 External Contact Functions 26 ...
Page 44: ......
Page 87: ... sudo etc init d netfilter persistent save 5 Configuring Software Environment 71 ...
Page 117: ...version information 13 Log out from the unit exit 5 Configuring Software Environment 101 ...
Page 148: ......
Page 149: ...7 Maintaining the CE50 10 This chapter describes maintenance of the CE50 10 133 ...
Page 157: ...8 Troubleshooting This chapter describes troubleshooting of the CE50 10 141 ...
Page 162: ...8 1 14 Cannot turn off the power to the unit Please contact us 8 Troubleshooting 146 ...