Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

pxi-6251 vs pxi-6221 - Tall Order?

Solved!
Go to solution

I'm writing LabVIEW and TestStand code for a number of test fixtures.  Some of the fixtures have PXI-6251 daq cards, and some have PXI-6221 daq cards.  These cards have very similar features, and the pinout of the I/O connections is nearly identical.  They *are* identical with respect to signals that I care about.

 

So, system A has a PXI-6221 daq.  System B has a PXI-6251 daq.  I have the wiper of 10k potentiometers connected to AI2 on both cards, while the ends of the pots are connected to +5v and ground.  Very simple analog test input.

 

Right click on the diagram -> Measurement I/O -> NI-DAQmx -> DAQ Assist.  Place the DAQ Assist on the diagram.  Configure for analog input, voltage, ai2, from -1v to +6v.

 

I run a bunch of samples, and the daq cards will read the voltages.  I can see them change as I adjust the pot.  Works great.

 

The problem is that such a VI built on system A won't work on system B, and vice versa.  When the express VI builds, it knows about the hardware present and makes the appropriate adjustments.

 

Is there any way to write VIs that can be portable between systems A and B?  Is there any way to "bulk rebuild" such express VIs?

 

Thanks for any suggestions.

 

-Mark

0 Kudos
Message 1 of 4
(3,345 Views)
Solution
Accepted by topic author Neurotikart

Hi Mark,

 

The same express VI should work as long as the devices have the same name in Measurement and Automation Explorer.  The 6251 does have some features not supported by the 6221 (e.g. Analog Triggering, Faster Sample Rate), but as long as you're not using these there shouldn't be a problem.

 

Having said that, you might want to switch to the lower level DAQmx API to give front-panel control over which device you select to run your task.

 

 

A couple of examples using the DAQmx API:

 

        Continuous Analog Acquisition with Software Timing

 

        Continuous Analog Acquisition with Internal Clock

 

 

 

To summarize, either of the two approaches should work:

 

  1. Rename the device in Measurement and Automation Explorer so that it is always the same (e.g. "Dev1").  You should be able to use the Same DAQ Assistant this way.
  2. Use the DAQmx API instead of the DAQ Assistant.  The user would then select the desired channel from a drop-down on the front panel.

 

Either option can be done programmatically as well:

 

  1. You can rename devices programmatically using the System Configuration API with DAQmx 9.2 or later.
  2. You can use a DAQmx System Property Node to query which devices are present in the system and get information about those devices (see example).  You would use this device name to programmatically build your channel name (e.g. "Dev1" + "/ai0" = "Dev1/ai0").

 

It's probably easiest to use the DAQmx API instead of the DAQ Assistant for your case (unless you are OK with manually renaming devices in MAX or going into the DAQ Assistant every time to reconfigure for your specific device name).  If you want the user to select the device from a drop-down, then you can probably just use a direct shipping example.  If you want to programmatically build the channel name then you'll need to use the DAQmx System Property Node to see what the device is named and go from there.

 

 

Best Regards,

John Passiak
Message 2 of 4
(3,338 Views)

I was trying to avoid having to use Measurement & Automation Explorer to configure all my test stations, but apparently there's no getting around that until we upgrade to the most recent versions of everything, specifically DAQmx 9.2.  (Since the "Devices" property of the System Node is read-only, at least in the versions I have.)  I also can't leave channel selection up to the user, but I can work out to open and configure them programmatically.

 

Once I used MAX to give all my DAQ cards the same name, I was able to create a portable VI that will open, read, and close an analog channel across test fixtures.  Thanks!

 

-Mark

0 Kudos
Message 3 of 4
(3,308 Views)

Hi Mark,

 

Without having to upgrade software, you can use the system property node to see what the device name is in a given system and then build your task to use that specific device.  You'll have to use the DAQmx API instead of the DAQ Assistant to do this, but the simplest case would look something like this:

 

        21644iF97304E1E7283E39

 

 

Of course, if you have two DAQmx devices in the same system, you need some way to distinguish them.  The method to do this would be unique to your system.  Right now, the above code would just take the ai0 channel of whatever device is listed first.  The idea is that you wouldn't have to use MAX to rename the devices.

 

Doing the above should actually be a little easier than renaming the device programmatically through System Configuration API (which was the feature added in 9.2).  Note that the System Configuration API is separate from the System Property Node and DAQmx (although it does talk to DAQmx).

 

 

Best Regards,

John Passiak
0 Kudos
Message 4 of 4
(3,289 Views)