Michael Aivaliotis Posted January 13, 2004 Report Share Posted January 13, 2004 :question: i am trying to find a way to send an event to another VIespecially a timeout event if possible, but an unused (in that case) event like "keydown" would be fine but am embarassed with this hassling registering procedure and can't make it work does someone could enlight me or send me a small example for it ? Here is an image of an example that will pass an event to another VI when a timeout has occured. remember to right-click on the event structure and select Show Dynamic Event Terminals Can anyone suggest a better approach to passing a timeout event to another VI? Please post any suggestions. Quote Link to comment
BienEntendu Posted January 13, 2004 Report Share Posted January 13, 2004 thanks for your answer but that's not exactly what i was searching for your method allow to send a special event to another VI (vi-2) but obliges you to share a reference to that event via a global variable and to create this reference before VI-2 runs that's why i would like to send a known event which wouldnt need to create a special event and for exemple be able to simulate a timeout event in VI-2, ordered by VI-1 but i could replace the timeout event with a keydow event or whatever is not used in VI-2 and wouldn't interact with his functionalities. the idea is to make know to VI-2 when n Vi's like VI-1 are closed by the user but without needing to check constantly if n windows are opened and use the power of the event functionality which is more responsive and less time consuming Quote Link to comment
Michael Aivaliotis Posted January 13, 2004 Author Report Share Posted January 13, 2004 the idea is to make know to VI-2 when n Vi's like VI-1 are closed by the userbut without needing to check constantly if n windows are opened and use the power of the event functionality which is more responsive and less time consuming I assume you have seen the NI example called: Dynamically Monitor VI's.vi. This will do what you ask. It is a combination of firing events and monitoring panel states. The entire process is very fast and efficient. You can also investigate ActiveX events that implement VI callbacks. Look at this post for more details.: http://forums.lavausergroup.org/index.php?showtopic=61 Quote Link to comment
BienEntendu Posted January 14, 2004 Report Share Posted January 14, 2004 I assume you have seen the NI example called: Dynamically Monitor VI's.vi... yes i did it before posting. the thing is that the VI constantly check if all vi's in memory are running and i was trying to avoid this with just sending an event (they should look at NI the way hypercard worked ...) and for active x : no way, i am developping on a mac and just want to use cross platform tools ! Quote Link to comment
Michael Aivaliotis Posted January 14, 2004 Author Report Share Posted January 14, 2004 yes i did it before posting.the thing is that the VI constantly check if all vi's in memory are running and i was trying to avoid this with just sending an event Yes, well you don't really have to do it the way they show. I mean you can also just respond to that event. You will have to get the references to those vi's that want to send an event then you can respond to a panel close or anything else. The way the existing event system works in LabVIEW requires that there be an event case for the specific event you are responding to. You cannot dynamically register NEW events only re-assign existing registrations to other VI's or controls. Hopefully this may be added in future releases. Quote Link to comment
BienEntendu Posted January 18, 2004 Report Share Posted January 18, 2004 you can also just respond to that event. You will have to get the references to those vi's that want to send an event then you can respond to a panel close or anything else. the thing is that i don't want to respond to any event i just want to send one just like we do with "value (signaling)" event in fact i am trying to send this event but tear my hairs off to figure out if it possible. i can't find a way to create a reference to a button which belongs to a different vi Quote Link to comment
Michael Aivaliotis Posted January 18, 2004 Author Report Share Posted January 18, 2004 i just want to send onejust like we do with "value (signaling)" event in fact i am trying to send this event but tear my hairs off to figure out if it possible. i can't find a way to create a reference to a button which belongs to a different vi Here is one way to do it... Quote Link to comment
BienEntendu Posted January 26, 2004 Report Share Posted January 26, 2004 Here is one way to do it... great great GREAT ! that's exactly it ! it does it perfectly i just guess if it is really necessary to close the references really a lot of thanks it is a really elegant way to update an interface without consuming processing time with a permanent checking of globals and by the way i think i understand better now how these references work thanks a lot again pascal Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.