Status
④ Analog Input [ai_status.vi]

 

Select when you want to check the status of continuous analog input

 

 


Layout of IN/OUT terminal

 


OUT terminal

AiSamplingCount

Get the current number of samplings for 1Ch

    e.g.) Sampling for 500 times in 2 channels, the number of data is 1000
    AiSamplingCount is 500

 

AiRepeatCount

Get the current number of repeat times
* For devices that cannot use repeat operation, the value that can be acquired is "0".

 

AiStatus

Get the current status of analog input

The followings are the meanings in bit of hexadecimal notation

Value

Status

Meaning

00000001H

Device is running

This status is ON from performing [Start] to conversion stop/stop by error/stop by [Stop]

This status is also ON when wait for the start trigger/delay sampling/ repeat operation

00000002H

Wait for the start trigger

Range comparison, this status is ON from performing [Start] to satisfying the trigger condition. As the conversion starts, this status changes to be OFF

Even if repeat operation, this status changes to be ON each time the state is waiting for a trigger

00000010H

Store up to the specified number of data

When the conversion data stored in the memory is up to the number of samplings set by AiSamplingTimes of [Start], this status changes to be ON

In the case of FIFO memory, perform [Read] when this status is ON. If the number of data in buffer is less than the specified number, this status changes to be OFF

This status changes to be OFF when performing [Start] or advanced function AioResetDevice_i.vi

If AiSamplingTimes in [Start] is specified as 0, this status is always OFF

00010000H

Overflow

When the buffer cannot contain the conversion data, this status changes to be ON

At this time, in the case of FIFO memory, conversion stops

In the case of RING memory, conversion continues and overwrites the old data

This status changes to be OFF when performing [Start] or advanced function AioResetDevice_i.vi.

00020000H

Sampling clock error

As the conversion speed is too fast, the error occurs, conversion stops and this status changes to be ON

This status changes to be OFF when performing [Start] or advanced function AioResetDevice_i.vi

00040000H

AD conversion error

Usually, this status is OFF, but when any error occurred, this status changes to be ON

If this status changed to be ON, there may be a failure of the device

If the problem is not resolved, please contact the window listed in [Contact]

00080000H

Driver spec error

If the driver cannot process in time, the error occurs

In the case of the device which uses the driver memory, the conversion needs [the conversion speed of device + the driver processing time]

(The driver processing time depends on the environment)

This error and [Sampling clock error] occur at the same time

e.g.) When AiStatus is [11H] (In decimal it's [17])
    [Device is running] and [Store up to the specified number of data] are ON

 

AiStopTriggerCount

Get the number of sampling for 1Ch when a stop trigger is input
* Since the CPS-AI-1608LI and CPS-AI-1608ALI cannot acquire the number of sampling when the stop trigger is input, the value that can be acquired is "0".

Continuous sampling by using status

When performing continuous sampling for a long time in the FIFO memory, if [Read] is not executed at a certain period, convention data will over the amount of data the device or driver can hold, and sampling will stop. (Overflow)

The [Store up to the specified number of data] (00000010H) status can be used for this reading period.

There is a way to periodically read all the data like sample InfiniteAi.vi. You can also try to read a certain amount of data every time.