LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

multi-process to single process

Here is the design I am looking at.

I have one process that initializes some external hardware device and stays active. A separate process (non cvi) can query this process to check status and to bring down the hardware. This just sits there.

Now the customer has a bunch of separate processes that can call a dll which talks to one of the resources on the hardware. Since the hardware can have up to 24 of these resources, the DLL needs to check which is not in use so it can use it. What way should I do the interprocess communications?

1) how should these other processes talk to the main "start-up" process?
2) how should one of the separate 24 processes 1) check for a free resource 2) mark when the resource is again free?

I need all
these things to be dll's, since installation needs to be non-cvi based.
0 Kudos
Message 1 of 2
(2,894 Views)
Hi
The most flexible way would be to use sockets (that way, the processes aren't even restricted to being on the same computer). CVI has a very nice sockets interface which allows you to register a callbakc to handle all incoming traffic. This should be fine unless the amount of traffic you expect to see is going to be very heavy.

In this case, you would make the "start-up" process a server which waits for connections and fulfills requsts. In your case, the requests are to check status, reserve a resource, to release a resource and to "shut down". Because of the way CVI handles tcp events, there will be a distinct ordering of requests so no two processes should ever be able to reserve the same resource.

If this proves to be too slow or clunky, you could
also use shared memory, but that comes with its own caveats and requires all the processes to coexist on the same machine. Thank you.

Robin D'Souza
National Instruments
0 Kudos
Message 2 of 2
(2,894 Views)