NI Home
Cart Cart | Help
Hello Events Academic NI Developer Zone Support Solutions Products & Services Contact NI MyNI
You are here: 
NI Home > NI Developer Zone > NI Discussion Forums


Reply
Member
FraCh
Posts: 6
0 Kudos
Accepted Solution

where should I save my SUD files?

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

Member
Wendler
Posts: 92
0 Kudos

Re: where should I save my SUD files?

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:smileyhappy:.

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

 

Active Participant
Walter_Rick
Posts: 972
0 Kudos

Re: where should I save my SUD files?

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

Member
FraCh
Posts: 6
0 Kudos

Re: where should I save my SUD files?

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

Trusted Enthusiast
Brad_Turpin
Posts: 2,389
0 Kudos

Re: where should I save my SUD files?

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

By using this web site, you accept the Terms of Use for this web site. Please read these Terms of Use carefully before using any part of this site. Please go here for information on ni.com's copyright infringement policy.
My Profile | Privacy | Legal | Contact NI © 2011 National Instruments Corporation. All rights reserved.    |    E-Mail this Page E-Mail this Page