09-11-2008 01:15 AM
I set the values of three controls to some default values. <data operations , make current value defualt>.
I expect to get output displays whenever I run the program and I change the value of any of the controls handled by the event structure.
However, I want to be able to get my output display using the defualt values of my controls, even if I do not chnge any of my controls. Since when I open the program, my controls are set to the default values, and when I click on run I want to see the output even if I did not change any of the controls handled by the event structure. I need to know the easiest way to handle this.
I have attached the VI, however, it uses IMAQ toolkit, but I believe it is a general question on event structure.
Thank you.
09-11-2008 01:29 AM
Hi okogidi,
the only thing you have to do, is to generate an event directly after startup. To do this, you can use different solution. You can use a "Producer/Consumer" architecture and generate an event after creating the queue. Another way is to use the value(signaling) property of one of your controls. This property will can change the value and generates and event. Insert this code into your timeout case. Make sure that you timeout case runs only one a the beginning.
Hope it helps.
Mike
09-11-2008 02:53 AM - edited 09-11-2008 02:54 AM
Here are two simple ways to do this:
(1) assign also the timeout to the controls event. Use a shift register initialized with 0 and wire it to the timeout terminal. Feed a -1 to the shift register on the right so the timeout will be infinite for all later iterations.
(2) before the loop, read on of the controls with a local vairable and feed it to a value(sgnl) proerty of the same control. This ensure that the event structure will recalcualte with the current setting. (Note that a signaling property will fire the "value change" event even if the value does not actually change).
Also: I have no idea why you read the "# of bins" from a terminal and a local variable in parallel inside the event structure. Don't be afraid to branch a wire and eliminate the local. 🙂 Of course "# of bins" should be blue (integer) and not orange. Always use the approriate representation.