LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

shifter register for array of waveforms

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

0 Kudos
Message 1 of 9
(2,802 Views)

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.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 2 of 9
(2,794 Views)

I just.....can't open it. Could you perhaps post an image?

Thanks!

 

0 Kudos
Message 3 of 9
(2,791 Views)

As I stated in the other thread, this is just for a single channel.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 4 of 9
(2,784 Views)

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?

 

0 Kudos
Message 5 of 9
(2,751 Views)

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:

 

http://forums.ni.com/t5/LabVIEW/How-does-one-find-the-average-waveform-out-of-N-waveforms/td-p/68232...

 

 

Peter T
Applications Engineer
National Instruments
0 Kudos
Message 6 of 9
(2,718 Views)

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

 

0 Kudos
Message 7 of 9
(2,700 Views)

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?

0 Kudos
Message 8 of 9
(2,695 Views)

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.

Peter T
Applications Engineer
National Instruments
0 Kudos
Message 9 of 9
(2,666 Views)