Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

Detect TTL signal using configured acquisition

I've attached my code below. I have already included the sampling rate in my code. What shall I change in my code to increase the data acquistion rate? Please help...

0 Kudos
Message 11 of 30
(1,971 Views)

Hi Paritosh,

 

You will need to call niScope_ConfigureHorizontalTiming. What language are you programming in? I know that we have some examples in different languages for this type of configured acquisition, and I can try to find one in the language you are using. 

 

Regards,

Travis Ann

Customer Education Product Marketing Manager
National Instruments
0 Kudos
Message 12 of 30
(1,958 Views)

I am using C# in visual studio 2008. Can you provide me some example for this one? Thank you..

0 Kudos
Message 13 of 30
(1,951 Views)

Hi Paritosh,

 

You will find examples in the NI-SCOPE .NET Class Library. The specific example that I think you would find helpful is "Configured Acquisition" in the cs folder. If you don't already have it, you can download the NI-SCOPE .NET Class Library from here, you will choose the one that works with your OS. Also, incase you need some extra help finding the examples, the following link should help you navigate there. 

 

Using NI-SCOPE with C# and Visual Basic .NET

 

Regards,

Travis Ann

Customer Education Product Marketing Manager
National Instruments
0 Kudos
Message 14 of 30
(1,943 Views)

As you can see from my attached code that I am also using the configured example program for dot net with some modifications of mine. The parameters of function you suggested i.e.  niScope_ConfigureHorizontalTiming is already inputted in my program which is similar to the "Configured acquistion" example for dot net. Do I still need to use this function although I've already declared those parameter in Scopesession in my program, if so do I need to wrap niscope.h to use this function in my C# code? 

0 Kudos
Message 15 of 30
(1,934 Views)

Hey Paritosh,

 

Travis Ann pointed you to the class library for NI-SCOPE with .NET. You should be able to use this class library for your programming as you've been doing in the code that you attached. There won't be a need to wrap since you wouldn't be using the niScope_ConfigureHorizontalTiming c function but rather the function in the .NET library.

 

It looks like the configureHorizontalTiming function takes in the ViSession vi, ViReal64 minSampleRate, ViInt32 minNumPts, ViReal64 refPosition, ViInt32 numRecords, ViBoolean enforceRealtime. These parameters are used so that the horizontal timing is configured with all of these properties, so if you're having issues related to this configuration, then you would still have to use this function in there. 

 

 

Lea D.
Applications Engineering
National Instruments
0 Kudos
Message 16 of 30
(1,914 Views)

Setting those parameters are already there in configured acquisition.cs, isn't it? As you can see in the code, I've already set those parameters in my code but still the data acquistion process is slow. So since you said I don't need to wrap as I am going to use the function in .NET library, I want to ask, which function shall I use and in what way to speed up the data acquistion time?

0 Kudos
Message 17 of 30
(1,910 Views)

Hi Paritosh,

 

That's right, the parameters should already be set in your configured acquisition.cs file.  When you say that your data acquisition process is slow what do you specifically mean?  Is the reading of the samples slow?  Is the processing of the data slow?  What sample rate do you use to read in your data?  

 

Regards,

 

Marcus 

Marcus M.
PXI Product Support Engineer
National Instruments
0 Kudos
Message 18 of 30
(1,889 Views)

The default sampling rate is 1 MHz and I've used that as well. So basically reading of the samples is very slow. Doesn't it have to be 1 MHz when I set that value? I am getting 500 samples per signal. Please help..

0 Kudos
Message 19 of 30
(1,882 Views)

Hi Paritosh,

 

I first want to clarify that you are running the DotNet Scope example ConfiguredAcquisition.2008.sln. If so, what is the Actual Sample Rate that the card is running at? Can you post a screenshot like the one below? Also, what sample rate do you want to see?

 

pic.jpeg

Regards,

Travis Ann

 

 

Customer Education Product Marketing Manager
National Instruments
0 Kudos
Message 20 of 30
(1,874 Views)