quanser.hardware.hil.is_valid quanser.hardware.hil.set_analog_input_ranges navigation bar

Table of Contents

quanser.hardware.hil.set_analog_input_configuration

Sets the configuration of analog inputs.

Syntax

        err = board.set_analog_input_configuration(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 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: .

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
        board.set_analog_input_configuration([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