DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

How to load data into DIAdem 10.2?

I've programmed an application (.NET, C#) which generates TDM-Files.

My customer has several VB-Scripts and want`s that I load the data into the running DIAdem.
How can I do that?

Is it possible to pass parameters to a VBS, so that the script can load the data into DIAdem?


Best regards,
Alex
0 Kudos
Message 1 of 6
(5,010 Views)

Hello Alex!

There are two possible aproaches:

  1. DIAdem commandline
  2. DIAdem OLE interface

A solution with 1. is quite simple. Start DIAdem as a process with /C parameters as commands (several are allowed!). There you can set variables, load data via the DIAdem command and start a script. The disadvantage is that for every new evaluation a new DIAdem has to be started. This is time consuming and after a while - if the user doesn't close the unused applications - many DIAdem are running ( DIAdem is verry resource consuming Smiley Mad ).

An aproach with 2. is from .NET/C# easy to implement. If you open the ToCommand interface (see DIAdem Help for details) you start a new DIAdem or connect to an already running. Then you can execute every DIAdem command from your .NET application. You can choose between synchronous or asynchronous command execution. You should load the data synchronous and execute the evaluation script asynchronous.

Hope this abstract helps to decide and to start

Matthias

Matthias Alleweldt
Project Engineer / Projektingenieur
Twigeater?  
0 Kudos
Message 2 of 6
(5,008 Views)
Hello Matthias,


I found the ToCommand Interface and can connect to DIAdem via OLE.

Where can I find information about the commands I can use? I'm totally new to DIAdem.

Concrete:
- How can I bring DIAdem to top?
- How can I reset/load a TDM-File?
- How can I start an autosequence?


Thanks,
Alex
0 Kudos
Message 3 of 6
(4,963 Views)
Hello Alex!
 
There is no way in standard DIAdem to bring it to top, but you can read the DIAdem main window handle and force Windows to bring the window to top. Assuming oDIAdem is your ToCommand interface you can read the DIAdem main window handle with this line of code:
 
oDIAdem.IntegerVarGet("MAINHWND", MyVar)
 
You can execute any DIAdem command via a call to 'CmdExecuteSync'. To reset the data in DIAdem the code looks like this
 
oDIAdem.CmdExecuteSync("DATADELALL")
 
To load data there is the command 'DataFileLoad'. See help for parameters and use the  'CmdExecuteSync' to execute.
 
To execute a script you should use the 'ScriptStart' command and the 'CmdExecuteASync' function from the interface. The asynchron execution is here better because your .NET programm will not wait for the script to finish!
 
Matthias
Matthias Alleweldt
Project Engineer / Projektingenieur
Twigeater?  
0 Kudos
Message 4 of 6
(4,958 Views)

Hello Alex

you can bring DIAdem to top with this command:

oDIAdem.CmdExecuteSync("WndShow('SHELL','Show')")

You can find an example how to work with OLE in the DIAdem ExampleFinder with the Keyword ToCommand.

Please use oDIAdem.bInterfaceLocked to be sure that DIAdem is responding, when you send a command. If for example a dialog is open or a script is running DIAdem will not respond.

Winfried

0 Kudos
Message 5 of 6
(4,950 Views)
Hello Winfried!
 
Does oDIAdem.CmdExecuteSync("WndShow('SHELL','Show')") now work in any cases? In past versions of DIAdem this doesn't worked reliable in all cases!
 
Matthias
Matthias Alleweldt
Project Engineer / Projektingenieur
Twigeater?  
0 Kudos
Message 6 of 6
(4,943 Views)