quanser.hardware.hil.watchdog_set_pwm_expiration_state quanser.hardware.hil.watchdog_set_other_expiration_state navigation bar

Table of Contents

quanser.hardware.hil.watchdog_set_digital_expiration_state

Sets the watchdog expiration state of the specified digital channels.

Syntax

err = board.watchdog_set_digital_expiration_state(channels, states)
    

Description

Configures the state to which the specified digital channels will be reset when a watchdog timer 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 set_digital_directions function. All the channels which will be used as digital outputs must be configured as outputs using this function. Failure to configure the digital I/O may result in the watchdog_set_digital_expiration_state function failing to write those outputs when the watchdog expires.

If no err output is provided then it throws an exception if an error occurs. In generated code it prints the error message. Use hil_get_error_message to get the message associated with an error code.

Parameters

board

The board instance returned by the quanser.hardware.hil.open function.

channels

A vector of channel numbers. Channel numbers are zero-based.

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

states

A vector of digital states. There must be one element for each channel. The table below shows the values that are valid as a digital expiration state:

State Description

0

Low

1

High

2

Tristate

3

No change

Outputs

err

A negative error code or zero on success.

Examples

% Configures digital outputs 0-15 to be reset to 1 on watchdog expiration
board.watchdog_set_digital_expiration_state(0:15, ones(1,16));
    

See Also

 

navigation bar