From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
11-21-2016 02:57 PM
Dear Community,
I'm currently working on a project where I'm programming a device control with LabVIEW. A colleague of mine is programming some image analysis with C, where he calculates about 3 paramateres per image every ~30 ms.
Now we want to use these parameters in my VI.
So the idea was to continuously wirte the parameters with the C-Program to a file and simultaneously read from that file with my LabVIEW VI.
For performance reasons the C-Program and LabVIEW VI are running on two different PCs.
My first idea was to use a TDMS file in a shared directory. But after my first tries with TDMS I have some doubts if this is the best solution, because I had some trouble while testing with an .exe to write some TDMS files and simultaneously reading it.
So I just want to ask if you guys know a better solution for our problem?
Solved! Go to Solution.
11-21-2016 03:46 PM
I don't think using files is going to be the best way to go here.
I think you probably want to use something like a Network Shared Variable.
11-21-2016 04:00 PM
11-21-2016 04:06 PM
@nanocyte wrote:Is there a C interface for shared variables?
...
According to the whitepaper that I linked:
"In addition, with the Network Variable Library introducted in NI LabWindows/CVI 8.1 and NI Measurement Studio 8.1, you can read and write to shared variables in ANSI C, Visual Basic .NET or Visual C#."
I haven't used the ANSI C interface to Measurement Studio myself. Should be pretty straightforward though.
11-21-2016 04:19 PM
As a possible way to make it simpler, you could use LabVIEW to build a DLL that accesses the shared variable instead of making your C programmer wade through a new API.
11-22-2016 12:50 PM
Thank you all guys,
I think just using TCP will be the best solution for me.