LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Switch

Hello,

I need a switch, which must turn on a led by its
high signal and turn off the led by the next high signal.
How can I create or get that kind of switch.

Thanks.
Message 1 of 15
(10,033 Views)
Hi Tayfun,
One way to solve your problem is to use a standard switch in combination with a while loop and a shift register . The latter then serves as a state memory. I attached an example for LabVIEW version 6.01. I hope this helps.

/Mikael Garcia
Message 2 of 15
(10,030 Views)

how can i modifly this switch so that it switchs state everytime a loop is run?

thanks

0 Kudos
Message 3 of 15
(9,885 Views)

A plain shift register and the Not function.

Message Edited by Dennis Knutson on 04-30-2007 09:44 PM

0 Kudos
Message 4 of 15
(9,878 Views)
Do you know how I can modify the timed switch so that instead of switching on and off repeatedly, the switch turns on and remains on for a user-defined period of time, then switches off and remains off for the same amount of time, and so on? (On a chart a square wave would appear, although generating a square wave is not my objective) Thanks
0 Kudos
Message 5 of 15
(9,778 Views)

Hi fireandfury,

Thanks for contacting National Instruments.  If I understand your question right, it sounds like you want a switch that will turn on and off for set periods of time programmatically.  It looks like the simplest way to do this may be to use a flat sequence structure that has wait timers in each sequence when the state of the switch is altered.  The attached image below should give you a good idea of how I did this and hopefully it will help you out.  As you can see, the boolean LED is only in the on or off states for 250ms at a time.  I hope this helps and if you have any more questions feel free to reply back. Thanks!

Noah R.

Message Edited by Noah R on 09-26-2007 04:22 PM

Regards

Noah R
Applications Engineering
National Instruments
0 Kudos
Message 6 of 15
(9,745 Views)
Thanks!

Is there a way to do it with a stacked sequence structure? I am using LV6, which i don't believe supports flat sequence structures.

Also, will this VI generate a square wave as opposed to a triangle wave (my ultimate objective)?
0 Kudos
Message 7 of 15
(9,717 Views)
If your ultimate objective is a triangle wave, then you shouldn't even be thinking about using a Boolean. A Boolean has exactly two states - on or off. Maybe if you stated your ultimate objective more clearly and what you need to do with a triangle wave? LabVIEW does have a built-in Triangle Wave Generator function.
0 Kudos
Message 8 of 15
(9,714 Views)

Hi fireandfury,

Using a stacked sequence structure shouldn't be a problem.  The only difference will be to make each frame of the flat sequence structure that I posted above its own layer on the stacked sequence structure.  This way, it will follow the same sequence that I have shown above. Let me know how it works.  Thanks!

Noah R.

Regards

Noah R
Applications Engineering
National Instruments
0 Kudos
Message 9 of 15
(9,692 Views)

Hi,

 

Is it possible to create a toggle switch which is automatically turned off after one iteration of a while loop and stays off until the user switches it back on? 

 

Thanks

0 Kudos
Message 10 of 15
(6,901 Views)