Jump to content

Messaging to vi (clones) with events


Recommended Posts

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?

Link to comment

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

Link to comment

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

Link to comment

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

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.