Eugen Graf Posted May 8, 2007 Report Share Posted May 8, 2007 Have anybody been worked with "publish subscriber" methode? Any informations? Thanks, Eugen Quote Link to comment
Michael Aivaliotis Posted May 9, 2007 Report Share Posted May 9, 2007 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. Quote Link to comment
Eugen Graf Posted May 9, 2007 Author Report Share Posted May 9, 2007 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 Quote Link to comment
JDave Posted May 9, 2007 Report Share Posted May 9, 2007 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 Quote Link to comment
Justin Goeres Posted May 10, 2007 Report Share Posted May 10, 2007 QUOTE(Eugen Graf @ May 7 2007, 11:43 PM) 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? I regularly do something like this, but the term I use for them is observers. I have a hunch that Publish/Subscribe and Observer may have very distinct meanings in software design, and I'm not completely sure my term is strictly correct -- if someone has semantic arguments to make either way I'd be all ears. I frequently use a variant queue, although it depends on the context. If all my observers to a particular resource will be getting the same type of data, I would typically define the queue for that data (and typedef the data). But in a general sense, the variant queue works fine. I've hacked up a little example (in LV80) that illustrates basically what I do. This example has a simple "Publish!" button and an associated DBL value that is published to any of 3 registered observers. Each observer can be registered and unregistered with buttons on the UI. Good Luck! Justin http://forums.lavag.org/index.php?act=attach&type=post&id=5777 http://forums.lavag.org/index.php?act=attach&type=post&id=5775 http://forums.lavag.org/index.php?act=attach&type=post&id=5776 Quote Link to comment
Eugen Graf Posted August 24, 2007 Author Report Share Posted August 24, 2007 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 Quote Link to comment
ohiofudu Posted August 24, 2007 Report Share Posted August 24, 2007 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 Quote Link to comment
Eugen Graf Posted August 24, 2007 Author Report Share Posted August 24, 2007 QUOTE(ohiofudu @ Aug 23 2007, 04:31 PM) Hi EugenLike to learn This one...Can you please post your complete Vi?? Thanks 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 Quote Link to comment
Mike Ashe Posted August 25, 2007 Report Share Posted August 25, 2007 Nice example Eugen, this could be worked into something suitable for the Code Repository, as well as Wiki. :thumbup: Quote Link to comment
Eugen Graf Posted August 25, 2007 Author Report Share Posted August 25, 2007 QUOTE(Mike Ashe @ Aug 24 2007, 03:41 AM) Nice example Eugen, this could be worked into something suitable for the Code Repository, as well as Wiki. :thumbup: Thank you, but this example is not completely made yet. If you want tu unsubscribe some tasks (modules), you have to duplicate the subscribe case in dispatcher and replace the true constant to false. http://forums.lavag.org/index.php?act=attach&type=post&id=6756''>http://forums.lavag.org/index.php?act=attach&type=post&id=6756'>http://forums.lavag.org/index.php?act=attach&type=post&id=6756 And I have two problems too: 1. I want to mix the communication with Notifiers and user events (I think here on a 3d topic table or array). 2. private topics should stay in module and must be not published to other modules, so I don't want to subscribe them on dispatcher. Eugen Quote Link to comment
ohiofudu Posted August 29, 2007 Report Share Posted August 29, 2007 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. Quote Link to comment
Eugen Graf Posted October 27, 2007 Author Report Share Posted October 27, 2007 Hello, anybody, who is interested can try my new version. This uses TCP/IP protocol, so you can transfer data over network. Cheers, Eugen Quote Link to comment
Eugen Graf Posted October 27, 2007 Author Report Share Posted October 27, 2007 Here a screenshot. Quote Link to comment
Eugen Graf Posted October 30, 2007 Author Report Share Posted October 30, 2007 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 Quote Link to comment
ohiofudu Posted October 31, 2007 Report Share Posted October 31, 2007 QUOTE(Eugen Graf @ Oct 29 2007, 02:09 PM) And if a client is disconnected, but forgotten to unsubscribe, it will be removed automatically from the topic table.Eugen Hi Eugen, Great job,OK I tried to add more client to the Server.do I have to have Diffrent Source daten and Dest daten?? Kindly see Pic. Danke und Grüße aus Stuttgart http://lavag.org/old_files/monthly_10_2007/post-2816-1193751916.jpg' target="_blank"> Quote Link to comment
Eugen Graf Posted November 1, 2007 Author Report Share Posted November 1, 2007 This new version supports 4 communication kinds: Queue, Notifier, User Event and TCP/IP. Eugen Quote Link to comment
Eugen Graf Posted December 14, 2007 Author Report Share Posted December 14, 2007 QUOTE(Mike Ashe @ Aug 24 2007, 02:41 AM) Nice example Eugen, this could be worked into something suitable for the Code Repository, as well as Wiki. :thumbup: Now it is in the Code Repository. :thumbup: Quote Link to comment
Eugen Graf Posted July 12, 2008 Author Report Share Posted July 12, 2008 What do you think about this article? Please comment, I need it. http://www.labviewtutorial.eu/en/index.php...1&Itemid=93 Thank you 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.