AioGetDemoDoByte


Function

This is a function that gets the digital output of the demo device in port.

Format

Ret = AioGetDemoDoByte ( Id , DoPortNum , DoPort , DoData )

Parameters

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

DoPortNum [ C, C++ : short ] [ Python : ctypes.c_short ]
Specifies the number of elements in the port number array.

DoPort [ C, C++ : short * ] [ Python : ctypes.POINTER(ctypes.c_short) ]
Specifies the address of the array that stored the port number.

DoData [ C, C++ : short * ] [ Python : ctypes.POINTER(ctypes.c_short) ]
Specifies the address of the array that stores the data.

Return values

Ret [ C, C++ : long ] [ Python : ctypes.c_long ]

Return values

Content

0

Normality completion

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.

18082

Pointer to DoPort, DoData is NULL

28080

The value of DoPortNum is outside the designated range of the device being used

28081

The value of DoPort is outside the designated range of the device being used

28082

A driver inner error occurred

Remarks

This is a function dedicated to the demo device.

You can modify Digital Output value by calling AioOutputDoByte function.

 

Example

Gets the digital output data of port 0 to port 7.

C, C++

long Ret;
short DoByte[8];
short DoData[8];
short i;
for( i = 0 ; i < 8 ; i++ ){
    DoByte[i] = i;
}
Ret = AioGetDemoDoByte ( Id , 8 , &DoByte[0] , &DoData[0] );
 

Python

Ret = ctypes.c_long()
DoByteType = ctypes.c_short * 8
DoByte = DoByteType()
DoDataType = ctypes.c_short * 8
DoData = DoDataType()
for i in range(8):
    DoByte[i] = i
Ret.value = caio.AioGetDemoDoByte ( Id , 8 , DoByte , DoData )
 

See also

AioGetDemoDoBit, AioOutputDoByte