Set the sweep information.
Ret = GenSetAoSweep ( AppId , AoChannel , SweepType , SweepTimes , SweepStart , SweepStop )
AppId [ VB.NET: Short ] [ C++: short ] [ C#: short ] [ Python: ctypes.c_short ]
Specify Application ID retrieved by GenOpenApplication.
AoChannel [ VB.NET: Short ] [ C++: short ] [ C#: short ] [ Python: ctypes.c_ushort ]
Specify the channel number.
SweepType [ VB.NET: Short ] [ C++: short ] [ C#: short ] [ Python: ctypes.c_ushort ]
Specify the sweep type.
- Sinewave
Value [Dec] |
Macro |
Description |
0 |
GEN_PARAM_SWEEP_NONE |
None |
1 |
GEN_PARAM_SWEEP_FREQUENCY |
Frequency sweep |
2 |
GEN_PARAM_SWEEP_AMPLITUDE |
Amplitude sweep |
3 |
GEN_PARAM_SWEEP_DC_OFFSET |
DC offset sweep |
- Square
Value [Dec] |
Macro |
Description |
0 |
GEN_PARAM_SWEEP_NONE |
None |
1 |
GEN_PARAM_SWEEP_DUTY_RATIO |
Duty ratio sweep |
- Other waveforms
Value [Dec] |
Macro |
Description |
0 |
GEN_PARAM_SWEEP_NONE |
None |
SweepTimes [ VB.NET: Short ] [ C++: short ] [ C#: short ] [ Python: ctypes.c_ushort ]
Specify the times of frequency.
Please specify a value between 0 and 10.
SweepStart [ VB.NET: Single ] [ C++: float ] [ C#: float ] [ Python: ctypes.c_float ]
Specify the initial value of the sweep used for conversion.
SweepStop [ VB.NET: Single ] [ C++: float ] [ C#: float ] [ Python: ctypes.c_float ]
Specify the value at the end of the sweep used for conversion.
Ret [ VB.NET: Integer ] [ C++: long ] [ C#: int ] [ Python: ctypes.c_long ]
Definition |
Return Value |
Description |
GEN_ERR_SUCCESS |
0 |
Normal completed |
GEN_ERR_STARTED |
10006 |
Cannot execute because the device is in operation. |
GEN_ERR_CHANNEL_NO |
22000 |
Channel number is outside the settable range. |
GEN_ERR_SWEEP_TYPE |
22008 |
Sweep type is outside the settable range. |
GEN_ERR_SWEEP_RATIO |
22009 |
Sweep time is outside the settable range. |
GEN_ERR_SWEEP1 |
22010 |
The value before the sweep change is outside the settable range. |
GEN_ERR_SWEEP2 |
22011 |
The value after the sweep change is outside the settable range. |
The others (See also: Error Code List)
Sweep Type : 0 (None)
The basic waveform can be swept.
This can be used when the basic waveform is a sine wave or square wave.
For other waveform types, there will be no sweep.
You can select from 4 types for sine wave and 2 types for square wave.
If the device is in operation, this function cannot be performed.
Condition: Waveform type sine
The sweep type of channel 0 is set to frequency sweep, from 5Hz to 0.5Hz in the time of one waveform.
VB.NET |
Dim Ret As Integer Ret = GenSetAoSweep(AppId, 0, 1, 1, 5, 0.5)
|
C++ |
long Ret; Ret = GenSetAoSweep(AppId, 0, 1, 1, 5, 0.5);
|
C# |
int Ret; Ret = gen.SetAoSweep(AppId, 0, 1, 1, 5, 0.5);
|
Python |
Ret = ctypes.c_long() Ret.value = cgen_api.GenSetAoSweep(AppId, 0, 1, 1, 5, 0.5)
|