05-11-2018 10:50 AM
I am testing a device via SPI using an Aardvark (USB-SPI). The Aardvark's API is a single-threaded DLL.
I want to interface 2 (or more) programs across that SPI channel. For example, one program is an automatic test sequencer, and the second program is a manual register debugger.
If I run both programs from the development environment, everything works. The programs share the API handle, and calls from either program will go out to the device.
If I create an EXE from both programs, the two programs run as separate Windows applications, so they can't share the API handle, so only one program can use the device. Switching ownership means closing the handle in one, opening in the other, and re-initializing.
What are some approaches to make this DLL accessible from both applications when they're built as an EXE?
Solved! Go to Solution.
05-11-2018 11:02 AM
Hi dan,
create a 4rd tool acting as server. This server tool will handle all the API access and provide it's service using network communication.
You other tools ("clients") can send send requests to the server and get the responses sent by the server…
05-11-2018 12:12 PM
Hi Gerd,
Thanks, that sounds workable. If you've done this before, is there a problem with overhead/performance of the approach? I'm not familiar using LabVIEW as a server. Do you mean 1 server program is hosting TCP/IP on localhost, and both client programs connect to it? Or does LabVIEW have other mechanisms to connect applications?
Regards,
Dan
05-11-2018 01:18 PM - edited 05-11-2018 01:45 PM
Hi Dan,
Do you mean 1 server program is hosting TCP/IP on localhost, and both client programs connect to it?
Yes.
You can also use UDP, if this ok for you…
Or does LabVIEW have other mechanisms to connect applications?
Yes.
Like said before UDP, but also other things like NetworkSharedVariables or NetworkStreams. On VIPM you also find implementations like STM…
05-11-2018 02:04 PM
That's exciting, I will research these more and try to implement one to solve my problem. Thanks for all your help!
05-12-2018 02:28 AM
It would seem simpler to have one exe that contains both programs in one application.
05-14-2018 09:01 AM
On the surface, that's definitely easiest. But the automated test sequencer is quite large. Some users only need the sequencer, some only need the debugger, and some need both. So I'm hoping to keep the programs as independent tools. That way I can modify & release the smaller debug tool without touching the validated test sequence.