AioGetAiStatus


Function

Retrieves the analog input status.

Format

Ret = AioGetAiStatus ( Id , AiStatus )

Parameters

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

AiStatus [ VB.NET : Integer ] [ C, C++ : long * ] [ C# : out int ] [ Python : ctypes.POINTER(ctypes.c_long) ]
Specifies the address of the variable that stores the status.
AiStatus have the meanings as following in bit.

Status

Macro

Value

Device is running

AIS_BUSY

00000001H

Wait the start trigger

AIS_START_TRG

00000002H

The specified number of data are stored

AIS_DATA_NUM

00000010H

Overflow

AIS_OFERR

00010000H

Sampling clock period error

AIS_SCERR

00020000H

AD conversion error

AIS_AIERR

00040000H

Driver spec error

AIS_DRVERR

00080000H

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.

11500

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

20001

This function can't be used by this device

20003

Can not use because another process is using the device
When another process is using the device, all functions except for those that support multi-process can not be performed.

Initial value

In all devices, AiStatus = 0

Remarks

If the sampling clock period error or AD conversion error occurs, the conversion stops.
In the FIFO memory format, if an overflow occurs, the conversion stops.
In the RING memory format, the conversion doesn't stop even if the overflow occurs.
This function cannot be used on devices without the analog input function.
This function can be executed if the device is working.
If the conversion start condition is specified to Event controller output, Wait the start trigger status will not be notified.

Example

Retrieves the analog input status.

VB.NET

Dim Ret As Integer
Dim AiStatus As Integer
Ret = AioGetAiStatus ( Id , AiStatus )
 

C, C++

long Ret;
long AiStatus;
Ret = AioGetAiStatus ( Id , &AiStatus );
 

C#

int Ret;
int AiStatus;
Ret = aio.GetAiStatus ( Id , out AiStatus );
 

Python

Ret = ctypes.c_long()
AiStatus = ctypes.c_long()
Ret.value = caio.AioGetAiStatus ( Id , ctypes.byref(AiStatus) )
 

See also

AioResetAiStatus