03-14-2011 02:58 PM
Hi,
i want to create a modular software with LabVIEW and MS C#.
All modules should be compiled (exe or dll). Perhaps one module for DAQ
and another for user administration, one the test sequencer...
How can I do the cyclic data exchange between the modules (for example the process image..)?
Is the shared variable the right way? I´ve tested shared variable with simple data, that´s not bad,
but with more complex data (array with cluster..) debugging (with NI-DSM) is not good.
Has anyone a good idea?
Thanx
03-15-2011
06:18 AM
- last edited on
01-15-2025
04:59 PM
by
Content Cleaner
Here are some ideas:
https://knowledge.ni.com/KnowledgeArticleDetails?id=kA03q000000x3cfCAA&l=en-US
03-15-2011 08:30 AM - edited 03-15-2011 08:35 AM
As Adnan said, there is always a possibility to exchange data thought files.
You could also use the .NET constructor to access your application's methods and parameter. You can find this constructor in the function palette under „Connectivity => .NET => Constructor Node“ and find help about it in the LabVIEW help under „VI and Function Reference => Connectivity VI and Functions => .NET Function“.
The issue with arrays in NI-DSM is known and should be fixed in a future version.
Regards
03-15-2011 10:36 AM - edited 03-15-2011 10:39 AM
I don't know if it's the best way but it's simple to just use TCP to communicate between the apps. This also provides greater modularity since if you know the TCP messaging scheme being used, you can write the component apps in any language or change them later and you're pretty much OS independent if you want to run the client/servers on another computer. If both are running on the same computer, you can just use 'localhost' for the communication. It may be more efficient to do it this way as opposed to writing/reading from a file.
03-15-2011
10:59 AM
- last edited on
01-15-2025
05:00 PM
by
Content Cleaner
@ kgolden : this might as well work. I used it once to communicate between a C++ program and a Python one, I feel quite stupid I didn't thought about it :
Basic TCP/IP Communication in LabVIEW:
I was also thinking about the possibility to use shared Libraries:
Calling LabVIEW VIs from Other Programming Languages:
There is specific examples using .NET at the end of the last link.
Regards
03-15-2011 11:31 AM
The link that I have posted mentions TCP/IP, ActiveX and others.
03-16-2011 02:57 AM
Hello Adnan,
I´m gonna write a small test programm (compiled to a DLL) with shared variables and test ist with C#.
If it doesn´t work I try TCP/IP.
As soon as i have any results I will post them.
Thanx for the help.
03-16-2011
11:48 AM
- last edited on
01-15-2025
05:01 PM
by
Content Cleaner
This looks like a pretty good example of NSV's in CVI.
Also uses the NSV callback capability, something that is missing in LV
03-17-2011 02:51 AM
Hi,
I don´t have any experience with CVI but you´re right that´s the same problem.
Here is the first test that I´ve programmed, just the MAIN-Programm (exe) and one
Module (Dll).
Please feel free to comment this stuff