LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Question on Event Structure

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.

0 Kudos
Message 1 of 3
(2,714 Views)

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

Message 2 of 3
(2,710 Views)

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.

 

Message Edited by altenbach on 09-11-2008 12:54 AM
Message 3 of 3
(2,692 Views)