PXI

cancel
Showing results for 
Search instead for 
Did you mean: 

Can a DAQ-mx Task contain channels from a Pxi-6143 and a Pxi-4472?

In DAQ-mx (v4.4.1f0) it says that a task can contain channels from multiple devices as long as they are all of the same kind e.g. all Analog Inputs. It says one can combine voltages, pressures, etc. It says to start with channels from the first device, then add those for the next device. I am trying to measure Ana Input voltages from a Pxi-6143 and a Pxi-4472. MAX allows me to combine the channels into 1 task, but I get a DAQ Asst error in DAQ-mx when I try to run the task. The error message says I must have a separate task for each device. This I know to be untrue - I can select channels from two 6143 devices and run these as 1 task. What am I doing wrong?
0 Kudos
Message 1 of 11
(5,755 Views)
Hi TimTower,
where do you read it? AFAIK you can create one task per device and I/O Type (AI, AO, DI, DO, ...).
Mike
0 Kudos
Message 2 of 11
(5,747 Views)

Hello TimTower,

 

In general what Mike said is correct, you need to use a separate task for each device and I/O function.  There are three exceptions to this that are detailed in the NI-DAQmx help file--multiple DSA, S Series, or cDAQ modules.

 

You can view the details by going to Start» All Programs» National Instruments» NI-DAQ» NI-DAQmx Help.  Then in the NI-DAQmx Help window navigate to NI-DAQmx Device Considerations» Multidevice Tasks.

 

Basically there are special cases for these three classes of devices, but one of the requirements is that all of the analog input channels come from devices of the same series (i.e. all DSA or all S Series, and not a mix).  That is why you're able to use the automatic channel expansion with two PXI-6143's but not a PXI-6143 and a PXI-4472.

 

In order to use analog inputs from both devices you’ll need to create a separate task for each device.

 

Cheers,

Brooks
Message 3 of 11
(5,739 Views)
Thanks for the feedback, both of you. I guess I had hoped that I could read all modules together in one task.

What I have is a VI which allows the user to select from a list of tasks which he has defined in MAX, and run one task. I need to log the data from all the Pxi modules at the same time. The user may add other analog input cards in future. I therefore would like the single VI to be able to read from a variable qty and type of module at the same time.

Is this possible? Assume the user creates a task for the two 6143's and another for the 4472. Can he run these two tasks at the same time in the same VI?  Can I allow him to run a variable number of tasks (selected from a list) at the same time? I did not see an example of this in the Find Examples (which, incidentally, I find very useful - thanks to everyone who wrote them!).

0 Kudos
Message 4 of 11
(5,737 Views)

Hello TimTower,

 

If your end setup only uses two PXI-6143's and/or a PXI-4472 then I think the easiest way to do this would be to copy the code and use a case statement to decide which tasks to run since at most you're going to need two tasks.  However, if you're going to be expanding this system and want to make a program that is expandable to have a large number of tasks then you can utilize for loops and auto indexing for arrays.

 

For instance, if you create an array of physical channel controls then you can pass this array into a for loop, enable indexing, and the loop will automatically run one time for each array element.  This will allow you to index through all of your devices and configure your tasks.  Utilizing for loops would be the cleanest way to implement this feature, but if you're going to synchronize the tasks and share sample clocks/start triggers between devices the implementation will get more difficult.  It is really up to you if you want to spend the time to do this rather than just copying and pasting the code for one channel.  In the end this would be very nice code, but it will almost certainly take longer to develop.

 

Another option would be to use only DSA or S Series cards and utilize the build in channel expansion capabilities of these cards.  This would require some different hardware (i.e. all S Series or all DSA cards), but would also be very easy to implement in software.

 

Cheers,

Brooks
Message 5 of 11
(5,716 Views)
Hello TimTower,
 
