From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Parallel sampling - different rates

Solved!
Go to solution

Dear Lab View discussion group members,

 

I would like to request some advice about how to stop sampling of two different signals simultaneously. I have been able to confirm they start sampling at the same time (based on time stamp on loop first call), but the waveform time for my two signals is vastly different.  The AE signal always samples for the correct time, but the load signal always shows about 1.5 to two seconds longer acquisition time.

 

it must have to do with the vastly different sampling rates ( 500 Khz vs. 1000 Hz). I can't get my head around why the load acquisition loop would run so much longer though even though each loop iteration should be about .001 + 10 micro seconds (acquisition rate plus buffer that NI adds).

 

I tried to use timed loops, but the result is the same. in this case I wired the loop iteration value (dt) to be...

 

 (signal acquisition rate)*(number of samples to acquire)

 

I also tried to use notefiers and master slave configuration ( where load loop was the slave and a notefier was sent every time 500 iterations of the AE loop were accomplished). This did not results in simultanous stops either.

 

My ultimate objective is to get two files and then compare spikes in my AE signal to when a specific load occurred. I will then count the number of spikes occuring within certain load ranges and generate a histogram.

 

 

I will be out of the office next week, returning July 6. I will reply to any posts at that time. 

 

thank you

 

Alfonso

 

 

A. Lopez
0 Kudos
Message 1 of 11
(4,124 Views)
Could you explain what it is that you are sampling and what it is that is doing the sampling? If it's an NI-DAQ card, most of them cannot do parallel sampling at different rates. What's an AE signal?
0 Kudos
Message 2 of 11
(4,123 Views)

Dennis,

 

I am trying to sample acoustic emission signals (voltage) and a load signal (voltage)

 

AE signal is being acquired with NI 9221 compact DAQ card at 500 to 600 Khz

load signal is being acquired with a PCI 6221 at 1000 to 2000 Hz

 

I know NI 9221 can not aquire load and AE simultaneously at different rates, or I would do that.

 

REgards,

 

Alfonso

 

 

A. Lopez
0 Kudos
Message 3 of 11
(4,118 Views)
Solution
Accepted by topic author lopez

I can not see that you need two separate loops. Also skip the software timing. I guess that is causing your troubleJust put the the NI-6221 reading into the loop running the NI-9221 read. Perhaps put them into a frame so both are read before data is written to file. I think also are pulling data from your NI-9221 buffer to often. You read the buffer 500 times pr second. Perhaps lover this to 50 times pr second. So each time you read the NI-9221 pull 10000 samples from the buffer, and 40 from the NI 6221 buffer. And for the timing just skip it. Stop your loop then you have run it 100 times. Assuming you read 10000 samples from the NI-9221 on each iteration you will then have read 100x10000 samples equal to two second of data



Besides which, my opinion is that Express VIs Carthage must be destroyed deleted
(Sorry no Labview "brag list" so far)
0 Kudos
Message 4 of 11
(4,101 Views)

Thanks for your reply Coq Rouge,

 

I will try to implement your suggestions.  One problem I had when trying to integrate the read operation in one loop was the AE signal read kept giving me an error that the data was no longer available and kept crashing the system.

 

Would this have to do with how many times are read from the buffer?

 

I need very high acquisition rates for the acoustic emission data acquisition as events occur very rapidly.

 

Regards

 

 

A. Lopez
0 Kudos
Message 5 of 11
(4,027 Views)

 The error message that you are getting comes from not reading your buffer fast enough.  This happens because new data overwrites the old data before you can read it.  You can prevent this by increasing the amount of data that you read every time you perform a read. 

 

 

Nick Keel 

Applications Engineering 

National Instruments

Nick Keel
Product Manager - NI VeriStand and Model Interface Toolkit
National Instruments
0 Kudos
Message 6 of 11
(4,000 Views)

NAKeel,

 

I have implemented a read operation of my two independent acquisition events in the same loop.  The load acquisition is taking place normally. But the AE acquisition is not taking place at all.  not sure where the problem is.  When running the VI in slow motion to debut, the first call goes though OK. But there is no data for the AE acquisition.

 

Do you have any suggestions?

 

I did not wire the samples to read input to the read VI in hopes Lab View would regulate the samples read and timing automatically.

 

I have attached the new VI

A. Lopez
0 Kudos
Message 7 of 11
(3,987 Views)

What hardware are you using?  You have two analog input start tasks, which will only work if you have an S-series card.  Can you run the AE task if it is all by itself in the VI (i.e. no other tasks)?

 

 

Nick Keel 

Applications Engineering 

National Instruments

Nick Keel
Product Manager - NI VeriStand and Model Interface Toolkit
National Instruments
0 Kudos
Message 8 of 11
(3,968 Views)

NAKeel,

 

the hardware I am using is

 

CDaq 9221 for fast acquisition of acoustic emission signals

PCI 6221 for slower load acquisition (M series)

 

either of the acquisitions works fine in a loop alone. However, when combined, the AE stops acquiring. 

 

Thanks in advance for any suggestions.

A. Lopez
0 Kudos
Message 9 of 11
(3,959 Views)

The problem you were getting came from having the wrong device name specified for the AE channel.  You were getting error 200220.  Once I updated the name to a valid device the VI ran properly.  Did you switch computers or change the order of your devices in MAX?  Try reselecting your device input to your create channel VI and it should work properly.

 

 

Nick Keel 

Applications Engineering 

National Instruments

Nick Keel
Product Manager - NI VeriStand and Model Interface Toolkit
National Instruments
Message 10 of 11
(3,942 Views)