DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

where should I save my SUD files?

Solved!
Go to solution

Hi All,

 

I am trying to call a dialog box from a script with this code:

 

Dim MyDlg Set MyDlg = SudDlgCreate("Input", "DlgProgress") 

 

DIAdem displays the error >>Cannot find "dlgProgress.SUD" file<<

How can I "tell" DIAdem where to look for the file? (inserting the full path instead of "DlgProgress" didn't work)

 

Regards,

    FraCh

0 Kudos
Message 1 of 5
(4,544 Views)

Hi FraCh,

 

you only need to mention the whole path like:

Dim MyDlg
Set MyDlg = SudDlgCreate("Input", "C:\DlgProgress") . But you'll have no permission to write this directory (C:).

If you don't mention any directory or  path DIAdem will use the path which is storage at Userpaths of the settings window. (%CSIDL_COMMON_DOCUMENTS%\National Instruments\DIAdem 2011\Data\)

 

In larger applications it's not recommended to use the whole path. You usually use path variables.

 

Have you already used the record mode(dt: Aufzeichnungsmodus)? When you start this mode you have to choose one of this three possibilities to go on(->Attachment)

Try them to see the differences.

Regards,

 

Philipp K.

 

AE | NI Germany

 

0 Kudos
Message 2 of 5
(4,538 Views)
Solution
Accepted by topic author FraCh

Hi FraCh,

 

You are going to create a non-modal SUD dialog. You can always specify the the dialog path with the SUD file name. Therefore you can use the following options:

 

Using the current path for scripts - typically where you started the main script (except you changed this path in the script)

Set MyDlg = SudDlgCreate("Input", CurrentScriptPath & "DlgProgress")

Using an explicit path

Set MyDlg = SudDlgCreate("Input", "MyDrive:\MyFolder\DlgProgress")

 

Using a variable for the path

dim sMyPathVar 
sMyPathVar = "MyDrive:\MyFolder\"
Set MyDlg = SudDlgCreate("Input", sMyPathVar & "DlgProgress")

 

Using no explicit path is pointing to the path which is set in the variable ScriptReadPath

Set MyDlg = SudDlgCreate("Input", "DlgProgress")

 

Please have a look at the example "VIEW_Statistic_Init.VBS" in which the command SUDDlgCreate is used.

 

Greetings

Walter

0 Kudos
Message 3 of 5
(4,535 Views)

Thanks you two.

This is a bit embarrassing: I used the method correctly but I didn't use the file name but the object name of the DlgBox to call it.

 

Regards,

    FraCh

0 Kudos
Message 4 of 5
(4,526 Views)

Hi FraCh,

 

I strongly recommend you use the old variable "AutoActPath" or the new variable "CurrentScriptPath" to programmatically build the relative file path of all needed resource files like the SUDialog file.  This way you can deploy your script application's start folder anywhere on the hard drive and all path parameters will stay correct.

 

Brad Turpin

DIAdem Product Support Engineer

National Instruments

0 Kudos
Message 5 of 5
(4,513 Views)