LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to transfer Variable data from Labview to C# code and also reverse way.

Hello

 

I am a Student and rite now i am doing my thesis work on Labview with controlling the robotic Arm. i have a C# program which is able to get the Spoken Speech commands From Kinect(XBOX360) Camera and my robotic arm is controlled by a Labview Program, now  i want to interface between C# Program and Labview program. I want to recognize a spoken word using C# program and then i want make my arm working with labview program according to the spoken word and also send the feedback to the C# Program from Labview.

 

In-short i want to send the data from a C# program to Labviewprgram and also from Labview Program to C#.

 

Looking forward to see some interesting answers

0 Kudos
Message 1 of 5
(3,210 Views)

LabVIEW integrates really well with .NET these days - have you done a search for .NET in the LabVIEW examples - there's a few in there to get you started, but in esssence calling a .NET assemby from LabVIEW is really not much different from C# - you need to call a constructor for the class you want to use and then using property nodes and invoke nodes you can access the class' data and call public methods - these functions can be found under Functions > Connectivity > .NET on the LabVIEW palette.

 

Only thing that can be a pain sometimes is using native .NET objects, that's where you have to be a bit clever sometimes, but otherwise it's not particularly difficult.

David Clark
CLA | CTA
IDEX Biometrics UK Ltd
Hampshire, England
0 Kudos
Message 2 of 5
(3,193 Views)

I would recommend using a simple TCP server/client model to pass data between the two programs. Another alterative would be to create a dll which could be called in both languages that would be able to pass the data. this might be a bit trickier since you will need to find a way to store the data in some common location both could access. the TCP method would work quite well. Create a very simple protocol to pass the data. Generally something along the lines of the data length followed by some type of identifier followed by the data itself.



Mark Yedinak
Certified LabVIEW Architect
LabVIEW Champion

"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot
0 Kudos
Message 3 of 5
(3,192 Views)

Just to add, if you're looking to transfer data between an asynchronous LabVIEW execution, and an asynchronous C# execution then there are various ways of doing this such as TCP/IP sockets, .NET Queues, I believe that you can use network shared variables in .NET although you may need Measurement Studio to do this, WCF I'm fairly sure you can use, but that might be a bit heavy weight for this application.

 

I would probably go for TCP/IP sockets as they are very easy to setup both in LabVIEW and .NET - but sure there are many other ways to skin this Cat!

David Clark
CLA | CTA
IDEX Biometrics UK Ltd
Hampshire, England
0 Kudos
Message 4 of 5
(3,187 Views)

Ok...Man i will try this way...will update if getting some positive results

0 Kudos
Message 5 of 5
(3,177 Views)