LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Is there a way to programmatically press enter to close a dialog box created in Labview?

I am trying to close a labview dialog box automatically when it appears. I don't always want
the user to have to press enter or use a mouse click
to close the dialog. Has anyone done this?

Thanks!
0 Kudos
Message 1 of 8
(6,398 Views)
Sure, it's easy. Take a look at the attached vi. You can use a boolean global variable as an auxiliary OK button. You simply NOR this with the OK button on the dialog box front panel to terminate the while loop. Any VI that sets this global to True will stop the while loop just like if the user were to click the OK button on the front panel.
0 Kudos
Message 2 of 8
(6,398 Views)
I should have clarified that I can not access the back panel of the vi - so I was looking for a way to access the dialog box without access to the block diagram...
may not be possible... I thought there might be a way to close the dialog or automatically press enter to get rid of the dialog.

I am attempting to integrate someone else's subvi into
my vi - that is why the block diagram is not accessible.
0 Kudos
Message 3 of 8
(6,398 Views)
Okay, now I understand you. Yeah there is a way to programatically click the OK button on a VI even if you can't access the diagram. You just need to know the name of the VI and the name of the control on its front panel. It works if the dialog is using a while loop to sense the OK button, but it doesn't seem to work if t he dialog VI is using an event struction. I don't know why. See the attached pair of VIs.

I hope this tip is more helpful than the last one.

Steve
0 Kudos
Message 4 of 8
(6,398 Views)
In LV 6 events structures only responded to user initiated events.

That is "why".

Ben
Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 5 of 8
(6,398 Views)
Thanks for your time and suggestion - I will give that a try! I am not sure how the dialog box is set up so I will just have to try it.

Thanks,
Jenn.
0 Kudos
Message 6 of 8
(6,398 Views)
I have been trying this ghost user vi with my vi. Do
you think that there is any way to apply this to a pop up dialog box... probably not - it doesn't seem to find the ok button on the popup dialog box when it is given the vi reference.

Thanks again for your help.

Jenn.
0 Kudos
Message 7 of 8
(6,398 Views)
Jenn,

I'm sorry, I don't think I understand what you mean by "pop up" dialog box. I don't find this term in any of the LabVIEW help files.

Is this still the same dialog box you've been struggling with, or is it a new one? If this is a new problem, does that mean the invoke node technique worked with the original dialog?

Is it possible the OK button simply has a different name on this pop up dialog? If you open the contextual help window and hold the mouse cursor over the OK button, it will show the true name of this control.

Steve
0 Kudos
Message 8 of 8
(6,398 Views)