LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Cluster of buttons not registering in an event structure

I have been studying for the CLD and have been working through the "Effective LabVIEW Programming" book.  I know there are still issues with this sample exam solution, but I cannot figure out why the event structure cannot see that I am trying to push a button in the cluster of "left buttons" or "right buttons".

 

When running the VI, push "press to insert card", then type "12345" into user input and then enter.  

 

After the user account is verified, it goes to the Main menu.  The cluster of buttons should be enabled, however I cannot activate them.  The main menu state always times out (10s) due to inactivity even though I'm trying to click on a button.

 

Looking for help, please.   I know there are other errors in the program, just looking for help on this one. 

 

Thanks.

0 Kudos
Message 1 of 8
(1,304 Views)

Well right off the top of my head your architecture is basically flawed. 

 

Instead of a simple state machine with multiple event structures (always a BAD idea)

 

Your architecture should be an Event Driven State Machine (EDSM) with ONE event structure that replaces the case structure in your simple state machine.

========================
=== Engineer Ambiguously ===
========================
0 Kudos
Message 2 of 8
(1,292 Views)

Hi Christine,

 


@ChristineM wrote:

I have been studying for the CLD and have been working through the "Effective LabVIEW Programming" book. 


Then you should immediatly start over from scratch and use only one (1) event structure in your VI!

 


@ChristineM wrote:

I cannot figure out why the event structure cannot see that I am trying to push a button in the cluster of "left buttons" or "right buttons".


Because you don't do any error handling!

For me there is an error with your UserInput checking (missing file) and so the property nodes aren't called correctly.

Did you even try to debug your VI using highlight execution or probes?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 3 of 8
(1,286 Views)

Hi Christine, I found the issue.

 

There is an option at the event structure to lock front panel interaction, and you have enabled that option in multiple event structures.

To disable it follow these steps:

 

1. Right click the event structure and edit the events handled by the case:

afort_0-1662889541293.png

 

2. Uncheck Lock panel option:

afort_1-1662889730318.png

 

3. Repeat for every event in each event structure.

 

Best of luck in your CLD,

Fort

0 Kudos
Message 4 of 8
(1,221 Views)

@afort wrote:

1. Right click the event structure and edit the events handled by the case:

2. Uncheck Lock panel option:

3. Repeat for every event in each event structure.


This is a mindless kludge that distracts from the primary very serious architectural problem. While it gets the code limping ("running" is the wrong term 😄 ), it would never pass the scrutiny of the test evaluators.

 

Very bad advice for somebody who studies for the CLD! 😞

0 Kudos
Message 5 of 8
(1,191 Views)

You are absolutely right, altenbach-- thanks for the insight. The architecture is definitely not ideal. An efficient event-driven state machine should only use one event structure that waits for user input in an "idle" case.

Nevertheless, the author already mentioned that although there are other errors/flaws in the program, they just wanted to know the exact reason the front panel controls didn't work.

 

Fort

0 Kudos
Message 6 of 8
(1,183 Views)

@afort wrote:

 

Nevertheless, the author already mentioned that although there are other errors/flaws in the program, they just wanted to know the exact reason the front panel controls didn't work.

 

Fort


Sure, but the OP also said they were studying for the CLD.

 

IMHO: Learning proper program architecture is more important than putting a band-aid on flawed code.

========================
=== Engineer Ambiguously ===
========================
Message 7 of 8
(1,111 Views)

Thank you for the constructive criticism.  Appreciate it. 

0 Kudos
Message 8 of 8
(1,105 Views)