Search code examples
c#.netactivexlabviewdata-acquisition

Getting matrix of data from LabVIEW into C# .NET


I am running a simultaneous data acquisition and hardware control. The data acquisition is with an NI-DAQmx device. The hardware control is already written in C#.NET and we would like to synchronize our acquisition with the control, i.e. wait for control event -> collect data -> stop collection -> continue control. I know there is NI Measurement Studio that gives .NET controls for data acquisition but I don't think my boss wants to pay the $350+ for a license and the 45 day evaluation is not enough. So then I found that you can communicate to LabVIEW (which is already installed on our computers) via ActiveX controls and this seems like the route to take. I found an example on zone.ni that open a LabVIEW vi, takes an input from the Windows form, does a calculation in the vi and returns a value. First, I don't understand LabVIEW in the slightest and can't see where the input parameters actually go in to the vi on its block diagram and how it knows to send the output into the output parameter back to the Windows form. Beyond this, for our purposes we need to collect a matrix of data (3-4 large columns) from the LabVIEW vi that we can run acquisition on. Does anyone know if/ how I can do this with an output parameter or where I could find out how? Also, I'd appreciate it if someone could explain how LabVIEW handles the input reference parameters when the vi is called.

Thanks


Solution

  • I have no practical experience with .NET, but the VIs simply call functions from C DLLs. I assume it should be possible to call the same functions yourself from C# and avoid LV completely, which is probably better for you if you don't know it. If you have Labwindows/CVI, I assume you should already have examples for how to do this. If not, I think that the DAQmx installer allows you to install such examples.