Geeta Tirlapur Posted October 29, 2010 Report Share Posted October 29, 2010 (edited) Hi, I have an existing c# window application. I want to make my Labview to communicate with C# application whenever an event happens and vice versa. Please let me know what will be the best way for the communication while making little changes to the C# window application. Running on windows XP machine with VS 2005. Edited October 29, 2010 by Geeta Tirlapur Quote Link to comment
Daklu Posted October 29, 2010 Report Share Posted October 29, 2010 You haven't included enough information for anyone to give you a specific suggestion. There is no single "best" way to communicate between apps; it all depends on your requirements and restrictions. Here are a couple options; there are others as well. Tightly coupled solution: To notify the C# app of events in the LV appAdd code to your .Net app exposing public methods telling the app something happened in the LV app. In your LV app use the .Net constructor node to get a reference to your .Net app. When events of interest occur in the LV app call the appropriate methods in the .Net app. [*]To notify the LV app of events in the C# app Use callbacks in your LV code. (I haven't done this so I can't comment on how to change your C# code to allow it.) This solution makes your LV source code dependent on the C# executable. In other words, you'll have to have the C# app installed on your dev computer and on any computer that executes the LV app. Loosely coupled solution: Add a TCP component to your LV app. When something interesting happens in the LV app, broadcast a message on the TCP port. At the same time, constantly listen on the TCP port for messages broadcast by other apps. When a message is received, react accordingly. Repeat steps 1-3 for the C# app. This solution removes the dependencies between the two applications. Neither app "knows" about the other one. They only know they are supposed to broadcast messages when stuff happens and do other stuff when messages are received. 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.