LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Need help displaying message to user

Solved!
Go to solution

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.

 

image.png

Screenshot 2025-03-12 at 5.23.18 PM.png

0 Kudos
Message 1 of 9
(487 Views)

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

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 2 of 9
(450 Views)

@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.


  • As has been said, we cannot debug blurry pictures, attach your VI instead.
  • Assuming only one option (or none) can be selected at any time, a radiobutton control would simplify (as has been mentioned).
  • Because [i] only start at zero when you start the VI and it will eventually go to infinity and you are seacrhing way outside the size of the array.
  • You have way too much duplicate code! It seems to me you have six nearly identical cases. All you probably need is one. I am absolutely sure you don't need any express VIs!
  • Why do you use a shift register if you are never ever using it's stored output on the left?
  • Why are all your front panel fonts underlined?
  • Be careful with words like "continuously updating" I am sure you don't want to popup the same message over and over, even if the selection does not change. (hint: event structure)
  • Again, If you want more specific help with your homework attach your VI.
  • etc.
Message 3 of 9
(440 Views)

Sorry, I’m a beginner (clearly lol). I've attached the vi. The specific problem is labeled P6.8. Thank you for the reply!

0 Kudos
Message 4 of 9
(412 Views)
Solution
Accepted by adamwarlock

Here is what I would do.

Tim
GHSP
Message 5 of 9
(370 Views)

@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")

0 Kudos
Message 6 of 9
(364 Views)

Fixed I hope that your heart feels a little better.

Tim
GHSP
Message 7 of 9
(361 Views)

Here's what I would probably do (look ma! No express VIs!):

 

altenbach_0-1741892335591.png

 

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

 

0 Kudos
Message 8 of 9
(351 Views)

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.

 

altenbach_0-1741894047928.png

 

 

 

See if it can give you some ideas...

 

 

 

altenbach_0-1741893781219.png

 

Message 9 of 9
(340 Views)