05-16-2013 10:15 AM
Hello
I've recently created a Data Plugin script to parse a data file with a proprietary format. The script works fine for indexing and loading our data files. I'm currently working on another VBS script which is called by one of the function keys (i.e. F2) to reopen one of these data files. I've read the on-line DIAdem help and found that I could use the OpenFile function of (global) DataPlugin object. However I don't know how to reference to this global DataPlugin object. By the way, I'm currently using the free evaluation copy of DIAdem. Please help.
Best Regards,
Tien.
Solved! Go to Solution.
05-16-2013 10:28 AM
Hi,
it is not possible to use DataPlugin VBS commands within DIAdem.
If you want to open a file in DIAdem with your developed DataPlugin, please use the following command:
call DataFileLoad("fullpath of your file", "your DataPlugin name")
05-16-2013 10:37 AM
Hello
Thank you so much for your quick response. I'd like to be able to open one of our data files and get a file object as a returned parameter - Just like the OpenFile function of the DataPlugin does. I looked through all 'File' functions on the on-line help and found no one except OpenFile could return such.
Best Regards,
Tien.
05-17-2013 04:56 AM
Hi,
DIAdem is not designed for work on data files. Instead the data you want to work with has to be available in the Data Portal. To be able to load your data files to the Data Portal National Instruments provides a lot of ready to use DataPlugins (see http://www.ni.com/dataplugins), or you can write a DataPlugin on your own.
After the data is available in the Data Portal, you can access it with the Data Object from the modul Script.
Hope that helps.
05-17-2013 08:16 AM
Hello
I guess I have misstated when I said 'data files'. Basically I'd like to be able to explicitly call the ASCII/ Binary File Reader that the DataPlugins use to read in (ASCII and binary) test data files. This reader is selected when configuring for a DataPlugin. Again it appears that this ASCII/ Binary File Reader function returns a file object that the ReadStore funciton uses. Is this reader function available for me to use in my own scripts to open ASCII/ Binary test data files? If not, what can I use to accomplish the same thing?
Again, I greatly appreciate your help on this.
Best Regards,
Tien.
05-17-2013 09:57 AM
Hi,
the reader function of the DataPlugin is not available in DIAdem. The reason is, that DataPlugins are executed by a shared component to be available in other products of National Instruments, e.g. LabVIEW Storage VIs, as well. This is a little bit confusing, because you write the VBS DataPlugin code in DIAdem. Please note that the DIAdem script syntax has to be changed in order to recognize DataPlugin commands (File -> Change Syntax -> VBS DataPlugin).
I try to understand what you want to do with the file reader object in DIAdem, what can not be done within the DataPlugin context. Can you please give me an idea?
05-17-2013 10:46 AM
Hello
The DataPlugin script that I've already written is to parse out header information only, e.g. channel names, channel groups, test file info, ... . The DataPlugin is not to read (or load) raw data. This is to allow raw data to remain in the original source. As channels or files selected in the DIAdem Browser or Search Area to be loaded to the Data Portal, I'd like to go back to the original test data file to read and load raw data to the Data Portal. This is why I need to be able to (re) open the test data file to read the raw data.
Best Regards,
Tien.
05-17-2013 11:05 AM
Hi Tien,
The "DataFinder parameter" is intended to cover just this scenario. If you go to your existing DataPlugin's profile in the "DataPlugin Settings" dialog in DIAdem, then select the "Properties" button and click on the little circle icon to open up the Advanced properties in the dialog, you'll see a "DataFinder parameter" checkbox at the bottom of the dialog. When you check this checkbox, the "ReadStore(File)" main subroutine in your DataPlugin gains a second (boolean) parameter. You can rename this second parameter to any variable name you wish. I usually use ReadStore(File, Indexing). Then in your DataPlugin code you can branch IF (Indexing) THEN to only read the header and IF NOT (Indexing) THEN to read the bulk values of the channels.
Brad Turpin
DIAdem Product Support Engineer
National Instruments
05-17-2013 12:44 PM
Brad
Please see my email that I will send you shortly.
Thanks.