Sets the counter operation as comparison count match occurs.
Ret = AioSetCntComparisonMode ( Id , CntChannel , CntMode )
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.
CntMode
[ VB.NET : Short ] [ C, C++ : short ] [ C# : short ] [ Python : ctypes.c_short
]
Specifies the operation mode from the following range in macro
or numerical value.
CntMode has the following meanings in bit, it can be specified by a combination
of these bits.
Operation mode |
Macro |
Value |
Preset count value load |
CNT_LOADPRESET |
00000001H |
Comparison count value load |
CNT_LOADCOMP |
00000002H |
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 |
10002 |
AIO
driver can't be called |
15000 |
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 |
20003 |
Can
not use because another process is using the device |
25000 |
The value of CntChannel is outside the designated range of the device being used |
25002 |
Operation mode 'preset count value load' is not enable |
25003 |
Operation mode 'Comparison count value load' is not enable |
CntMode = 0
In this case, "Preset count value load" and "Comparison
count value load" are always fixed to 0.
The function sets the counter operation after the comparison count match.
If "Preset count value load" is
set as operation mode, the count value will move to the preset value set
in advance after comparison count match.
If the value is set, you must set the preset value using the function AioSetCntPresetReg.
If the preset value isn't set, it becomes the initial value 0.
If "Comparison count value load"
is set as operation mode, the next comparison count value after comparison
count match will be updated to the value that is set by AioSetCntComparisonReg.
If the value is set, you must set the comparison count value using the
function AioSetCntComparisonReg.
If the comparison count value isn't set, it becomes the initial
value 0.
This function cannot be used on devices without
counter functionality.
If the device is in operation, the function cannot be performed.
In the case of Analog L Series
- Even if CNT_LOADPRESET is specified, it's not valid.
- When the comparison count match has occurred, the count value is cleared
to zero.
AI-1664UG-PE AIO-163202G-PE |
All operation mode can be used. |
AIO-160802L-LPE |
All operation mode can be used. |
AI-1616L-LPE |
All operation mode can be used. |
AO-1604L-LPE |
All operation mode can be used. |
AIO-163202FX-USB |
All operation mode can be used. |
AI-1664LAX-USB |
All operation mode can be used. |
AIO-121602LN-USB |
All operation mode can be used. |
Sets "Preset count value load" as the operation mode for channel 0.
VB.NET |
Dim
Ret As Integer |
C, C++ |
long
Ret; |
C# |
int
Ret; |
Python |
Ret
= ctypes.c_long() |
AioGetCntComparisonMode, AioSetCntPresetReg, AioSetCntComparisonReg