10-29-2009 04:26 PM
I have a script writtem in Diadem that uses config files to load the data and then add it to a report. It then exports the report in a pdf format. I would like to run this script with labview so I can automate this when new log files are created.I have used the report template VI but I have csv files not signal files plus I want to be able to export the reports automatically
10-30-2009 09:53 AM
Hi chandler,
So you want to be able to call a VI that sends DIAdem a file path to the CSV data file and a file path to the VBScript or TDR report layout file to use? I'm attaching an example that tricks the "DIAdem Report.vi" into using a data file path instead of the input data wires it's expecting.
Let me know if this example doesn't make sense or doesn't enable you to do what you want.
Brad Turpin
DIAdem Product Support Engineer
National Instruments
10-30-2009 11:53 AM - edited 10-30-2009 11:53 AM
I am not quite sure how this works. I get the script part and the output file but I am not sure about the tdms parts. What do they accomplish?
10-30-2009 01:01 PM
10-30-2009 01:08 PM
another question can the diadem VI do multiple page reports?
I have used this in tha past and there was only one page and it contained a graph. I now have a 10 page report and it seems that I can only setup the VI for the first page
10-31-2009 06:50 PM
Hi chandler,
Don't give up on me just because you've tried the DIAdem Report.vi before and it didn't do what you needed. Like I said, this example tricks the DIAdem Report.vi into doing things it wasn't designed to, like passing a CSV file path and calling a VBScript that can create a multipage report.
The "DIAdem Report Script.TDMS" file is not a data file but rather a parameter transfer file from LabVIEW to DIAdem. The DIAdem Report.vi does NOT have a data file path input, so this is how I'm tricking it into using one-- the VI writes all the info LabVIEW knows and the reporting DIAdem needs to know into this "DIAdem Report Script.TDMS" parameter transfer file. Then when the "DIAdem Report Script.VBS" file is called, the first thing it does is loads the "DIAdem Report Script.TDMS" file and reads off those transfer parameters. In this case what is being passed is just the file path of the data file-- in your case a CSV file.
The DIAdem Report.vi DOES have an input for a REPORT file path, and if you wire up a file path to a VBScript file to that VI input, it will launch DIAdem and run the VBScript you wired up. If that "DIAdem Report Script.VBS" then loads the "DIAdem Report Script.TDMS" file to read off the transfer parameters, then clears the Data Portal and loads the desired CSV data file (that was passed in the transfer parameter TDMS file), THEN calls your reporting VBScript with ScriptStart(), you should have what you want.
This is a non-obvious architecture, but it is robust,
Brad Turpin
DIAdem Product Support Engineer
National Instruments
11-03-2009 12:09 PM
11-04-2009 10:14 AM
Hi chandler,
Either the DIAdem Report Script.VBS or your own reporting script have to load the csv file. I was suggesting that you let the DIAdem Report Script.VBS do that, and I was assuming that your reporting script would start with the data already loaded.
Alternatively, you could copy the code from the DIAdem Report Script.VBS into your reporting script that loads the data file path from the Root property (as loaded by the TDMS transfer file).
Feel free to post your reporting script and data file and/or ask if you need help with this,
Brad Turpin
DIAdem Product Support Engineer
National Instruments
11-12-2009 02:16 AM
I have the same problem. I have programmed in DIAdem with VBScript. I wanted to automate to take out the data and make a report and then, the report save as PDF but I didn't know how to automate this.
So, I would like to run this scpript with labVIEW and the report will save as PDF, is possible??
Thank you!
11-12-2009 11:28 AM
Hi Txumy,
I reworked the example posted above to make it easier to run, understand, and incorporate into your existing VI. You just want to add the "DIAdem Report Script.vi" to your existing VI and make sure the "DIAdem Report Script.VBS" file is in the same folder as the "DIAdem Report Script.vi" file. Your data file (simulated by "My DIAdem Data File.csv"), your reporting VBScript (simulated by "My DIAdem Report Script.VBS") and the resulting PDF file (simulated by "My DIAdem Report.PDF") can all be in arbitrary (and different) file directories. I recommend that any layouts or resource files (simulated by "My DIAdem Report Layout.TDR") your reporting VBScript needs be in the same folder as the VBScript and be accessed by the VBScript with the DIAdem "AutoActPath" variable.
Ask if you have questions,
Brad Turpin
DIAdem Product Support Engineer
National Instruments