12-03-2013 03:53 AM
Hello,
I wrote a State Machine VI in Labview. Everything works fine, but there is one last problem, the graphical user interface. I only want to display the buttons for the possible exits transfers out of the current state and the controlling elements linked with them. I have about twenty states and a lot of them have several controlling elements, so all of them shouldn't be displayed at the same time.
Should I work with registers and can I control the window that should be displayed or is there a more elegant solution?
Regards
Simon
12-03-2013 06:49 AM
I typically just disable and gray out the controls that are not applicable during a specific state.
12-03-2013 10:31 AM
12-03-2013 12:05 PM
If I have just a few controls and indicators to hide or disable I usually just use individual property nodes. If there are large numbers of GUI objects involved I generally put them on a tab control and then switch pages with its property node (you can make the tabs hidden). This works especially well when there are distinctive groupings based on functionality. I often color the tabs and use the same colors on main controls that aren't in the tab control but share functionality. It all depends on the complexity and whether there are controls to logically group together. AND you're willingness to spend time on cool GUI styling.
12-03-2013 06:10 PM
Depending on how fancy you want to get you can use picture controls and use one common set of buttons. Change the picture, visibility of the controls as needed. The state will know what each button means within its own context. A bit more work up front but very flexible in the long run.
12-03-2013 08:47 PM
Hi karl_ender,
I prefer to create a cluster of reference of controls and indicators present on the GUI and in each state I will unbundled cluster and using property node and invoke node I will play with the controls for disabling, enabling the control and will bundle and same reference in the cluster.
You can use a shift register to move the reference in all the states.
this might helps you in solving the problem.
Thanks
Pankaj
12-11-2013 09:06 AM
Thank you for your answers everybody!
the idea with the tab control sounds very good. I played a little bit with a tab control and if I change it to an indicator and create an enum with values that have exactly the names of the pages of the tabcontrol, the tabcontrol can be controlled by the enum. I chose this way, because it seemed easier to me than property nodes, since the enum and the tab control are of the same type in the block diagram (and if I'm honest I'm not very familliar with property nodes...). Now I have one more question left. I control my state machine with an enum and the case structur can automatically create a value for each enum value (I can just right click on the case structure and chose this). Can the tab control do this, too? Or do I have to type in every single case in my tab control?
12-11-2013 09:51 AM
12-12-2013 03:35 AM
Hi Udka,
thanks a lot for your answer. I tried out what you said on a little example program and your suggestion works fine, I can control the tab that should be displayed wirth an enum. The problem that is left though are the values of the the single tabs of the tab control and their names. Is there a way, how I can manipulate the tab control, so the tabs have the same values with names as my enum? I have about twenty states in my state machine and while developing I change them a lot, if I want to control the property node of my tab control with the enum they always have to be exactly the same and I don't want to alter everything each time I change the enum of my state diagram
12-12-2013 04:07 AM