hil_close_all hil_set_analog_output_ranges navigation bar

Table of Contents

hil_set_analog_input_ranges

Deprecated

The HIL API MATLAB functions have been deprecated in favour of the new quanser.hardware.hil class, which has support for code generation for Quanser targets. Hence, with the new hil class it is possible to run MATLAB scripts in real-time on Quanser targets, while making use of the Quanser hardware.

Sets the voltage ranges of the specified analog input channels.

Syntax

err = hil_set_analog_input_ranges(board, channels, minimums, maximums)
    

Description

Sets the voltage ranges of the specified analog input channels. The voltages ranges are specified as a vector of minimum and maximum voltages, with the range for a particular element in the channel vector being indicated by the corresponding elements in the minimum and maximum vectors.

Only voltage ranges supported by the board may be specified. Invalid ranges will generate an error.

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 handle returned by hil_open.

channels

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

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

minimums

A vector of voltages indicating the minimum voltage for the corresponding channel. There must be one element for each element in the channels vector.

maximums

A vector of voltages indicating the maximum voltage for the corresponding channel. There must be one element for each element in the channels vector.

Outputs

err

A negative error code or zero on success.

Examples

% Set channel 0 to bipolar 10V, channel 3 to unipolar 10V and channel 4 to bipolar 5V
hil_set_analog_input_ranges(board, [0 3 4], [-10 0 -5], [10, 10, 5]);
    

See Also

 

navigation bar