LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

why why why???

HI all.... i'm using LabVIEW 7.1

i got something can't understand... no matter how i try but i still get the answer... hope here have someone to solve my question....

i developing a program by using DAQ hardware and software now... i found there got a something very strange while running my program...

the problem is when my waveform read those signals from DAQ device... it can't display smoothly and not continuos just like the picture that i posted... hope someone can unswer this question....

with regard Jaxx
0 Kudos
Message 1 of 16
(4,415 Views)
Make sure your number of samples and sample rate ( in your VI) are set right for the appropriate wave form. For example, you might want to have the DAQ read 5-10 waveforms to get an accurate reading. If I was reading a 1 khz waveform I would need: 1/ 1khz= 1 msec for 1 waveform for 10 waveforms I would need to read 10 msec. I also want 2x my freq of interest for my sample rate (Nyquist). I've found 10 works much better. I also pick 100 samples for my waveform ( arbitrary). You need to try each of these to get the best reading. Now if I have a sample rate of 10 khz ( set by my vi), 100 samples ( also set in my vi) I get a displayed waveform of 10khz/100samples=100 sec. More than enough to get an accurate reading. You can change the sample rate and number of samples so you don't have to wait as long but remember Nyquist.
Message 2 of 16
(4,393 Views)

@Clint Eastwood wrote:
Make sure your number of samples and sample rate ( in your VI) are set right for the appropriate wave form. For example, you might want to have the DAQ read 5-10 waveforms to get an accurate reading. If I was reading a 1 khz waveform I would need: 1/ 1khz= 1 msec for 1 waveform for 10 waveforms I would need to read 10 msec. I also want 2x my freq of interest for my sample rate (Nyquist). I've found 10 works much better. I also pick 100 samples for my waveform ( arbitrary). You need to try each of these to get the best reading. Now if I have a sample rate of 10 khz ( set by my vi), 100 samples ( also set in my vi) I get a displayed waveform of 10khz/100samples=100 sec. More than enough to get an accurate reading. You can change the sample rate and number of samples so you don't have to wait as long but remember Nyquist.




@Clint Eastwood wrote:
Make sure your number of samples and sample rate ( in your VI) are set right for the appropriate wave form. For example, you might want to have the DAQ read 5-10 waveforms to get an accurate reading. If I was reading a 1 khz waveform I would need: 1/ 1khz= 1 msec for 1 waveform for 10 waveforms I would need to read 10 msec. I also want 2x my freq of interest for my sample rate (Nyquist). I've found 10 works much better. I also pick 100 samples for my waveform ( arbitrary). You need to try each of these to get the best reading. Now if I have a sample rate of 10 khz ( set by my vi), 100 samples ( also set in my vi) I get a displayed waveform of 10khz/100samples=100 sec. More than enough to get an accurate reading. You can change the sample rate and number of samples so you don't have to wait as long but remember Nyquist.


I made a mistake in one of my formulas. It should have been 100 samples/ 10 Ksamples/sec (khz) ( not the other way around) which would have given you a displayed waveform of 10 msec. In my opinion this is just right. It satisfys Nyquist, you get enough samples and enough waveforms displayed.
One other thing you can do for more info. On the waveform click the X and Y icons on the graph display ( right click on the waveform graph in the front panel view, select visible items then scale legend). This will scale the waveform so it fills the graph. It can help to determine if anything is even there.
Sorry for the formula error.
Message 3 of 16
(4,387 Views)
HI... Clint Eastwood...

depend on what you posted... is it mean "sample = 10 x 1 sample rate"?
for my VI i'm using an array waveform for display 16 channels together and read 1000 samples in 30sec... so it mean i should config my sample rate to about 160khz??
0 Kudos
Message 4 of 16
(4,337 Views)
Hi... Eastwood...

what would happen if those values of samples and sample rate are same?

with regard
Jaxx
0 Kudos
Message 5 of 16
(4,330 Views)
Are you using continuous sampling, or reading the waveforms in a loop.

It could be that if you are repeatedly calling the DAQ read in a loop (Non-continuous) that you get small time gaps between calls. If you also have the chart set to not interpolate the points, you will see the gaps on your chart.

By the way, if you happen to have a few NaN in your data, these will also produce gaps on your graph. I don't know where a NaN should come from in your application, but it's maybe worth noting nonetheless.

If you want a continuous acquisition you need to use the "AI Continuous Scan" waveform read. This allocates all measured data to a buffer in RAM which can then be read and displayed. Since this runs in the background, delays in your processing will not affect the data acquisition.

Hope this helps

Shane.
Using LV 6.1 and 8.2.1 on W2k (SP4) and WXP (SP2)
0 Kudos
Message 6 of 16
(4,308 Views)
thanks for your advice shane...

i will try to do what mention, if got any problem again i will post message to here again...

with regard
Jaxx
0 Kudos
Message 7 of 16
(4,298 Views)
You'd still use the formula I mentioned earlier. You also have to keep in mind the max sample rate of your DAQ Card. For example, the PCI 6111 is 10 Meg samples / sec. You can't exceed this value when you select it in your VI. If, as you ask, the sample rate = # of samples you might have 1000 samples divided by 1000 samples/sec you get a waveform display of 1 sec long. I've found in most cases start with 100 samples and figure out the rest from there. You know the sample rate ( rule of thumb for me, 10x my highest frequency) and you like to display ABOUT 10 waveforms maybe less( at least 2). One divided by my highest freq is the period of one waveform. Now x10 waveform gives how long I need to display it. The rest is formulas and solving for unknowns. Hope this helps.
0 Kudos
Message 8 of 16
(4,265 Views)
thanks about shared your experience with me Eastwood, i think i understand what you trying to say... if have any problem i will post message to here again. 🙂

thanks again for your help!!!

best regard
Jaxx
0 Kudos
Message 9 of 16
(4,213 Views)
Hi Shane..

i had following what you mention but i still got small gaps between my signals...

got another solution or suggestion?

with regard
Jaxx
0 Kudos
Message 10 of 16
(4,142 Views)