Sets the mode for the hardware clocks.

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

Syntax

Visual Basic (Declaration)
Public Sub SetClockMode ( _
	clocks As Hil..::.Clock(), _
	modes As Hil..::.ClockMode() _
)
C#
public void SetClockMode(
	Hil..::.Clock[] clocks,
	Hil..::.ClockMode[] modes
)
Visual C++
public:
void SetClockMode(
	array<Hil..::.Clock>^ clocks, 
	array<Hil..::.ClockMode>^ modes
)
JavaScript
function setClockMode(clocks, modes);

Parameters

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

An array containing the clocks whose modes will be changed. System clocks do not support different modes so only hardware clocks, such as Hil.Clock.Hardware0, should be specified.

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

modes
Type: array< Quanser.Hardware..::.Hil..::.ClockMode >[]()[]
An array of clock modes containing the new clock mode for each channel. Each element in the modes array corresponds to the same element in the clocks array. Hence, there must be as many elements in the modes array as there are channels. Refer to the Hil..::.ClockMode enumeration for a list of valid clock modes.

Remarks

The SetClockMode method sets mode of the hardware clocks. This method is used with hardware clocks that are multipurpose. Some boards, like the Q8, allow the hardware clocks to be configured as timebases (the default) or as PWM outputs. This function allows the appropriate mode to be selected.

Examples

This sample illustrates how to use the SetClockMode(array<Hil..::.Clock>[]()[], array<Hil..::.ClockMode>[]()[]) method. It configures Hil.Clock.Hardware0 as a PWM output.
C# Copy Code
Hil.Clock []     clocks = { Hil.Clock.Hardware0 };
Hil.ClockMode [] modes  = { Hil.ClockMode.Pwm };

board.SetClockMode(clocks, modes);
Visual Basic Copy Code
Dim clocks() As Hil.Clock = {Hil.Clock.Hardware0}
Dim modes() As Hil.ClockMode = {Hil.ClockMode.Pwm}

board.SetClockMode(clocks, modes)
Visual C++ Copy Code
array<Hil::Clock>^     clocks = { Hil::Clock::Hardware0 };
array<Hil::ClockMode>^ modes  = { Hil::ClockMode::Pwm };

board->SetClockMode(clocks, modes);

Exceptions

ExceptionCondition
Quanser.Hardware..::.HilException If the clock modes cannot be set then an exception is thrown. This situtation typically arises when the card does not support one of the modes specified.

See Also