From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

DIAdem Idea Exchange

cancel
Showing results for 
Search instead for 
Did you mean: 
0 Kudos
P.A.

It would be useful to have a way for dataplugins to obtain their file path programatically

Status: Completed

This request is implemented in DIAdem 2017

We added 'CurrentScriptPath' and 'CurrentScriptName' as global variables containing path and script name.

I created a service request asking for a way to do this after reading the documentation and the person that answered the request confirmed that there's currently no way to do this. He also recomended that I posted the information here, in order to include this feature in future versions of DIAdem / DataPlugins.

 

The file path I want my dataplugins to obtain is the path of the dataplugin’s own script file, including the filename. For example: if my dataplugin is named “ABCD.vbs”, then I would like that dataplugin to find out its own absolute path, which may be something like “C:\Dataplugins\ABCD.vbs”. Having a way to do that would save us the trouble of hardcoding it and keeping track of the path if it changes for every single dataplugin.

For scripts that run on the Windows Script Host we can use Wscript.ScriptFullName to obtain it and for scripts that are run in DIAdem’s scripting context we can concatenate the DIAdem variables CurrentScriptPath and  CurrentScriptName. What I want is to have that same functionality but for dataplugins.

1 Comment
Walter_Rick
NI Employee (retired)
Status changed to: Completed

This request is implemented in DIAdem 2017

We added 'CurrentScriptPath' and 'CurrentScriptName' as global variables containing path and script name.