From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Call LV example to launch WMP from TS

Solved!
Go to solution

I used an example from the NI site.  https://decibel.ni.com/content/docs/DOC-25131.  The example works great for me when running it in LV.  I need to call it from Teststand.  I create an action step in TS and call the vi.  I get an error 97 on the IWMPPlayer4 URL Property Node.  The value for the Windows Media Player terminal is 0 when callled from TS which causes the error.  When running from LV the terminal has a number and works.    

I'm using LV2009, TS4.2.1, and WMP 11.

 

Mick

0 Kudos
Message 1 of 3
(3,624 Views)

I suspect TS is not initalising the ActiveX control on open, whereas LabVIEW does. See attached snippet which uses the automation open VI. The constant refnum is set to the WMPLib.IWMPPlayer4 class. Seemed to work for me. I made the video window an indiactor, rather than a control.

Other stuff to do...

Set VI properties to a dialog so it shows when called from TestStand.

Add an event case to handle on window close (or disable window close button).

You may want to add a TestStand Termination monitor and start/end modal dialog.

 

P.S. I am on TestStand 2012 SP1.

 

Nick

0 Kudos
Message 2 of 3
(3,550 Views)
Solution
Accepted by topic author MickF

Thanks NickAct for the suggestion.  I forgot I had posted here.  I needed to get a solution quickly so I contacted NI support.  This is the email with the solution that worked. 

 

 

Good news! I was able to find a workaround for calling the LabVIEW code with the ActiveX Windows Media Player control. In TestStand as well as LabVIEW, you must load and unload the code module dynamically. This ensures that all references are released properly. You can change this setting in the Run Options of the Step Settings. I hope that you find this information useful. I will keep this service request open for one more week if you need additional support regarding this issue.

Regards,

Anjelica Warren
Applications Engineer
National Instruments

0 Kudos
Message 3 of 3
(3,541 Views)