EOF Posted July 9, 2009 Report Share Posted July 9, 2009 Hi all, I am wondering how to send messages between different projects. It seems (from the little testing I tried) that notifiers and semaphores cannot be passed between projects. So I am wondering what is the mechanism for doing this, or should I develop everything that would want to communicate within the same project. Thanks, EOF Quote Link to comment
ned Posted July 9, 2009 Report Share Posted July 9, 2009 The easiest way to communicate between projects is using VI Server, for which there is plenty of documentation in the LabVIEW help. Each project is its own "Application Instance" and there's some information about how to get a reference to an application instance in this thread. Quote Link to comment
PaulL Posted July 9, 2009 Report Share Posted July 9, 2009 Hi all, I am wondering how to send messages between different projects. It seems (from the little testing I tried) that notifiers and semaphores cannot be passed between projects. So I am wondering what is the mechanism for doing this, or should I develop everything that would want to communicate within the same project. Thanks, EOF Yes, you need some sort of message-passing mechanism if you use different projects, since you are communicating now between two different applications. Networked shared variables (used properly and on a supported platform) offer a good solution for this, but you can also use TCP/IP, UDP, or the like. You might try looking at the Simple Messaging Reference Library (STM) on NI's site. If I faced the same problem (and I do) I would use networked shared variables for this purpose, as they probably offer the most flexible and most easily configurable solution (and with the DSC module we can add logging and alarming functionality). If your applications are on the same machine you can use .NET or a Windows message service, but the former is not very efficient and the latter is quite nontrivial (and both require Windows). You also can use a web server, which is at least platform-independent, but your message timing and delivery reliability will suffer. Will your applications always run on the same computer? What requirements do you have for message timing and delivery? You could also consider building one project's top-level VI into an application (e.g., .exe, .dll) and exposing calls to the other application. Or you can import one project into the other (which it sounds like you have considered) and if you can build only one application you can still use notifiers and semaphores. This can be a very simple solution and will work well as long as your applications run on the same computer (or a desktop and a cRIO or the like). In the current version of LabVIEW you can't add two desktop computers to a project, and you can't use queues and the like over a network anyway. Hopefully I've said everything correctly but my descriptions may not be 100% correct. I suggest using networked shared variables offers the most flexibility and offers one of the best performance options, too. Paul Quote Link to comment
Mark Yedinak Posted July 9, 2009 Report Share Posted July 9, 2009 You can also use network queues. Network queue have a TCP/IP wrapper around native LabVIEW queues which allow you to pass data between two applications. You can even pass data between two machines. Quote Link to comment
Popular Post Norm Kirchner Posted July 9, 2009 Popular Post Report Share Posted July 9, 2009 Hi all, I am wondering how to send messages between different projects. It seems (from the little testing I tried) that notifiers and semaphores cannot be passed between projects. So I am wondering what is the mechanism for doing this, or should I develop everything that would want to communicate within the same project. Thanks, EOF There is a novel technique that I have seen and done a variety of times. It requires creating a wrapper for the "Send Notification" VI like this http://screencast.com/t/zRDGaScM What the video hopefully details is that you can create a VI that is in memory on Application A. Inside of that VI is a shift register that holds the reference to the needed thing (semaphore, queue, user event and so on) Then you pass that VI the data that you want to end up in the (semaphore, queue, user event, notifier, and so on) using Call by Reference Node And then the VI fires the (Notifier, user event, EnQueue) with that data and the stored reference. By doing that, you have successfully sent data to any other LV application regardless of whether it is another Application Instance, an executable, or a VI across the world. Note: Scott Menjoulet (LAVA member w/ the Detroit Red Wings Avatar) is the originator behind this idea, and I have merely been it's rah -rah boy over the years and strange uncle to work it into a generic LVOOP based implementation in LVx See the attached file for the VI's and projects used in the video Step 1 is to open both projects, local and remote and then go from there. -Norm REx.zip 3 Quote Link to comment
Michael Aivaliotis Posted July 9, 2009 Report Share Posted July 9, 2009 You can also use network queues. Network queue have a TCP/IP wrapper around native LabVIEW queues which allow you to pass data between two applications. You can even pass data between two machines. Sorry, where in my LabVIEW palette is this? Or do you mean network shared variables? Quote Link to comment
Norm Kirchner Posted July 10, 2009 Report Share Posted July 10, 2009 Mike, STFF man! (search the freaking forum) Someone came up w/ a very similar way as REx to use queues over a network or at least that's what I found on lava search. >8^}> Quote Link to comment
Michael Aivaliotis Posted July 10, 2009 Report Share Posted July 10, 2009 Mike, STFF man! (search the freaking forum) Someone came up w/ a very similar way as REx to use queues over a network or at least that's what I found on lava search. >8^}> Well, last time, you were on here telling everyone how LAVA search sucks! So now you're telling me to use the LAVA search? make up your mind! Quote Link to comment
Gary Rubin Posted July 10, 2009 Report Share Posted July 10, 2009 Mike, STFF man! (search the freaking forum) Someone came up w/ a very similar way as REx to use queues over a network or at least that's what I found on lava search. Is this what you're talking about? It refers to an attached file, but I don't see one. Michael, did attachments not port from LAVA 1.0? Quote Link to comment
Michael Aivaliotis Posted July 10, 2009 Report Share Posted July 10, 2009 Is this what you're talking about? It refers to an attached file, but I don't see one. Michael, did attachments not port from LAVA 1.0? Most of them did. It looks like this one fell through the cracks. I have all the files and I have a manual way of associating them to the original post, but it takes some effort. If anyone has a copy on their computer then please attach it to that thread. I will look later to see if I can find the file. Quote Link to comment
Michael Aivaliotis Posted July 10, 2009 Report Share Posted July 10, 2009 I found the attachment and updated the original Network Queue topic. Quote Link to comment
Norm Kirchner Posted August 6, 2013 Report Share Posted August 6, 2013 Offically posted REx http://lavag.org/topic/17024-rex-remote-export-framework-and-remote-events/ 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.