09-08-2015 02:47 AM
How does implies funciton works while using numeric controls?
Solved! Go to Solution.
09-08-2015 07:46 AM - edited 09-08-2015 07:47 AM
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.
Unofficial Forum Rules and Guidelines
Get going with G! - LabVIEW Wiki.
16 Part Blog on Automotive CAN bus. - Hooovahh - LabVIEW Overlord
09-08-2015 07:54 AM
@Rashme_SR 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.
09-08-2015 10:50 AM
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.
09-08-2015 01:10 PM
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
09-08-2015 01:17 PM
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
09-08-2015 01:41 PM
@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.
Unofficial Forum Rules and Guidelines
Get going with G! - LabVIEW Wiki.
16 Part Blog on Automotive CAN bus. - Hooovahh - LabVIEW Overlord
09-08-2015 01:44 PM
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
09-08-2015 02:42 PM
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.
09-08-2015 02:48 PM - edited 09-08-2015 02:48 PM
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