DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

How to use a relative path within a Desktop.DDD file for a script-extension

I am launching DIAdem from LabVIEW with a particular desktop file that has a specific script-extension.  In development mode, everything works fine as I have absolute paths. 

 

When I build the LabVIEW application, I will be placing the desktop file and the script into a support "DIAdem" folder.  However, the path may change depending upon where the user installs the application. 

 

Is there a way to use a relative path within the desktop file? 

 

Otherwise I guess I'll have my LabVIEW application modify the desktop file upon launch.

 

Thanks,

Becky


Becky Linton
LabVIEW Champion
Certified LabVIEW Architect
Senior Systems Engineer, Konrad Technologies
GCentral
0 Kudos
Message 1 of 6
(4,782 Views)

I've tried to programmatically modify the desktop file by opening it in LabVIEW, replacing the path and resaving it.  I used the "Read from Text File" and "Write to Text File" VIs.  

 

When trying to use this modified desktop file in DIAdem, I get an "unexpected end of file" error; call with incorrect handle error and DIAdem configuration read error. 

 

I have attached the LabVIEW code I used to modify the file (version 2011).

 

Any other ideas would be greatly appreciated.

 

Thanks,

Becky


Becky Linton
LabVIEW Champion
Certified LabVIEW Architect
Senior Systems Engineer, Konrad Technologies
GCentral
0 Kudos
Message 2 of 6
(4,767 Views)

Hi Becky,

 

Let me know if you have any questions about what Beau told you on the phone this morning.  For everyone else, I suggested that instead of using a DDD file to use the ScriptDefault.VBS that ships with DIAdem and always runs on startup.

 

Brad Turpin

DIAdem Product Support Engineer

National Instruments

0 Kudos
Message 3 of 6
(4,726 Views)

Hey Becky,

 

There is a script, ScriptDefault.vbs, that is always run and is located automatically by DIAdem (C:\Program Files\National Instruments\DIAdem \Libr\Documents\ScriptDefault.VBS). This file is hidden from users.You could add a ScriptCmdAdd() function to this default script file to call a script with user commands. 

 

I hope this helps!

0 Kudos
Message 4 of 6
(4,722 Views)

Brad/Courtney/Beau -

 

I was successful in adding ScriptCmdAdd() to the UserCmdExample.VBS file (the one that is registered as an example script extension by default). 

 

I'd prefer to use the ScriptDefault.VBS file, but I get file permission errors when I try to programmatically edit the file using LabVIEW or manually in Notepad++ or the DIAdem script editor.  The programs all return that the file is read-only.  However, when I view the file properties in explorer, it is not marked read-only.  Any suggestions on changing file permissions would be appreciated.

 

Thanks,

Becky


Becky Linton
LabVIEW Champion
Certified LabVIEW Architect
Senior Systems Engineer, Konrad Technologies
GCentral
0 Kudos
Message 5 of 6
(4,719 Views)

Hi Becky,

 

Can you delete the ScriptDefault.VBS file with Windows Explorer?  If not, then you don't have administrative privileges.  If you can, then you will be able to delete or edit that file programmatically as long as the VBScript (DIAdem) is running (was launched) with administrative privileges.  That's one downside to the ScriptDefault.VBS approach, it's in the Program Files directory, which many users are locked out of.

 

Brad Turpin

DIAdem Product Support Engineer

National Instruments

0 Kudos
Message 6 of 6
(4,710 Views)