08-01-2013 11:00 AM
Hi guys,
I was trying to use shift register to append waveforms from multiple channels to their previous waveforms correspondingly.
The problem is when I click the stop button on the front panel and saved the data, the data file contains nothint except for some words like "waveform","t0", and "dt".
The attachment is the image of my VI.
Thanks!
Jude
08-01-2013 11:18 AM - edited 08-01-2013 11:20 AM
Your problem is your FOR loop at the bottom. When you first call this VI, the shift register will have the default value for the data type. In this case it will be an empty array of waveforms. A FOR loop will iterate the smallest of the size of the smallest autoindexing input array or the N. Well, the smallest will be 0 because of that empty array. So the FOR loop actually does not run at all. It just outputs an empty array. What you need to do is put a case structure around that FOR loop. When the loop index of the WHILE loop is 0 (first time reading anything) set the output to the waveform you just read. If the loop index is greater than 0 run the FOR loop like you have now.
If you look at the VI I gave you here you will see what I mean.
08-01-2013 11:34 AM
I just.....can't open it. Could you perhaps post an image?
Thanks!
08-01-2013 11:42 AM - edited 08-01-2013 11:43 AM
As I stated in the other thread, this is just for a single channel.
08-02-2013 10:39 AM
Thank you! It helps a lot!
Sorry there's one more question. Is it possible to continuously take data (without while loop or set the number of samples to be -1) and average them at the same time?
08-05-2013 08:09 AM
Hi JudeLi,
You will need to have a while or for loop to continuously take data in LabVIEW otherwise the code will only iterate once. As to averaging waveform data, here is a forum thread:
08-05-2013 02:04 PM
Hi Peter,
I've tried the method of using a while loop and it looks fine, but I was kinda worried about the time it takes between two ineration. Is it goint to matter a lot?
Thanks!
Jude
08-05-2013 02:16 PM
Hi,
I was taking data using the method in your picture. The rate is 1000s/s and it's 10 samples per average. But the programme suddenly stopped after around 10 sec. If the rate is 10ks/s, it will stop immediately.
Is there any perticular reason for that?
08-06-2013 01:13 PM
Is LabVIEW giving you some sort of error when it stops? Along the lines of a memory issue? If so, include a screenshot in your reply.