GenSetChannelSetting


Function

Set channel information for the specified channel number.

Format

Ret = GenSetChannelSetting ( AppId , AoChannel , Amplitude , Offset , AmplitudeType , AmplitudeUnit , Duty , Phase )

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.

Amplitude [ VB.NET: Single ] [ C++: float ] [ C#: float ] [ Python: ctypes.c_float ]

Specify the amplitude.

Offset [ VB.NET: Single ] [ C++: float ] [ C#: float ] [ Python: ctypes.c_float ]

Specify the offset.

AmplitudeType [ VB.NET: Short ] [ C++: short ] [ C#: short ] [ Python: ctypes.c_ushort ]

Specify the type.

Value

[Dec]

Macro

Description

0

GEN_PARAM_AMPTYPE_AMPLITUDE

Amplitude

1

GEN_PARAM_AMPTYPE_VPP

Vp-p

AmplitudeUnit [ VB.NET: Short ] [ C++: short ] [ C#: short ] [ Python: ctypes.c_ushort ]

Specify the unit.

Value

[Dec]

Macro

Description

0

GEN_PARAM_AMPUNIT_V_MA

If the device is voltage, it will be "V".

If the device is current, it will be "mA".

1

GEN_PARAM_AMPUNIT_BINARY

LSB

Duty [ VB.NET: Single ] [ C++: float ] [ C#: float ] [ Python: ctypes.c_float ]

Specify the duty ratio.

Please specify a value between 0 and 100.

Phase [ VB.NET: Single ] [ C++: float ] [ C#: float ] [ Python: ctypes.c_float ]

Specify the phase.

Please specify a value between -360 and 360.

Return Value

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_AMPLITUDE

22001

Amplitude is outside the settable range.

GEN_ERR_OFFSET

22002

Offset is outside the settable range.

GEN_ERR_AMPLITUDE_TYPE

22003

Frequency is outside the settable range.

GEN_ERR_AMPLITUDE_UNIT

22004

Frequency type is outside the settable range.

GEN_ERR_DUTY

22005

Frequency unit is outside the settable range.

GEN_ERR_PHASE

22006

Oscillation type is outside the settable range.

The others (See also: Error Code List)

Initial Value

Amplitude: 10 [V or mA]

Offset: 0 [V or mA]

Duty ratio: 50 [%]

Phase: 0 [degree]

Remarks

Set the amplitude, duty ratio, offset, and phase.

Some parameters may not be used depending on the selected waveform type.

If there are multiple errors in the settings, the error with the earliest parameter number will be displayed preferentially as the return value.

If the device is in operation, this function cannot be performed.

Example

Enter amplitude 10 [V or mA], offset 0 [V or mA], duty ratio 50[%], and phase 0 [degrees] to channel 0.

VB.NET

Dim Ret As Integer

Ret = GenSetChannelSetting(AppId, 0, 10, 0, 0, 0, 50, 0)

 

C++

long Ret;

Ret = GenSetChannelSetting(AppId, 0, 10, 0, 0, 0, 50, 0);

 

C#

int Ret;

Ret = gen.SetChannelSetting(AppId, 0, 10, 0, 0, 0, 50, 0);

 

Python

Ret = ctypes.c_long()

Ret.value = cgen_api.GenSetChannelSetting(AppId, 0, 10, 0, 0, 0, 50, 0)

 

See Also

GenGetChannelSetting