Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Connecting PCIe 6361

Hi all,

 

For my measurement setup I am using a NI PCIe 6361.

As my measuring devices put out data every 4 microseconds I have to use a data frequency of 250 kHz.

The measurement cycle is initialized as continuous measurement and the data acquire subVI is called inside a while loop.

Inside this while loop I want to not only save the data but also du some calculations.

The idea is to check one channel and determine if the mean value over 256 measurements is zero and then stop the inner while loop and execute other orders.

I often get the error that the software is not fast enough for the hardware, it seams that there is any sort of buffer which fills up over time and at some point the whole VI stops working/responding. A quick restart of the VI does NOT solve the problem.

First completely shutting down LabVIEW and all its instances and restarting my VI lets me perform another measurement.

 

I attached a minimal example of the VI I use, some features I use to initialize are missing but the main part stays the same.

 

Is it possible to run several VIs parallel connecting to the same PCIe card?

In my case using one VI to measure the data generated by my setup and saving it to hard disk, the other VI to also measure the data and perform another task if the mean of 256 measurements of one channel drops to 0.

 

(further information: PC: Win7 64bit with 8 Gig of RAM and CPU 2 Quad)

 

I hope you guys can help me out with my problem.

If there are further questions feel free to ask.

Regards, Max

0 Kudos
Message 1 of 2
(1,932 Views)

This is a classic use case for a Producer-Consumer pattern using parallel loops queues to move data around.

 

You should generally prioritize the speed of the DAQ loop because the consequence of lagging too far behind is an unrecoverable task error.   I advocate that the DAQ loop sends the data from DAQmx Read directly to an Enqueue function with no wire branching (which would make data copies).  Whoever receives it can then decide how and whether to distribute copies of the data to distinct processing loops (such as logging, process monitoring & decision making, user display).

 

When multiple loops all want to receive the same data in parallel, there's an approach based on User Events (aka Dynamic Events) that many consider preferable.  There's a steeper learning curve though so I'd advise that you keep User Events in mind for the future, but start with Queues. 

 

BTW, be careful bout checking for a mean value being = to 0.  A better practice is to look for an absolute value less than a small tolerance.  There are issues with *any* use of comparisons for equality with floating point values, especially when they're real-world measurement signals.

 

 

 

-Kevin P

CAUTION! New LabVIEW adopters -- it's too late for me, but you *can* save yourself. The new subscription policy for LabVIEW puts NI's hand in your wallet for the rest of your working life. Are you sure you're *that* dedicated to LabVIEW? (Summary of my reasons in this post, part of a voluminous thread of mostly complaints starting here).
0 Kudos
Message 2 of 2
(1,918 Views)