Sets the state that the digital 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 WatchdogSetDigitalExpirationState ( _
	channels As Integer(), _
	states As Hil..::.DigitalState() _
)
C#
public void WatchdogSetDigitalExpirationState(
	int[] channels,
	Hil..::.DigitalState[] states
)
Visual C++
public:
void WatchdogSetDigitalExpirationState(
	array<int>^ channels, 
	array<Hil..::.DigitalState>^ states
)
JavaScript
function watchdogSetDigitalExpirationState(channels, states);

Parameters

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

An array containing the numbers of the digital 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: .

states
Type: array< Quanser.Hardware..::.Hil..::.DigitalState >[]()[]

An array in which each element contains the binary values to which to set the corresponding channel in the channels array upon watchdog expiration. This array must be the same size as the channels array.

Remarks

The WatchdogSetDigitalExpirationState method sets the state that the digital 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. Valid expiration states are DigitalState.Low (GND), DigitalState.High (VCC), DigitalState.Tristate (Z) and DigitalState.NoChange. Refer to the Hil..::.DigitalState enumeration for details.

The Quanser Q8-series cards may be configured to reset the digital outputs to tristate only. In this case, the analog outputs must also be configured to go 0V. If no expiration states are configured for the Q8-series, then the analog and digital outputs will not be reconfigured when the watchdog expires.

Warning

Many cards allow the digital I/O lines to be programmed as inputs or outputs. The digital I/O lines are configured as inputs or outputs using the SetDigitalDirections(array<Int32>[]()[], array<Int32>[]()[]) method. All the channels which will be used as digital inputs or outputs must be configured accordingly using this function. Failure to configure the digital I/O may result in the WatchdogSetDigitalExpirationState(array<Int32>[]()[], array<Hil..::.DigitalState>[]()[]) method failing to write the digital outputs as expected.

Examples

This example configures the first three digital outputs to go tristate upon watchdog expiration. Exceptions are ignored for simplicity.
C# Copy Code
int [] channels = { 0, 1, 2 };
Hil.DigitalState [] states = { Hil.DigitalState.Tristate, Hil.DigitalState.Tristate, Hil.DigitalState.Tristate };

card.WatchdogSetDigitalExpirationState(channels, states);
Visual Basic Copy Code
Dim channels() As Integer = {0, 1, 2}
Dim states() As Hil.DigitalState = {Hil.DigitalState.Tristate, Hil.DigitalState.Tristate, Hil.DigitalState.Tristate}

card.WatchdogSetDigitalExpirationState(channels, states)
Visual C++ Copy Code
array<int>^ channels = { 0, 1, 2 };
array<Hil::DigitalState>^ states = { Hil::DigitalState::Tristate, Hil::DigitalState::Tristate, Hil::DigitalState::Tristate };

card->WatchdogSetDigitalExpirationState(channels, states);

Exceptions

ExceptionCondition
Quanser.Hardware..::.HilException If the digital 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 digital state provided is not supported by the card.

See Also