From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

RabbitMQ/AMQP messaging: example for LabVIEW

RabbitMQ (http://www.rabbitmq.com/) is an open source message broker based on the AMQP protocol (http://www.amqp.org/). I plan to use it to connect data processing modules written in different programming languages (LabVIEW, Ruby, Python and Java) and running on different computers.

 

As I couldn't find any LabVIEW wrappers so far, I would like to share my first success with the community. Under the hood of the attached example, I use the .NET client according to the example given at https://github.com/rabbitmq/rabbitmq-tutorials/tree/master/dotnet.

 

The example simply sends a string from send.vi to receive.vi, both on localhost (it can be easily modified to send messages from one computer to another). Read the readme.txt to try it out.

 

I'll post further examples while working my way deeper into the topic.

Message 1 of 9
(10,340 Views)

Awwwww!

 

I was curious by you description  and discovered it is latter than 2009 (only version I have on this machine, bummer).

 

IT does sound interesting.

 

Don't back-save it for me since Olivia will be visitng shortly but others may want to look at an older version.

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 2 of 9
(10,330 Views)

Good hint (the above file is LV2011)! Here are the LV2009 and LV2010 versions...

 

 

Download All
Message 3 of 9
(10,328 Views)

Too cool, this stuff!!! Just managed to send a message from LabVIEW to Ruby!

 

The Ruby script can be found at: https://github.com/rabbitmq/rabbitmq-tutorials/blob/master/ruby/receive.rb

 

Procedure:

1.) Install JRuby http://jruby.org/ or Ruby http://www.ruby-lang.org/de/downloads/

2.) Install the amqp gem. For JRuby, enter jruby -S gem install amqp in the console. For Ruby, enter gem install amqp.

3.) In the console, start the ruby script: jruby -rubygems receive.rb or ruby -rubygems receive.rb, respectively.

4.) Start send.rb from the posts above and send a message.

0 Kudos
Message 4 of 9
(10,325 Views)

I'm so glad to find your example here, and used it to send a message to python/pika.

Though I don't know anything about ruby, I'm wondering when you receive the message from lv, can you do it with a event-driving style? I mean can you make it listen to the mq while still perfom other task in ruby?

I'm currently stuck inside the listening loop in python/pika, and I wish to find a way out.

 

Thanks,

 

Lei

 

0 Kudos
Message 5 of 9
(10,231 Views)

Distrio made a LabVIEW wrapper for RabbitMQ: http://sine.ni.com/nips/cds/view/p/lang/en/nid/211065

0 Kudos
Message 6 of 9
(9,264 Views)
 
 

Hello!

 

How can I use this library with CRIO? I'm getting some erros when I try to put the code on CRIO.

0 Kudos
Message 7 of 9
(7,907 Views)

Could you help me setting an address and API KEY??

0 Kudos
Message 8 of 9
(5,088 Views)

@Marcos.eletrica wrote:
 
 

Hello!

 

How can I use this library with CRIO? I'm getting some erros when I try to put the code on CRIO.


You can't use it with CRIO because it is based on .NET library provided by the RabbitMQ team. .NET library calls are still not supported on NI RT Linux platforms.

You could however try to use the C library provided by RabbitMQ team (or any other MQTT or AMQP C library), compile it for ARMv7 (32 or 64 bit for CRIO) and then use it. There is a lot of work to create wrappers for that said C library though 🙂

Researcher @ Gdańsk University of Technology
Python enthusiast
0 Kudos
Message 9 of 9
(4,944 Views)