LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

MSMQ with Labview

I want to use the Microsoft Message Queue to communicate between applications on different machines. Does anybody have experience in using the MSMQ with Labview (in the .NET framework)? How do I send messages? The MessageQueue.Send method requires an object, and I don't know how to create this object format.
0 Kudos
Message 1 of 10
(7,190 Views)
Hi,

you can find the MSQM Local API (incl. documentation) there: http://support.microsoft.com/default.aspx?kbid=242471

And the main side is this one:
http://www.microsoft.com/windows2000/technologies/communications/msmq/default.asp

regards,
Thomas Sandrisser
NI Germany
0 Kudos
Message 2 of 10
(7,179 Views)
and here is the link for the library

http://sine.ni.com/apps/we/niepd_web_display.display_epd4?p_guid=B45EACE3E7AC56A4E034080020E74861&p_node=DZ52071

regards
Thomas Sandrisser
NI Germany
0 Kudos
Message 3 of 10
(7,199 Views)
I know this may come a little late, but since I'm just doing some MSMQ (Microsoft Message Queue) stuff in LabVIEW myself at the moment...

@ThSa wrote:
and here is the link for the library
http://sine.ni.com/apps/we/niepd_web_display.display_epd4?p_guid=B45EACE3E7AC56A4E034080020E74861&p_...
ATTENTION: The named library and example is targetting at Windows Message Queues, which is something completely different than the MSMQ Microsoft Message Queue networking/inter-application communication infrastructure! MS only knows, why they often chose confusingly similar names in different contexts...
 
Besides that, I found it pretty easy to get MSMQ messaging with LabVIEW running, using the System.Messaging namespace in .NET 2.0 and LV 8.
In case you're interested in a (most simple) example: Just tell me!
Smiley Happy
 
Grüße,
Hans-Jürgen Philippi
 
0 Kudos
Message 4 of 10
(7,053 Views)
Hans-Jürgen,
  I'd like to see a simple example of labview using MSMQ if you have one.
Thanks,
Jim Dunphy

0 Kudos
Message 5 of 10
(6,815 Views)

Jim,

please find attached an MSMQ send/receive example I've created with LabVIEW 8.2.1
To get it working, you need to do the following:

1. Make sure MSMQ is installed on all involved machines, senders and receivers. The attached ZIP archive contains batch files to install MSMQ on Windowx XP and Vista in the so-called workgroup mode (does not involve active directory integration).

2. Manually create a private queue named "labQueue" or whatever you like on the receiving(!) MSMQ target machine.
See http://technet2.microsoft.com/windowsserver/en/library/53f029d6-8824-4b1b-a312-167b03f5fca51033.mspx... for instructions to do so.
Important note: people often misunterstand the term "private" in a way that such queues would only work locally, within one machine. This is not the case, in fact there is no kind of local-only receive queue like there is no local-only TCP port binding and private queues are open to get messages from anywhere. They are just not public to the active directory queue management services so any sender needs to know the correct target address itself.

3. Adapt the "FormatName" string of the SampleSender.vi that it points to the queue on the MSMQ receiver, that is: Insert the queue name you've chosen and replace the IP with the address of the target machine.

Run both VIs, SampleSender.vi and SampleReceiver.vi and send single messages typed into the "myMessage" string control by pressing the "Send" button or create looped bulk messages with the corresponding boolean switch control.
To experience the coolness of MSMQ, send some messages from the running sender VI before the receiver was started, then start the receiver VI. Or run both VIs on 2 different machines, unplug the LAN connection of one while still sending messages and then plug it in again. MSMQ does all the caching for you in case one of the peers is temporarily unavailable. This rocks!

The VIs demonstrate a very straight forward use of the .NET System.Messaging namespace for synchronous MSMQ messaging. A more elaborate (and better) way included the automatic creation of non-exisiting receive queues and asynchronous message receiving with .NET events.

Greetings + have fun,
Hans

Message 6 of 10
(6,770 Views)

Me again: I found a small problem with the MSMQ setup batch file I renamed to MSMQsetupXP.bat just before creating the ZIP archive some minutes ago. It has to be named MSMQsetup.bat again to work properly.

This happens whenever you create examples without testing.
Smiley Wink

Greetings,
Hans

Message Edited by HJPhilippi on 10-04-2007 10:48 AM

Message Edited by HJPhilippi on 10-04-2007 10:55 AM

0 Kudos
Message 7 of 10
(6,771 Views)

One additional note: Whoever may read this thread and is going to do serious MSMQ programming should have a look at a tool named QueueExplorer by Cogin (http://www.cogin.com/).
While the standard Windows management console lets you do very basic MSMQ handling only like single queue creation/deletion, check number and properties of queued and journal messages etc., QueueExplorer has much more to offer in queue administration tasks, testing and message analysis, e.g. view the (deserialized) body of queued or journaled messages. Together with most valuable MSMQ tips and help by Dejan Grujic, the QueueExplorer developer, it saved my day in many tricky situations.

I'm not related the company and won't get any royalties for this, I'm just a very satisfied customer!

Greetings,
Hans

0 Kudos
Message 8 of 10
(6,750 Views)

Hello

 

I have been trying to integrate MSMQ send into one of my communication programs. I am running into an issue when using the MSMQ send - If I send a long messages (having ~300 characters), the message gets discarded. If I shorten the message, I am able to send it.

 

When I go to Computer Management and look at the outgoing messages, I can see that all messages less than "400" in size show up in the outbound queue. However messages longer than these do not show up at all. I do not know the units for this "400", but I was wondering whether it would be possible to increase that limit to say 2000 or similar.

 

I have tried setting the queue quota for the queue, but it does not help. Any inputs will be appreciated!

 

Thanks

Ajit

0 Kudos
Message 9 of 10
(6,263 Views)

Kudos to Hans for the Post, it may be old but it is still good information

 

I have an extended chalenge:

 

Impliment this on a realtime controller.

 

My understanding is that the .net framework isn't available on PharLap or VX Works which means the solution will need to come from another source.

 

Tim L.

iTm - Senior Systems Engineer
uses: LABVIEW 2012 SP1 x86 on Windows 7 x64. cFP, cRIO, PXI-RT
0 Kudos
Message 10 of 10
(4,978 Views)