LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

stuck with making my event structure examine if two arrays are equal

Hi there, I'm new to labview. I'm trying to write an event structure; examining if one array equals another array. The program will carry on if they are equal, otherwise it will continue checking... Any help is appreciated.

 

My program is attached.. It is eventually going to be a memory game when I get it working..

 

Sequence 1, case structure 10 is were I'm stuck with the case structure.

 

Thank you in advance

0 Kudos
Message 1 of 7
(2,722 Views)

Your array comparison is just fine.

 

Where you have problems is your use of the event structure.  In case structure 10, you have an event structure with only one event, the timeout case, but you don't have any timeout value wired.  So your VI is going to be stuck there forever waiting for a timeout that will never occur.

 

In another case, you have an event structure with a button value change event.  But you also have that event to lock the front panel until the event completes.  If you hit that button, after that case executes, you will lock up your whole VI front panel since that event structure will never execute again to handle the event.

 

Multiple event structures are a bad idea unless you know what you are doing.  I suggest you read Caveats and Recommendations when Using Events in LabVIEW.

Message 2 of 7
(2,710 Views)

thanks for your help. So I understand I have the event set as a time out case with no timeout value wired...

 

would you say it is defiantly an event structure I need to use or is there a better way?

0 Kudos
Message 3 of 7
(2,684 Views)

An event structure has nothing to do with the comparison of arrays.

 

Event structures are intended to handle certain things such as user events such as do an action when the user presses a front panel button, or changes the value in a numeric control.

 

What you are asking is whether an apple peeler is the best way to juice an orange.

0 Kudos
Message 4 of 7
(2,678 Views)

@Alex5132 wrote:

thanks for your help. So I understand I have the event set as a time out case with no timeout value wired...

 

would you say it is defiantly an event structure I need to use or is there a better way?


Could you please explain what you are trying to accomplish? It is difficult to understand your end goal from your code.

Charles Chickering
Architecture is art with rules.

...and the rules are more like guidelines
0 Kudos
Message 5 of 7
(2,672 Views)

Ok lol,

 

Here's what I want to accomplish; the goal of my case structure 10 is to compare the values of 2 arrays. These arrays are both boolean button arrays in the front panel...

 

when these arrays are equal (the case is accomplished) (i.e. the buttons that are pressed or not pressed are the same), I would like the 'event structure' to allow the program to continue to the next case structure for the next part of my game...

 

 

 

 

0 Kudos
Message 6 of 7
(2,665 Views)

Seems to me like you should implement a true State Machine.  This way you can repeat states and/or jump states as needed.

State Machine


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
Message 7 of 7
(2,639 Views)