From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

making the result of (T/F) fucntion non latched

Dear all,
I need a method to make the result of (True/False) functions (e.g. equal?) non latched. I just want somthing like a "pulse" of the result (True or false).

The picture may clear what I'm saying.

Thanks in advance
-----------------------------
Ayman Mohammad Metwally
Automation Engineer
Egypt - Cairo
0 Kudos
Message 1 of 7
(2,401 Views)
Here is the picture (I'm sure I attached it in the first post!!, never mind)
-----------------------------
Ayman Mohammad Metwally
Automation Engineer
Egypt - Cairo
0 Kudos
Message 2 of 7
(2,397 Views)
You need to keep the value of the previous iteration and only output a "true" if [current="true" AND previous="false"].

The previous value is most easily obtained using a shift register. The attached example shows one possibility using a coumpund arithmetic node set to "AND" and with the upper terminal inverted.
Message 3 of 7
(2,390 Views)
Equivalent, but with shorter wires would be using a feedback node. (see attached image).
Message 4 of 7
(2,387 Views)
Thanks altenbach for the quick reply,
It's a good way to do it.
Here is another method one of my friends suggested it, It seems strange, but it works just fine.
-----------------------------
Ayman Mohammad Metwally
Automation Engineer
Egypt - Cairo
0 Kudos
Message 5 of 7
(2,381 Views)
That is actually a very dangerous way to do it because there is no absolute certainty that it works. It is a prime example of a race condition because the LabVIEW code shown assumes that the local variable AAA contains a stale value. It falsely assumes that in every iteration of the loop, the local variable is read before the AAA terminal is written, an assumption that cannot be guaranteed by the dataflow! It might well be that once in a while (or almost always!) the local variable already contains the current value and you'll get a FALSE even though your trigger condition is met.

It could stop working at any time, e.g. once you add some more code to the loop, recompile the VI, upgrade to a new version, or just by itself, without reason. 😉
Message 6 of 7
(2,371 Views)
I certainly agree with you, Thanks
-----------------------------
Ayman Mohammad Metwally
Automation Engineer
Egypt - Cairo
0 Kudos
Message 7 of 7
(2,364 Views)