DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

How to give command's out from a SUD Dialog

Hi,
 
I like to give out an information per the OK or Cancel Button but I don't find how to make it.
I will start the Dialog in a Loop and if the user Cancel's the Dialog, the Loop has to start from the beginning.
 
 
Thomas
 
 
PS: Why do you give per Dialog the user not just all options like in normal VB? Nothing is the same here........Smiley Sad
0 Kudos
Message 1 of 10
(4,199 Views)
Hello Thomas!

One solution is:
Do
Call
SudDlgShow(
"Dlg1","C:\test.sud")
 
Select Case DlgState
Case
"IDOk" : MsgBox "OK"
Case "IDCancel" : MsgBox "Cancel"
End Select
Loop While
DlgState<>
"IDOk"
You also can use the click event for the buttons to show up the dialogs.

Matthias

P.S.: DIAdem is not normal! ;-)))
Matthias Alleweldt
Project Engineer / Projektingenieur
Twigeater?  
0 Kudos
Message 2 of 10
(4,190 Views)

Hello Matthias,

thanks for your answer.

Who does make up that stuff and it is not even written down in the help?!

Thomas

0 Kudos
Message 3 of 10
(4,173 Views)

Actually, it is in the help:

Brad Turpin
DIAdem Product Support Engineer
National Instruments

 

0 Kudos
Message 4 of 10
(4,157 Views)

OK,

So the pretty pictures only show up on my computer.  If you look in the help for "SudDlgShow()", you will find a description of the "Return Parameter" called "DlgState".  If you click on that link, it lists the allowed values of "DlgState", which Matthias used in his answer.

Brad Turpin
DIAdem Product Support Engineer
National Instruments

0 Kudos
Message 5 of 10
(4,150 Views)
Hello,
 
now is the shame on me........... 😉
For me is still a bit the question, why NI did it that strange and did not just use the normal VB stuff..... anyway, otherwise it would maybe getting booooring. 🙂
 
Next problem:
-I use the dialog to display me some variables. Now when I do change them i the dialog, it will also change the type of the variable.
I solved the problem by useg the "val" function but it is quit stupid to produce a lot of code just for this. Is there an other option to change it back, so that DIAdem can use the variable?`
 
Thomas
0 Kudos
Message 6 of 10
(4,143 Views)
Good morning,
 
and again soemthing. Is there a way do work with the channals from the dialog?
I like to give that command by pushing a button.
 
 For i=trigval_3 To trigval_4
       ChD(i, "Data/ImportKanal_1")=0.1
 Next
 
Thomas

Message Edité par tom_the_dude le 05-23-2006 03:12 AM

Message Edité par tom_the_dude le 05-23-2006 03:12 AM

0 Kudos
Message 7 of 10
(4,130 Views)
Good morning Thomas!

As I know there are no restrictions to use any DIAdem command in a SUD dialog. Only the refresh of some parts of DIAdem will be different from interactive using the program e.g. the Portal will be updated after you close the dialog and finish the calling script.

Your code works in my test dialog! Can you please describe what is your result/problem.

Matthias
Matthias Alleweldt
Project Engineer / Projektingenieur
Twigeater?  
0 Kudos
Message 8 of 10
(4,124 Views)

Hello Matthias,

oh yes, it's true. I can do stuff from my dialog but just this command does not work. So I have to have something wrong in the whole process.
Have to check it.

Thank you!

Thomas

0 Kudos
Message 9 of 10
(4,115 Views)

Hi Tom,

In answer to your question about why NI implemented the SUDialog interface the way they did-- in a word... licensing.  NI does not own the rights to Visual Basic, which does indeed have a lovely form editor.  We could have used VB or VBA as the automation language and custom GUI engine for DIAdem, but then we would have had to pay a licensing fee for each copy of DIAdem, and then your version of DIAdem would have been noticeably more expensive.

Brad Turpin
DIAdem Product Support Engineer
National Instruments

 

0 Kudos
Message 10 of 10
(4,109 Views)