NI Home
Cart Cart | Help
Hello Events Academic NI Developer Zone Support Solutions Products & Services Contact NI MyNI
You are here: 
NI Home > NI Developer Zone > NI Discussion Forums


Reply
Member
diishen
Posts: 15
0 Kudos

How to change local variables in sequence structures

[ Edited ]
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
Proven Zealot
MikeS81
Posts: 5,371
0 Kudos

Re: How to change local variables in sequence structures

[ Edited ]

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
Member
diishen
Posts: 15
0 Kudos

Re: How to change local variables in sequence structures

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?
Proven Zealot
MikeS81
Posts: 5,371
0 Kudos

Re: How to change local variables in sequence structures

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
By using this web site, you accept the Terms of Use for this web site. Please read these Terms of Use carefully before using any part of this site. Please go here for information on ni.com's copyright infringement policy.
My Profile | Privacy | Legal | Contact NI © 2011 National Instruments Corporation. All rights reserved.    |    E-Mail this Page E-Mail this Page