LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

C# send data to Labview

Hello,

I have a project to send the data from C# (Visual Studio 2013) to Labview 2018. VS2013 and Labview2018 are in one PC. The C# project only have to send the data continuously to Labview, so it is no need to receive data from Labview. The C# project includes product's SDK which has to be developed under c# console application, so maybe the solution of .dll is not suitable for the project (I'm not sure about it). Does anyone have any idea on dealing with this situation?  

 

Thank you

0 Kudos
Message 1 of 5
(2,888 Views)

@alwaysfantasy100 wrote:

Does anyone have any idea on dealing with this situation?  


Either figure our how the C# project communicates, or use the SDK to DIY...

 

Without any information, we can't tell you anything.

0 Kudos
Message 2 of 5
(2,850 Views)

wiebe@CARYA  已寫:

@alwaysfantasy100 wrote:

Does anyone have any idea on dealing with this situation?  


Either figure our how the C# project communicates, or use the SDK to DIY...

 

Without any information, we can't tell you anything.


Sorry for not giving any detailed information.

I use C# in visual studio 2013, and the Tobii core SDK is included in the project. The thing I try to do is to send the gaze data to Labview, so when I look a specific spot, it can help me to turn on/off the boolean button or do other functions. Visual studio 2013 and Labview 2018 are installed in the same PC. The c# code is attached.

 

Thank you

0 Kudos
Message 3 of 5
(2,827 Views)

Based on that C# code, it looks like the "Tobii" API requires you to supply a delegate that it will call with the relevant information (x, y, ts). LabVIEW can't create it's own delegates directly however it can consume (register) for events. So you could possibly do the following:

  1. Create a library (dll) project in Visual Studio.
  2. Expose a class with:
    • Method that inits the hardware (new Host(), CreateGazePointDataStream()) (or possibly use constructor instead)
    • Exposes an event to LabVIEW with the same parameters as the delegate (x, y, ts).
    • Method that executes the GazePoint method (the delegate you supply to the GazePoint method will invoke the exposed event)
    • Method that closes the hardware (DisableConnection() etc.) (or possibly add a finalizer instead).
  3. Consume the library within LabVIEW using the .NET nodes. You will need to register an event callback on the new exposed event and deal with the data in that callback.

Have a go at this and let us know how you go.

0 Kudos
Message 4 of 5
(2,815 Views)

How are you going to press the button (based on coordinates?)?

 

If you're going to use a Windows API, you might as well call it from C#. No need to do anything in LabVIEW, the Tobii program will basically act as an input device.

 

Just a thought..

0 Kudos
Message 5 of 5
(2,808 Views)