LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Timed loops

Hello,

I am having a dilemma,
I have a vi for a timed loop that should pause 10 seconds after finishing the sequence. The problem is that it waits half a second. Why is this so?
Might it be that the 10 seconds minus the run time of the sequence is the 1/2 second? If so must I add the time the loop finishes to the expected delay that we want to get our delay time. Attached is my vi. By the way, i cannot use an array for the led's and switches for they are output to different pins, also you will be looking for some vi's , you can ignore them.

Thanks In Advance.

Fred Fred
0 Kudos
Message 1 of 6
(3,302 Views)
Sorry,
I forgot to post the vi.
0 Kudos
Message 2 of 6
(3,299 Views)
If im not mistaken, you have a 500ms wait period where you want to have a 10000ms wait period.

Message Edited by DavidT on 04-12-2005 11:19 AM

0 Kudos
Message 3 of 6
(3,295 Views)
You have 16 x 0.5sec waits in all the sequences, which is 8 seconds. Your timed loop is programmed to repeat every 18 seconds. You don't have any wait programmed, so that 10 second extra wait assumes that the rest of your code does not use any time at all.

The only thing to check is if the timed loop executes every 18 seconds. Does it?

For some reason, your "loop condition" terminal is not wired, but you say "Run Continuously" in big red letters. How is the loop condition wired. Does the timed loop (1) keep spinning by wiring a "continue" to the terminal or do you (2) keep it running by pressing the "continuous run" button in the tool bar? Only if you do (1), your loop will behave as expected. If you do (2), you inter-loop timing will be meaningless.

I am not sure why you even use a 17 frame sequence, because except for a few booleans and constants, the code in each frame is absolutely identical. This calls for a FOR loop. With proper FOR loops, you need exactly one instance of Dbitout (and not 68!) and 2 instances of Dbitin (and not 52!) and you don't need any local variables. You have again your weird logical constructs that can be simplified (e.g. a "not equal false" is "same", and a "not equal true" is a "Not", right?).

I just spend 5 minutes to show how to simplify your diagram (LV7.1) without any loss in functionality (please double check. I cannot test because I don't have your subVIs)). The code is now less that 10% of your code, much more efficient, and easier to maintain. Let me know if you have any questions.
Message 4 of 6
(3,288 Views)
I appreciate the candorness in your reply altenbach. I am not an experienced labview user, i am a rookie, but, regardless of status, i am learning alot from everybody in the forum and thank the folks at NI for making this forum!

Thank you for your help, and now i must eliminate frames from my vi and make it easier to understand!

-FredFred
0 Kudos
Message 5 of 6
(3,246 Views)

Hiii, Altenbach

            I am facing the problem for synchronising the timed loop, actually, i want one loop to generate the data and another timed loop to used that generated data to make a buffer of type fifo, but when i run these two loops, it hangs, what happens is upto 200 records, it runs good, but after that both the loop gets hanged, instead i want both to run synchronously without hanged, here with this i am attaching my vi and in the vi i have given some description, and i am also attaching drivers, which are in the vi, which help you to run it.

Thanks,

Nishant

Download All
0 Kudos
Message 6 of 6
(3,086 Views)