GenSetDeviceSetting


Function

Set up the device.

Format

Ret = GenSetDeviceSetting ( AppId , AoChannels, Frequency, FrequencyType, FrequencyUnit )

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.

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

Specify the frequency.

 

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

Specify the type.

Value

[Dec]

Macro

Description

0

GEN_PARAM_FREQTYPE_FREQUENCY

Frequency

1

GEN_PARAM_FREQTYPE_PERIOD

Period

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

Specify the unit.

Value

[Dec]

Macro

Description

0

GEN_PARAM_FREQUNIT_HZ_SEC

Frequency [ Hz ], Period [ sec ]

1

GEN_PARAM_FREQUNIT_KHZ_MSEC

Frequency [ kHz ], Period [ msec ]

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_NUM

20002

Number of channels is outside the settable range.

GEN_ERR_FREQUENCY

20003

Frequency is outside the settable range.

GEN_ERR_FREQUENCY_TYPE

20004

Frequency type is outside the settable range.

GEN_ERR_FREQUENCY_UNIT

20005

Frequency unit is outside the settable range.

GEN_ERR_OSCILLATION_DATANUM

20009

Created data is outside the settable range. Please reduce the number of oscillation waveforms or reduce the stops.

GEN_ERR_DEVICE

24001

Device condition error occurred.

The others (See also: Error Code List)

Initial Value

Frequency: 1 [Hz]

Remarks

Set the frequency and channel number.

When specifying the frequency of the output waveform, you can select to specify "frequency" and "period".

Frequency setting range : 0.1 to 10000[Hz]

Period setting range       : 0.0001 to 10[sec]

 

When the device is in operation, you can change the "frequency" and "period" as long as one Number of basic waveform data points does not change.

If you change the number of data points, an error "20003: Frequency is outside the settable range." will occur.

For details, please refer to Number of basic waveform data points.

 

Additionally, the number of channels cannot be changed while the device is in operation.

Example

Set the number of channels to 0 and the frequency to 1Hz.

VB.NET

Dim Ret As Integer

Ret = GenSetDeviceSetting(AppId, 0, 1, 0, 0)

 

C++

long Ret;

Ret = GenSetDeviceSetting(AppId, 0, 1, 0, 0);

 

C#

int Ret;

Ret = gen.SetDeviceSetting(AppId, 0, 1, 0, 0);

 

Python

Ret = ctypes.c_long()

Ret.value = cgen_api.GenSetDeviceSetting(AppId, 0, 1, 0, 0)

 

See Also

GenGetDeviceSetting