LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Toggling values

Solved!
Go to solution

Hello,

 

Is there a quick way to progam a section in LabVIEW to toggle the value of a variable every, say, 3 seconds, non-stop? For example, I want a control button to turn on and off every 3 seconds. I have tried various methods but they all seem a bit messy.

 

Thank you,

LD

0 Kudos
Message 1 of 5
(2,996 Views)

Shift register in a while loop.  Not! function on that wire.  Wait 3000 ms in the loop.

 

 

Not messy at all!

Message Edited by Ravens Fan on 02-16-2010 08:17 PM
0 Kudos
Message 2 of 5
(2,995 Views)

Could you please attach the vi file, there's some components I'm not sure what they are.

 

And this configuration would make the whole program to wait right? Is there a way to get that only bit to toggle and the rest of the program working without any delay? I am still working on the program from yesterday that you helped me with Smiley Tongue

 

 

Thanks a lot for your help,

LD

0 Kudos
Message 3 of 5
(2,986 Views)
Solution
Accepted by topic author LD_PVL

It's a VI snippet.  If you have LV 2009, drag and drop the image from your browser into your block diagram.

 

Which functions don't you know?  It has a wait (ms) and Not functions.  That's it.

 

Yes, each loop iteration will take 3 seconds.  If that is too long for other reasons, then you can use the elapsed time function to toggle the shift register.

 

Message Edited by Ravens Fan on 02-16-2010 09:41 PM
0 Kudos
Message 4 of 5
(2,971 Views)

Thank you very much. Unfortunately I'm suing LabVIEW 8.5 so can't drag and drop. I usually have icons displayed so I got a bit confused about the representation of the components but it's all fine now. Never used a shift register before so you really helped me to find out a basic useful thing.

 

PS: and thanks for the tutorials.

Message Edited by LD_PVL on 02-17-2010 06:24 PM
0 Kudos
Message 5 of 5
(2,943 Views)