LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Timing problem with alternating on/off

Solved!
Go to solution

Hello all

 

 

For my project I need to alternate two LEDs, I have found a way to do this, but it isn't a very good one.

 

Now I have placed a wait with a large time, inside a case. So in case the statement for starting the alternation is true, my entire program will slow down.

 

I tried to use the 'elapsed time', but then one of the LEDs is on for a short period of time, but I want them both to be blinking at the same rate (which I can choose), but opposite of each other.

The idea is that the LEDs will be replaced with digital outputs to open and close valves.

 

 

Apart from that the program works pretty good.

 

current setup:

LEDs.jpg

0 Kudos
Message 1 of 7
(2,857 Views)

You only posted a screenshot of a small portion of your VI.  We can't tell what is happening in the rest of the VI, what else is inside the loop, what is in the False case, nor what boolean value is driving that case structure.

 

Post an actual VI.

0 Kudos
Message 2 of 7
(2,827 Views)

It's a large VI, with many other different things, for now it's just a simulation, but I'll add a smaller version of the VI.

It basically simulates that when the temperature or pressure becomes to high, both valves need to alternate between open and closed.

 

0 Kudos
Message 3 of 7
(2,818 Views)
Solution
Accepted by topic author XebeXUC

Hello XebeXUC,

If I understood your problem, this is my solution :

snippet blink.png

And attached, the false condition

Hope it helps

 

PS: Haven't seen your last message yet

Yddet

 

Download All
0 Kudos
Message 4 of 7
(2,816 Views)

Where would I set the time one LED has to stay on? (I guess blinking speed)

In the future real (hardware) project, they should be on for about 1-2 minutes.

 

 

Also, I'm having trouble connecting the second select, for some reason I can't insert boolean.

0 Kudos
Message 5 of 7
(2,805 Views)

I only have LV2011 so I can't read your VI

You should set the "blink speed" command at 60000 (ms) to set a 1min blink time.

Yddet

0 Kudos
Message 6 of 7
(2,793 Views)

Alright, it seems to work good, thanks a lot for your help.

 

I added a x1000 for convenience.

0 Kudos
Message 7 of 7
(2,788 Views)