12-15-2022 01:06 AM
Hi. I'm new to labview. I have managed to do a boolean transition and it works. But now I want the boolean 3 true and the false 3 to count as 1. I thought it would be easy but haven't figured a way to do it.
Solved! Go to Solution.
12-15-2022 01:42 AM
Hello,
for me it is not really clear what you want to achieve.
It is good that you attached your code. You can store your example data in the boolean array with context menu of the array control, "Data operations / Make current value default". Then explain what you expect with your example data.
P.S. Transitions are recognized with an Exclusive OR (even a Not Equal works).
12-15-2022 01:51 AM

Hello,
Instead of this image, I want to make 1 transition for 3 true boolean and 3 false.
12-15-2022 03:24 AM
@User002 wrote:
Hello,
Instead of this image, I want to make 1 transition for 3 true boolean and 3 false.
You now have +1 if current is true and previous is false).
If you want to add 1 when going from true to false, simply invert the logic:
That shift register is not initialized. So it will keep the last value of the array for the next run. The first run the value in the shift register is false, the 2nd time (and thereafter) it will be true since the last value in the array is true.
Not sure if that is what you want...
Note that you are reinventing Boolean Crossing PtByPt.vi, which isn't bad...
12-15-2022 07:10 AM - edited 12-15-2022 07:12 AM
I still haven't booted my laptop this morning but,
12-15-2022 07:18 PM
But the output still same as my code.
This output should be 0 because I want only 3 true and 3 false as 1 transition

This is that output I want

12-16-2022 01:39 AM
This should work for you:
It takes the next 6 elements starting from the ith element and compares it to the transition requirement. 1 if equal, 0 if not.
12-16-2022 02:28 AM - edited 12-16-2022 02:30 AM
@User002 wrote:
But the output still same as my code.
This output should be 0 because I want only 3 true and 3 false as 1 transition
That wasn't clear. I thought you mentioned 3 just to refer to the example, not as a specification.
It still is underdefined. Is 3 the minimum number or the exact number Of trues and\or falses?
If you only want exactly 3, add a false\true before\behind the reference array.
12-16-2022 02:31 AM
Yes. This is what I want. Thank you for the help.
12-16-2022 02:44 AM
@User002 wrote:
Yes. This is what I want. Thank you for the help.
Your first kudo for accepting an answer!