quanser.hardware.hil.poll_interrupt quanser.hardware.hil.monitor_start navigation bar

Table of Contents

quanser.hardware.hil.monitor_create_interrupt_reader

Creates a monitor to read the specified interrupt channels.

Syntax

[monitor, err] = board.monitor_create_interrupt_reader(channels)
    

Description

Creates a monitor to read the specified interrupt channels. The monitor must be deleted using the monitor.close or the monitor_close_all function. Monitors are used for querying the status of events. Monitors query events in the background once the monitor is started. The current state may be read using the monitor.read_interrupt function. Since the monitor.read_interrupt function blocks and MATLAB is not multi-threaded, it is often preferable to use the poll_interrupt function instead of monitors.

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 corresponding to interrupt sources. Channel numbers are zero-based.

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

Outputs

monitor

A monitor structure. Fields of the structure should never be modified.

err

A negative error code or zero on success.

Examples

% Create a monitor to read interrupt sources 0 and 3.
monitor = board.monitor_create_interrupt_reader([0 3]);
    

See Also

 

navigation bar