01-20-2022 02:01 PM - edited 01-20-2022 02:15 PM
Hi All,
I've observed what I believe to be an issue that's been bugging me for a while, or perhaps I'm misunderstanding something.
I observe that NXG and System buttons set to Latch when Released mechanism don't actually reset in my application. They actually don't reach their "state" when chosen to switch when released either. I have them placed in the event structure. I considered there could be an issue of having multiple buttons handled by the same case, so I separated them out as well. The behavior remains.
System and NXG buttons have 6 states (see nxg options.PNG). I believe the first two items in the top row are OFF and ON. I believe this to be the case because when you're just in the editor menu and click on/off, these are the two colors that it toggles between. So the other states, I'm presuming to be for transitions.
I decided to make a little "study" and changed these states to distinguishable colors and recorded what states the button goes through (see Color Flow.pdf).
Latch when released:
In red is what I assume for these colors to be ON/OFF. The blue is what you observe in the application (ignoring the first click). It remains in the green state, going through the red state. As I was doing this test, once in a blue moon (20+ clicks) it would sometime go into the expected OFF state - interesting.
Switch when released:
Again, the red is my expectation for ON and OFF. After the first click, it goes from off to the red state and then it continues as labeled in the diagram.
The ON/OFF states appear to be the white and green, T > F goes through the black state, F > T goes through the red state.
Lastly, as noted in the document, when I shutdown the application, the button actually resets to what ON and OFF should be.
I can A - change the picture states to look like the expected ON/OFF or B - use switch and the reset it myself. However, that defeats the purpose of having a latching action available. Am I missing something? Of course, the other buttons behave as anticipated.
Before someone else says it - I am choosing these buttons because they look better. Pleasant/modern looking GUIs make the user experience better.
I attached my sample VI (developed in LV 2019 SP1, 64-bit) but can save it in other versions should anyone be interested. It's a pretty easy thing to recreate. Attaching screenshots as well.
Thanks for any help.
01-20-2022 02:13 PM - edited 01-20-2022 02:15 PM
As soon as I posted this, I tried to customize a new button to appear to work correctly. Well.. now they all work! As anticipated. Also suggesting that some of those states are transitions for mouse over (which I've read somewhere). Here's the thing. This has not worked correctly for me countless times. Most often, once I build the EXE this behavior occurs. Has anyone dealt with this?
01-20-2022 08:59 PM
A latched button won't return to its false state until you read it. Any chance those troublesome controls are not sitting in the event case that calls it?
01-20-2022 09:30 PM
Hi Bill, all except two are in their corresponding event case of the event structure, but those two were just an experiment. (I included two buttons that are just in the while loop and have no event case because I found on a forum that this helped them with a similar issue. It didn't work, no surprise there.)
01-20-2022 10:01 PM
@TheresaM wrote:
Hi Bill, all except two are in their corresponding event case of the event structure, but those two were just an experiment. (I included two buttons that are just in the while loop and have no event case because I found on a forum that this helped them with a similar issue. It didn't work, no surprise there.)
Wow, isn't that just weird!
01-21-2022 11:24 AM
It really is. It's surprising just how repeatable this issue is too when it comes to this style of a button. By some miracle, it worked as expected for one run yesterday, but now it's back to the behavior I typically see. I hope someone can share some insight. I saw on some thread that maybe there's an issue with LabVIEW, but I have seen this issue across different versions.
01-21-2022 11:38 AM
I've seen peculiar issues with Silver controls and indicators, but to my knowledge, NXG and System controls behaved themselves. But I guess my knowledge has gaps.
02-11-2022 03:31 PM - edited 02-11-2022 03:32 PM
Hi Bill,
So, I still haven't found a reason for these issues. BUT, I made an interesting discovery today that I wanted to share.
Here's the usual buggy scenario: I click on my latching NXG/System button and it doesn't actually release. Here's the discovery, when I scroll with my mouse button - it finally releases! Interestingly enough, not to the default state, meaning if my latching button is false by default, after clicking and reading it (placed inside the event case structure), it should reset back to false. With this "scroll workaround," it swaps between resetting to the other state. So first time around I click on it, scroll, it resets to True. Then I click on it, scroll, it resets to False. etc.
I think this is very interesting. I would love to know how the six states of these buttons were actually intended to function, maybe that's where the answers to this "bug" lie.
02-11-2022 04:29 PM
@TheresaM wrote:
Hi Bill,
So, I still haven't found a reason for these issues. BUT, I made an interesting discovery today that I wanted to share.
Here's the usual buggy scenario: I click on my latching NXG/System button and it doesn't actually release. Here's the discovery, when I scroll with my mouse button - it finally releases! Interestingly enough, not to the default state, meaning if my latching button is false by default, after clicking and reading it (placed inside the event case structure), it should reset back to false. With this "scroll workaround," it swaps between resetting to the other state. So first time around I click on it, scroll, it resets to True. Then I click on it, scroll, it resets to False. etc.
I think this is very interesting. I would love to know how the six states of these buttons were actually intended to function, maybe that's where the answers to this "bug" lie.
Wow - that is really strange!