Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

Getting started with C# and the PXI-6552

Hello,
 
   I am getting started with C3 and the PXI-6552. I have been able to create Labview programs for this card, which I have to migrate to C#.  Are there any good examples of C# code to work with teh 6552? I am looking for something as simple as using the following method to get a generation session "InitGenerationSession".
 
Regards,
 
Kaspar
 
Regards,


Kaspar
0 Kudos
Message 1 of 6
(5,180 Views)

Hi,

We do have an example for HSDIO card in C#.  One of them is C# niHSDIO - Static Acquisition.

If you take a look in the HSDIO driver readme; look under system requirement, you will see that we do not have c# .NET on the list, one of the workarounds we have is: Microsoft Visual C# and Visual Basic .NET Wrappers for National Instruments Modular Instruments Driv..., for many modular instruments products, .NET wrappers have been created and are attached below. The attached wrappers are based on the ANSI C API that is installed with the drivers of the respective instruments. So my suggestion would be to open the C example as a guide and use the wrapper to call the C functions.

I hope it helps

Jaime Hoffiz
National Instruments
Product Expert
Message 2 of 6
(5,160 Views)
Hello,
 
  Thanks for your response. I have looked at the "C" examples to get the function names and have created my own C# code to talk to the 6552. I am looking for a way to close the init and or generation sessions for the 6552. Any ideas?
 
Regards,
 
 
Kaspar 
Regards,


Kaspar
0 Kudos
Message 3 of 6
(5,143 Views)

Hi,

So I guess you are already looking at the functions C functions, these are the functions responsible of initialization and closing of either the acquisition or generation sessions: niHSDIO_InitAcquisitionSession (deviceID, VI_FALSE, VI_FALSE, VI_NULL, &VI)); niHSDIO_close (VI);

 

If you take a look at the wrapper that is included with the only example I was able to point you to, the first two functions are: “InitAcquisitionSession” and “InitGenerationSession”. After chatting with one of my co-workers it seems that you have made your own wrapper from the HSDIO.dll. This library has a function call HSDIO_close in it and there should be one for initialization.

 

Remember you can always use our wrapper.

I hope it helps

Jaime Hoffiz
National Instruments
Product Expert
Message 4 of 6
(5,127 Views)

Hello,

 

  Thanks for getting back to me. I am looking at the "C" example to understand the names of the methods to call in C# with Visual Studio 2005. When I am writing the code in Visual Studio 2005, the only close function I can find is CloseExtCal, which closes a external cal session, which is different that closing a generation session.

Regards,

 

Kaspar

Regards,


Kaspar
0 Kudos
Message 5 of 6
(5,123 Views)

Hi,

One of my co-workers with a lot more experience in C# programming has answered the same question. “How do I close a generation session in C#

I hope it helps

Jaime Hoffiz
National Instruments
Product Expert
Message 6 of 6
(5,112 Views)