Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

converting c++ code to c#

I have c++ code that interfaces the a PC-DIO-96 board (or equivalently a USB-6509).  I'd like to convert my code to c#.  There are a few examples of c# code but they're very simple.  I can use PInvoke from c# to call c++ functions but I'd rather use c# function calls directly.  Does anyone know where I can find a listing of c# functions with appropriate namespaces and which dll's if any I need for c#?  Thanks.

0 Kudos
Message 1 of 4
(2,076 Views)

Hi Gene,

 

In the next links you can find the help documents for Measurement Studio, there you can find some additional examples and syntaxis for C# code.

 

Measurement Studio 2012 for Visual Studio 2010 Help

http://zone.ni.com/reference/en-XX/help/372636F-01/

 

NationalInstruments.UI.WindowsForms Namespace

http://zone.ni.com/reference/en-XX/help/372636F-01/mstudiowebhelp/html/bc10ffb8/

 

Using the Measurement Studio Windows Forms .NET Controls

http://zone.ni.com/reference/en-XX/help/372636F-01/mstudiowebhelp/html/usingninetwinformscontrolswin...

 

Hope this can help.

Best regards,
Cesar Ortega
Technical Support Engineering
National Instruments
www.ni.com/support
0 Kudos
Message 2 of 4
(2,047 Views)

Hello,

 

I found some c# examples but (1) they're very simple and don't correlate very well to the code I need to convert and (2) when I tried to build one of the examples, I get an error on the NationalInstruments.DAQmx namespace - error CS0234: The type or namespace name 'DAQmx' does not exist in the namespace 'NationalInstruments' (are you missing an assembly reference?).  Normally I add a reference to a DLL that contains a namespace I want to use.  The namespace NationalInstruments.DAQmx is referenced but what DLL contains that namespace?.  Evidently that DLL is not begin accessed by the sample program.

 

Thank you,

 

Gene

0 Kudos
Message 3 of 4
(1,725 Views)

Please disregard my last message.  The .NET libraries weren't installed, once I installed them the sample programs built successfully.

 

Gene

0 Kudos
Message 4 of 4
(1,719 Views)