NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Make Window Modal from SubVI

I have a VI which I want to make modal to TS so I am using the Start/Stop Modal Dialog VIs. Now, I also have a set of preconditions and a bunch of code which I will include in this and several VIs more so I decided to make a subVI that includes the StartModal VI + all the repeated operations,  is there a way to do this? (using a sort of caller vi property in labvi) so far in the tests I've made LV/TestStand always make modal the VI that in which Start/Stop Modal VIs are directly placed...
 
Suggestions? ideas??
0 Kudos
Message 1 of 6
(3,935 Views)

Hi,

You might try this example, http://zone.ni.com/devzone/fn/p/sn/n23:4.33/sb/navsRel?q=make+VI+modal&x=11&y=11

Have a look at the edit subVI.

Regards

Ray Farmer

Regards
Ray Farmer
Message 2 of 6
(3,916 Views)

That's exactly what I was looking for...

Thanks a lot!!!

0 Kudos
Message 3 of 6
(3,914 Views)

This is exactly what I was looking for and I'm still looking for it because of the broken link!!! 

 

NI - Can you post a link to the new location???

0 Kudos
Message 4 of 6
(3,395 Views)

I think the link has died - and I can't find where it's been moved to - it was a few years ago!!

Just to check - you have a VI in LV that you want to make modal to the TestStand window (UI or sequence editor), but it's not the launched VI from TestStand and it's not the VI that contains the "Start Modal"

 

In other words, TS calls LV VI which decides if it should call another VI based on decisions and it's that other VI that needs to be modal.

 

In TestStand 2014, the Start Modal vi has an extra input compared to previous versions where you can wire in a reference to the VI you want made modal (don't wire it and it assumes the current VI).

 

Does that help?

 

If you're in an older version, then I believe the Engine methods for RegisterModalWindow, UnregisterModalWindow, NotifyStartOfModalDialog and NotifyEnd Of ModalDialog should exist.

E.g. http://zone.ni.com/reference/en-XX/help/370052K-01/tsapiref/reftopics/engine_registermodalwindow_m/

 

You obviously need to get the HWND for the VI you've launched but this should be fairly easy :

http://digital.ni.com/public.nsf/allkb/136F6B1F34CBB76E852563FC007AEFC7

The example pointed to here used FindWindow or FindWindowEx to get the HWND based on the titlebar name from User32.dll

http://digital.ni.com/public.nsf/allkb/1B733F0C719BF70386257372002F847D

 

Thanks
Sacha

// it takes almost no time to rate an answer Smiley Wink
Message 5 of 6
(3,378 Views)

Thanks Sacha, 

Just the reply I was hoping to get!  I was using TS 2013, but have 2014 installed.  I verified that 2014 does have this functionality, which is exactly what I needed.  So I will try this out today.  If for some reason this project needs to stay in 2013, I will try out the other methods.  I really appreciate you covering both of the cases.  Thanks again!

Scott

0 Kudos
Message 6 of 6
(3,371 Views)