LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Changing the GUI programmatically

I've been playing with XControls, Subpanels, and Tab controls in an attempt to display different interfaces programatically.  The end goal is a program to configure various nodes on a CAN bus.  But depending on which nodes were found, different configuration interfaces are required.

The obvious and easiest method would be to display the configuration VI's as a modal dialog.  The problem I have with this approach is that there are several levels of configuration.  For example, one of the nodes can have up to 4 sensors, and each sensor can be one of several sensor types.  So using dialogs, the node configuration dialog would have 4 buttons to bring up the configuration for each of its sensors.

What I want is for the user to select a node from a list, and have the subpanel show the correct VI.  I tried this, but couldn't figure out how to pass data back and forth to the subpanel's VI.  Another idea I have is to use a tab control with a different XControl on each page, and display whichever page corresponds to the selected node.

Is there a good solution for this?  Am I on the right track, at least?  I seem to be having issues with the VI's running concurrently or something, but I am unable to explain the exact problem.  If something goes wrong, I end up having to close down LabVIEW just to stop the VI from running.

I've been dealing with this for a few days now and I'm getting a bit frustrated, so any ideas would be appreciated.

Thanks,
John
0 Kudos
Message 1 of 2
(2,786 Views)

"jbutera" <x@no.email> wrote in message news:1162939207386-437942@exchange.ni.com...
I've been playing with XControls, Subpanels, and Tab controls in an attempt to display different interfaces programatically.&nbsp; The end goal is a program to configure various nodes on a CAN bus.&nbsp; But depending on which nodes were found, different configuration interfaces are required.The obvious and easiest method would be to display the configuration VI's as a modal dialog.&nbsp; The problem I have with this approach is that there are several levels of configuration.&nbsp; For example, one of the nodes can have up to 4 sensors, and each sensor can be one of several sensor types.&nbsp; So using dialogs, the node configuration dialog would have 4 buttons to bring up the configuration for each of its sensors.What I want is for the user to select a node from a list, and have the subpanel show the correct VI.&nbsp; I tried this, but couldn't figure out how to pass data back and forth to the subpanel's VI.&nbsp; Another idea I have is to use a tab control with a different XControl on each page, and display whichever page corresponds to the selected node.Is there a good solution for this?&nbsp; Am I on the right track, at least?&nbsp; I seem to be having issues with the VI's running concurrently or something, but I am unable to explain the exact problem.&nbsp; If something goes wrong, I end up having to close down LabVIEW just to stop the VI from running.I've been dealing with this for a few days now and I'm getting a bit frustrated, so any ideas would be appreciated.Thanks,John



John,


When I have to communicate between a subpanel vi and the main, I start the subpanel VI (dynamically), and pass a user event reference to it (set the value before starting the VI). This way, the subpanel VI can send user events to the main (and visa versa).


Since you seem to have a hierarchial structure, you might consider a treeview control. When the user select another item, open the matching VI in a subpanel. Can be very nice.


When you know you will only have 4 different types, you can do thinks a lot easier. Put 4 controls on the front panel, and simply show the correct control, and hide all others. This is a less "growable" solutions (with subpanels, you can even add new types without compiling/changing the main) but is a lot easier to implement.


Regards,


Wiebe.





0 Kudos
Message 2 of 2
(2,765 Views)