From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to programatically make the drop down of a Ring or Enum appear?

I'm trying to do some VI scripting for automated documentation generation. Part of this involves setting up the front panel in a certain configuration and taking a screenshot (using FP.GetImage and Write PNG File).

 

I'd like to programatically make the drop down menu show for a Text Ring, and then capture a screenshot of this.

 

The ideal output may look something like this:

ijustlovemath_0-1615993468914.png

 

This doesn't seem to be an available method or property on the ring control, so if that's not possible, perhaps the documentation generation won't be entirely automated, and will be coordinated with the user through some sort of timed sequence of front panel interactions.

 

0 Kudos
Message 1 of 3
(871 Views)

You'd have to use Windows APIs to simulate a mouse click (search for simulate mouse click).

 

That's easy enough, unless the VI lives in a subpanel. That makes it harder. It's even harder if the VIs are clones.

0 Kudos
Message 2 of 3
(844 Views)

Afterthough...

 

You could also 'fake' this:

 

+ use VI server to get the strings.

+ use the strings to make a picture that exactly looks like the drop down.

+ put the fake image over your screenshot.

 

That will give you a screenshot of the activated ring\enum. There will be corner cases, like very long lists, controls at the edge of the screen, etc. But covering most situations will not be too hard.

 

It might actually be less clumsy than the simulating the click. 

0 Kudos
Message 3 of 3
(773 Views)