The primary class used for accessing hardware.

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

Syntax

Visual Basic (Declaration)
Public Class Hil _
	Implements IDisposable
C#
public class Hil : IDisposable
Visual C++
public ref class Hil : IDisposable
JavaScript
Quanser.Hardware.Hil = function();

Type.createClass(
	'Quanser.Hardware.Hil',
	null,
	IDisposable);

Remarks

The Hil class is the starting point for accessing hardware using the Quanser .NET Class Library. Create a Hil object to begin accessing a particular data acquisition card. If the default constructor is used to initialize the object then the Open(String) or Open(String, String) method must be called to open a specific data acquisition card.

Data acquisition cards are identified by the type of card and a card identifier. The card type is denoted by a string, such as "q8", which corresponds to a particular kind of card. In this case, "q8" refers to the Quanser Q8 card.

The card identifier is also a string. It distinguishes between more than one card of the same type in the system. For example, if you have two Quanser Q8 cards in your system then the first card would be identified by "0" and the second card by an identifier of "1". Card identifiers are typically the numbers "0", "1", "2", etc. as strings. In this case the first card is always denoted by "0". Some cards also support symbolic names such as "Dev1". The National Instruments cards allow symbolic card identifiers which are set using Measurment and Automation Explorer.

Hardware access under the Quanser .NET Class Library may be categorized into several categories:

CategoryDescription
Configuration Methods The configuration I/O methods are used to configure specific features or functionality of the data acquisition card, such as programming the directions of bi-directional digital I/O lines.
Properties The properties methods are used for getting information about the card or setting properties of the card. Properties are designed for features that may be queried or reconfigured repeatedly, but not frequently, during the course of operation.
Immediate I/O The immediate I/O methods read or write a single sample immediately, where a sample consists of any number of I/O channels on the card.
Buffered I/O The buffered I/O methods read or write a number of samples at a fixed rate.
Task-Based I/O The task methods are used to create an asynchronous task that may be used to read or write any number of samples at a fixed rate in the background, allowing other operations to be done in the foreground.
Watchdog Methods The watchdog methods allow a timer on the data acquisition card to be used as a hardware watchdog, resetting the outputs of the card if the timer is allowed to expire.

The configuration methods are:

Method NameDescription
SetAnalogInputRanges(array<Int32>[]()[], array<Double>[]()[], array<Double>[]()[]) Set the ranges of analog input channels.
SetAnalogOutputRanges(array<Int32>[]()[], array<Double>[]()[], array<Double>[]()[]) Set the ranges of analog output channels.
SetDigitalDirections(array<Int32>[]()[], array<Int32>[]()[]) Set the directions of bidirectional digital I/O lines.
SetEncoderCounts(array<Int32>[]()[], array<Int32>[]()[]) Set the current encoder counter values.
SetEncoderQuadrature(array<Int32>[]()[], array<Hil..::.Quadrature>[]()[]) Set the quadrature mode used by the encoders.
SetEncoderFilterFrequency(array<Int32>[]()[], array<Double>[]()[]) Set the frequency of the filters used by the encoders.
SetClockMode(array<Hil..::.Clock>[]()[], array<Hil..::.ClockMode>[]()[]) Set the mode of the hardware timers on the card (timebase, PWM, etc).
SetClockFrequency(array<Hil..::.Clock>[]()[], array<Double>[]()[]) Set the frequencies of hardware clocks.
SetPwmMode(array<Int32>[]()[], array<Hil..::.PwmMode>[]()[]) Set the mode of the PWM channels (variable duty cycle, frequency or period).
SetPwmFrequency(array<Int32>[]()[], array<Double>[]()[]) Set the frequency of the PWM channels.
SetPwmDutyCycle(array<Int32>[]()[], array<Double>[]()[]) Set the duty cycle of PWM channels in frequency or period mode.
SetCardSpecificOptions(String) Set options specific to this particular data acquisition card.

The properties methods are:

Method NameDescription
GetIntegerProperty(array<Hil..::.IntegerProperty>[]()[], array<Int32>[]()[]) Gets the values of integer properties of the board.
GetDoubleProperty(array<Hil..::.DoubleProperty>[]()[], array<Double>[]()[]) Gets the values of double properties of the board.
GetStringProperty(Hil..::.StringProperty) Gets the value of a string property of the board.
SetIntegerProperty(array<Hil..::.IntegerProperty>[]()[], array<Int32>[]()[]) Sets the values of integer properties of the board.
SetDoubleProperty(array<Hil..::.DoubleProperty>[]()[], array<Double>[]()[]) Sets the values of double properties of the board.
SetStringProperty(Hil..::.StringProperty, String) Sets the value of a string property of the board.

The immediate I/O methods are:

