LoggerSetSamplingClock


Function

Sets clock information.

Format

Ret = LoggerSetSamplingClock ( AppId , ClockType , SamplingClockUnit , SamplingClock )

Parameters

AppId [ VB.NET: Short ] [ C++: short ] [ C#: short ] 

Specify Application ID retrieved by LoggerOpenApplication.

ClockType [ VB.NET: UShort ] [ C++: unsigned short ] [ C#: ushort ]

Specify the clock type.

Value

[Dec]

Macro

Description

0

LOGGER_PARAM_CLOCK_INTERNAL

Internal Clock

1

LOGGER_PARAM_CLOCK_EXTERNAL_FALLING

External clock (Falling edge)

2

LOGGER_PARAM_CLOCK_EXTERNAL_RASING

External clock (Rising edge)

SamplingClockUnit [ VB.NET: UShort ] [ C++: unsigned short ] [ C#: ushort ]

Specify the units.

Value

[Dec]

Macro

Description

0

LOGGER_PARAM_FREQUNIT_USEC  

Period µsec

1

LOGGER_PARAM_FREQUNIT_MSEC

Period msec

2

LOGGER_PARAM_FREQUNIT_SEC

Period sec

3

LOGGER_PARAM_FREQUNIT_Hz

frequency Hz

4

LOGGER_PARAM_FREQUNIT_KHz

frequency kHz

5

LOGGER_PARAM_FREQUNIT_MHz

frequency MHz

SamplingClock [ VB.NET: Double ] [ C++: double ] [ C#: double ]

Specify the frequency (or Period).

Return Value

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

Definition

Return code

[Dec]

Description

LOGGER_ERR_SUCCESS

0

Normal completed

LOGGER_ERR_STARTED

10006

Cannot execute because the device is in operation.

LOGGER_ERR_INVALID_ID

10010

Invalid AppId was specified.

 LOGGER_ERR_UPDATEINTERVAL

20014

Update interval is out of the settable range.

LOGGER_ERR_SAMPLINGCLOCK

20015

Sampling clock period is out of the settable range.

LOGGER_ERR_SAMPLINGCLOCK_UNIT

20016

Sampling clock period unit is out of the settable range.

The others (See also: Error Code List)

Initial Value

Nothing in particular.

Remarks

Sets clock information.

For the internal clock, you can specify the unit and period (or frequency).
For the external clock, you cannot specify the unit and period (or frequency).

Example

Specify an internal clock of 10msec.

VB.NET

Dim Ret As Integer

Ret = LoggerSetSamplingClock(AppId, LOGGER_PARAM_CLOCK_INTERNAL, LOGGER_PARAM_FREQUNIT_MSEC, 10)

 

C++

long Ret;

Ret = LoggerSetSamplingClock(AppId, 1, LOGGER_PARAM_CLOCK_INTERNAL, LOGGER_PARAM_FREQUNIT_MSEC, 10);

 

C#

int Ret;

Ret = logger.SetSamplingClock(AppId, 1, LOGGER_PARAM_CLOCK_INTERNAL, LOGGER_PARAM_FREQUNIT_MSEC, 10);

 

See Also

LoggerGetSamplingClock