03-12-2025 04:26 PM
I need to create a VI with a cluster of six buttons labeled Option1…Option6. When executing, the VI should wait for the user to press one of the buttons. When a button is pressed, use the Display Message To User Express VI to indicate which option was selected. Repeat this process until the user presses the Stop button. I have everything working except after I close the messages that show what options are pressed and press new buttons, the new messages for the new buttons won't pop up unless I stop the VI and run it again with the new buttons pressed. In other words the messages are only triggered based on the state of the buttons when I run the vi. I need to have it continuously updating. I attached some images of my vi.
Solved! Go to Solution.
03-13-2025 01:54 AM - edited 03-13-2025 02:52 AM
Hi adam,
why do you wire "i" to the case selector?
Where do you "wait for the user to press a button"? (Shouldn't there be en event structure?)
Why don't you use a RadioButton control with 6 "options"?
Why do you attach only images (even downscaled and unreadable) instead of code?
Edit:
This seems to be a very common homework as can be seen here…
03-13-2025 02:58 AM - edited 03-13-2025 10:10 AM
@adamwarlock wrote:
I need to create a VI with a cluster of six buttons labeled Option1…Option6. When executing, the VI should wait for the user to press one of the buttons. When a button is pressed, use the Display Message To User Express VI to indicate which option was selected. Repeat this process until the user presses the Stop button. I have everything working except after I close the messages that show what options are pressed and press new buttons, the new messages for the new buttons won't pop up unless I stop the VI and run it again with the new buttons pressed. In other words the messages are only triggered based on the state of the buttons when I run the vi. I need to have it continuously updating. I attached some images of my vi.
03-13-2025 10:02 AM - edited 03-13-2025 10:03 AM
Sorry, I’m a beginner (clearly lol). I've attached the vi. The specific problem is labeled P6.8. Thank you for the reply!
03-13-2025 01:47 PM - edited 03-13-2025 01:52 PM
Here is what I would do.
03-13-2025 01:49 PM - edited 03-13-2025 02:08 PM
@aeastet wrote:
Here is what I would do.
It is really bad form to attach a different VI with an identical name to the one that was posted earlier by a different user. I would not do that. 😄
(In order to tell which one is which, I need to remember in what order they got downloaded because the second one will be renamed by the browser to "Problem (1).vi")
03-13-2025 01:53 PM - edited 03-13-2025 01:53 PM
Fixed I hope that your heart feels a little better.
03-13-2025 02:01 PM - edited 03-13-2025 02:05 PM
Here's what I would probably do (look ma! No express VIs!):
The case will be true whenever the control has changed (or something has already been selected on first run).
Yes, once you learn a bit more, an event structure would be better, but requires some tweaks.
You also need to decide if "no selection" should be allowed.
Personally, I don't like popups because they will stall the VI. Maybe all you need is display the selection in an indicator
03-13-2025 02:25 PM - edited 03-13-2025 02:27 PM
And if you allow multiple booleans to be true, here's how to do the event structure that tells you what just changed and how.
See if it can give you some ideas...