02-22-2007 04:46 AM
02-22-2007 06:15 AM
Could you post an example VI of this problem?
I can't duplicate it, but I may not be understanding your VI configuration correctly.
Ed
02-22-2007 06:32 AM
I was probably not very clear.
Here a test vi that shows the problem.
Ture
LV 8.2
02-22-2007 06:37 AM
02-22-2007 06:43 AM
02-22-2007 08:06 AM
Couple of notes just for, "Good information to know".
You should always try and put the control you are reading inside the event case that it is configured for. This way, it's value is not read until you actually change the value. If the control is outside the event case, it's value will be read before the event fires and you will not get the new value. There is a "New Value" terminal inside the event case you can use if you can't put the terminal in that case.
You should never use a property node or local variable to pass a value when you can use a wire. These causes copies os the data to made in memory and in the case of the property node, a switch in execution engines. With the Event Structure, if you have to put the control outside the structure, use the "new Value" terminal as stated above. Of course in your case, that would not work because the event case you're reading the control in configure to the boolean button and it will return the boolrans value.
See attached.
Ed
02-22-2007 08:30 AM
02-22-2007 08:52 AM
After making the changes to TestEvent, I get the new value when clicking the OK button.
The difference I see is that TestEvent is firing the Event Structure from the "Mouse Down" event and Untitled_MOD is using the "Value Change" event of the button. This really should only effect the way the button reacts. With the Value Cahnge, the event isn't fired until the user release the mouse button because the value of the button doesn't change until the button is released. Since the buttons mechanical action is set to "Latched When Released", the button will stay down until it is read inside the event case. When it is read in the event case, it is reset to its False state.
With the "Mouse Down" event, the event case fires as soon as the mouse button is clicked. So the front panel control is still being help down when the event fires and can't be reset till the next loop iteration.
Ed
02-22-2007 09:02 AM
02-22-2007 10:36 AM