DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

start diadem program from a running diadem application

Hi there,

How to start another DIAdem 9.1 program from a running DIAdem application?
Try to start the other program in Sub "SFD_ProcessChannel()“ with „scriptstart()“, „SUDDefLoad()“ oder „schemeload()“ results in an error message "Types invalid" or similar.
What's going wrong? Is there an other methode to start the new program?
By the way the program to be called runs fine as single application.


Es soll aus einer laufenden DIAdem Anwendung heraus per Knopfdruck eine weitere DIAdem - Anwendung gestartet werden.
Alle Versuche mittels DIAdem „Script DAC Treiber“ eine andere Anwendung aufzurufen scheitern an der immer gleich lautenden Fehlermeldung:

 „Typen unverträglich“.

 Und das gilt für alle Versuche mit „scriptstart()“, „SUDDefLoad()“ oder „schemeload()“.

Als einzelne Basic-Anwendungen funktioniert der Code einwandfrei, nur innerhalb der Routine „SFD_ProcessChannel()“ machen die Aufrufe o.g. Probleme. Was läuft falsch?


Oder gibt es eine andere Möglichkeit ein weiters DIAdem - Programm  aufzurufen?

 
Vielen Dank für Ihre Antwort


Norbert

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

Hi schade,

Have you tried:

Call ExtProgram(ExtProgramName)

(For me, ExtProgramName = "C:\Program Files\National Instruments\DIAdem 9.1\DIADEM.exe"
 
I hope this works!
 
Julia
Message 2 of 3
(3,182 Views)
Hello Norbert,

Julia is right, you should use the command ExtProgram if you want to start an external application from DIAdem.
Maybe you allready tried that and found that is is working inside a normal VBS but not in the Script DAC context. This is because the Script DAC driver only uses a subset of DIAdem functions that may be used in normal scripts.
Because of the loss of performance during a measurement it is not recommended to implement time consuming scripts inside this driver block. For that reasons we do not support the ExtProgram command inside these scripts.

If you really want to do it, there is still a possibility to realize that. But take care, the performance of your mesurement will be affeted by that call and make sure that the application is not started with every iteration of the ProcessChannel fuction.

Try this out: It uses the Windows Scripting Host Shell to run a program (here: the Windows Calculator)
Set WshShell = CreateObject("WScript.Shell")
WshShell.run "calc"

Regards
Ingo Schumacher
Systems Engineering Manager CEERNational Instruments Germany
Message 3 of 3
(3,174 Views)