I just realized I skipped over the last part of your question.  You can run as many different tasks as you like in the same VI as like as each task is for a unique device and I/O function (i.e. you can't run two analog input tasks on the same device).  The one exception is counter tasks--each counter, even on the same device, must be configured in a separate task.  That means that if you make one analog input task for your two PXI-6143's that you could copy and paste the same code into the same VI and select the PXI-4472.
 
Let me know if you'd like me to explain anything more.
 
Cheers,
Brooks
0 Kudos
Message 6 of 11
(5,712 Views)
Hi Brooks
Thanks for the feedback. I have finally got back onto this. It took only a few hours to follow your suggestion, and to revise my VI to use a FOR loop to index thru the tasks selected by the user. I then concatenate all the chan names and their values and send them to my display. Seems to work fine. As you mentioned, if you have multiple tasks which refer to the same module, you get an error, but it is rather cryptic. What I intend to do is to extract all the devices from the tasks selected, then look to see if there is overlap. Then I will prompt the user, before allowing him to initialize the read process.

You mentioned timing. How much delay would you expect between, say, 2 tasks, reads as above? Assume the first task reads 8 channels from a 4472, at 8000 Hz Cont Sample Rate. Buffer size is 16000. I then average the samples to give one value per chan. I do this at a rate of 200 Hz. The Second task would read 8 channels from each of the two 6143 cards, at the same rate. The results from the 2 tasks (3 cards total) are then concatenated, to give an array of 24 numbers, updated at 200 Hz. What I would like to know is, what is the typical phase shift in ms that I might expect between these 24 numbers? An approx value would be fine - just to get an idea as to whether it will be a problem.

I have another PXI question. I found out the hard way that if one turns off the Pxi chassis while the PC runs, it causes a BSOD. Rather unnerving. The BSOD may not happen at once, but some time later. Clearly, WXP thinks a Pci card has been removed and crashes. My customer's will be warned about this, but it is not very elegant to stick large"don't turn off if PC runs" stickers on a nice new installation. Is there a more elegant way to handle this? Like, displaying a message to warn the user of an impending crash, so he save his work? Or, better still, tell the OS to ignore the PXI chassis. I know, wishful thinking, but I just thought I would ask...

Many thanks
Tim Tower
0 Kudos
Message 7 of 11
(5,524 Views)
Hi Brooks
I have run into another issue with my DAQmx code. I am trying to read the Physical channel names of all the channels in the selected tasks. (As are displayed in MAX).  I wish to extract from these the Slot#, to display in the table of channel name and values. I find that I get error 200428 when I try to read the Physical channel names of an array of channels in the task. See attached VI. What is wrong?
Thanks
Tim
0 Kudos
Message 8 of 11
(5,500 Views)

Hello Tim,

 

With regards to your timing question, this delay depends on how your tasks are configured.  In order to be completely synchronized you need to share a start trigger and sample clock.  For all of the channels within one task there will be no phase delay because they all share the start trigger and sample clock, however, unless you explicitly share these items between your two tasks there will be an unknown phase delay between the two channels.  In the best case you would configure both tasks and then use data flow to start one after the other--in this case you might have something on the order of 1-10 ms delay; however this will be highly dependent on what your computer is doing at the time.  The short story is that you're either synched on the order of 25-50 ns by sharing the clock or out of sync by 1-10 due to Windows software timing.

 

Unfortunately, there isn't a good way to avoid complications if you shut down the chassis while the computer is running.  While I wouldn't necessarily expect a BSOD it doesn’t surprise me that it happens--the chassis are not intended to be shut down in this way and it should just be avoided.  If you're interested, there is a way to disable the PCI bridge to turn the chassis off without turning the computer off, but it won't really help protect your customers since they'll need to be aware of it either way.

 

For your second post, take a look at the attached VI, I believe the issue is that you needed to wire a task reference to the second property node and not the channel.

 

I hope this helps, and have a great night!

Brooks
0 Kudos
Message 9 of 11
(5,492 Views)

Hello,

 

I am looking to do something similar with a USB Digital I/O device. What I am looking to do is to drive relays, for now I'm using 2 USB-6009's - using the 12 digital I/O lines (for output).  I have a couple of options for the count sequence: binary sequence, decimal sequence, all on/off, and random.  If I'm only working with one device it's fine.  The final target is to be capapble of driving 502 points - for now I'm working with low count quantities. 

 

Driving one device gives me 12 lines to drive.  I have been playing around with the line grouping configuration in the DAQ MX virtual channel.  When I went to 2 devices I had to create separate digital output tasks and then split the number value in half.  If I could group the digital output tasks so that the 2 USB devices are transparent to the user that would be super.  But it's starting to look like I'll have to have one VI for a low device count, and for the high device count use a relay card so I don't have to build/buy relays - making the interfacing easier.

 

Thoughts / comments / suggetions?

 

Mike

Mike
0 Kudos
Message 10 of 11
(3,997 Views)