Sets the configurations of the analog inputs.

Namespace:  Quanser.Hardware
Assembly:  Quanser.Hardware.Hil (in Quanser.Hardware.Hil.dll)

Syntax

Visual Basic (Declaration)
Public Sub SetAnalogInputConfiguration ( _
	channels As Integer(), _
	configurations As Hil..::.AnalogInputConfiguration() _
)
C#
public void SetAnalogInputConfiguration(
	int[] channels,
	Hil..::.AnalogInputConfiguration[] configurations
)
Visual C++
public:
void SetAnalogInputConfiguration(
	array<int>^ channels, 
	array<Hil..::.AnalogInputConfiguration>^ configurations
)
JavaScript
function setAnalogInputConfiguration(channels, configurations);

Parameters

channels
Type: array< System..::.Int32 >[]()[]

An array containing the numbers of the analog input channels whose configurations will be changed. Channel numbers are zero-based. Thus, channel 0 is the first channel, channel 1 the second channel, etc.

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

configurations
Type: array< Quanser.Hardware..::.Hil..::.AnalogInputConfiguration >[]()[]
An array of input configurations containing the new configuration for each channel. Each element in the configurations array corresponds to the same element in the channels array. Hence, there must be as many elements in the configurations array as there are channels. Refer to the Hil..::.AnalogInputConfiguration enumeration for a list of valid configurations.

Remarks

The SetAnalogInputConfiguration method sets the configurations of the analog inputs. Not all cards support programmable input configurations. Some cards only allow all inputs to have the same configuration, rather than allowing each analog input to have a separate configuration. Refer to the documentation for your card for details on the features supported by the card.

Examples

This sample illustrates how to use the SetAnalogInputConfiguration(array<Int32>[]()[], array<Hil..::.AnalogInputConfiguration>[]()[]) method. It sets the configuration of analog input 0 to referenced single-ended, the configuration of analog input 3 to referenced single-ended, and the configuration of input 5 to differential.
C# Copy Code
int []                          channels = { 0, 3, 5 };
Hil.AnalogInputConfiguration [] configs  = { Hil.AnalogInputConfiguration.RSE, Hil.AnalogInputConfiguration.RSE, Hil.AnalogInputConfiguration.DIFF };

board.SetAnalogInputConfiguration(channels, configs);
Visual Basic Copy Code
Dim channels() As Integer                     = {0, 3, 5}
Dim configs() As Hil.AnalogInputConfiguration = { Hil.AnalogInputConfiguration.RSE, Hil.AnalogInputConfiguration.RSE, Hil.AnalogInputConfiguration.DIFF }

board.SetAnalogInputConfiguration(channels, configs);
Visual C++ Copy Code
array<int>^                           channels = { 0, 3, 5 };
array<Hil::AnalogInputConfiguration>^ configs  = { Hil::AnalogInputConfiguration::RSE, Hil::AnalogInputConfiguration::RSE, Hil::AnalogInputConfiguration::DIFF };

board->SetAnalogInputConfiguration(channels, configs);

Exceptions

ExceptionCondition
Quanser.Hardware..::.HilException If the input configurations cannot be configured then an exception is thrown. This situtation typically arises if the card does not support programmable analog input ranges.

See Also