LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Implies Boolean Logic

Hi guys,

just a bit stuck on something.

In my programs i've been using a shift register and a not-implies boolean function to perform an action once only, when a value changed from false to true

in boolean logic how would I spot a change so that a true to false change will provide true, but other states false?

any help very much appreciated - got a bit of a hangover and my brain isn't flying at full-mast!

cheers!
0 Kudos
Message 1 of 11
(4,713 Views)
Implies "negates x and takes the OR of y and the negated x" (from help).

You could use a compound arithmetic node of size=2 set to mode=OR. Negate the output and the lower input. Voila! (see attached image).
0 Kudos
Message 2 of 11
(4,703 Views)
You are currently able to recognize all changes, right?
In that case, just take that value (changed?) and AND it with NOT the original value. If the original is now F and it was changed, they will both be T. Personally, I use a change detector VI which is a simple functional gloabl of a variant, which compares to the last value and also gives me the previous value. If I remember correctly, there is something similar in openg. You can also create a polymorphic version if you want.

Edit: After seeing's Altenbach's post, it seems I misunderstood a bit. I would like to point out that the change detector is, regardless, a generally good thing and it should be reentrant and used "per wire".

Message Edited by tst on 03-19-2005 11:54 PM


___________________
Try to take over the world!
0 Kudos
Message 3 of 11
(4,705 Views)
it's pretty late and i'm tired but those seem like the right answers guys!

cheers 😄
0 Kudos
Message 4 of 11
(4,694 Views)
Just pondering over a new issue relating to this............

In my program i've got one part that examines to LV2 globals - and if they are both over 0 starts a motor............

That's all cool, but i'm using an AND gate, so once one of them becomes false, the output is false and the motor stops

Does anyone know a way of making it so that it needs both counters >0 to start and both counters ==0 to stop?

I'm reckoning it can't be done with just one set of logic and one case statement maybe?

At the moment the output of the AND feeds into a true/false case statement - true starts the motor, false stops it.

Any suggestions greatly appreciated 🙂
0 Kudos
Message 5 of 11
(4,629 Views)
Place your AND inside a T case and an OR inside the F case. Then NOT the result to have the case condition change on whether or not they're both >0. It doesn't do =0 at the moment, but I'm sure you can modify it if necessary.

___________________
Try to take over the world!
0 Kudos
Message 6 of 11
(4,622 Views)
Since the state of (one true/one false) has a different output depending on the motor running or not, you need a shift register to store the motor state. Only if both are equal, the state should change.

The attached codelet shows one possibility.

(edit: replaced booleans with counters in image. Thanks tst)

Message Edited by altenbach on 04-03-2005 02:14 PM

0 Kudos
Message 7 of 11
(4,619 Views)
thanks for the reply guys but I don't think those two are viable. Can't really see how yours works tst...............with the shift register set to true, isn't it going to take the inversed result of the and gate every time? So if the top value is 1 and the bottom is 0, it will activate?

I'm thinking I might just do an OR gate - it will start when there's at least 1 thing in the system and stop when there's nothing - not ideal but no complex logic required and does virtually the same job 🙂

any suggestions for books to read or places to look on the net for getting my boolean logic up to scratch cheers?

thanks
0 Kudos
Message 8 of 11
(4,602 Views)
Hi Michael

I think the key is to have a "no change" state as part of a non-boolean case structure.
I've converted the two boolean outputs to a number and use this as the input to the case.
In this way you can easily ignore the situations where the two counter states differ.
See attached VI - written in LabView 7.0.

Neil
0 Kudos
Message 9 of 11
(4,587 Views)
Neil

that is absolutely bang on as far as I can tell 🙂

liking your style!

tst, altenbach - thanks as ever - some damn helpful people on here!
0 Kudos
Message 10 of 11
(4,580 Views)