Sets the frequencies of clocks on the card.

Namespace:  Quanser.Hardware
Assembly:  Quanser.Hardware.Hil (in Quanser.Hardware.Hil.dll)

Syntax

Visual Basic (Declaration)
Public Sub SetClockFrequency ( _
	clocks As Hil..::.Clock(), _
	frequency As Double() _
)
C#
public void SetClockFrequency(
	Hil..::.Clock[] clocks,
	double[] frequency
)
Visual C++
public:
void SetClockFrequency(
	array<Hil..::.Clock>^ clocks, 
	array<double>^ frequency
)
JavaScript
function setClockFrequency(clocks, frequency);

Parameters

clocks
Type: array< Quanser.Hardware..::.Hil..::.Clock >[]()[]

An array containing the clocks whose frequencies will be set. Only hardware clocks, such as Hil.Clock.Hardware0, should be specified.

Select a board type from the list for board-specific details: .

frequency
Type: array< System..::.Double >[]()[]
An array of doubles containing the new frequency for each clock in Hertz. Each element in the frequency array corresponds to the same element in the clocks array. Hence, there must be as many elements in the frequency array as there are clocks.

Remarks

Some cards support hardware clocks. The SetClockFrequency method sets the frequencies of the selected clocks on the card. Note that many cards do not support programming the frequencies of clocks on the card independent of other functionality. However, most do support clocks as a hardware timebase for tasks (see Start(Hil..::.Clock, Double, Int32) method).

The Quanser QPID-series support programmable clock frequencies and each clock may be assigned a different frequency. Clock frequencies will be rounded to the nearest frequency supported by the card.

Examples

This sample illustrates how to use the SetClockFrequency(array<Hil..::.Clock>[]()[], array<Double>[]()[]) method. It sets the frequencies of clocks 0 and 3 to 8.33 MHz and sets channel 2 to 4.17 MHz.
C# Copy Code
Hil.Clock [] clocks      = { Hil.Clock.Hardware0, Hil.Clock.Hardware2, Hil.Clock.Hardware3 };
double []    frequencies = {       8.33e6,               4.17e6,             8.33e6        };

board.SetClockFrequency(channels, frequencies);
Visual Basic Copy Code
Dim clocks() As Hil.Clock = {Hil.Clock.Hardware0, Hil.Clock.Hardware2, Hil.Clock.Hardware3}
Dim frequencies() As Double = {8.33e6, 4.17e6, 8.33e6}

board.SetClockFrequency(channels, frequencies)
Visual C++ Copy Code
array<Hil::Clock>^ clocks      = { Hil::Clock::Hardware0, Hil::Clock::Hardware2, Hil::Clock::Hardware3 };
array<double>^     frequencies = {         8.33e6,               4.17e6,                8.33e6         };

board->SetClockFrequency(channels, frequencies);

Exceptions

ExceptionCondition
Quanser.Hardware..::.HilException If the clock frequencies cannot be set then an exception is thrown. This situtation typically arises when given frequencies are out of range or the card does not support programming of the frequencies for its clocks independently.

See Also