AioSetAiStartTrigger


Function

Sets the conversion start condition.

Format

Ret = AioSetAiStartTrigger ( Id , AiStartTrigger )

Parameters

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

AiStartTrigger [ C, C++ : short ] [ Python : ctypes.c_short ]
Sets the conversion start condition from the following range.
The available value differs by the device.

0

Software

1

External trigger rising edge

2

External trigger falling edge

3

Level comparison

4

In Range comparison

5

Out Range comparison

10

Event controller output

Return value

Ret [ C, C++ : long ] [ 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.

11160

The value of AiStartTrigger is outside the designated range of the function

20001

This function can't be used by this device

20002

Can not use while by another device works
To use this function, analog input operation must be stopped.

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.

21160

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

Initial value

Software start for all devices

Remarks

If the conversion start condition is "Level comparison", please use AioSetAiStartLevel function to set Level comparison start.
If the conversion start condition is "In Range comparison", please use AioSetAiStartInRange function to set In Range comparison start.
If the conversion start condition is "Out Range comparison", please use AioSetAiStartOutRange function to set Out Range comparison start.
If the event controller output is used as the clock, please use AioSetEcuSignal function to connect Event controller.
If you only perform this function, the connection of the event controller isn't changed.
 

This function cannot be used on devices without the analog input function.
If the device is in operation, the function cannot be performed.

Specifications based on devices

AI-1204Z-PE

Available AiStartTrigger is 0, 1, 2, 3, 4, 5, 10.

AI-1664UG-PE
AIO-163202G-PE
AIO-163202UG-PE
AIO-123202G-PE
AIO-123202UG-PE
AIO-163202F-PE
ADA16-32/2(PCI)F

Available AiStartTrigger is 0, 1, 2, 3, 4, 5, 10.

AIO-160802L-LPE
ADA16-8/2(LPCI)L
ADAI16-8/2(LPCI)L
AIO-160802LI-PE

Available AiStartTrigger is 0, 1, 2, 3.

AI-1616L-LPE
AD16-64(LPCI)LA
AD16-16(LPCI)L
ADI16-16(LPCI)L
AI-1616LI-PE
AI-1664LA-LPE

Available AiStartTrigger is 0, 1, 2, 3.

AD12-16(PCI)EV
AD12-16U(PCI)EV
AD16-16(PCI)EV
AD16-16U(PCI)EV
AIO-121601E3-PE
AIO-121601UE3-PE
AIO-161601E3-PE
AIO-161601UE3-PE
AI-1216I2-PCI

Available AiStartTrigger is 0, 1, 2, 3.

AD12-64(PCI)
AD12-16(PCI)

Available AiStartTrigger is 0, 2, 3.

AI-1604CI2-PCI

Available AiStartTrigger is 0, 2, 3.

AI-1608AY-USB
AIO-160802AY-USB
AI-1608GY-USB
AIO-160802GY-USB

Available AiStartTrigger is 0, 1, 2, 3.

AIO-163202FX-USB

Available AiStartTrigger is 0, 1, 2, 3, 4, 5, 10.

AI-1664LAX-USB

Available AiStartTrigger is 0, 1, 2, 3.

AIO-121602LN-USB
AIO-120802LN-USB

Available AiStartTrigger is 0, 1, 2, 3.

AI-1608VIN-USB
AI-1608AIN-USB
AI-1608VIN-ETH
AI-1608AIN-ETH

Available AiStartTrigger is 0, 1, 2, 3.

CPS-AI-1608LI
CPS-AI-1608ALI

Available AiStartTrigger is 0.

AIO-16256256-DEMO

Available AiStartTrigger is 0, 1, 2, 3.

Precautions when using level comparison (range comparison) as the conversion start condition for USB devices

When using a USB device, level comparison is determined by driver software processing.
Therefore, when the StartAI() function is executed with the level comparison start condition, USB transfer of data between the USB device and the driver software will start.
If the USB transfer is not done in time even before the start condition is satisfied, the buffer overflow error on the USB device may occur.
If an error occurs, it is necessary to execute the AioResetAiMemory() function separately to clear the error.

Note that the following USB devices are designed to perform level comparison judgments in processing on the devices.
Therefore, improvements have been made so that buffer overflow does not occur before the start condition is satisfied.

AI-1608AIN-USB、AI-1608VIN-USB

 

Example

Sets "Software" as the conversion start condition.

C, C++

long Ret;
Ret = AioSetAiStartTrigger ( Id , 0 );
 

Python

Ret = ctypes.c_long()
Ret.value = caio.AioSetAiStartTrigger ( Id , 0 )
 

See also

AioGetAiStartTrigger