Configures digital I/O channels as either inputs or outputs.

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

Syntax

Visual Basic (Declaration)
Public Sub SetDigitalDirections ( _
	inputChannels As Integer(), _
	outputChannels As Integer() _
)
C#
public void SetDigitalDirections(
	int[] inputChannels,
	int[] outputChannels
)
Visual C++
public:
void SetDigitalDirections(
	array<int>^ inputChannels, 
	array<int>^ outputChannels
)
JavaScript
function setDigitalDirections(inputChannels, outputChannels);

Parameters

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

An array containing the numbers of the digital channels which will be configured as inputs. If no channels are to be configured as inputs then this parameter may be NoChannels or nullptr.

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

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

An array containing the numbers of the digital channels which will be configured as outputs. If no channels are to be configured as outputs then this parameter may be NoChannels or nullptr.

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

Remarks

The SetDigitalDirections method configures digital I/O channels as either inputs or outputs. In general, a digital I/O line cannot be configured as an input and output at the same time.

Examples

This sample illustrates how to use the SetDigitalDirections(array<Int32>[]()[], array<Int32>[]()[]) method. It sets the directions for the first three digital channels. Channels 0 and 3 are configured as outputs while channel 1 is configured as an input.
C# Copy Code
int [] inputChannels  = { 1 };
int [] outputChannels = { 0, 3 };

board.SetDigitalDirections(inputChannels, outputChannels);
Visual Basic Copy Code
Dim inputChannels() As Integer = {1}
Dim outputChannels() As Integer = {0, 3}

board.SetDigitalDirections(inputChannels, outputChannels)
Visual C++ Copy Code
array<int>^ inputChannels  = { 1 };
array<int>^ outputChannels = { 0, 3 };

board->SetDigitalDirections(inputChannels, outputChannels);

Exceptions

ExceptionCondition
Quanser.Hardware..::.HilException If the digital directions cannot be set then an exception is thrown. This situtation typically arises when the card does not support programmable digital I/O or an attempt was made to configure one channel as both an input and output.

See Also