08-14-2014 11:40 AM - edited 08-14-2014 11:41 AM
Hello,
My dataplugin is for various '.csv' files, and works perfectly when reading and loading the files. But, what would really be nice is if I could then somehow bring the data in those files into their appropriate report templates and then export that report as a '.pdf'.
So, I tried adding:
Call DataFileLoad([Filepath],[Script]
Call DataFileSave([Filepath], ".TDM","TDM")
Call Report.LoadLayout([Report Path])
Call Report.Sheets.ExportToPDF([Path to save .pdf] ,False)
Call Report.Refresh
Call Data.Root.Clear()
When I test the dataplugin by manually indexing a file, I receive the error: Variable is undefined: 'DataFileLoad'"
So, if it is reading it as a variable does that suggest that it does not recognize functions unless they are stated in the sub?
Is it possible to do what I would like it to do?
Thanks.
Solved! Go to Solution.
08-17-2014 09:17 PM
Hi Kevin,
Your VBScript DataPlugin can not call "red" DIAdem commands. The VBScript host that the DataPlugin uses contains only the basic VBScript functions plus a few specific DataPlugin commands but none of the rest of the DIAdem commands.
You'll need to use a DIAdem VBScript to load the data file, load the layout, and save the PDF file.
Brad Turpin
DIAdem Product Support Engineer
National Instruments
08-18-2014 07:52 AM
Do you know of any way to automate the calculations and reports? I have the script written, just need to make it so that no operator is required to just hit a button to make it run.
I have searched the forums and I only see reference to running a script on startup, which doesn't help.
Thank you for your help.
08-19-2014 10:53 AM
Hi Kevin,
DIAdem does not provide scheduling services, so some entity needs to tell DIAdem to start. You can either manually set up a DIAdem to poll for files to pricess in an endless loop, or you can use the Windows Task Scheduler to launch a DIAdem instance periodically that automatically looks for files to process for a certain duration (after which it shuts itself down to avoid any potential long term memory leaks).
R&D is interested in improving our offering for this use case, but as of DIAdem 2014 we do not have anything new available.
Brad Turpin
DIAdem Product Support Engineer
National Instruments
03-27-2018 02:07 PM
Hi Brad,
could you please provide an example how to save the data if
Call DataFileSave([Filepath], ".CSV","CSV")
doesn't work?
Thank you very much!
03-28-2018 01:06 PM
Hi Dsfgg,
You're going to have a lot more success getting responses by creating a new forum post, since this forum closed in 2014.
Whenever you do make a forum post, can you clarify what you mean by "doesn't work"? Are you seeing an error when running this code?