Jump to content

publish subscriber


Recommended Posts

Are you referring to a specific vi server method or the general concept of publish/subscribe?

I would think that if you create a queue and then dequeue this constitutes a publish subscribe one to one. If you need multiple subscribers then you would have to somehow create an array of queues. When someone subscribes, you add a new queue to the array. The publisher in this case would have to put the message onto all the queues.

Link to comment

QUOTE(Michael_Aivaliotis @ May 8 2007, 04:16 AM)

Are you referring to a specific vi server method or the general concept of publish/subscribe?

I would think that if you create a queue and then dequeue this constitutes a publish subscribe one to one. If you need multiple subscribers then you would have to somehow create an array of queues. When someone subscribes, you add a new queue to the array. The publisher in this case would have to put the message onto all the queues.

Thanks Michael, I need generally informations to publish subscriber in relation to Labview, how to and examples. Are there any? Or should I make me one myself?

Queues in array should be variant? I think, yes. A little example code, which only explains how to implement a easy one?

Eugen

Link to comment

QUOTE(Eugen Graf @ May 8 2007, 12:43 AM)

Thanks Michael, I need generally informations to publish subscriber in relation to Labview, how to and examples. Are there any? Or should I make me one myself?

Queues in array should be variant? I think, yes. A little example code, which only explains how to implement a easy one?

Eugen

I don't know of any examples for publish-subscribe except for DataSocket -- search for 'subscribe' in the Example finder and only one comes up. There are several ways of accomplishing this, and Michael suggested a good one. Variants would make it flexible. Some different ways of doing publish-subscribe are

  • DataSocket, programmatic -- this is lossy, but gives you programmatic control over who is publishing and subscribing and when
  • DataSocket, front panel -- also lossy, can bind a control to a datasocket or shared variable without any code
  • Queues -- not lossy, must create separate queue for each subscriber
  • Functional Global -- probably lossy, no intrinsic way of notifying subscribers that new data is available
  • User Events -- not lossy, can notify many subscribers with one event, must individually 'register' for event in each subscriber. I like this one because once you set up the registration, you just fire one event to publish.

That surely isn't all of the available methods, but you can look for examples in any of those areas. For User Events I would look at the examples "Dynamically Monitor Vi's.vi", "Dynamically Register for Events.vi", and "Programmatically Fire Events.vi"

David

Link to comment
  • 3 months later...

I thank you all. I use Pub/Sub model in one project now. It's really cool. I can see all queues traffic, all themes and tasks:

http://forums.lavag.org/index.php?act=attach&type=post&id=6729

My StartUp VI looks like in following example:

http://forums.lavag.org/index.php?act=attach&type=post&id=6730

My Dispatcher Task is here:

http://forums.lavag.org/index.php?act=attach&type=post&id=6731

And on this example you can see, how my modules (tasks) say to dispather about themes (topics) while starting:

http://forums.lavag.org/index.php?act=attach&type=post&id=6732

And this is my Create&Subscribe VI used in each task:

http://forums.lavag.org/index.php?act=attach&type=post&id=6733

A big thank to all, Eugen

Link to comment

QUOTE(Eugen Graf @ Aug 23 2007, 09:18 AM)

I thank you all. I use Pub/Sub model in one project now. It's really cool. I can see all queues traffic, all themes and tasks:

A big thank to all, Eugen

Hi Eugen

Like to learn This one...Can you please post your complete Vi??

Thanks

Link to comment

QUOTE(Eugen Graf @ Aug 23 2007, 09:38 AM)

Here are 4 VIs and 1 Typedef I used. I can't post my whole project, because of rights. But you can see on screenshots, how I use them.

Eugen

Danke Eugen,

The Vis are helpfull,I will have to take sometime out to analyze them to figure out how you use them.

Danke nochmal.

Link to comment
  • 1 month later...

A new version of my Pub/Sub is available. Now you can connect one Dispatcher to an other and select/subscribe availabe topics of them. Furthermore is the TCP/IP transfer protocol some better, syncbytes and checksum are implemented now. And if a client is disconnected, but forgotten to unsubscribe, it will be removed automatically from the topic table.

Eugen

Link to comment
  • 1 month later...
  • 6 months later...

Join the conversation

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

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
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.