DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

Load a file into DIAdem with a dataplugin using LabVIEW

Solved!
Go to solution

Is it possible to load a file into DIAdem with a custom dataplugin using LabVIEW.  I looked through the pallet and did not see anything.

0 Kudos
Message 1 of 11
(5,517 Views)

Hi Siriusly,

 

Yes, but there's no dedicated VI for that case, you need to use the "Execute Command Synchronous" VI, with the following input string:

 

DataFileLoad('Path_To_Data_File', 'Name_of_DataPlugin')

 

It should be easy enough to build this string programmatically with the string concatenation VI.

 

Brad Turpin

DIAdem Product Support Engineer
National Instruments

0 Kudos
Message 2 of 11
(5,516 Views)

Brad,

 

Thanks for the quick response.  I have tried this solution without success.

 

I could not fine the ""Execute Command Synchronous" VI you referenced, so I assume you wanted me to use the "DIAdem Run Automation Command" VI (included in the Diadem the add-on)

 

There may be an issue with the command as I could not get it to work within DIAdem as a script.

I have attached the VI, .STP and a TXT file I am  working with.

 

Any and all help on this is appreciated.

 

Thanks

 

0 Kudos
Message 3 of 11
(5,511 Views)

Hi Siriusly,

 

Yeah, sorry, "DIAdem Run Automation Command" was the VI which I meant and whose name I was too lazy to look up.  When you were testing the code I posted, did you pay close attention to the single quotes ' in command?  The ActiveX interface in DIAdem still requires the old "Autosequence" syntax which uses single quotes instead of double quotes.  So the same exact command that works through ActiveX will not work in a VBScript and vice versa.  Of course, if you can't get a command to run in a DIAdem VBScript, there's no point trying to get it to run through ActiveX, but surely you can get the DataFileLoad() command to load your data file with the DataPlugin, right?  There is NO issue with that command, so if it's not working for you, either the syntax of the command is wrong, the DataPlugin is not properly registered, you're using the wrong programming name for the DataPlugin, or the file path parameter you're providing does not exist on disk or isn't readable with that DataPlugin.

 

Brad Turpin

DIAdem Product Support Engineer
National Instruments

0 Kudos
Message 4 of 11
(5,487 Views)

Brad,

 

I was laoding a text file into the Data Portal using a configuration file. 

 

What I thought was a dataplugin (*.URI) was actually a configuration file (*.STP) created with the ASCII import wizard.  I need to learn how to load the text file remotely using this configuration file (*.STP).  I have never created or registered a dataplugin before does this process include my configuration (.STP) file?  Can I create a dataplugin from a .stp file?

 

This is my first attempt using something other then TDM or TDMS format. 

0 Kudos
Message 5 of 11
(5,485 Views)

Hi Siriusly,

 

I recommend you use a DataPlugin instead of the *.STP file, but here is how you can programmatically load an ASCII file using a predefined *.STP file, in VBScript syntax:

 

Call AsciiAssocSet(AsciiFilePath, StpFilePath) ' assign STP file
Call AsciiLoad(AsciiFilePath, ShowWizardInt)   ' load the ASCII file
Call AsciiAssocDel(AsciiFilePath)              ' decouple *.STP from this file

 

I would be happy to work with you to create a DataPlugin that you can use instead of an *.STP file, or you can just use the DataPlugin Wizard which you can launch from the NAVIGATOR File menu.

 

Brad Turpin

Product Support Engineer
National Instruments

0 Kudos
Message 6 of 11
(5,478 Views)

 

Thanks Brad,

 

I was able to load the file with the .STP remotely so this will work for me.  I would also like to learn to load using a dataplugin.  I tried creating one through the wizzard without success.  Could you make me a dataplugin using the attached .TXT file?  I only need  the data with channel names. (Ignore from "[Start Details]" to "[End Details]"). 

 

0 Kudos
Message 7 of 11
(5,472 Views)

Hi Siriusly,

 

Here's a first version of a DataPlugin for that ASCII file.  It parses the ":" delimited (File/Group) properties and the "," delimited (Channel) properties but ignores the "//" delimited (File/Group) properties.  Mostly that's because those "//" delimite properties need custom names-- the ones in the file are way too long to build programmatically, we'd need to use a lookup table abd key off the [index] in that line.

 

Detach the ZIP file to any location on your hard drive, unzip it to expose the *.URI it contains, then double-click on tehe *.URI file in Windows Explorer to register the DataPlugin.  After that you should be able to drag&drop those data files from the NAVIGATOR (or Windows Explorer) into the Data Portal.

 

Brad Turpin

DIAdem Product Support Engineer
National Instruments

Message 8 of 11
(5,460 Views)

 

That works great.  I only have one issue left.  The last data set in each channel is incorrect.  I noticed there are 2 blank lines at the end of the text file that must be affecting the last data point.  These blank lines appear to be on all the files.  Can the data plugin be modified to ignore these blank lines or do i need to delete them?

0 Kudos
Message 9 of 11
(5,432 Views)
Solution
Accepted by Siriusly

Hi Siriusly,

 

I added 2 additional lines of formatter configuration to the DataPlugin, and now that last row of empty values has disappeared for the one file you sent me.

 

Brad Turpin

DIAdem Product Support Engineer
National Instruments

Message 10 of 11
(5,409 Views)