Method NameDescription
ReadAnalog(array<Int32>[]()[], array<Double>[]()[]) Read analog channels immediately.
ReadEncoder(array<Int32>[]()[], array<Int32>[]()[]) Read encoder channels immediately.
ReadDigital(array<Int32>[]()[], array<SByte>[]()[]) Read digital channels immediately.
ReadOther(array<Int32>[]()[], array<Double>[]()[]) Read other channels immediately.
Read(array<Int32>[]()[], array<Int32>[]()[], array<Int32>[]()[], array<Int32>[]()[], array<Double>[]()[], array<Int32>[]()[], array<SByte>[]()[], array<Double>[]()[]) Read analog, encoder, digital and/or other channels immediately.
WriteAnalog(array<Int32>[]()[], array<Double>[]()[]) Write analog channels immediately.
WritePwm(array<Int32>[]()[], array<Double>[]()[]) Write pulse-width modulated (PWM) channels immediately.
WriteDigital(array<Int32>[]()[], array<SByte>[]()[]) Write digital channels immediately.
WriteOther(array<Int32>[]()[], array<Double>[]()[]) Write other channels immediately.
Write(array<Int32>[]()[], array<Int32>[]()[], array<Int32>[]()[], array<Int32>[]()[], array<Double>[]()[], array<Double>[]()[], array<SByte>[]()[], array<Double>[]()[]) Write analog, PWM, digital and/or other channels immediately.
ReadAnalogWriteAnalog(array<Int32>[]()[], array<Int32>[]()[], array<Double>[]()[], array<Double>[]()[]) Read and write analog channels immediately in one operation.
ReadEncoderWritePwm(array<Int32>[]()[], array<Int32>[]()[], array<Int32>[]()[], array<Double>[]()[]) Read encoder channels and write PWM channels immediately in one operation.
ReadDigitalWriteDigital(array<Int32>[]()[], array<Int32>[]()[], array<SByte>[]()[], array<SByte>[]()[]) Read and write digital channels immediately in one operation.
ReadOtherWriteOther(array<Int32>[]()[], array<Int32>[]()[], array<Double>[]()[], array<Double>[]()[]) Read and write other channels immediately in one operation.
ReadWrite(array<Int32>[]()[], array<Int32>[]()[], array<Int32>[]()[], array<Int32>[]()[], array<Int32>[]()[], array<Int32>[]()[], array<Int32>[]()[], array<Int32>[]()[], array<Double>[]()[], array<Int32>[]()[], array<SByte>[]()[], array<Double>[]()[], array<Double>[]()[], array<Double>[]()[], array<SByte>[]()[], array<Double>[]()[]) Read analog, encoder, digital and/or other channels and write analog, PWM, digital and/or other channels immediately in one operation.

The buffered I/O methods are:

Method NameDescription
ReadAnalogBuffer(Hil..::.Clock, Double, Int32, array<Int32>[]()[], array<Double>[]()[]) Read a number of samples of analog channels at a fixed sample rate.
ReadEncoderBuffer(Hil..::.Clock, Double, Int32, array<Int32>[]()[], array<Int32>[]()[]) Read a number of samples of encoder channels at a fixed sample rate.
ReadDigitalBuffer(Hil..::.Clock, Double, Int32, array<Int32>[]()[], array<SByte>[]()[]) Read a number of samples of digital channels at a fixed sample rate.
ReadOtherBuffer(Hil..::.Clock, Double, Int32, array<Int32>[]()[], array<Double>[]()[]) Read a number of samples of other channels at a fixed sample rate.
ReadBuffer(Hil..::.Clock, Double, Int32, array<Int32>[]()[], array<Int32>[]()[], array<Int32>[]()[], array<Int32>[]()[], array<Double>[]()[], array<Int32>[]()[], array<SByte>[]()[], array<Double>[]()[]) Read a number of samples of analog, encoder, digital and/or other channels at a fixed sample rate.
WriteAnalogBuffer(Hil..::.Clock, Double, Int32, array<Int32>[]()[], array<Double>[]()[]) Write a number of samples of analog channels at a fixed sample rate.
WritePwmBuffer(Hil..::.Clock, Double, Int32, array<Int32>[]()[], array<Double>[]()[]) Write a number of samples of pulse-width modulated (PWM) channels at a fixed sample rate.
WriteDigitalBuffer(Hil..::.Clock, Double, Int32, array<Int32>[]()[], array<SByte>[]()[]) Write a number of samples of digital channels at a fixed sample rate.
WriteOtherBuffer(Hil..::.Clock, Double, Int32, array<Int32>[]()[], array<Double>[]()[]) Write a number of samples of other channels at a fixed sample rate.
WriteBuffer(Hil..::.Clock, Double, Int32, array<Int32>[]()[], array<Int32>[]()[], array<Int32>[]()[], array<Int32>[]()[], array<Double>[]()[], array<Double>[]()[], array<SByte>[]()[], array<Double>[]()[]) Write a number of samples of analog, PWM, digital and/or other channels at a fixed sample rate.
ReadAnalogWriteAnalogBuffer(Hil..::.Clock, Double, Int32, array<Int32>[]()[], array<Int32>[]()[], array<Double>[]()[], array<Double>[]()[]) Read and write a number of samples of analog channels in one operation at a fixed sample rate.
ReadEncoderWritePwmBuffer(Hil..::.Clock, Double, Int32, array<Int32>[]()[], array<Int32>[]()[], array<Int32>[]()[], array<Double>[]()[]) Read and write a number of samples of encoder and PWM channels in one operation at a fixed sample rate.
ReadDigitalWriteDigitalBuffer(Hil..::.Clock, Double, Int32, array<Int32>[]()[], array<Int32>[]()[], array<SByte>[]()[], array<SByte>[]()[]) Read and write a number of samples of digital channels in one operation at a fixed sample rate.
ReadOtherWriteOtherBuffer(Hil..::.Clock, Double, Int32, array<Int32>[]()[], array<Int32>[]()[], array<Double>[]()[], array<Double>[]()[]) Read and write a number of samples of other channels in one operation at a fixed sample rate.
ReadWriteBuffer(Hil..::.Clock, Double, Int32, array<Int32>[]()[], array<Int32>[]()[], array<Int32>[]()[], array<Int32>[]()[], array<Int32>[]()[], array<Int32>[]()[], array<Int32>[]()[], array<Int32>[]()[], array<Double>[]()[], array<Int32>[]()[], array<SByte>[]()[], array<Double>[]()[], array<Double>[]()[], array<Double>[]()[], array<SByte>[]()[], array<Double>[]()[]) Read and write a number of samples of analog, encoder, PWM, digital and other channels in one operation at a fixed sample rate.

