04-04-2012 01:32 PM
NO I know how to define inputs in the event structures, but when I connected my subVI to my main VI, nothing happened in my data mainstream like in the subVI. I think it's because of some event structure properties. I read the "recommendations" for using an event structure but I couldn't the reason related to my case.
04-04-2012 03:19 PM
So just to get something cleared.
What do you think the nature of the Event Structure is?
How does it work ?
After that, try to explain what your subvi is doing.
04-04-2012 03:23 PM
Event structure is the structure used for creating a program which waits till the defined event happens, then the program inside the loop will run.
My subVI is waiting for the change of unit (value change), then the corresponding values will change.
04-04-2012 04:30 PM
@Bombbooo wrote:
Event structure is the structure used for creating a program which waits till the defined event happens,
then the program inside the loop will run.
My subVI is waiting for the change of unit (value change), then the corresponding values will change.
then the code inside the event structure which corresponds to the event trigger will execute once for each time there is a trigger.
Depending on where you placed your sub-vi, it may not even be called.
Can you post both the main VI and the sub-vi?
04-04-2012 04:51 PM
here it is!!
04-04-2012 05:04 PM
So how do you think a value change event should happen when you call your vi as a subvi ?
Will the user be able to change a value on the front panel ?
04-04-2012 05:11 PM
yes the user can change the unit and value.
When I turned on the highlight excecution button, the data flow got stuck at this subVI. Then I thought this sub vi was waiting till the unit has changed, it will continue. But it didn't work like that
04-04-2012 05:18 PM
And what made you think that ?
When does the subvi finish ?
When does the while loop in the subvi finish ?
How does a subvi send output to the calling vi ?
04-04-2012 05:23 PM
How do you think you are generating a "Values change" event ?
Why have you add a Dynamic Event registration for 3 controls you already have events for ?
04-04-2012 05:24 PM
I think like that because of the function of event structure as I have understood. It waits till the value changes, then the operation will begin.
It finishes when the stop button is pressed.
I think the stop button in the subvi need to be pressed before it sends the data to other blocks.
(PS: you are very patient to help me all the way here. Thank you for that. You can be my labview tutor.)