Digital I/O

cancel
Showing results for 
Search instead for 
Did you mean: 

Flipping state of output after every 3 cycles of while loop

Solved!
Go to solution

Hello,

 

I am trying to flip the state of output after every 3 cycles of while loop.  At this point, the code would look like this:

 

if  i_quotient_of_while_loop_iterator == 0

then output_1 = not output_1

 

It seems like there is no way to do if, how can I accomplish this

0 Kudos
Message 1 of 7
(3,872 Views)
What language are you using? It's trivial in LabVIEW with the Quotient & Remainder function. Other languages have a Mod() function which does the same thing.
Message 2 of 7
(3,870 Views)
I am very new to LabView, but I believe i am creating the block diagram for VI.  Yes, I did try to use quotient&remainder, and the output does blink, but it only turn on for 1 cycle, but I need 3 cylces on and 3 cycles off.  See the attached picture of screen capture.
0 Kudos
Message 3 of 7
(3,864 Views)
Solution
Accepted by topic author TimSit

TimSit,

 

This is one way to do this.

 

 

 

  Example_VI_BD.png

 

Message 4 of 7
(3,847 Views)
Very Elegant, thank you...
0 Kudos
Message 5 of 7
(3,832 Views)
Three cycles at one logic level at a rate of x sec is the same thing as 1 cycle at a rate of 3x sec? I don't understand the point.
0 Kudos
Message 6 of 7
(3,826 Views)

The program is only a portion of the whole picture, 1 second domain is required to do other functions.

0 Kudos
Message 7 of 7
(3,823 Views)