DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

Updating a DIAdem plugin fails

Solved!
Go to solution

I am having trouble making updates to a DIAdem plugin. I started out with a plugin provided by NI based on our .xlxs file format. This worked, but I wanted to make some additions. I took the existing code from the .vbs file and copied it to a new file.

 

Long story short, after running into a lot of trouble I reverted back to this file, the exact copy of the script provided by NI, saved with a new name and packaged in a new .uri.  If I remove the NI version and keep my version (of the exact same code), moving my Excel file into the data portal results in the excel file wizard coming up. If I remove my version and keep the NI version, the plugin works when I move the Excel file into the data portal.

 

What is the exact proper set of instructions to follow to successfully replace an existing vbs plugin?

0 Kudos
Message 1 of 10
(5,879 Views)
Solution
Accepted by gizmogal

Hi gizmogal,

 

What was the name of your XLSX DataPlugin?  There's a decent chance I was the one who helped with that.  The simplest avenue to edit a DataPlugin is to keep the original *.URI file for backup purposes but open up the source VBScript into the SCRIPT panel using the DataPlugin dialog.  Then any change you make to the DataPlugin VBScript in the SCRIPT panel, just click <Ctrl-S> on your keyboard to save your change to disk.  Now you can test your change with drag&drop or better yet with a test VBScript.  Once you like your new version, export a new *.uri file for backup purposes.

 

Brad Turpin

DIAdem Product Support Engineer

National Instruments

Message 2 of 10
(5,861 Views)

Hi Brad,

I do believe it was your script - Philips_XLSX.vbs

I will try following your steps exactly and report back.

Thanks,

Marisette (Gizmogal)

 

0 Kudos
Message 3 of 10
(5,856 Views)

Quick question - I ran the wizard and created a new test plugin from it. To disable it so I could try your suggestion, I tried going to Navigator Settings, My DataFinder-> Configure, and unchecked that plugin. It is still running if I drag an xlsx file over to the data portal. Is that normal?

0 Kudos
Message 4 of 10
(5,854 Views)

Hi Brad,

Thanks a bunch! That worked.

M (G)

0 Kudos
Message 5 of 10
(5,844 Views)

Hi Marisette,

 

Yup, I did that one.  If you've unchecked a DataPlugin from the DataFinder configuration, then it will not be used if you drag a data file from a yellow NAVIGATOR folder that is a Search Area into the Data Portal.  If, on the other hand, you drag a data file from a grey NAVIGATOR folder that is not a Search Area, then the DataFinder is not involved and its settings are ignored, and the DataPlugin may very well be used, unless another one succeeds first.

 

I prefer to test DataPlugins with a loading VBScript, like this, where you can specify exactly the DataPlugin you are testing:

 

Call Data.Root.Clear
DataFilePath = "D:\FolderNames\DataFileName.Ext"
Call DataFileLoad(DataFilePath, "DataPluginName")

 

Brad Turpin

DIAdem Product Support Engineer

National Instruments

Message 6 of 10
(5,829 Views)

Hi Brad,

 

Thanks. I'll try that. I don't know if it will solve my current problem, which is that ChnGenTime is not creating the channel  I'm trying to create. I recorded a script to ensure I set up the call properly, then modified it with my own channel name, but stil, no new channel.

 

BTW, I thought I did set up the datafinder with my files in the search area (below the DIAdem with the little sun, under Search Areas, under My DataFinder), and it it still reverting to the unchecked plugin when I mess up my script and it can't complete.

 

I'm still curious why my own script wouldn't work when exported to a new plugin. From your description I see no reason why. Unless the exporter somehow maintains some identifier that got it confused when I originally did a Save As... ?

 

Marisette

0 Kudos
Message 7 of 10
(5,822 Views)

Hi again Brad,

 

I tried an experiment using your suggested script-running approach. First I ran Philips_XLSX, which ran as well as it did yesterday (still no time channel, but that's a different issue).

 

Then I changed the second argument from "Philips_XLSX" to "Philips_TTE_XLSX", the name of the plugin that I created. I got this error:

Cannot load the file "D:\...xlsx" with the loader "Phlips_TTE_XLSX".

Further information:

"Either the ReadStore function was not found or the function does not accept 1 arguments."

 

Now, here's the odd part. I went to the Plugin dialog, right-clicked on the Philips_TTE_XLSX plugin script, and opened it in the editor. Then I deleted the entire contents of the script, and pasted in the entire contents of Philips_XLSX's script, and saved.  I still see the same error. Switching back to Philips_XLSX returns functionality. The error can be repeated with a recently created TestXLSXPlugin as well.

 

At one point I was trying to keep my plugin files in an easy to locate folder on my D drive. I finally gave up and let it live shared USI folder that it always wants to go to. Is it possible that this alternate location is the cause?

 

I would really like to have the confidence that it is possible to create my own plugin.

 

Thanks,

Marisette

0 Kudos
Message 8 of 10
(5,803 Views)

Brad,

 

Your script testing hint is very useful!

 

Now I see what is happening with ChnGenTime: "Error in line 21: Variable is undefined: 'ChnGenTime'"!

 

Wha...?? Code copied from the script recorder?

 

Marisette

0 Kudos
Message 9 of 10
(5,802 Views)

Just in case anyone reading this thread is interested in the questions I raised, here are the answers:

 

Make sure the plugin configurations match! My copied plugin defaulted to a different configuration from the original. As soon as I made them match, especially the little checkbox at the bottom, the errors disappeared and my changes took hold.

 

And, any call that displays red in the DIAdem script editor is not available for use in the plugin script. This includes ChnGenTime.

 

Thanks, Brad, for all the helpful hints.

 

Marisette

0 Kudos
Message 10 of 10
(5,771 Views)