Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

Do the internal Ni measurement functions initiate a new acquisition everytime?

I am trying to using the NI internal measurement functions with my NI 5112 Scope card and I also want to output the waveform array that they measurement function(s) is using to calculate the values. From my testing it seems as though everytime I have the NI internal measurement functions calculate anything, it is internally starting a new acquistion, which is not desirable for me, since I want all calculations to be on the same waveform array, else I can't be sure that they readings are happening at the same time. Also, I would like to output that waveform too, so that I can be sure that what I am plotting on screen matches the calculated values.

 

Here is an example of what I am doing:

 

I call the Voltage Low, and Voltage Min measurements and want to output the waveform and the measurement values. Here is what I do step by step:

1. Initiate Acquistion

2. Fetch Waveform and save in an array

3. Call the Voltage Low Function

4. Fetch waveform and save in an array

5. Call the Voltage Min Function

6. Fetch waveform and save in an array.

 

When I compare the 3 waveforms they do not match.

 

Can someone please help me here? I am not initiating a new acquisition, so the NI5112 should not be grabbing a new waveform array, so why are the 3 arrays not matching?

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

Hello,

 

From what I can tell you are simply initiating the acquisition and then doing some processing on each sucessive Fetch call. When you call the Fetch function, it does not mean that the data that is returned by that function is going to be the same. I'm not sure why you think that each call to the Fetch function is going to give you the same data. Is your overall acquisition finite? or continuous? You should make sure to check on this, and if it is finite, how many samples you have configured to acquire in your entire acquisition. Also, check how many samples you have configured to fetch each time you call the Fetch function. If you are fetching less than the number of samples your acquisition is configured to sample then you will get different data each successive fetch. 

 

If you are trying to take one acquisition and save it to an array and perform the Low and Minimum functions to that array why not create new variables to store the otuputs of that data so that your waveform data array is not manipulated after being used by either of those functions.

 

Chris W

0 Kudos
Message 2 of 4
(3,378 Views)

So, you're saying that the NI SCOPE hardware, will give me a different waveform everytime I call the Fetch Command and everytime I call a different NI measurement call? That means that there is no way for the NI hardware to internally insure that the measurements are being calculated with the same waveform, correct?

 

I can certainly, grab the waveform and store it myself to insure that the waveform is not changed in between measurement calculations, but I want to know if the NI hardware is capable of handling this task.

 

 

0 Kudos
Message 3 of 4
(3,363 Views)

As an example of what I was explaining, let's say you have the number of sample that you acquiring in a finite acquisition be 1000 and in your fetch function you specify you want to fetch 500 points. The first time you call the fetch function, you will be taking the first 500 of the total 1000 points that will be acquired in your entire acquisition, and moving those 500 points from your Scope's onboard memory into PC RAM. The next time you call the fetch you be retrieving the second set of 500 points to the PC RAM . These two sets of 500 points together comprise the full 1000 points of your acquisition.

 

The functions that you described, like the Min and Low functions, are performed on the data once it is in your PC memory. So, if you are calling the Min function, for example, directly after you call the fetch function the first time (with 500 points), you will only be perform the Min function on that first set of 500 points that were retreived to your PC memory. If you then call the fetch function one more time and then call the Min function you will be performing the Min function on that second set of 500 points. This is why I say you need to make sure that you are performing the Min and Low functions on the same set of data in order to get anything meaningful. If you make sure that when you call your fetch function you are retreiving all your data then you can do whatever processing on that data and if you store that data properly, it will be the same data that you are analyzing each time. I hope this helps.

 

Chris W

0 Kudos
Message 4 of 4
(3,348 Views)