Clocks Analog Inputs Analog Outputs Digital Inputs Digital Outputs Encoder Inputs PWM Outputs Other Inputs Other Outputs Interrupts Watchdog Board-Specific Options Properties Targets See Also navigation bar

NI PCI-6731

The National Instruments PCI-6731 is an AO Series card for a PCI slot. For more information, visit the National Instruments' website for the NI PCI-6731.

The QUARC driver name for this card is ni_pci_6731 .

NI PCI-6731

Beta

This driver is currently a beta version. Quanser does not guarantee that this driver will work as expected and shall not be liable for any damage resulting from its use. However, if you are using this driver, we would appreciate any feedback at tech@quanser.com.

Clocks

This card is part of the DAQmx API, and therefore the hardware clocks cannot be directly accessed. The clocks can only be set indirectly with the functions that utilize them such as the timebase blocks.

Warning Only one hardware timebase may be used at a time. In addition, immediate I/O and task-based I/O cannot use the same channels with the NI PCI-6731 card, even if they use different resources. For instance, if a task created using hil_task_create_analog_reader is reading from analog input 0, then hil_read_analog cannot be used to read from analog input 0 while the task is running.

Warning The hil_task_create functions only support a samples_in_buffer argument of 1 when used with the NI PCI-6731 card. Attempting to use a different buffer size will result in the error: "The specified buffer size is not valid. It may be out of an acceptable range."

Analog Inputs

The NI PCI-6731 card does not support analog inputs.

Analog Outputs

The NI PCI-6731 supports 4 analog outputs (channels 0 to 3) with 16-bit resolution.

The only valid output range is ±10V.

Warning

Note that when using task-based I/O, the samples_in_buffer argument to the hil_task_create function must be set to 1 for this card.

Digital Inputs

The NI PCI-6731 supports 8 digital input lines (lines 0 to 7).

A digital I/O line cannot be used as an input and output at the same time.

Since the digital I/O lines may be individually programmed as inputs or outputs, all the channels which will be used for digital inputs should be configured with the hil_set_digital_directions function. Set the input_channels argument to all the digital I/O channels that will be used as digital inputs on the board.

Digital Outputs

The NI PCI-6731 supports 8 digital output lines (lines 0 to 7).

A digital I/O line cannot be used as an input and output at the same time.

Since the digital I/O lines may be individually programmed as inputs or outputs, all the channels which will be used for digital outputs should be configured with the hil_set_digital_directions function. Set the output_channels argument to all the digital I/O channels that will be used as digital outputs on the board.

Encoder Inputs

The NI PCI-6731 supports 2 encoder inputs with 24-bit count values (channels 0 and 1). Note that since this card uses its counters for both encoder inputs and PWM outputs, you can only use a counter as either an encoder input or a PWM output channel.

In order to set the encoder counters to a particular count, use the hil_set_encoder_counts function. Configure the quadrature mode using the hil_set_encoder_quadrature_mode function. The NI PCI-6731 only supports non-quadrature (count and direction) counting. The NI PCI-6731 does not support encoder filtering.

PWM Outputs

The NI PCI-6731 supports 2 24-bit PWM Outputs using its 2 counters (channels 0 and 1). The PWM outputs on this card use a counter timebase rate of 20 MHz. Note that since this card uses its counters for both encoder inputs and PWM outputs, you can only use a counter as either an encoder input or a PWM output channel.

Use the hil_set_pwm_mode function to set the desired PWM output mode. The NI PCI-6731 supports all the PWM output modes: duty cycle, frequency or period. See the description of the PWM Output Configurations for details on these modes. Then use the hil_set_pwm_frequency or hil_set_pwm_duty_cycle function to set the desired frequency or duty cycle respectively. Note that this card is part of the National Instruments' DAQmx API and one of the limitations of this API is that you cannot output a PWM signal with a 0% or 100% duty cycle. Furthermore, a value of 0 for frequency is also not acceptable. When in duty cycle mode, the acceptable range of duty cycles are:

Note that the PWM signal period is the frequency inverted. Therefore, the acceptable value for duty cycle is related to the frequency at which the signal is being generated. In frequency mode, the acceptable range of frequencies are related to the duty cycle of the signal and are as follows:

In period mode, the maximum and minimum values for period are recipricols of the minimum/maximum values for frequency above.

Warning

As mentioned earlier in this section, the counters cannot be used as both encoder inputs and PWM outputs. Attempting to do so would produce an error message.

Warning

Due to the DAQmx API limitations, a value of 0 (0%) and 1 (100%) for duty cycle is not accepted. Also, a frequency or a period with value of 0 is also unacceptable. However, attempting to command a value which is out of range would not produce an error. The driver would simply saturate the value at the limits.

Other Inputs

The NI PCI-6731 card does not support other inputs.

Other Outputs

The NI PCI-6731 card does not support other outputs.

Interrupts

The NI PCI-6731 card, or its driver, does not support any interrupt sources.

Watchdog

The NI PCI-6731 card does not support a watchdog timer.

Board-Specific Options

The NI PCI-6731 card does not support any board-specific options.

Properties

The NI PCI-6731 card does not support any properties.

Targets

Target

Supported

Comments

QUARC Win32 Target

Yes

Fully supported.

QUARC Win64 Target

Yes

Fully supported.

QUARC Linux Nvidia Target

No

Not supported.

QUARC Linux Raspberry Pi 3 Target

No

Not supported.

QUARC Linux Raspberry Pi 4 Target

No

Not supported.

QUARC Linux RT ARMv7 Target

No

Not supported.

QUARC Linux x64 Target

No

Not supported.

QUARC Linux DuoVero Target

No

Not supported.

QUARC Linux DuoVero 2016 Target

No

Not supported.

QUARC Linux Verdex Target

No

Not supported.

QUARC QNX x86 Target

No

Not supported.

Rapid Simulation (RSIM) Target

Yes

Supported with no communication to the hardware.

Normal simulation

Yes

Supported with no communication to the hardware.

See Also

 

navigation bar