LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to change local variables in sequence structures

Hey guys,
I am very new to LabVIEW and I have already tried searching this question on the forum but could not find anything related. You patience and help is greatly appreciated.

I am working with an example VI (attached below) that creates a digital output and all I want it to do is to generate a 0 or a 1 every other frame in a flat sequence structure. In other words, the VI can continuously generate a single output but I want it to switch back and forth according to the sequence.

My approach was to make "Data to Write" a local variable and write it in every frame but this does not work, what should I do? Again, I am very new to LabVIEW so please bear with me. If you could attach a simple image to work this out, I would greatly greatly appreciate it. Thank you all very much


Message Edited by diishen on 05-27-2008 04:16 AM

Message Edited by diishen on 05-27-2008 04:16 AM
0 Kudos
Message 1 of 4
(2,727 Views)

Hi diishen,

you can use a shift register. Connect a boolean constant to it and use a not inside the loop. convert the boolean value to a number and you get your 0 or 1.
See the attachment.

Hope it helps.

Mike



Message Edited by MikeS81 on 05-27-2008 11:24 AM
0 Kudos
Message 2 of 4
(2,721 Views)
Hey Mike,

Thank you for the fast response! I've never heard of the shift register before, I will look it up now, can I do the same to start and stop the VI? So say, one frame would turn on the output while the next turns it off?
0 Kudos
Message 3 of 4
(2,717 Views)

Hi diishen,



diishen wrote:
... So say, one frame would turn on the output while the next turns it off?


yes, i think the example shows exactly that.
Mike
0 Kudos
Message 4 of 4
(2,710 Views)