LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Disable event structure until in need

Hi All,

 

              Attached is the result page code. It suppose to act like a game where the picture appear at a random grid and show up. The user had to click on the correct 2D picture to level up after matching the same pattern

 

            The problem I face now is that when the state machine is not in the Result page and the user had click on the 2D picture already, it will memorise the click and when it come to the Result state, the result will be generated and go to the next level if correct or stop at the start if wrong

 

            Any solution for this? 

Download All
0 Kudos
Message 11 of 27
(1,477 Views)

From what I was seeing, I'm thinking the state machine might not be the architecture you want.  I'm thinking you could use a while loop with an event structure.  The event structure would then take care of all of your logic.  Keep some shift registeres to keep track of states.  This way, you can use the "Lock front panel until this event case completes".


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 12 of 27
(1,466 Views)

Hi Crossrulz,

  

                  I dont understand your point 🙂

 

                  Can you elaborate. My state machine is not the full code as I am still figuring out the event structure. At the game state, I will process a random code generation to sequence through the state diagram. Now my problem is when the state is finished, it will alway got to the result state for the appropriate click. However, before going to the result state, when the mouse button is click, it will register the click already. So I would like to disable the event until the result state is called.

 

0 Kudos
Message 13 of 27
(1,449 Views)

@Paradigm1999 wrote:

 The problem I face now is that when the state machine is not in the Result page and the user had click on the 2D picture already, it will memorise the click and when it come to the Result state, the result will be generated and go to the next level if correct or stop at the start if wrong


You would use one single event structure in the "Start" case, add "result" as a second condition to that same case. It will contain all possible events you need. (OK to start, mouse down, etc).

In the "mouse down" event cases use a case structure wired to the state that has an nearly empty default case, but does the appropriate state switching in the "result" case.

 

0 Kudos
Message 14 of 27
(1,442 Views)

@altenbach wrote:
You would use one single event structure in the "Start" case, add "result" as a second condition to that same case. It will contain all possible events you need. (OK to start, mouse down, etc).

In the "mouse down" event cases use a case structure wired to the state that has an nearly empty default case, but does the appropriate state switching in the "result" case.



Here's a broken draft that shows some of these points. Most of the other code is missing, but it should give you some ideas.

0 Kudos
Message 15 of 27
(1,438 Views)

Hi

 

 

0 Kudos
Message 16 of 27
(1,418 Views)

Paradigm1999 wrote:


  1. Right-click the terminal...create reference.
  2. Simply look at my code. I create an array of references. The event terminal outputs the reference of the control that has been clicked. If you search the array of references for it, the resulting index will give you the control that fired the event. That's all you need. (make sure you arrange the array in the correct order to simplify the assignments).

 

0 Kudos
Message 17 of 27
(1,414 Views)

You did already tried with cursor vi, with get busy.vi can disable click while completing the process.

0 Kudos
Message 18 of 27
(1,408 Views)

Hi Mahu,

 

                 what you mean by cursor.vi and busy.vi? Where can I get these VI?

0 Kudos
Message 19 of 27
(1,386 Views)

Hi Mahu,

 

             I saw the set busy.vi but it cause the cursor to be in busy icon. Ppl may misunderstood it as the VI is not ready and is still loading. Is there a way to disable the cursor without marking it looks busy?

0 Kudos
Message 20 of 27
(1,380 Views)