Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

PCI-5105 data acquisition

Hi

I am using NI PCI-5105 digitizer. I have already configured the digitizer setting and acquired data using LabView according to my need. I have posted the vi I used for the process. However, I need to do the same thing with C# using visual studio. I am new to C# and I just have basic concept about it. So please help me do this. I have both Visual Studio 2008 and 2010 installed but I have installed Measurement studio 2010 evaluation version only. Can anyone provide me a sample code and also step by step instruction to use the niscope in visual C#? Please help me with this...

0 Kudos
Message 1 of 14
(5,840 Views)

Hi Paritosh,

 

I would first familiarize yourself with the NI Scope Functions. Look at the NI High-Speed Digitizers Help and navigate to Programming -> Reference -> NI-Scope Functions Reference Help -> Functions. The online version can be found here. In this section of the help, you will be able to look up expected behaviour of each function and the parameters they require. If you look closely the functions, they closely resemble similar VI's in your code that utilize the NI Scope drivers.

 

Similarly, you can find tons of examples if you navigate to Start -> Program Files -> National Instruments -> NI-SCOPE -> Examples -> C.

 

Jason L.

Product Support Engineer
National Instruments
0 Kudos
Message 2 of 14
(5,831 Views)

I tried few examples for dotnet 3.5. The configured acquisition and fetch forever. They are working fine. What shall i do to merge these examples and change the way I need to? Can you give me some examples similar to my need? Please help. 

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

HI Paritosh,

 

We generally don't write code for customers. If you look at the GenericConfiguredAcquisition.c file that is in the common directory (Start -> Programs -> National Instruments -> NI-SCOPE -> Examples -> C -> common) that the ConfiguredAcquisition example calls and compare it to the GenericFetchForever.c that the FetchForever example calls, you can see that in the GenericConfiguredAcquisition.c file that you are configureing parameters manually starting from around line 65 and also you declare relavant variables above.

 

Similarly in GenericFetchForvever.c you can see that you are configureing a software trigger instead of prompting the user to configure the trigger. In order to fetch forever, the example configures a software trigger but never triggers and instead pulls values off of the buffer. Using this knowledge you should be able to embed the fetch forever functionality into any code. I think with this information and examples, you shouldn't have too much problem combining the functionalities of both codes.

 

Jason L.

Product Support Engineer
National Instruments
0 Kudos
Message 4 of 14
(5,820 Views)

Is it the same for cs files as well? Can you give me some instruction on merging the cs file as well? and also I need an external trigger in the code, how can i be able to detect the external trigger? Do i need to use any other example files?

0 Kudos
Message 5 of 14
(5,816 Views)

Paritosh,

I think I directed you to the C examples. However, I realize now that you were in need of examples in C#. The examples can be found by following this KB here. Similarly, there is another example for C# here

 

Jason L.

Product Support Engineer
National Instruments
0 Kudos
Message 6 of 14
(5,809 Views)

Hi

When i run the "Configured acquisition.cs" a different GUI used to come showing the wavefrom graph and acquiring data only once. Now from yesterday, from the same program, a different GUI is appearing which I've attached here. How can I get old GUI and interface back for configured acquisition. 

 

When I fetch the data using multifetch, can I directly do mathematical operations with the data (like averaging) or do I need to save the data first. Also, the 1st link you've given is not working. Please help.

0 Kudos
Message 7 of 14
(5,794 Views)

Paritosh,

 

Sorry, the first link goes to this KB here: http://digital.ni.com/public.nsf/allkb/D139037C4D9744B48625743C0077885F?OpenDocument

 

Jason L

Product Support Engineer
National Instruments
0 Kudos
Message 8 of 14
(5,791 Views)

And can u give me a solution for the problem I am having with configuired acquisition.cs? Is the attached GUI a desired output of the "Configured Acquisition.cs"? I used to get different GUI with the waveform as well. Please help. 

0 Kudos
Message 9 of 14
(5,789 Views)

HI Paritosh,

 

Did you change anything (software/updates?) on your computer from the time the GUI changed? What veresion of Scope are you using? Also, which configured acquisition.cs file are you using? Can you give me the path for the file?

 

Jason L.

Product Support Engineer
National Instruments
0 Kudos
Message 10 of 14
(5,782 Views)