Start of trail End of trail navigation bar

Table of Contents

hil_set_analog_input_configuration

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 configuration of the specified analog input channels.

Syntax

        err = hil_set_analog_input_configuration(board, channels, configurations)
    

Description

Sets the configuration of the specified analog input channels. Only configurations supported by the board may be specified. Invalid configurations 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: .

configurations

A vector of analog input configurations indicating the configuration for the corresponding channel. There must be one element for each element in the channels vector. Configurations may be specified from the t_analog_input_configuration enumeration or numeric values may be used. See the t_analog_input_configuration page for details.

Outputs

err

A negative error code or zero on success.

Examples

        % Set channel 0 to referenced single-ended, channel 3 to differential and channel 4 to non-referenced single-ended
        hil_set_analog_input_configuration(board, [0 3 4], [...
            t_analog_input_configuration.ANALOG_INPUT_RSE_CONFIGURATION, ...
            t_analog_input_configuration.ANALOG_INPUT_DIFF_CONFIGURATION, ...
            t_analog_input_configuration.ANALOG_INPUT_NRSE_CONFIGURATION ...
        ]);
    

See Also

 

navigation bar