02-23-2006 10:07 AM
02-23-2006 10:13 AM
02-23-2006 10:48 AM
Evan,
I did use the Value (Signalling) property, but it doesn't seem to help as the while loop is not incrementing for some reason. Without using the event structure the VI works perfectly fine. I just started reading up on event-driven programming, so I am using my previous code to come with some simple examples to see how exactly it works. Can you throw some pointers as to what the reasons could be for the above problem. Thanks!
02-23-2006 11:20 AM
02-23-2006 12:00 PM
Anthony,
Tried out ur suggestions...the loops are incrementing but for some reason the events are not fired in the event structure. What might be the problem according to you?
02-23-2006 12:31 PM
02-23-2006 12:38 PM
Anthony,
I actually got it to work. Have another question...in the event structure, I would like to use a boolean indicator (round LED on the front panel) which flashes (True) each time a value changes and needs to be reset to false between changes. How does one write a True value to a boolean indicator in the event structure to accomplish this task?
02-24-2006 02:33 AM
I would simply wire 'true' to the boolean, wait a few hundred milliseconds, and wire 'false' to it. Either using locals, or property nodes for writing to the boolean.
If you don't wait too long, then there's no harm putting that completely within one event.
If you want the LED to stay on for seconds, then it might be wise to have the blinking handled asynchronously in a seperate loop, otherwise your front panel is not responding during the time that the LED is on. Such a seperate loop can be very simple. For example a loop waiting on a queue element, or waiting on a notifier.
02-24-2006 08:36 AM
02-24-2006 11:47 AM
Hadn't had the time yet to look at your code. But some thoughts before the weekend:
I wouldn't use a Labview event structure for triggering the DAQ card. Keep the event structure for handling GUI events. Do the data handling in a seperate loop, that you control with a queue. It's similar to an event structure, except that you define the events yourselve as queue elements.
Take a look at the Producer/Consumer design patterns. The producer is the GUI, and is using the event structure. The consumer is the loop reading the queue. Put your DAQ code in the consumer loop. Firing an event to trigger the DAQ card is then simply a matter of putting an element on the queue.
The queue can contain anything. Could be text, in which case you could send commands and data (flattenend to a string) over the queue. Queue could also be a enumerate, if you only send commands, and want a case structure in the loop. Or you could even use an cluster as the queue element, which command and data parts...