DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

"Diadem command line control"

Hi Midhunseelan O.S,
 
Excel does not register an ActiveX control for a Pie Chart that you can put on a DIAdem SUD dialog.  However, you can call the Excel ActiveX API directly from VB Script, thereby launching excel and possibly populating a pie chart programmatically.   
 
Here are two links to help get you started:
Cheers,

David Goldberg
National Instruments
Software R&D
0 Kudos
Message 11 of 19
(3,308 Views)

Is there a way i can load a file using command prompt in a running instance of Diadem Navigator ?

0 Kudos
Message 12 of 19
(2,188 Views)

Hi,

 

I want to pass list of mf4 files to DIAdem script through command line and export PDF report based on specific template for each.

What is the best way to do it?

0 Kudos
Message 13 of 19
(1,988 Views)

Hello,

 

My favorite way to process files from  command line, is to have the command line call a script and the script will expect a file to exist in a specific path like c:/users/public/temp/Filelist.csv

 

Then before you call the command line, you make the Filelist.csv file. The VBS will then read the CSV file and do what you have coded in the script.

 

Paul

Message 14 of 19
(1,980 Views)

Thanks!

0 Kudos
Message 15 of 19
(1,976 Views)

Is there a way to execute scripts from the cmd line prompt WHEN diadem is already open?  

 

I have used the following code and it opens DIAdem and then executes the script.  However running this multiple times will cause multiple open instances of Diadem.

 

"C:\Program Files\National Instruments\DIAdem 2021\DIADEM.exe" "/cscriptstart('C:\some script.VBS')" 

 

 

Also can a variable be passed to the script when the called script runs?  Similar to passing a global variable to a subscript when called by a main script?

 

Thanks

 

Tim
0 Kudos
Message 16 of 19
(430 Views)

Hi Smooth,

 

The only way I know of to run commands on an existing DIAdem instance is to use ActiveX.  I recently discovered how to call DIAdem via ActiveX from python, and python has command line execution options... would that be an interesting avenue for you to pursue?  Alternatively, you could run a VBScript  from the command line that connects to the existing DIAdem instance via ActiveX.

 

Brad Turpin

Principal Technical Support Engineer

NI / Emerson

0 Kudos
Message 17 of 19
(358 Views)

hey Brad

 

You wouldn't have an example of how one would create an ActiveX object on via command line and then run the Diadem script?

 

Tim
0 Kudos
Message 18 of 19
(299 Views)

Hi Tim,

 

I don't have anything specific to command line execution, but of course you can invoke a *.vbs or *.py file from the command line easy enough.

 

Here's sample code to connect to DIAdem and run commands from an external VBscript:

Set Dd = CreateObject("DIAdem.ToCommand")
Dd.CmdExecuteSync("LogFileWrite('" & now & "')")
Dd.CmdExecuteSync("WndShow('SHELL', 'MAXIMIZE')")
Call Dd.IntegerVarGet("ProgramVersion", DdVer)
MsgBox "DIAdem Version = " & DdVer
Set Dd = Nothing

 

Here's sample code to connect to DIAdem and run commands from an external python script:

import win32com.client
dd = win32com.client.Dispatch("DIAdem.ToCommand")
DdVer = dd.IntegerVarGet("ProgramVersion")
print(str(DdVer))

dd = win32com.client.Dispatch("DIAdem.TODataSheet")
is_locked = dd.bInterfaceLocked
ch_com = dd.ChnCommentGet("[1]/[3]")
print(str(is_locked))
print(str(ch_com))

 

Hope that helps,

Brad

0 Kudos
Message 19 of 19
(254 Views)