LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

wave reconstitution

Solved!
Go to solution

Hello

 

I am using a wave generator to simulate a 200 Hz wave and a NI acquisition board is used to acquire the signal.

I think that according to Nyquist theorem, I must, at least, acquire at 2x the frequency of the wave.

Thus, I'm acquiring, in continuous samples, at 1000Hz. I checked for different number of samples and only 20 seemed ok for wave reconstitution in excel.

 

When I try to acquire two waves simultaneously, (both 200 HZ) I can't seem to manage...

I'm not very confident with acquiring at high frequency...

Hope someone can help me  

 

I attached my vi

 

Thanks in advance

 

0 Kudos
Message 1 of 12
(3,718 Views)
I see that you are using all of the built in assistants in LabVIEW. They are ok to get you started but you need to evolve. I changed your code to two loops. There is one loop for data acquisition and one for writing data file. The should help significantly with your problem. There is a lot mor that you could do and you may have to before your done.
Tim
GHSP
0 Kudos
Message 2 of 12
(3,705 Views)

Hi,

 

When you said that you can't seem to manage, what did you mean?  Did you have an error?  Did you buffer overflow?  Some questions and comments that I have.

 

1. What kind of hardware do you have?  We need to know the capability of the hardware.

2. In the code, you are doing a continuous acquisition at 2k for 2 channels, 2000 samples/s/channel.  You set the number of samples to read as 200.  That means you will read 200 samples at every loop count.  What worries me is that you have a lot of analysis code in the acquisition loop.  If the analysis code slow down the loop enough, you can have a buffer overflow.  One thing that you can try is to do two parallel loops, one for acquisition and one for analysis.  From the acquisition loop, you can queue the data onto a queue structure and dequeue the data in the analysis loop. 

 

Yik

------------------------------------------------------------------

Kudos and Accepted as Solution are welcome!
0 Kudos
Message 3 of 12
(3,700 Views)

Hello

 

First of all, I would like to thank for your reply

I can't open your file, because I'm using LV8.5 and your version is 9....

Could place a pic of the code you sent me?

 

Thanks again

0 Kudos
Message 4 of 12
(3,694 Views)

Hello Yik

 

Thanks for the reply.

When I said that I didn't manage i was referring to reconstruct the wave in excel file...

The code I sent, I tried many combinations of acquisition freq and number of samples...2kHz and 200 samples results weren't able to reconstruct the wave.

I'm using a NI USB 6211, 16 bit, 250kS/s

I'll erase analysis for now and try it.

 

Thanks for the help

0 Kudos
Message 5 of 12
(3,690 Views)

Here is what I did:

 

Sample.png

Tim
GHSP
0 Kudos
Message 6 of 12
(3,689 Views)
Your original code is just plain wrong. You are acquiring 400 samples at 2000 S/sec and then throwing away all of the timing information and all but one sample. Why even bother setting a sample rate or number of samples. Converting the scalars back to dynamic data accomplishes nothing.
0 Kudos
Message 7 of 12
(3,680 Views)

Hello aestet

 

I just reproduce your code, but I wasn't enable to reconstruct the wave in excel. I only get few poits per second. I used 1000Hz, 400samples

Attached is lvm file. I think my problem, aside from code, is the relation between samples and acq frequency and the way that I write it to lvm

The bad thing is that i'm lost and can't figure out a solution

 

Again, thanks for your help. It was very valuable

 

 

0 Kudos
Message 8 of 12
(3,665 Views)
To change the record speed change the time out on the event structure for the time out loop. Make it 5 or 1. What ever you are looking to do. Right now it should be recording every 100 msec. You could give it the frequency and take the invers to figure out how often you need to record.
Tim
GHSP
0 Kudos
Message 9 of 12
(3,663 Views)

Hi Dennis

 

Could you be more specific?

I figured that the code was wrong, otherwise I won't be here. Note that 400 samples and 2000Hz was one of the attempts to reconstruct both waves.

I can say that only one chanel acquiring a single wave of 200Hz was reconstructed with 20 samples and 1000Hz acq frequency. Luck? maybe.

when I try to acquire 2 waves, I couldn't reconstruct any of them because I don't have enough data (samples/s) in the lvm file.

If you could help me I would apreciate that.

 

What do you mean with "and then throwing away all of the timing information and all but one sample. "

 

Thanks

 

0 Kudos
Message 10 of 12
(3,662 Views)