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.

DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

Minimize 2nd instance of Diadem executed from script

Solved!
Go to solution

Hello,

i got an issue, in my script im executing running of new instance with following code

Set oShell = CreateObject("WScript.Shell")  
oShell.Run """"& cDiademExePath &""" /CScriptStart('" & sScriptToRunPath & "')", 7

Second Diadems opens, but its active and i would like it to be minimized and that the main instance remains active.

By this documentation ( Run Method (Windows Script Host) ), the second parameter controls the behaviour, but it has note "Note that not all programs make use of this information." - Is it this the case?

 

Is the re some other way to have the new instance minimized, or is there a way to have it not displayed, set visible of the instance to false?

Thanks for info

0 Kudos
Message 1 of 6
(2,799 Views)

Hi Lukas,

 

There may be a way to include a DOS extension specific to DIAdem to launch invisibly, but that may not be the best solution for what you want to do.  What do you want to do?  Are you launching a new DIAdem instance from an existing instance?  In that case you might want to explore the option of invoking "worker" DIAdem instances that are by nature invisible (and lower memory footprint) and which can be controlled by the calling parent DIAdem instance.  Or are you launching a new DIAdem instance from another program?  In that case you might want to consider using the DIAdem ActiveX interface, which has a native flag to run invisibly, and again the calling program can exert control over the executing DIAdem instance.

 

If you launch DIAdem with a DOS shell command, as you've set out in your post, you will be launching a separate thread, such that if the calling program ends, the DIAdem instance will remain.  This may be exactly what you want, but it comes at the cost that the calling program can no longer control the independently launched DIAdem instance.  You can tell the DIAdem instance you're launching this way to run a particular VBScript as soon as it launches, and that VBScript can of course minimize the DIAdem application or perform any other tasks you want the independent DIAdem instance to do.  But the communication between the calling program and the new DIAdem instance ends at launch time.

 

Brad Turpin

DIAdem Product Support Engineer

National Instruments

0 Kudos
Message 2 of 6
(2,771 Views)

I am calling the run command from script which is running from Diadem.

I want to do exactly this:

- run a script which collect data from user

- after having data, i want to run a new instance of diadem which will do some operations, but the main script should continue doing other operations. the point is when i run a new instance, its active and i cant see the main script running, so i want to do that the new instance should be visible, but minimized and the main script should stay active.

 

now the main script opens new diadem and i see loading screen and after the new instance, i would like it to be minimized from its launch.

0 Kudos
Message 3 of 6
(2,761 Views)

Hi Lukas,

 

It sounds like you should be using one or more DIAdem "workers".  What version of DIAdem are you running again?

 

Brad Turpin

DIAdem Product support Engineer

National Instruments

0 Kudos
Message 4 of 6
(2,748 Views)
Solution
Accepted by Lukas_Doubek

Hi Lukas,

 

If you're using DIAdem 2014 or later, check out the following 2 objects to see how to use DIAdem "workers"

 

  • ParallelProcessControl
  • SystemInfo

 

Brad Turpin

DIAdem Product Support Engineer

National Instruments

0 Kudos
Message 5 of 6
(2,747 Views)

im using Diadem 2017 64bit and i solved it by putting

 

Call WndShow("SHELL","MINIMIZE")

on the beginning of "slave" script runned in second diadem, but running diadem with some parameter which will make it minimalized directly before the loading screen of Diadem would be more elegant, because now i see the loading screen and after its loaded, it gets minimalized.

0 Kudos
Message 6 of 6
(2,722 Views)