ni.com is currently experiencing unexpected issues.

Some services may be unavailable at this time.

取消
显示结果 
搜索替代 
您的意思是: 

Load a file into DIAdem with a dataplugin using LabVIEW

已解决!
转到解答

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 项奖励
1 条消息(共 11 条)
5,600 次查看

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 项奖励
2 条消息(共 11 条)
5,599 次查看

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 项奖励
3 条消息(共 11 条)
5,594 次查看

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 项奖励
4 条消息(共 11 条)
5,570 次查看

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 项奖励
5 条消息(共 11 条)
5,568 次查看

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 项奖励
6 条消息(共 11 条)
5,561 次查看

 

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 项奖励
7 条消息(共 11 条)
5,555 次查看

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

8 条消息(共 11 条)
5,543 次查看

 

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 项奖励
9 条消息(共 11 条)
5,515 次查看
解答
已被主题作者 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

10 条消息(共 11 条)
5,492 次查看