β10-09-2011 02:36 PM
Hello,
My problem is that if i open my vi in a subpanel, the mechanical action of the buttons are changing π for eg it is set to 'switch until released' but if the vi run in a subpanel it works as a regular switch π The program itself is a GUI vi which opens different VIs in a subpanel according to the selected menupoint.
Pls help π
β10-09-2011 03:44 PM - edited β10-09-2011 03:47 PM
All the buttons in the program you have attached are set to plain "switch when pressed".
Where are the subVIs?
Your convoluted DBL math to select the cases as well as the use of "string to path" might indicate that you are relatively new to LabVIEW. Why is the "Status" string a control instead of an indicator? Please attach the full project.
β10-09-2011 04:30 PM
Yeah you're right, i'm quite new to Labview π The buttons that i was talking about are in the subvi, i'll attach it if you want. By the way do you know a better solution to decide which button is pressed in the menu? I've tried event structure with 'value changed' parameter but when i did i didn't get respond from the subvi ( for eg i connected a button to a led but the led didn't lit when i pressed the button ) Thx for the help π
β10-10-2011 12:51 PM
I've made a small example program. The same problem occurs with this one as well. The button is set to 'switch until released' but it is acting like it is set 'switch when pressed'. By the way while the program is running the mouse pointer keeps switching between the 'hand' and the 'arrow' icon at an incredible speed π I think the problem is that the main VI is running parallel with a subVI but i really don't know how to fix it π
β10-10-2011 01:14 PM - edited β10-10-2011 01:23 PM
You don't have any while loops and the program completes within milliseconds. How are you running this? Are you using "run continuously"?
("run continuously" is a debugging tool and has no valid purpose in a built application. Basically, your VI completes and restarts immediately when done as fast as the computer allows. Basically, your VI is switching between edit and run mode in rapid succession)
(btw: switch until released is not a very usual mechanical action, because it is easy for the code to miss an action if it is too short. please explain how the users is supposed to interact with the small example program)
β10-10-2011 01:36 PM - edited β10-10-2011 01:40 PM
well as you can see in my original example, the program increments/decrements the value of the numeric indicator while the button is pressed but if it is released the incrementation/decrementation shall stop. It is working like a charm when i run the subVI alone, but if it is running in the subpanel of the main VI, everything is messed up π In the small example program it is the same, the LED should be lit while the button is pressed, and if the user let go of the button it shall switch off but it doesn't π oh and yeah i use run cont. mode
β10-10-2011 01:42 PM
β10-10-2011 01:54 PM
You need to rearchitect your project from scratch, because you have some serious misconceptions about dataflow and program design.
The current code makes absolutely no sense and it just appears to work by accident. Basically the subVI is continuoulsy re-lauched at a rapid rate.
You need a toplevel VI containing a while loop that senses the buttons on the main VI. Whenever they buttons changes, you need to close the currently loaded subVI and insert a new subVI into the sub panel. The subVI should keep running (with a while loop in it!) until a different subVI is desired. All interactive while loops also need a small wait (e.g. 50ms).
β10-10-2011 02:16 PM
oh i see now what the problem was π thank you very much for the help, managed to solve it ^^