TG Posted October 13, 2007 Report Share Posted October 13, 2007 Hi guys, Concerning an excellent events messaging example from Mike awhile ago. Here is a modified version renamed Download File:post-2402-1192158504.llb I fiddled with Mikes original example to launch vi:(clones) from the main VI. This works fine. Anytime a clone is launched from Main the clone can communicate back to change the station ID or the command in Main. No sweat there. Now if Main wants to kill all the clones after creating them it appears as if it is able to do so. (Pressing Kill Clones button) However, If Main creates a second set of clones the Kill event is lost on them (even though they can still fire events back as before.) Another clue is that if two clones are created and Dynamic_VI.vi:1 (clone) is closed by the user (while Main is running) but vi:2 (clone) is kept open the kill event from Main is also lost as in Main cannot close vi:2 (clone) I gotta admit some of this event stuff really breaks my head. How could this example be modified so that Main can kill any clones it creates at any time? Is it (hopefully) a simple matter? Quote Link to comment
TG Posted October 15, 2007 Author Report Share Posted October 15, 2007 QUOTE(TG @ Oct 12 2007, 03:19 AM) Hi guys,Concerning an excellent events messaging example from Mike awhile ago. blah blah... I cant believe I was able to fix this ! It seems to be stable too, hallaluahh! Share in my happiness and if you are really good explain me what I did to fix since I have no clear idea PS: Sorry its in 8.2.1 I do not know if it would work with 8.0 since it uses clones. It definately does not in 7.1 Quote Link to comment
TG Posted October 20, 2007 Author Report Share Posted October 20, 2007 QUOTE(TG @ Oct 14 2007, 08:38 PM) I was very happy when I >> thought << it had been resolved. Download File:post-2402-1192819271.zip 8.2.1 In fact, the above example may or may not work on your machine (as I found at work when I tried to use it again.) So instead, I used a singleton queue to make the strictly typed event reference available to the clone and this appears to be foolproof for now. Download File:post-2402-1192819397.zip So I guess that fixes the problem. But I need to know for next time if missing anything. Why does a named event not function like a named queue? It appears that the event wire or a reference to it must be transferred to the clone in order that it can register for the event reliably. Again this is my best guess I am reaching here... and yet... Example 1 worked reliably (still does here at home) Q I keep pondering why did it work so reliably at my home rig only to not work at all on my work PC. Anyone want to comment? Thanks Bumping.. Thx Quote Link to comment
djolivet Posted October 26, 2007 Report Share Posted October 26, 2007 Hi TG, I think the root of your problem is that you are using one user event/event registration for all your clones. You should have one for each clone. Find attached a modified version of your code that should work properly. Note that the global variables should be replace with some other mechanism. Good luck Denis 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.