AioStartCnt


Function

Starts the counter action according to the set condition.

Format

Ret = AioStartCnt ( Id , CntChannel)

Parameters

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

CntChannel [ VB.NET : Short ] [ C, C++ : short ] [ C# : short ] [ Python : ctypes.c_short ]
Sets the channel of counter.

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.

15140

The value of CntChannel 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, counter 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.

25140

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

Remarks

The counter operation starts according to the set condition as soon as this function is performed.

After the counter operation was started, its status becomes ON when the comparison count match occurs.
The status is set back to OFF by performing the function AioResetCntStatus.

If the status of comparison count match is in ON, the overrun status becomes ON when the comparison count match occurs again.
The status is set back to OFF by performing the function AioResetCntStatus.
Even if the overrun status changes to ON, the counter operation isn't stopped.

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

Example

Starts the counter action for channel 0.

VB.NET

Dim Ret As Integer
Ret = AioStartCnt ( Id , 0 )
 

C, C++

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

C#

int Ret;
Ret = aio.StartCnt ( Id , 0 );
 

Python

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

See also

AioStopCnt