09-16-2020 06:03 AM
Dear all,
I'm looking for the best way to implement a communication between 2 Labview applications. The context:
- 2 exe build from labview code
- 2 exe on the same computer
- communication must be fast and safe (no data loss)
- application 1 send a data to application 2, application 2 must process data received as fast as possible (like an event)
- time between 2 data not known (between 1s and...)
In your opinion, what is the best way to do that?
Regards,
FrancisM
Solved! Go to Solution.
09-16-2020 06:27 AM
A lot more information is needed to properly make suggestions. What is the data? When you say "fast" what do you mean? Will there be large packets of data?
Is there a reason that you chose to make two separate applications on the same machine? Could this be made into a single application with two separate loops?
09-16-2020 06:35 AM
Assuming that there's some reason you want two exes (as John said above, making a single exe might be easier, and if it's for maintaining/upgrading parts of code, PPLs might be a better solution than separate exes, but anyway...), I'd take a look at Network Streams.
09-16-2020 06:37 AM
Hello,
In my specific problem, I've a big and complicated application (application 2) who received data from RS232. It's not so big data, typically a bar code or a datamatrix (sting of maybe 50 characters max). This application is use in some places in my company. To automate the process, I wanted modified the application to add another reception canal, to be defined.
The other application (application 1) I wanted to developp will be specific to a machine. I wanted to implement to specific code in this application, and send the codes to application 2.
With this solution, application 2 is updated once to be able to work in the 2 ways every where, and I build a specific appliciation 1 depending of my need. Am I clear?
Regards,
09-16-2020 07:26 AM
I would recommend that you consider LVOOP options. You can use LVOOP to choose which method to utilize at runtime. I think this will be much better than a patchwork of separate programs that must be running (what happens when you need to add a third or fourth method). This really is an encapsulation problem. Running two programs to try to solve this problem just seems to be asking for issues.
09-16-2020 07:32 AM
@Cisco wrote:
Hello,
In my specific problem, I've a big and complicated application (application 2) who received data from RS232. It's not so big data, typically a bar code or a datamatrix (sting of maybe 50 characters max). This application is use in some places in my company. To automate the process, I wanted modified the application to add another reception canal, to be defined.
The other application (application 1) I wanted to developp will be specific to a machine. I wanted to implement to specific code in this application, and send the codes to application 2.
With this solution, application 2 is updated once to be able to work in the 2 ways every where, and I build a specific appliciation 1 depending of my need. Am I clear?
Regards,
This sounds like an application for a Factory Pattern based on Packed Project Libraries. The idea is you use OOP to create a hierarchy of interfaces that you can talk through, only loading the actual interface you need. The factory pattern works with PPLs quite well, making it so you can just compile the PPL for the exact interface you are dealing with in order to update your system. It will also be extendable for when the next system needs something similar.
But if you insist on the two executables, I would go with a simple TCP protocol. Network streams would be my second choice mostly due to personal preference.
09-21-2020 01:48 AM
Thank you to all of you for your answer!
I've made a little patch to send/receive information between my 2 programm with TCP protocol. OOP will definitively be more proper, but I'm not very comfortable with this and it implies a redesign of the main application...
Regards,