DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

Pulling Text from One SUD and Outputting to Another SUD...Need help

Solved!
Go to solution

I have 2 separate *.SUD's I am working with in my GUI. The main SUD is:  testCntrl.SUD (frontEnd) which contains my listBox, textBox and table of contents buttons for navigation purposes. My second *.SUD is: Navigation.SUD (Navigation) and it is built into every page aside from my main Index page. The idea with the Navigation SUD is that it contains a Return button that when clicked it returns the user to the Index page and also contains a textBox. I'm trying to enable the text box on the Navigation.SUD to populate based on selections made in the testCntrl.SUD. Is this possible? I've been experimenting with the SUDDlgShow command with little success. Any suggestions or nudges in the right direction would be much appreciated.

 

If you notice on the first attached image the text box outputs several strings based on selections made by the user from the listbox upon pushing the "Load Data" button. I'd like to get information similar to this to output to the second SUD on the rest of the pages.

 

Attached are some screenshots of what I am referring to. The first image is the main testCntrl.SUD named (frontEnd) the second image is just a subsequent worksheet that contains the Navigation.SUD named (Navigation) @ the top of the page.

 

Thanks,

 

~Nathan 

Download All
0 Kudos
Message 1 of 2
(3,531 Views)
Solution
Accepted by topic author Nate102

Hey Nathan -

 

There's a few ways to do this that I can think of off the top of my head, but the easiest might be to just declare a global variable - that way it will be accessible from all areas of DIAdem, including inter-SUD communication.

 

The basic premise is:

 

  1. Check if a variable is already declared.
  2. If it isn't, declare it; if it is, don't.
  3. Write to and read from the variable.

The code to declare the variable is as follows:

 

IF NOT ItemInfoGet("MyVariableName") THEN ' check to see if it already exists
    Call GlobalDim("MyVariableName") ' if not, then declare a variable
END IF

 After that code executes (I'll let you choose where to execute it - perhaps in your testCntrl.SUD dialog's initialization?) you'll be able to read from and write to that variable just like any other variable in DIAdem:

 

MyVariableName = "This is some text" ' Write text to the variable
TestBox.Text = MyVariableName ' Read text from the variable

 

Another possible option would be that you could leverage the object-oriented nature of the VIEW panel to travel all the way down the rabbit hole to access the text in your first SUD.  For example, let's assume that your testCntrl.SUD dialog always lives on the first sheet in VIEW.  You could do something like (I haven't tested this but the theory is accurate):

 

TextBox2.Text = VIEW.Sheets(1).Areas(1).DisplayObj.Dialog.Controls("TextBox").Text

 

...where you would update the [name or index] parameter of the Sheets, Areas, and Controls collection objects appropriately.

Derrick S.
Product Manager
NI DIAdem
National Instruments
0 Kudos
Message 2 of 2
(3,516 Views)