02-08-2010 12:22 PM
I will begin by saying that I have not looked at your code yet, but you may want to look at the examples for state machines and the producer/consumer architecture. Both of these architectures are used frequently in LabVIEW and are a solid foundation on which to build your applications.
Some things to consider when using event structures is that the code within your event cases should be code that executes very quickly. The event structure is used to process user interaction with your system and you don't want to delay processing of user events for a long period of time. For tasks that do require more processing time a parallel task should be part of your applictaio that will process the given task. You can use a queue or a notifier to trigger this task. Both the queue and notifier will allow you to pass data to the task.
As you begin learning LabVIEW try to avoid using global and local variables as well as property nodes (for setting or getting the value of the control). Try to use data flow and get you values from the wire or control itself. Or in the cases of parallel tasks use a queue or a notifier. The exceptions to this adivce is during program initialization. In these cases using property nodes or local vairables is generally acceptable. If you take this advice to heart you won't have to unlearn bad habits in the future.