LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

mechanical action change in subpanel

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 😞

0 Kudos
Message 1 of 9
(3,267 Views)

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.

0 Kudos
Message 2 of 9
(3,260 Views)

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 🙂

0 Kudos
Message 3 of 9
(3,249 Views)

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 😕

0 Kudos
Message 4 of 9
(3,218 Views)

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)

0 Kudos
Message 5 of 9
(3,213 Views)

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

0 Kudos
Message 6 of 9
(3,202 Views)

@Ombre3333 wrote:

oh and yeah i use run cont. mode


Don't!

0 Kudos
Message 7 of 9
(3,197 Views)

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).

0 Kudos
Message 8 of 9
(3,191 Views)

oh i see now what the problem was 😄 thank you very much for the help, managed to solve it ^^

0 Kudos
Message 9 of 9
(3,186 Views)