LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How does implies funciton works?

Solved!
Go to solution

How does implies funciton works while using numeric controls?

0 Kudos
Message 1 of 14
(4,633 Views)

So I'll be honest, I've never used this function ever, in 11 years of LabVIEW developemnt, practically using LabVIEW every day in those 11 years (except weekends).  But what I can say is reading the help how it works.  It will invert X then perform a logical OR meaning the output will always be false, unless X is True and Y is false.

 

So how does this apply to numerics?  It does the same operation on numerics as it would booleans.  So if you provide the inputs as U8 then it will be evaluated as if this implies is in a for loop running 8 times.  In this example all of the numeric outputs will be the same.

 

Example_VI_BD.png

Message 2 of 14
(4,593 Views)

@srrashme wrote:

How does implies funciton works while using numeric controls?


All boolean function operate bitwise when used with integers. There is nothing special about the implies function.

Message 3 of 14
(4,585 Views)

I would suggest using the compound arithmetic function in any case, as I expect it's much easier to read for most people. Then you don't have to worry about how implies works.


___________________
Try to take over the world!
0 Kudos
Message 4 of 14
(4,558 Views)

I took Symbolic Logic in college (a lot of fun), and can say that "Implies" was one of the most difficult things to handle.  I've used this function a very few times in LabVIEW, but would be hard-pressed to explain "why" I did it, even to myself.  In fact, I'm not sure (without doing a laborious search) I could even find one of those rare examples ...

 

Bob (... because it's there ...) Schor

0 Kudos
Message 5 of 14
(4,533 Views)

Implies is quite useful for finding transitions in an array of booleans. Compare current value to previous value.  One of the four possible combinations returns False, telling you where the Transistion corresponding to that combination is.

 

Lynn

0 Kudos
Message 6 of 14
(4,523 Views)

@johnsold wrote:

Implies is quite useful for finding transitions in an array of booleans. Compare current value to previous value.  One of the four possible combinations returns False, telling you where the Transistion corresponding to that combination is.


In the past when I needed this I just used a compound arithmatic node.  Is there any benefit over using implies over this?  There certainly is more flexibility with compound arithmatic, because I could choose to invert the first or second input.  I also have the option to be use the AND instead of Or.  So if this value is true AND the last value was false then a falling edge was seen.

Message 7 of 14
(4,516 Views)

I think Implies was around before compound arithmentic with invertable inputs. Also, I tend to not think of compound arithmetic until I have more than two inputs. Thus: Laziness.

 

Lynn

0 Kudos
Message 8 of 14
(4,511 Views)

Well, I have trained myself and try to train my minions to always use the compound node. It's readable enough and doesn't encourage adding more nodes if more logic is needed.


___________________
Try to take over the world!
Message 9 of 14
(4,495 Views)

That is probably a good idea because I use Implies seldom enough that I always need to stop and refresh myself on how it works. Plus an extra inverter is often required.

 

Now, if I just remember this thread the next time I need it.

 

Lynn

0 Kudos
Message 10 of 14
(4,489 Views)