GenGetAoSweep


Function

Get the sweep information.

Format

Ret = GenGetAoSweep ( AppId , AoChannel , SweepType , SweepTimes , SweepStart , SweepStop )

Parameters

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#: out short ] [ Python: ctypes.POINTER(ctypes.c_ushort) ]

Return 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

SweepTime [ VB.NET: Short ] [ C++: short * ] [ C#: out short ] [ Python: ctypes.POINTER(ctypes.c_ushort) ]

Return the times of frequency.

SweepStart [ VB.NET: Single ] [ C++: float * ] [ C#: out float ] [ Python: ctypes.POINTER(ctypes.c_float) ]

Return the initial value of the sweep used for conversion.

SweepStop [ VB.NET: Single ] [ C++: float * ] [ C#: out float ] [ Python: ctypes.POINTER(ctypes.c_float) ]

Return the value at the end of the sweep used for conversion.

Return Value

Ret [ VB.NET: Integer ] [ C++: long ] [ C#: int ] [ Python: ctypes.c_long ]

Definition

Return Value

Description

GEN_ERR_SUCCESS

0

Normal completed

The others (See also: Error Code List)

Remarks

If sweep type is 0, the other values are not used.
This function can be executed even if the device is in operation.

Example

Get the sweep type, sweep time, value at the start of the sweep, and value at the end of the sweep for channel 0.

VB.NET

Dim Ret As Integer

Dim SweepType As Short

Dim SweepTimes As Short

Dim SweepStart As Single

Dim SweepStop As Single

Ret = GenGetAoSweep(AppId, 0, SweepType, SweepTimes, SweepStart, SweepStop)

 

C++

long Ret;

short SweepType;

int SweepTimes;

float SweepStart;

float SweepStop;

Ret = GenGetAoSweep(AppId, 0, &SweepType, &SweepTimes, &SweepStart, &SweepStop);

 

C#

long Ret;

short SweepType;

short SweepTimes;

float SweepStart;

float SweepStop;

Ret = gen.GetAoSweep(AppId, 0, out SweepType, out SweepTimes, out SweepStart, out SweepStop);

 

Python

Ret = ctypes.c_long()
SweepType = ctypes.c_ushort

SweepTimes = ctypes.c_ushort

SweepStart = ctypes.c_float
SweepStop = ctypes.c_float

Ret.value = cgen_api.GenGetAoSweep(AppId, 0, ctypes.byref(SweepType), ctypes.byref(SweepTimes), ctypes.byref(SweepStart),  ctypes.byref(SweepStop))

 

See Also

GenSetAoSweep