Re: MSMQ with Labview



Jim,
please find attached an MSMQ send/receive example I've created with LabVIEW 8.2.1To 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(!)&nbsp;MSMQ target machine.See <a href="http://technet2.microsoft.com/windowsserver/en/library/53f029d6-8824-4b1b-a312-167b03f5fca51033.mspx?mfr=true"; target="_blank">http://technet2.microsoft.com/windowsserver/en/library/53f029d6-8824-4b1b-a312-167b03f5fca51033.mspx?mfr=true</a>&nbsp;for instructions to do so. Important note: people often misunterstand the term "private" in a way that&nbsp;such queues would&nbsp;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&nbsp;before the receiver was started, then start the receiver VI. Or run both VIs on 2 different machines,&nbsp;unplug the LAN connection of one while still sending messages and then plug it in again. MSMQ does all the caching for you in&nbsp;case one of the peers is temporarily unavailable.&nbsp;This rocks!
The VIs&nbsp;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


MessageQueue (MSMQ).zip:
http://forums.ni.com/attachments/ni/170/276010/1/MessageQueue (MSMQ).zip
.



Relevant Pages

  • Re: How to Use MSMQ in .Net?
    ... I always think MSMQ is direct send to remote matchine. ... But I Want to know when remote machine is offline. ... >> correct.Error is my install MSMQ under domain.When I change domain to ...
    (microsoft.public.dotnet.framework)
  • Re: MSMQ, COM and 32/64 bit compatibility
    ... No takers to this question yet? ... reason is development will most likely take place in 32 bit machines but deployment in 64 bit machines. ... Does MSMQ 3.0/4.0 has any inherent dependency on COM/COM+? ...
    (microsoft.public.dotnet.framework)
  • Re: MSMQ in VFP8.0
    ... I could successfully install MSMQ; however I could not get help on using ... MSMQ in visual foxpro 8.0, though, MSMQ seems to be available since vfp6.0. ...
    (microsoft.public.fox.programmer.exchange)
  • Re: MSMQ in VFP8.0
    ... I am referring to the same article. ... My objective is to be able to communicate between a vfp8.0 application and ... >> but it seems to me that MSMQ has not been installed on my machine. ... >> How do I install MSMQ? ...
    (microsoft.public.fox.programmer.exchange)
  • Re: MSMQ in VFP8.0
    ... I don't know what your requirements are, but MSMQ is probably overkill. ... There are several ways to communicate between .NET and VFP. ... > "Sergey Berezniker" wrote: ... >>> How do I install MSMQ? ...
    (microsoft.public.fox.programmer.exchange)