LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How do you use boolean values to switch between cases?

Hi again
 
i actually forgot to answer your question:
simply put a unit converter from your data type to double, then the comparison with the 9.8, you will get an actuall boolean.
but since you are looping this data to itself, you are unlickely to ever get a "false". again, do not use the feedback node whitout defining initial value in. also, use  shift register to loop back this value to the DAC out for the next iteration.
good luck
-----------------------------------------------------------------------------------------------------
... And here's where I keep assorted lengths of wires...
0 Kudos
Message 11 of 13
(667 Views)


@ambrownster wrote:

Partha,

thanks for your help.  Here is the code in labview 7.1.  I hope you can help me out!! Is there some sort of switch that will toggle between two values whenever it recieves a true value or something.  The case structure I'm using has an assigned true and false, but I don't want each case to have an assigned true or false value because as soon as they go false, I want to switch to the other curve.

THANKS!!

Alison




Hi Alison,

I think you ve saved the screenshot of the actual VI, in the VI you ve attached with your previous post. So, I cant view the False case.

Moreover, I dont ve the DAQ H/W with me presently. Smiley Sad

To your question, "Is there some sort of switch that will toggle between two values whenever it recieves a true value or something.", al I can say is you can connect a local variable of the switch you want to toggle in the respective cases. But I dont understand the phrase "true value or something". I m not clear about this "something". Do you mean "False", or some other ambiguous state like tristate ? A third state cannot exist for a boolean state. Can you come a bit more precise of that part of the requirement ?

Further, if you dont want each case to ve an assigned value, you can check the state of the switch & toggle it (NOT gate), and update it to tis local variable itself. By this way, you can achieve the toggling of the switch you wish to have...

Post here if you still have more doubts.

 

- Partha ( CLD until Oct 2027 🙂 )
Message 12 of 13
(638 Views)
Partha,
Thanks, you hit upon my question exactly.  I want the section of code to run while the boolean value is true.  When false, I want it to switch to another section of code and run until the boolean value is false again.  So a couple of questions.
1. where do I find an appropriate switch?  I thought I'd looked all over the palettes and couldn't find something.
2. How do I toggle the state?
 
thanks, it looks like this might actually come together!
Alison
0 Kudos
Message 13 of 13
(630 Views)