The task methods are:

Method NameDescription
TaskCreateAnalogReader(Int32, array<Int32>[]()[]) Creates a task for reading analog channels.
TaskCreateEncoderReader(Int32, array<Int32>[]()[]) Creates a task for reading encoder channels.
TaskCreateDigitalReader(Int32, array<Int32>[]()[]) Creates a task for reading digital channels.
TaskCreateOtherReader(Int32, array<Int32>[]()[]) Creates a task for reading other channels.
TaskCreateReader(Int32, array<Int32>[]()[], array<Int32>[]()[], array<Int32>[]()[], array<Int32>[]()[]) Creates a task for reading analog, encoder, digital and/or other channels.
TaskCreateAnalogWriter(Int32, array<Int32>[]()[]) Creates a task for writing analog channels.
TaskCreatePwmWriter(Int32, array<Int32>[]()[]) Creates a task for writing pulse-width modulated (PWM) channels.
TaskCreateDigitalWriter(Int32, array<Int32>[]()[]) Creates a task for writing digital channels.
TaskCreateOtherWriter(Int32, array<Int32>[]()[]) Creates a task for writing other channels.
TaskCreateWriter(Int32, array<Int32>[]()[], array<Int32>[]()[], array<Int32>[]()[], array<Int32>[]()[]) Creates a task for writing analog, PWM, digital and/or other channels.
TaskCreateAnalogReaderAnalogWriter(Int32, array<Int32>[]()[], array<Int32>[]()[]) Creates a task for reading and writing analog channels.
TaskCreateEncoderReaderPwmWriter(Int32, array<Int32>[]()[], array<Int32>[]()[]) Creates a task for reading encoder and writing PWM channels.
TaskCreateDigitalReaderDigitalWriter(Int32, array<Int32>[]()[], array<Int32>[]()[]) Creates a task for reading and writing digital channels.
TaskCreateOtherReaderOtherWriter(Int32, array<Int32>[]()[], array<Int32>[]()[]) Creates a task for reading and writing other channels.
TaskCreateReaderWriter(Int32, array<Int32>[]()[], array<Int32>[]()[], array<Int32>[]()[], array<Int32>[]()[], array<Int32>[]()[], array<Int32>[]()[], array<Int32>[]()[], array<Int32>[]()[]) Creates a task for reading and writing analog, encoder, PWM, digital and/or other channels.
TaskStopAll()()() Stops all tasks associated with this hardware instance.

The watchdog methods are:

Method NameDescription
WatchdogSetAnalogExpirationState(array<Int32>[]()[], array<Double>[]()[]) Sets the state to which analog outputs will be set if the watchdog is allowed to expire.
WatchdogSetPwmExpirationState(array<Int32>[]()[], array<Double>[]()[]) Sets the state to which PWM outputs will be set if the watchdog is allowed to expire.
WatchdogSetDigitalExpirationState(array<Int32>[]()[], array<Hil..::.DigitalState>[]()[]) Sets the state to which digital outputs will be set if the watchdog is allowed to expire.
WatchdogSetOtherExpirationState(array<Int32>[]()[], array<Double>[]()[]) Sets the state to which other outputs will be set if the watchdog is allowed to expire.
WatchdogStart(Double) Starts the watchdog timer.
WatchdogReload()()() Reloads the watchdog timer to prevent it from expiring.
WatchdogIsExpired()()() Checks whether the watchdog timer has expired.
WatchdogClear()()() Clears the watchdog state so that I/O may be resumed on the card.
WatchdogStop()()() Stops or disables the watchdog timer.

The interrupt methods are:

Method NameDescription
PollInterrupt(array<Int32>[]()[], array<SByte>[]()[]) Queries the current states of interrupt sources on a card.
MonitorCreateInterruptReader(array<Int32>[]()[]) Creates a monitor for reading the states of interrupt sources on a card.
MonitorStopAll()()() Stops all monitors associated with this hardware instance.

Inheritance Hierarchy

System..::.Object
  Quanser.Hardware..::.Hil

See Also