AioGetDemoDoBit


Function

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

Format

Ret = AioGetDemoDoBit ( Id , DoBitNum , DoBit , DoData )

Parameters

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

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

DoBit [ C, C++ : short * ] [ Python : ctypes.POINTER(ctypes.c_short) ]
Specifies the address of the array that stored the bit 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.

18062

Pointer to DoBit, DoData is NULL

28060

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

28061

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

28062

A driver inner error occurred

Remarks

This is a function dedicated to the demo device.

You can modify Digital Output value by calling AioOutputDoBit function.

 

Example

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

C, C++

long Ret;
short AoChannel[8];
float AoData[8];
short i;
for( i = 0 ; i < 8 ; i++ ){
    AoChannel[i] = i;
}
Ret = AioGetDemoAo ( Id , 8 , &AoChannel[0] , &AoData[0] );
 

Python

Ret = ctypes.c_long()
DoBitType = ctypes.c_short * 8
DoBit = DoBitType()
DoDataType = ctypes.c_short * 8
DoData = DoDataType()
for i in range(8):
    DoBit[i] = i
Ret.value = caio.AioGetDemoDoBit ( Id , 8 , DoBit , DoData )
 

See also

AioGetDemoDoByte, AioOutputDoBit