03-05-2007 02:25 PM - edited 03-05-2007 02:25 PM
Message Edited by vanguns on 03-05-2007 02:26 PM
03-05-2007 02:27 PM - edited 03-05-2007 02:27 PM
The attachments are not there.
Never mind, they are there after you edited the post.
Message Edited by Dennis Knutson on 03-05-2007 01:28 PM
03-05-2007 02:53 PM
Dataflow is the basic underlying design of LabVIEW and you violate it in just about every way. Unless you are running in continuous mode (which is not the correct way to do it), none of the code that is outside the while loop is going to run more than once. For example, the status of the local variables in your emergency shutoff will be read and the case statement will executed once. It won't be run again until you restart the VI. The local variables are set inside the while loop though. The ending routine will also start up at the very beginning and not run again. As another example, once the main while loop starts, the Booleans wired to the serial case statements are no longer polled so your serial com won't work at all. As a minimum, you would have to put all of that code inside their own while loops so that they are running concurrently with the main loop.
You've got way too many local variables. Locals can be used effectively but they can also cause a race condition. Even if you create additional while loops, I suspect that you will have problems there as well.
I'm afraid that you are going to have to do a serious rewrite. If you stick with 6.0, you might want to look at something called a state machine. A state machine is simply a while loop with a case statement inside. I believe that 6.0 comes with some simple examples of this. You might also want to look at a couple different loops running in parallel and passing data between them with a queue.
03-05-2007 02:58 PM