02-11-2013 08:39 AM - edited 02-11-2013 08:41 AM
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
02-11-2013 09:20 AM - last edited on 08-15-2024 03:39 PM by Content Cleaner
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.
02-11-2013 11:33 AM
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?
02-11-2013 11:40 AM - edited 02-11-2013 11:41 AM
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.
02-11-2013 11:50 AM
@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.
02-11-2013 12:04 PM - edited 02-11-2013 12:10 PM
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...
02-11-2013 01:23 PM - last edited on 08-15-2024 03:39 PM by Content Cleaner
Seems to me like you should implement a true State Machine. This way you can repeat states and/or jump states as needed.