LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

conditional case

hello

Here i need help of making vi of conditonal case.

I have 2 input. first input A and input B(digital line),may it be represented by boolean control. it has 2 possible condition that might happen. Both A and B are normally OFF.

first case -- initially A will be ON first, then B on. The output i need is that the final output (Boolean indicator), will be set to ON as soon as A set to be ON, and OFF as long as B set to ON.

second case -- Initially A will be ON, then A off, after then B set to ON. The output i need is that  the final output set to ON as soon as A set to be on, and remain on before B set to ON. Even though A set to off before B set to ON, the output remain ON.

It might be hard to be explained in text. Here i attach with the State ON-OFF state diagram. The output will follow the red-green indicator as shown in the diagram.

0 Kudos
Message 1 of 13
(3,764 Views)

Both of the diagrams really show the same thing....Output true when A comes ON until B comes ON.

In that case

if ((A==true) && (B==true)) return true; else return false;

If there is more to it I am not getting it from your explanations.

________________________________________________________

Use the rating system, otherwise its useless; and please don't forget to tip your waiters!
using LV 2010 SP 1, Windows 7
________________________________________________________
0 Kudos
Message 2 of 13
(3,745 Views)
thanks for the prompt reply
After doing these vi, i find that it only follow the first case, however, the 2nd case it doesnt happen to result the real output that i wish to get.
the output B will happen only A trigger is trigger to ON state.

How can i do it?

thanks


0 Kudos
Message 3 of 13
(3,733 Views)

I just dont understand what your second case is...If A and B are ON then output true? otherwise false?

You should be able to use that example of boolean logic to do what you want....

Do you need a single VI to hndle both cases???



Message Edited by TWGomez on 04-11-2008 11:57 AM
________________________________________________________

Use the rating system, otherwise its useless; and please don't forget to tip your waiters!
using LV 2010 SP 1, Windows 7
________________________________________________________
0 Kudos
Message 4 of 13
(3,731 Views)
thanks for the prompt reply

here the result output i wish to get
Another saying of the desire output is
If input A is set to ON, then it will trigger a timer(representation of input B). Only the timer finish running, the output will be OFF , regardless of whether the input A is ON or OFF.
0 Kudos
Message 5 of 13
(3,712 Views)
Try this.
 
The code is a bit more convoluted than i would like, but it seems to work.  In LV 8.5


Message Edited by Ravens Fan on 04-11-2008 02:10 PM
0 Kudos
Message 6 of 13
(3,696 Views)
thanks
sorry can you convert it to labview 7.1?or can you pls print screen that block diagram so that i can browse it?
thanks


0 Kudos
Message 7 of 13
(3,675 Views)
I can't save back that far.  But here is the screen shot.


Message Edited by Ravens Fan on 04-11-2008 10:45 PM
0 Kudos
Message 8 of 13
(3,668 Views)
Here is another possible approach?
 
Best regards....
 


Message Edited by tartan5 on 04-12-2008 08:33 AM
0 Kudos
Message 9 of 13
(3,642 Views)

Note that if:

A and B off.   A Turns On.  Out turn on.  B turns ON.  Out turns Off.  B Turns Off.  Out turns ON. 

 

This is from the sentance:

---- "first case -- initially A will be ON first, then B on. The output i need is that the final output (Boolean indicator), will be set to ON as soon as A set to be ON, and OFF as long as B set to ON."

This implies that as long as b is on the output is off, but when b turns off if A is still on then the output turns on.

Is this what you are looking for, or do you want A to stay off, or is it irrelevant?

0 Kudos
Message 10 of 13
(3,639 Views)