From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Pressing on the Table Control locks the front panel in a certain state

Solved!
Go to solution

Hello everyone!

 

I have following problem. I have a very simple state machine with two cases. In the Idle case there is an event structure receiving input from a Table Control. When pressing Run the Vi enters the Run state. To exit the RUn state I have a Finish button, but IF I during the running state press anything on the Table Control the entire front panel will lock. Disabling the Table Control in the running state doesn´t help in the same way it helped for Button 1 and 2. Any help would be appreciated. I have tried unsuccesfully with the Registering and Unregistering event functions.

 

Attached is a simplified version of the problem. Thanks in advance.

0 Kudos
Message 1 of 8
(2,775 Views)
Solution
Accepted by topic author RealBjörkis

LabVIEW is doing what it has to do. In the Mouse down event of the Table control you can see an option "Lock Front panel" which did this magic. Unmark that option and check it. Also for the Boolean button they are value change event thats why you didn't face the problem with that.

-----

The best solution is the one you find it by yourself
Message 2 of 8
(2,762 Views)

O my god, it was so simple. I have never paid any attention to that field in the Edit Events window. Thank you very much! Now I can enjoy some football/soccer in peace 🙂

0 Kudos
Message 3 of 8
(2,753 Views)

Hi, RealBjörkis !

 

I ran your VI and I saw a few problems, try to keep your controls outside the events structure, also do what said P@Anand previously.

Here is your VI with some corrections. (Hope it fix the problem)

Good Luck.

0 Kudos
Message 4 of 8
(2,750 Views)
Its not a problem if you keep the controls inside the event but when you keep it outside, the control will execute before the event executes (Assuming the control is inside the same while loop). So what will happen is when you try to read the control value directly you may endup reading the previous value before the event was executed.
-----

The best solution is the one you find it by yourself
0 Kudos
Message 5 of 8
(2,740 Views)

Hi 13Cmmkl,

 

Thanks for the tip but for the reaons P@Anand mentioned I have been putting for a very long time the controls inside the their corresponding event state.

 

Nevertheless now I have seen another problem. Since the GUI remembers the clicks/actions that were done in the table or menu (Menu not seen in the reduced example) this actions will be performed when the run state has finished. This creates very odd behaviour and doesn´t looks so pretty. Does it exist any ways to ignore the clicks/actions being done during the run state as soon as the run state has finished?

0 Kudos
Message 6 of 8
(2,694 Views)

You can find a way out of it but I would recommend you to go for a proper design pattern. Check the producer/Consumer design pattern and re-structure your code so that you can develop your application in future without problem.

-----

The best solution is the one you find it by yourself
0 Kudos
Message 7 of 8
(2,689 Views)

Thanks P@Anand I was alrady planning for that due to other reasons. If that solution also solve this problem then it is a bonus.

0 Kudos
Message 8 of 8
(2,675 Views)