LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Reset a feedback node within a loop

Solved!
Go to solution
Hi everyone,
 
I am new user of LabVIEW and sometimes even the most simple task seems to be very difficult for me.
 
What I am trying to do is this:
 
1. Reading a signal (I am using the random generator in the example below).
2. Display the signal on the screen (the Waveform Charts)
3. When I press a button, a predefined number of signals should be saved to file.
 
I have managed to both display the signal and save it to file, but I am unable to find a way to stop the file saving when enough signals have been saved.  I am now trying to count the signals saved using a Feedback Node.  This works fine the first time the button is pressed, but the next time the button is pressed, the Feedback Node continues from the last time, ie. it is only reset when the outer While-loop is run the first time.
 
So my questions are:
 
1. Is it possible to reset the Feedback Node when the Boolean variable as shown in the example changes from True to False?
2. Is there a better way to save the data (and being able to display it to screen (and later using the data in the VI)).
 
Best regards,
 
Martin T. 
Save_n_numbers.jpg
0 Kudos
Message 1 of 6
(14,813 Views)
Solution
Accepted by Martin_T

Yes you can using a simple 'Select' function:

 

 

Ton

 

Message Edited by TCPlomp on 29-10-2009 10:09 AM
Free Code Capture Tool! Version 2.1.3 with comments, web-upload, back-save and snippets!
Nederlandse LabVIEW user groep www.lvug.nl
My LabVIEW Ideas

LabVIEW, programming like it should be!
Message 2 of 6
(14,805 Views)

Instead of feedbak loop you can use shift register and can initialize the shift register within the case.

 

Regards

 

Visuman

0 Kudos
Message 3 of 6
(14,801 Views)

Excellent!  This solution works exactly the way I wanted it to!

 

Thanks a lot!

 

Best regards, Martin

 

0 Kudos
Message 4 of 6
(14,775 Views)

@visuman 10-29-2009 04:12 AM

 

I tried earlier to see if I could use Shift Registers, but I didn't manage to add one to a Case Structure.  Is it possible to add a Shift Register to a Case Structure, and if so, how do I do it?

 

Best Regards, Martin

 

0 Kudos
Message 5 of 6
(14,772 Views)
The shift register would be added to the loop and its wire would be passed through all of the cases in the cases structure. You would only need to wire through the case structure if the value of that wire was modified in any case. If you were only reading the value inside the case structure you would not have to wire it through the case structure. In addition, if you wire it through the case it must be connected in every case.


Mark Yedinak
Certified LabVIEW Architect
LabVIEW Champion

"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot
0 Kudos
Message 6 of 6
(14,753 Views)