LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Simple question: period of timed while loops

Solved!
Go to solution

Hi,

 

I have a timed while loop, and if the user presses a "repeat" button the loop will execute until "repeat" is false. I want the loop to iterate at a given period, which the user inputs. Inside the loop, a square wave pulse is created based on some parameters provided by the user, then displayed on a waveform graph. 

 

However, when I change some of the initial parameters for the square wave, such as starting voltage, the waveform graph is updated instantly. I want the waveform graph to only be updated based on the period provided by the user, say every one second. I've tried setting the input period to different amounts from 10000 to .0001, but the waveform graph still updates simultaneously. 

 

I'm not sure what I'm missing, but I'm sure it's something trivial. My VI is attached. Any help will be appreciated. 

0 Kudos
Message 1 of 3
(2,566 Views)
Solution
Accepted by Djaunl

I don't understand what your issue is.

 

If I run your VI (and hit the repeat button first, otherwise the VI runs instantanly then stops), and make changes to voltages, duration, or delay, it will take a little time or a lot of time depending on what the period of the loop is, and where I make the change to the controls during the timing of the loop.

 

(With a 5000 millisecond period, a change may take up to 5 seconds to show in the event you make the change right after the loop begins.  Or it may take a fraction of a second if you make the change right before the loop iteration ends.)

 

Perhaps you can give us a setup of parameters we should enter into each of the controls (better yet is setting those parameters yourself, make the current values default, then saving the VI before posting) and any precise instructions on what we should do to recreate whatever your issue is.

Message 2 of 3
(2,555 Views)

Thanks a lot for the quick reply.

 

You're right; it does run exactly as how I described I wanted it to run. I'm not sure how the issue was caused before. I must have been testing something wrong. Before the waveform would instantly change when I input new parameters regardless of the period; now it changes based on the period like intended. 

 

Again, I guess I was just testing it wrong or something, because it works fine now without any changes. Sorry if I wasted any of your time. 

 

Thanks again!

0 Kudos
Message 3 of 3
(2,518 Views)