Sets the state that the PWM outputs will be set to if the watchdog expires.

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

Syntax

Visual Basic (Declaration)
Public Sub WatchdogSetPwmExpirationState ( _
	channels As Integer(), _
	values As Double() _
)
C#
public void WatchdogSetPwmExpirationState(
	int[] channels,
	double[] values
)
Visual C++
public:
void WatchdogSetPwmExpirationState(
	array<int>^ channels, 
	array<double>^ values
)
JavaScript
function watchdogSetPwmExpirationState(channels, values);

Parameters

channels
Type: array< System..::.Int32 >[]()[]

An array containing the numbers of the PWM output channels for which the expiration state should be set. Channel numbers are zero-based. Thus, channel 0 is the first channel, channel 1 the second channel, etc.

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

values
Type: array< System..::.Double >[]()[]

An array in which each element contains the value to which to set the corresponding channel in the channels array upon watchdog expiration. How these values are interpreted depends on the PWM mode. The PWM mode is configured using the SetPwmMode(array<Int32>[]()[], array<Hil..::.PwmMode>[]()[]) method. This array must be the same size as the channels array.

Remarks

The WatchdogSetPwmExpirationState method sets the state that the PWM outputs will be set to if the watchdog expires. Most cards do not allow this state to be configured. The expiration states must be set prior to starting the watchdog timer using the WatchdogStart(Double) method.

The interpretation of the PWM states depends upon the PWM mode. Typically the data is interpreted as a duty cycle, in which a magnitude of 0.0 denotes a 0% duty cycle and magnitude of 1.0 indicates a 100% duty cycle. The sign determines the polarity of the output for those boards supporting bidirectional PWM outputs. However, other PWM modes are possible with some boards. Refer to the SetPwmMode(array<Int32>[]()[], array<Hil..::.PwmMode>[]()[]) method for details.

Examples

This example configures the first two PWM outputs to go to 0% duty cycle upon watchdog expiration. Exceptions are ignored for simplicity.
C# Copy Code
int []    channels = { 0, 1 };
double [] values   = { 0, 0 };

card.WatchdogSetPwmExpirationState(channels, values);
Visual Basic Copy Code
Dim channels() As Integer = {0, 1}
Dim values() As Double = {0, 0}

card.WatchdogSetPwmExpirationState(channels, values)
Visual C++ Copy Code
array<int>^    channels = { 0, 1 };
array<double>^ values   = { 0, 0 };

card->WatchdogSetPwmExpirationState(channels, values);

Exceptions

ExceptionCondition
Quanser.Hardware..::.HilException If the PWM expiration states cannot be set then an exception is thrown. This situtation typically arises if the board does not support a watchdog timer, or the PWM state provided is not supported by the card.

See Also