10-14-2015 04:26 PM
Hi,
In the attached VI, when a boolean from BooleanArray is True, that row is highlighted. When the clear button is pressed, all highlighted rows are cleared. The next time the array changes (triggered by the event structure), the Trued booleans are highlighted again.
I would like to be able to highlight only the boolean that were not True before the clear button was pressed. In other words, I only want to highlight new booleans.
I think of shift registers, but I am not sure how to implement that in here.
Thank you for your help.
Solved! Go to Solution.
10-14-2015 04:33 PM - edited 10-14-2015 04:34 PM
Can you reset all your booleans after the clear is pressed by Anding it with a false. Attached is an update.
Or you could try on triggering the value change of the booleans, XOR it with the old value, and only update the row that has changed.
Unofficial Forum Rules and Guidelines
Get going with G! - LabVIEW Wiki.
17 Part Blog on Automotive CAN bus. - Hooovahh - LabVIEW Overlord
10-14-2015 04:36 PM - edited 10-14-2015 04:46 PM
Shift register is correct. Every time the Clear button value change event is triggered True, pull the current highlighted cells in the form of an array and write them to a shift register. Every other event case should just pass this array through without changing it. The event when BooleanArray changes should pull in the array of cleared rows and not highlight those.
Make sure that if you clear again after already clearing, you append the new cleared values.
You will also need to take in to account when a previously cleared value is changed... so that would require you to edit the cleared values and remove one if it changes value...
Hooovahh's second idea is what you want. See attached.
Cheers
--------, Unofficial Forum Rules and Guidelines ,--------
'--- >The shortest distance between two nodes is a straight wire> ---'
10-14-2015 04:44 PM - edited 10-14-2015 04:44 PM
Yeah I probably should have used a shift register in my posted VI, but to be honest I wanted to be quick to the reply to beat James.
Unofficial Forum Rules and Guidelines
Get going with G! - LabVIEW Wiki.
17 Part Blog on Automotive CAN bus. - Hooovahh - LabVIEW Overlord
10-14-2015 04:48 PM - edited 10-14-2015 04:48 PM
Haha, and you did beat me because I was overcomplicating it. I posted before really understanding how the highlighting was working. The listbox itself is acting as the shift register (memory) as long as all he wants to do is highlight the new True values. It was redudant in the code by marking all true values green every time.
Cheers
--------, Unofficial Forum Rules and Guidelines ,--------
'--- >The shortest distance between two nodes is a straight wire> ---'
10-14-2015 04:49 PM
Hi TeamHalli,
I think you can compare the old value and new value in the event case to determine which element is changed in the boolean array.
And then feed the compared result into the for loop to determine whether it should be highlighted or not.
10-14-2015 04:57 PM
Hi TeamHalli,
After reviewing your post, I think "Less than" operator is more appropriate to your case...
By the way, it might be better to initialize the boolean array first.
10-14-2015 06:20 PM
Just a few final comments:
10-14-2015 08:46 PM
Thank you all for your suggestions. Would it be possible to have the highlight flash green/clear instead of it being a steady green?
Your help is greatly appreciated!
10-14-2015 09:22 PM
Cheers
--------, Unofficial Forum Rules and Guidelines ,--------
'--- >The shortest distance between two nodes is a straight wire> ---'