Function
Sets the preset value loaded after the comparison count match.
Format
Ret = AioSetCntPresetReg ( Id , CntChannel , PresetNumber , PresetData , Flag )
Parameters
Id
[ C, C++ : short ] [ Python : ctypes.c_short ]
Specifies the ID retrieved from AioInit.
CntChannel
[ C, C++ : short ] [ Python : ctypes.c_short ]
Sets the channel of counter.
PresetNumber
[ C, C++ : long ] [ Python : ctypes.c_long ]
Specifies the total number of the preset data to be set.
PresetData
[ C, C++ : long * ] [ Python : ctypes.POINTER(ctypes.c_long) ]
Specifies the pointer to the array that stores the preset of counter (initial
value).
The range that can be set is different according to devices.
Flag
[ C, C++ : short ] [ Python : ctypes.c_short ]
Specifies whether to repeatedly set the data array of preset data.
0 |
Not repeat |
1 |
Repeat |
If Repeat is set, the first
data of the array is set again when the last preset value of the array
matches the next comparison count set.
If Not repeat is set, data isn't preset when the last preset value of the
array matches the followed comparison count set.
Return values
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 |
10002 |
AIO
driver can't be called |
15020 |
The value of CntChannel is outside the designated range of the function |
15021 |
The value of PresetNumber is outside the designated range of the function |
15022 |
The value of Flag is outside the designated range of the function |
15023 |
Pointer
to PresetData is NULL |
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 |
25020 |
The value of CntChannel is outside the designated range of the device being used |
25021 |
The value of PresetNumber is outside the designated range of the device being used |
Initial values
None
Remarks
The value set by using this function is loaded
as the count value after comparison count match.
The values set in the array are set in turn when the comparison count match
occurs every time.
If the preset data after comparison count match is fixed, please set PresetNumber = 1 and Flag = 1.
In order to use this functionality, you should
set "Preset count value load" as the operation mode by using
the function AioSetCntComparisonMode.
This function cannot be used on devices without counter functionality.
If the device is in operation, the function cannot be performed.
Specifications based on devices
AI-1664UG-PE |
PresetNumber can
be set in 1 to 255(FFH). |
AIO-160802L-LPE |
PresetNumber can
be set in 1 only. |
AIO-163202FX-USB |
PresetNumber can
be set in 1 to 255(FFH). |
AIO-121602LN-USB |
PresetNumber can
be set in 1 to 255(FFH). |
AI-1664LAX-USB |
PresetNumber can
be set in 1 to 255(FFH). |
AO-1604LX-USB |
PresetNumber can
be set in 1 to 255(FFH). |
Example
Set the first preset data 10000 to channel 0 repeatedly.
C, C++ |
long
Ret; |
Python |
Ret
= ctypes.c_long() |
See also