How to design a process for communication that is used by multiple processes

50 Views Asked by At

I have written a c++ app on Windows that uses a secondary thread to communicate with a PLC. The content of the messages are vectors (of fixed size around 120) of uint_16t. The interface also allows to send something to the PLC.

I am really new to this so I want to start correctly. I would like now to separate the communication from the app and run it in a separate process. One reason for that is that I would like to write other apps that could also use this process for communicating with the PLC. The communicating process would thus organise and distribute the messages, since all app don't share the same messages from or to the PLC. So I still need to receive the vector of uint_16t (and for that I need to let know to the communicating process which one to read!) but also to send some things to the PLC. Thus I would need a bidirectional communication.

I have seen that there are many possibilities to achieve this but I would like to communicate via Message Queues (Message Passing). If possible, I would also like to allow apps on other computers to connect to this communicating process.

I am therefore looking for a c++ library to do that. I would appreciate any advises about which one to favor.

I can use message queue from Boost but it doesn't allow to communicate with another computer.


As a secondary question related to this one, I would like to start the communicating process if at least one interface process is opened. How to achieve that synchronization?

I thank you in advance for your help.

0

There are 0 best solutions below