rscott9399 Posted April 29, 2019 Report Share Posted April 29, 2019 Hello I am running a few small tests with a type of sudo menu environment The menu on the "main VI" has several bool buttons tied to an event structure Inside of each event it simply calls the sub vi. The sub vi's are setup to open the front panel when called. However, when the front panel of the sub VI opens and i try to use the functionality of the SUB VI i can hit buttons on the front panel but the action will not complete. Obviously there is an issue with the sub vi's execution. Anyone can help me out with ideas? Thanks Quote Link to comment
Norm Kirchner Posted April 29, 2019 Report Share Posted April 29, 2019 You need to disable the 'Lock Panel (Defer Processing of UI) until event completes' option for the event case. What's happening is that the event structure is locking the UI thread until all code inside of the case completes. In your case you've got another UI coming up which you need to interact with for the case structure to complete. A bit of a catch 22. It might feel wrong that it's happening to you, but there are a variety of good cases that that feature exists and behaves as it does. More commonly, for what you're trying to accomplish, people will make action loops which might receive a message to start open another panel instead of calling immediately from within the structure. However that's a more complicated solution and if you're just trying to keep things simple, then just unclick that option and you'll be off to the races. Quote Link to comment
rscott9399 Posted April 29, 2019 Author Report Share Posted April 29, 2019 8 hours ago, Norm Kirchner said: You need to disable the 'Lock Panel (Defer Processing of UI) until event completes' option for the event case. What's happening is that the event structure is locking the UI thread until all code inside of the case completes. In your case you've got another UI coming up which you need to interact with for the case structure to complete. A bit of a catch 22. It might feel wrong that it's happening to you, but there are a variety of good cases that that feature exists and behaves as it does. More commonly, for what you're trying to accomplish, people will make action loops which might receive a message to start open another panel instead of calling immediately from within the structure. However that's a more complicated solution and if you're just trying to keep things simple, then just unclick that option and you'll be off to the races. Hi Thank you for your reply Unfortunately, disabling this feature did not solve the problem I have added to simple pictures of the "main.vi" and the VI its called. As i said this is a very simple case. The bool.VI just simply turns on an LED on its front panel. I can toggle the switch but the light will not come on when the VI opens Quote Link to comment
Gribo Posted April 29, 2019 Report Share Posted April 29, 2019 Your event structure should be in a While loop. one of the events should generate a stop signal for the loop. Quote Link to comment
rscott9399 Posted April 29, 2019 Author Report Share Posted April 29, 2019 (edited) I have fixed the event structure by adding the while loop around it The sub VI still will not run I can flip the switch but the light will not turn on Edited April 29, 2019 by rscott9399 Quote Link to comment
rscott9399 Posted April 29, 2019 Author Report Share Posted April 29, 2019 Can anyone lend a hand? I am rather confused as why something so seemingly easy has taken me 12 hours Obviously i am not doing something properly Quote Link to comment
shoneill Posted April 29, 2019 Report Share Posted April 29, 2019 Maybe post your VI? Quote Link to comment
rscott9399 Posted April 29, 2019 Author Report Share Posted April 29, 2019 Just now, shoneill said: Maybe post your VI? Hi There I posted a picture of it above Thats all there is Its just a test right now so its just main.vi and bool.vi The main is the picture above with the event structure and the bool.vi is the picture below. its just a switch tied to an LED Quote Link to comment
shoneill Posted April 29, 2019 Report Share Posted April 29, 2019 A picture is not a VI. You say you added a while loop. How? There are still a lot of variables which could go wrong. Post your code or we can't really help. Quote Link to comment
rscott9399 Posted April 29, 2019 Author Report Share Posted April 29, 2019 ok will do. I am new here so how do i post a VI? Obviously its different then a text based language? Do i just post the VI files Thanks in advance Boolean_Test.vi Main.vi Quote Link to comment
shoneill Posted April 29, 2019 Report Share Posted April 29, 2019 Works for me. What do you expect to happen? Quote Link to comment
rscott9399 Posted April 29, 2019 Author Report Share Posted April 29, 2019 I expect to be able to click on the button on the main. Open the VI and use it ( whatever it does) Then close the VI and go back to the main menu It will be a learning tool for students Each button will demonstrate a different feature of labview bools, strings, etc etc Quote Link to comment
shoneill Posted April 29, 2019 Report Share Posted April 29, 2019 (edited) Your sub-VI does not have a loop. It will run once and once only per Event. If you leave the FP of the sub-VI open, you can click on the boolean when it is not running and it will be applied whenever it is run. If you want your sub-VI to keep running, it also needs a while loop around it(either in the sub-VI itself or ourside). Just make sure you have a stop criterium for the loop. If you go into the properties of the sub-VI you can also set the FP to open when called. This still won't make it keep running, but it will at least make sure the FP is opened. Edited April 29, 2019 by shoneill Quote Link to comment
shoneill Posted April 29, 2019 Report Share Posted April 29, 2019 Also, I don't mean to be mean, but are you sure you're in the position to create code to teach people LabVIEW? This isn't advanced LabVIEW. If this is the quality of material students will be using to learn LabVIEW it might be best not doing it at all. Again, I'm not being mean, I'm being honest (and if anything I'm being diplomatic). Don't you have access to people who have (a lot) more experience in LabVIEW to help you out? Quote Link to comment
Tim_S Posted April 29, 2019 Report Share Posted April 29, 2019 rscott9399... You may want to look through an Introduction to LabVIEW on NI's website and LabVIEW Basics at LabVIEW MakerHUB website. Quote Link to comment
rscott9399 Posted April 29, 2019 Author Report Share Posted April 29, 2019 Thanks for your help I will give your suggestions a try I appreciate your concern. I am not teaching lab view It is simply a test bench to develop and test different functions. This is just the main place to select different VI's you want to test is all. Again, i appreciate your help and concerns. I fully agree, im not teaching anyone labview lol im a matlab guy truthfully 1 Quote Link to comment
infinitenothing Posted April 29, 2019 Report Share Posted April 29, 2019 I recommend you change your booleans on the main panel to Latch When Released I modified your bool test subVI so it would pop up and stay active until the user closed the panel Quote Link to comment
shoneill Posted April 30, 2019 Report Share Posted April 30, 2019 16 hours ago, rscott9399 said: It is simply a test bench to develop and test different functions. This is just the main place to select different VI's you want to test is all. Again, i appreciate your help and concerns. I fully agree, im not teaching anyone labview lol im a matlab guy truthfully No problems. I understood from the previous post you were teaching LabVIEW as opposed to using LabVIEW to teach something else. All clear now. And either way, the community is always ready to help. Quote Link to comment
rscott9399 Posted April 30, 2019 Author Report Share Posted April 30, 2019 4 hours ago, shoneill said: No problems. I understood from the previous post you were teaching LabVIEW as opposed to using LabVIEW to teach something else. All clear now. And either way, the community is always ready to help. Thank you guys very much The only one im teaching is myself haha with the help of experts like you Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.