AioInputDiByte


Function

Inputs the data in byte from the specified port of digital input. This function supports multi-process.

Format

Ret = AioInputDiByte ( Id , DiPort , DiData )

Parameters

Id [ VB.NET : Short ] [ C, C++ : short ] [ C# : short ] [ Python : ctypes.c_short ]
Specifies the device ID retrieved from AioInit.

DiPort [ VB.NET : Short ] [ C, C++ : short ] [ C# : short ] [ Python : ctypes.c_short ]
Specifies the port of digital input.

DiData [ VB.NET : Short ] [ C, C++ : short * ] [ C# : out short ] [ Python : ctypes.POINTER(ctypes.c_short) ]
Specifies the address of the variable that stores the input data.

Return value

Ret [ VB.NET : Integer ] [ C, C++ : long ] [ C# : int ] [ 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
Use the Id retrieved from AioInit to specify the Id in this function.

10002

AIO driver can't be called
At first, perform AioInit function.

14010

The value of DiPort is outside the designated range of the function
Specify the digital input port in range: 0 <= DiPort <= Max port.

14011

Pointer to DiData is NULL
Specify the address of variable to parameter.

20001

This function can't be used by this device

24010

The value of DiPort 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.

Specifications based on devices

AIO-163202G-PE
AIO-163202UG-PE
AIO-123202G-PE
AIO-123202UG-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 for the parameter DiPort.

When accessing DIO08 to DIO15, specify 1 for the parameter DiPort.

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 for the parameter DiPort.

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 for the parameter DiPort.

When accessing DIO08 to DIO15, specify 1 for the parameter DiPort.

For digital output port, it is the echo back value.

Example

Inputs the digital data from port 0.

VB.NET

Dim Ret As Integer
Dim DiData As Short
Ret = AioInputDiByte ( Id , 0 , DiData )
 

C, C++

long Ret;
short DiData;
Ret = AioInputDiByte ( Id , 0 , &DiData );
 

C#

int Ret;
short DiData;
Ret = aio.InputDiByte ( Id , 0 , out DiData );
 

Python

Ret = ctypes.c_long()
DiData = ctypes.c_short()
Ret.value = caio.AioInputDiByte ( Id , 0 , ctypes.byref(DiData))
 

See also

AioInputDiBit