Function
Inputs the data from the specified bit of digital input. This function supports multi-process.
Format
Ret = AioInputDiBit ( Id , DiBit , DiData )
Parameters
Id [ C, C++ : short ] [ Python : ctypes.c_short ]
Specifies the ID retrieved from AioInit.
DiBit [ C, C++ : short ] [ Python : ctypes.c_short ]
Specifies the bit of digital input.
DiData [ C, C++ : short * ] [ Python : ctypes.POINTER(ctypes.c_short) ]
Specifies the address of the variable that stores the input data.
0 |
OFF |
1 |
ON |
Return values
Ret [ C, C++ : long ] [ Python : ctypes.c_long ]
Return values |
Content |
0 |
Normality completion |
7 |
Execute AioResetDevice function because the device has recovered from standby mode |
10001 |
Invalid Id was specified |
10002 |
AIO driver can't be called |
14000 |
The value of Bit is outside the designated range of the function |
14001 |
Pointer to DiData is NULL |
20001 |
This function can't be used by this device |
24000 |
The value of Bit is outside the designated range of the device being used |
Remarks
This function cannot be used on devices without digital input functionality.
A device that has both digital input and
external control signal input can use only one of these functions.
If digital input is performed while an external control signal is set,
the external control signal setting becomes invalid.
AIO-163202G-PE |
The behavior depends on the [E-series settings] jumper on device.
If the [E-series settings] jumper on the device is [Do not use as E-series compatible], you can switch the I/O direction with AioSetDioDirection. When accessing DIO00 to DIO07, specify 0 to 7 for the parameter DiBit. When accessing DIO08 to DIO15, specify 8 to 15 for the parameter DiBit. For digital output port, it is the echo back value.
If the [E-series settings] jumper on the device is [Use as E-series compatible], DIO00 to DIO07 are fixed as Input, and DIO08 to DIO15 are fixed as output. When accessing DIO00 to DIO07, specify 0 to 7 for the parameter DiBit. DIO08 to DIO15 cannot be accessed. |
AIO-121602LN-USB AIO-120802LN-USB |
You can switch the I/O direction with AioSetDioDirection.
When accessing DIO00 to DIO07, specify 0 to 7 for the parameter DiBit. When accessing DIO08 to DIO15, specify 8 to 15 for the parameter DiBit. For digital output port, it is the echo back value. |
Example
Inputs the digital data from bit 0.
C, C++ |
long Ret; |
Python |
Ret = ctypes.c_long() |
See also