Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Interrupting DAQmx, But Keeping Retained Data

Jason,

i have an idle state where acquisition is running and data is analyzed to apply FFT on it , i want the spectrum to be with 0.1 Hz resolution and band of 5 KHz (acheiving 0.1 Hz resolution means simply to acquire (10 X the sampling rate) samples) which will result in an acquisiton shots , each shot will be busy acquiring for 10 seconds.... this is the idle state.

 

suddenly if a rising edge occured on a PFI , i want to move from this state to another IMMEDIATELY  where other processes using the same resources (DAQ device and channels) will start immediately and continue until a falling edge occur on the same PFI. then i will return to the idle state

 

i want just to know which is the best solution in the reading process , should i read continuously, N samples or on demand (i don't like the last one because of critical timing). and for the best solution, how can i interrupt the acquisition immediately to move to the other state (after a rising edge)

 

Best Regards...

Mohammed Ashraf

RF test Dev. Engineer

CDMA sector

QuickTel R&D

Eng. Mohammed Ashraf
Certified LabVIEW Associated Developer
InnoVision Systems Founder, RF Test Development Engineer
www.ivsystems-eg.com
0 Kudos
Message 11 of 19
(1,732 Views)

MAshrof:

 

I think you would want to have some kind of "producer-consumer" architecture along with your state machine. Your data acq task(s) would run and read continuously, and you could serve up the data to be used by code running in parallel in your different states.

 

-Kevin

ALERT! LabVIEW's subscription-only policy came to an end (finally!). Unfortunately, pricing favors the captured and committed over new adopters -- so tread carefully.
0 Kudos
Message 12 of 19
(1,710 Views)

Yin,

 

The first thing to consider is whether you need to:

 

A.  View any of the data while it's being collected during the 5 - 30 minute acquisition

B.  Store data to file throughout acquisition in case it can't be fully held in RAM.

 

An archtitecture I've used is to start up a data acq process which reads all available data about once a second.  It writes that data to a queue for file storage and to a notifier for user display.

 

-Kevin P.

ALERT! LabVIEW's subscription-only policy came to an end (finally!). Unfortunately, pricing favors the captured and committed over new adopters -- so tread carefully.
Message 13 of 19
(1,709 Views)

Kevin,

 

A.  I will not need to view any of the data.

B.  We have enough ram to store the data.  For the long tests, we sample at lower frequencies so the file sizes all end up being about 5-8MB.

 

I have tried in the past to store data in increments, but I had difficulty controlling the reinitialization timing of the while loop or for loop which largely appeared to be based on the processor speed.

 

Is there no way to just interrupt the  DaqMx read vi once it starts?

0 Kudos
Message 14 of 19
(1,702 Views)

Yin,

 

It isn't clear why you find a need to "interrupt the DAQmx Read vi once it starts."  However, the way to approach it was mentioned earlier in the thread.  Start your task, then run a loop that occasionally queries the DAQmx Read property node for "available samples."  You could easily update a progress indicator with it if you want.  Don't actually call DAQmx Read until you *know* you have all the samples you want, and then wire in that specific # of samples to read.  This way, during the 5-30 minutes of acquisition, you never get stuck waiting for a DAQmx Read call to return.

 

-Kevin P.

ALERT! LabVIEW's subscription-only policy came to an end (finally!). Unfortunately, pricing favors the captured and committed over new adopters -- so tread carefully.
0 Kudos
Message 15 of 19
(1,699 Views)

MAshraf,

 

The issue we are going to encounter here is that the only way to make that switch will be using software, which is very nondeterministic.  Depending on what your computer is doing at the time of the shift, it could take anywhere from 1 ms to 20 ms to make the switch, maybe even longer.  Faster timing would require that the switch be made in the hardware on the DAQ device itself and most devices cannot store different acquisition settings onboard that they can switch between.

 

Getting away from software timing in a state machine setup is very difficult.  Triggering a DAQ acquisition immediately is very easy, but if we are having to change the parameters of the acquisition we are reliant on Windows (or your OS of choice) to transmit the changes as quickly as possible.

 

We have a couple of options to do what you are asking:

1. Use two DAQ devices.  Use one to do your continual FFT and route the same signals to the second card.  On the second card, set up a digitally triggered DAQ task.  This will likely be the fastest option, though moderately more expensive and will result in a small increase in noise on the lines from splitting them.

 

2. Use a real-time OS and LabVIEW Real Time.  This will rapidly speed up your software operations and will get us closer to immediate response on the card.  This will, however, be quite expensive, though we will get less noise on the lines since we won't need to split them and it will be deterministic.

 

3. Set up a digital task in your idle state and route your trigger to a digital port. Use this digital line to trigger the current task to stop and switch to your second DAQ state.  In that state, change your acquisition settings and restart the task.  This will require no additional cost or noise, but will entirely rely on the Windows OS , it could take up to 10 ms, and will be very dependent on the current state of the computer.

Seth B.
Principal Test Engineer | National Instruments
Certified LabVIEW Architect
Certified TestStand Architect
Message 16 of 19
(1,698 Views)

Dear All,

i found a way which will easily interrupt the Data Acquisiton and at the same time the acquisition of 10 times sampling rate (to reach a spectrum Resolution bandwidth = 0.1Hz) , now i can differn between two peaks displaced 0.1 Hz from each others.

 

i made the acquisiton to acquire 1/10 from the scanning rate, so the total time will be only 0.1 second for each acquisition shot. then i used a Collector to collect samples for 100 iterations and send the collected data to an FFT power sepctrum VI.

now once an event occur , the loop will be interrupted in maximum 0.1 s and the acquisition stops.

Please find the attached file for more details.

i used a DAQ assistant VI right now , but will be replaced with DAQmx VIs soon and i will post here the final results.

any advices will be extremly welcomed 🙂

Best Regards adn thanks in Advance

 

Mohammed Ashraf

 

 

Eng. Mohammed Ashraf
Certified LabVIEW Associated Developer
InnoVision Systems Founder, RF Test Development Engineer
www.ivsystems-eg.com
0 Kudos
Message 17 of 19
(1,673 Views)

Kevin,

 

The creating a loop that occasionally queries the DAQmx Read property node is where I am stuck at.  I'm not sure where to put the loop in.  So far I have a DAQmx timing wired to a DAQmx reference trigger wired to a DAQmx start task wired to a DAQmx read.  I have tried to put a while loop and a timed loop in the program in different places but without results.   The program either gets stuck in the loop or it gets stuck on the DAQmx read vi.  

 

Yin 

0 Kudos
Message 18 of 19
(1,666 Views)
nvm.  I got it working now.  Thanks again!
0 Kudos
Message 19 of 19
(1,662 Views)