Documentation Home Page â—‡ RT-LAB Home Page
Pour la documentation en FRANÇAIS, utilisez l'outil de traduction de votre navigateur Chrome, Edge ou Safari. Voir un exemple.

DAQmx NI PCI-4461 driver

Description

This document explains how to use the Data Interchange Layer (DiL) system to instantiate a NI PCI-4461 driver to monitor and control configured 24-bits analog inputs and outputs.

This driver behaves as a 2-Input / 2-Output Dynamic Signal Analyzer.

The NI PCI-4461 card is a high-accuracy data acquisition (DAQ) module specifically designed for high-channel-count sound and vibration applications.

It supports the following features:

  • 2 input and 2 output channels
  • Software-configurable AC/DC coupling and IEPE conditioning
  • 24-bit resolution ADCs and DACs with 118 dB dynamic range
  • Two simultaneously updated analog outputs at up to 204.8 kS/s
  • Six gain settings for input ranges from ±316 mV to ±42.4 V
  • Two simultaneously sampled analog inputs at up to 204.8 kS/s

The driver supports the XHP mode.

Configuration

A configuration file is required for two major reasons:

  • Set the NI PCI-4461 card general parameters
  • Configure data points to be monitored and controlled

If the user does not modify any parameters in the configuration file, the NI PCI-4461 driver will use a default configuration with preconfigured values.

If the user needs to change a parameter value, the configuration file must be edited.

It is important to understand that the manual modification of this configuration file is temporary. In future RT-LAB releases, this file will be replaced by a nice configuration panel.

The following lines show how to configure the NI PCI-4461 driver using the configuration file:

NI PCI-4461 General Parameters

OPAL-1.0 Object
NI::Configuration {
	verbose=1
	boardType=4461
	aiSamplingRate=10000.0
	aiSamplesPerChannel=1000
	aoSamplingRate=10000.0
	aoSamplesPerChannel=1000
}
  • boardType: Only NI-4461 board is supported for now
  • aiSamplingRate: Sets the rate of the Sample Clock for the analogs in
  • aiSamplesPerChannel: Sets the number of samples to acquire for the Analogs in
  • aoSamplingRate: Sets the rate of the Sample Clock for the analogs out
  • aoSamplesPerChannel: Sets the number of samples to generate for the analogs out

Data Configuration

The data points to be monitored and controlled by the user must be specified in the configuration file.

Each data point has the following parameters:

namechannel name
typedata type used on the channel
directionAI for analog in or AO for analog out
channelrepresents the mapping of the I/O channel
gainrepresents the gain in dB configured before/after the conversion.  It can be positive or negative for the analog in modules, but only negative for the analog out modules as it is, in fact, an attenuation.
iepefor analogs in only. When set to TRUE, it specifies that the analogs in require piezoelectric excitation
minminimum voltage
maxmaximum voltage


Gain and Min/Max allowed values for the analog in modules:

Gain (dB)Min / Max value (V)
30± 0.316
20± 1.00
10± 3.16
0± 10.0
-10± 31.6
-20± 42.4

Gain and Min/Max allowed values for the analog out modules:

Gain (dB)Min / Max value (V)
-40± 0.1
-20± 1.00
0± 10.0

The following lines show how to configure 4 I/O channels, two outputs AO and two inputs AI.

pointsSetup {
		item {
			name=AnalogInput0
			type=double
			direction=AI
			channel=0
			gain=0
			iepe=0
			min=-10.0
			max=10.0
		}
		item {
			name=AnalogOutput0
			type=double
			direction=AO
			channel=0
			gain=0
			min=-10.0
			max=10.0
		}
		item {
			name=AnalogInput1
			type=double
			direction=AI
			channel=1
			gain=0
			iepe=0
			min=-10.0
			max=10.0
		}
		item {
			name=AnalogOutput1
			type=double
			direction=AO
			channel=1
			gain=0
			min=-10.0
			max=10.0
		}
	}

Configuration File Example

You can find a configuration file example named "NI_cfg_sandbox.opal" in the following directory:


YOUR_RT_LAB_INSTALLATION_FOLDER/Examples/IO/National_Instruments/NI-PCI4461/simulink

RT-LAB Usage

In RT-LAB, a file named 'connections.opal' must also be written by the user and transferred to the target in ASCII mode. The same has to be done for the configuration file "NI_cfg_sandbox.opal".

The following screenshot shows how to configure the files to be transmitted to the Opal-RT simulator when the model is loaded.

The 'connections.opal' file is required to bind the model signals to the driver variables. This is how all drivers implemented with the Data Interchange Layer work for the moment. In the future, the user will no longer have to work with this file. The connections will be handled through a special RT-LAB panel.

The following lines are an example of this connections file:

OPAL-1.0 Object
List {
  item {
    configFile=NI_cfg_sandbox.opal
    id {
      NI
    }
    outputs {
      item {
        dataInExchanger=NI/4461/AnalogOutput0[0]
        dataInProcess=OpOutput:AnalogOut0[0]
      }     
      item {
        dataInExchanger=NI/4461/AnalogOutput1[0]
        dataInProcess=OpOutput:AnalogOut1[0]
      }
    }
    inputs {
      item {
        dataInExchanger=NI/4461/AnalogInput0[0]
        dataInProcess=OpInput:AnalogIn0[0]
      }   
      item {
        dataInExchanger=NI/4461/AnalogInput1[0]
        dataInProcess=OpInput:AnalogIn1[0]
      }
    }
  }
}


In this file, it is important to make sure that the connection name set in the 'dataInExchanger' section matches exactly the content of the configuration file.The corresponding format is "NI/boardType/name".

The name used for 'dataInProcess' must match the name of the respective 'OpInput' or 'OpOutput' blocks in the master subsystem of the Simulink model.

The NI PCI-4461 example model shows how to perform the connections using 'OpInput' and 'OpOutput' blocks and send/receive on the I/Os.It is located in the following directory:

YOUR_RT_LAB_INSTALLATION_FOLDER/Examples/IO/National_Instruments/NI-PCI4461/simulink

The example model is also accessible from the New Project wizard in RT-LAB. Select the NI-PCI4461 template under IO/National_Instruments/NI-PCI4461.

In the Simulink master sub-system, model signals that will be sent to the analogs out have to be connected to "OpOutput" blocks.

"OpInput" blocks receive the redirected signals.

The picture below shows the main view of the model, it has a master and a console sub-systems.

In this model, two loopback connections are made between the I/Os of the board.


As shown in the following figure, in the master sub-system, sinusoid and triangular signals are generated.

The sinusoid signal is connected to the first OpOutput block (AnalogOut0).

The triangular signal is connected to the second OpOutput block (AnalogOut1).

The OpInput blocks are linked to sinks.

The console sub-system shows the signals redirected from the analogs out to the analogs in of the board:


OPAL-RT TECHNOLOGIES, Inc. | 1751, rue Richardson, bureau 1060 | Montréal, Québec Canada H3K 1G6 | opal-rt.com | +1 514-935-2323
Follow OPAL-RT: LinkedIn | Facebook | YouTube | X/Twitter