From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, 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: 

"Diadem command line control"

I have a report format that I wish to use many times with different data files. Does diadem support command line arguements so that i can startup diadem and pass it the report format and data file names i want it to use.
0 Kudos
Message 1 of 15
(8,741 Views)
There are different ways to do this. The easiest way would be to start DIAdem with a command line argument that starts a DIAdem script, which will in turn load the report template and data files(s) you wish to use.

The format for the DIAdem command line is:

DIAdem.exe /CScriptStart('MyScript.vbs')

The script can include any DIAdem command and access any of the data files you have stored.

Let me know if you need additional help.

Otmar
Otmar D. Foehner
0 Kudos
Message 2 of 15
(8,739 Views)
Is this the only way as the data filenames and template name could be different everytime I call diadem. Can the script take command line arguements?.

If so I could pass the template name and the data file on the command line.
0 Kudos
Message 3 of 15
(8,738 Views)
You can transfer the names of the files you wish to use via ActiveX/OLE.

What application ae you using to pass the file name(s) to DIAdem? If you use LabVIEW, we have functions build into DIAdem to pass these names directly from LabVIEW, if you use another program, we'd have to figure out how to pass that information on to DIAdem.

Just let me know how you determine the files name(s) of the data files and report template before you want to pass them to DIAdem and I'll try and figure out how to send the information to DIAdem.

Otmar
Otmar D. Foehner
0 Kudos
Message 4 of 15
(8,739 Views)
I currently use another aplication which allows the user to choose the data file they wish to view and the report format they require. This is not Labview

These two choices resolve to two filenames, one for the data file and one for the report template. My existing data reporting package is then called with the two filenames as command line arguements.

As I wish to replace my existing reporting package with Diadem I was hoping to use a similar method. I could modify the selection application to use OLE or to actually generate the script which diadem would use, however from an initial look at Diadem it does not dupport passing a datafile and a report format as command line arguments.
0 Kudos
Message 5 of 15
(8,729 Views)
Hi GRD,

You can indeed start DIAdem with parameters, which Otmar is quite right in saying are usually built into a Windows shortcut, though you can just as easily issue them from the command line. The most useful of these is the "/c" parameter to run a DIAdem command immediately after launching DIAdem. If you have all your commands built into a VBScript, you can run all of them with a single parameter by referencing the VBScript, as follows:

diadem "/cScriptStart('VBScriptPath')"

The extra "" quotation characters surrounding the /c parameter enable your path to have spaces in it (i.e. 'Program Files'). If you do not have your commands in a single VBScript, you can queue up multiple /c parameters to be run sequentially after DIAdem start up.

Note that the syntax for these command parameters follows the old "autosequence" syntax from DIAdem 7 and prior versions, for example, the "/cScriptStart('VBScriptPath') command uses '' quotation characters and has no "Call" statement.

For the specific case of wanting to load a data file and a report layout file into DIAdem 9.1 just after launching it, use the following parameters:

diadem "/cDataFileLoad('DataFilePath')" "/cPicLoad('ReportLayoutPath')" /cPicUpdate

Note that if your path starts with the standard DIAdem path that you can use the "." character to quickly communicate this fact. If, for instance, your files were in the DIAdem user directory, you would use the following parameters:

diadem "/cDataFileLoad('.\user\dat\DataFileName')" "/cPicLoad('.\user\gra\ReportLayoutName')" /cPicLoad

Hope this helps,
Brad Turpin
DIAdem Product Support Engineer
National Instruments
Message 6 of 15
(8,718 Views)
Thanks for that Brad. Unfortunately there doesn't seem to be a command called DataFileLoad. I have found DataLoad and DataFileImport and have had some success with the DataFileImport command.

As the files are ASCII then the ascii import wizard starts when the file is loaded, all I now need to do is to stop this happening and I will be close to what i need to justify replacing my existing reporting package.

I am currently playing with the FileImportFilter settings of the DataFileImport command to see if I can stop the ASCII wizard from butting in. I don't understand why the wizard is starting because the file type is associated and a .STP file exists for this type of file.
0 Kudos
Message 7 of 15
(8,701 Views)
Hi again GRD,

The DataFileLoad() command is new to DIAdem 9.1, so you must be using a previous version of DIAdem. I also did not realize you were loading an ASCII file. I'm not sure why this is the case, but I also can not get the ASCII file load operation to complete successfully from a command line parameter during the DIAdem start sequence. I tried all sorts of stuff, but to no avail. The simplest solution would be to use DIAdem 9.1 instead and create a DataPlugin for your ASCII file format. Then the command line parameter would be:

"/cDataFileLoad(AsciiFilePath, DataPluginName)"

Do you have the option of using DIAdem 9.1 at your company? You could download the evaluation version from the NI web and give this a try.

Alternatively, you could dynamically create a DIAdem DAT header file for the ASCII file you want to import. I have all the VBScripts to do this-- it's basically a poor man's DataPlugin for prior DIAdem versions, and it has some advantages over the ASCII Import Wizard and its STP file, but it's not super-simple. If DIAdem 9.1 is not an option, then we can go this routes instead.

Let me know,
Brad Turpin
DIAdem Product Support Engineer
National Instruments
0 Kudos
Message 8 of 15
(8,681 Views)

Dear omtar,

                       I have a doubt in diadem regards using pie chart. Pie chart is not available in diadem. I thinkg we can use pie chart with the help of excel from using ole control. can u tell me how i use that one..

 

Thanks and regards,

 

Midhunseelan O.S

0 Kudos
Message 9 of 15
(7,818 Views)

Hi GRD,

I'm not sure, if all of your questions were answered.
In addition to the answers you already got, I want to let you know the following.

You can pass your filenames through DIAdem when you save it in variables like
"/cT1:='DataFileName'" "/cT2:='ReportFileName'" "/cScriptStart('yourScript.vbs')" as parameter when you call DIAdem.
Now you can use these variables (T1 and T2) in your script to do what you want.

You also can chosse your Filenames in DIAdem with call FileNameGet - see in DIAdem-help how to use the parameters.

 

greets Andreas

Volkswagen AG
Wolfsburg - Germany
0 Kudos
Message 10 of 15
(7,794 Views)