LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Communication between programs

Hello all,
 
I need to write a program that can be called by other programs, written by my colleagues. My program receives commands from the other programs, and then communicates with our driver boards through RS232 to execute these commands. The idea is that my colleagues have easy access to our driver boards using my program as a kind of interface. My program should be launched by their program (if not already running), and run silently in the background. While running, their programs then communicate with my program to perform actions on the driver board.
 
I have read some threads about communication between programs about datasockets and TCP, but I do not know the best solution for my problem. It is quite important that my programs can be accessed by multiple master programs at the same time. And I would prefer it to run silently (no taskbar icon).
 
Thanks a lot for all tips,
Wim
0 Kudos
Message 1 of 6
(3,793 Views)
I'm assuming here that more than one program at a time will need to communicate with your interface application, otherwise you could just write a simple dll that a single external application could call. When two or more different processes are involved, some form of inter-process communication is needed to overcome the memory management issues and Windows provides several types that are usable within CVI via the SDK.
 
I had a similar need a while ago and eventually settled on a shared memory approach, where I reserved 4K of system memory and arranged for it to be accessible by any processs that wanted to communicate to each other. It was based on the CVI example at C:\Program Files\National Instruments\CVI70\samples\sdk\sharemem but drastically cut down (to about 70 lines) and implemented as a dll, without a user interface. As each process loaded up the same dll, it received a different set of local variables, so by keeping the key control variables within the shared area it was fairly straight-forward.
 
JR
Message 2 of 6
(3,788 Views)
Thanks a lot for the tip JR. I'll take a look at it immediately Smiley Happy
0 Kudos
Message 3 of 6
(3,777 Views)

Hello JR,

this works great! This only leaves me the problem that I would like my server program to be "invisible". Is there any way to hide an application's task bar icon?

0 Kudos
Message 4 of 6
(3,772 Views)

There was some discussion on this topic a short while ago. Although I haven't tried it myself, it seems that:

    SetSystemAttribute (ATTR_TASKBAR_BUTTON_VISIBLE, 0);

should do what you need, although it's effect may depend on your other panel (if any) settings.

JR

Message 5 of 6
(3,769 Views)
OK, that does the trick. Thanks a lot for helping me out Smiley Very Happy
0 Kudos
Message 6 of 6
(3,765 Views)