12-01-2014 10:06 AM
12-01-2014 10:36 AM
12-01-2014 11:12 AM - edited 12-01-2014 11:27 AM
Alright, so I'm looking at what I believe is your latest code and I'm going to have to tell you, this isn't going to work. From what I'm seeing (don't take offense to this) there's a misunderstanding of how a State Machine works. You also have a Front Panel with controls that I assume are going to trigger events. I see the Event Structure, but by the way you have it placed within a Case Statement which is also paralleled with what I am assuming is your timing code. It just appears that the general grasp of a while loop is misunderstood here as well. The State Machine document I asked you for was a basic programming exercise. The idea was for you to sort of visualize the code in a linear format. You want to be asking questions all the time when you program, especially in LabVIEW. If this, then what? Also, remember that LabVIEW is DataFlow. Unlike Text based code where you tell the computer a list of steps, LabVIEW will "randomly" pick which things to do first based on what tasks have the necessary data. For example, your "Initialize Game" case. You have an Event Structure and two while loops. You and I have no idea which of those three structures will happen first which could lead to a race condition. The two while loops will run in parallel, but the event structure is pretty much useless like that. You can force the While Loops to act in a sequential order by passing data from one to the other. I have attached a very basic user event state machine. You're going to want to be aware, in this example, when the user event triggers a new state, your state machine gets thrown off track. You need to figure out how to maintain the state you were wanting to go to (if that's even necessary) and handle the user event.
12-01-2014 12:31 PM
Hi,
Thanks for the heads up. Can you help me work through this problem step by step?
12-01-2014 01:05 PM - edited 12-01-2014 01:11 PM
Hey i some new code since the last maybe this might work?
12-01-2014 01:40 PM
I do not see any code. And it needs to be in 2011. Also, the files I looked at were not in a Project Explorer. They were just VIs and folders zipped up.
12-01-2014 01:41 PM
Also, I do not have LINX library. So I will not be able to view those VIs.
12-01-2014 01:52 PM
sorry how can i send you the code at your email
12-01-2014 01:54 PM
can we chat in gmail possibly it might be easier
12-01-2014 02:13 PM
check your private messages