LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Event Structure question

I have a series of vi calls within an event structure. I also have a slider bar "threshold1" that is tied to the event structure. Everytime the value of threshold1 changes, it will run through the series of vi calls.
 
My question is: When the program initializes and I want that series of vi calls to run before I change a value in threshold1, what shall I do to do that besides copying and pasting all of the vi calls from within the event structure to before the event structure?
 
I attached a simplified version. In this one, everytime the slider value changes, it will display the new value (think of the display as being a series of vi calls). However, if I want to display the value at startup, what will I need to do in order to accomplish that?
 
0 Kudos
Message 1 of 18
(3,857 Views)

Use the value(sgnl) property of the slider control to trigger the value change event.

Mike...


Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
Message 2 of 18
(3,847 Views)
Where is that located?
0 Kudos
Message 3 of 18
(3,840 Views)
Value(Signaling) is a property of the control.  So right click on the control and select Create>>Property Node.  Then in the property node you can select Value(Signaling), which will set the control to the wired in value, and will also fire the Value Changed event.
0 Kudos
Message 4 of 18
(3,827 Views)

OK, I did that, but it appears to freeze now.

Attached is the simplified version.

0 Kudos
Message 5 of 18
(3,825 Views)
No. If you just want to do some initialization, put the property OUTSIDE the while loop. Wire the error out of the property to the left side of the while loop to ensure that the val(sig) property is called before the while loop starts.
Message 6 of 18
(3,818 Views)
I updated the slider_sample.vi so that it includes three inputs now - a slider, a numeric control, and enum control. I wired it so that each time one of the controls updates the value, it will display the updated value on the indicators.
 
However, when I went to run the program, if I move the slider around, it will show me the updated value. When I go and change the numeric control value, it will show me the change of the numeric control, but it will move the slider back to the value beforehand.
 
Attached is the vi.
0 Kudos
Message 7 of 18
(3,779 Views)
I think you will need to use a shift register in order to maintain the values of the slider and the numeric.  If you change the slider, the original value of the numeric (and any other control) is remembered at the edge of the while loop.  Vice versa for changing the numeric and the slider being reset to zero.  See attachment.

Message Edited by tuned99 on 08-01-2005 12:56 PM

0 Kudos
Message 8 of 18
(3,773 Views)
Thanks, that solved everything!
0 Kudos
Message 9 of 18
(3,763 Views)
I don't understand what you're doing. There is no reason to have any wires from the initial state to any of the indicators going through each event. Just do like the mod in the attachment.
0 Kudos
Message 10 of 18
(3,763 Views)