From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

strange behavior of an array

I'm writing a program to read data from a nanovolt meter and write it to a file. In order to speed things up a bit, I'm trying to put the voltmeter data into an array and then every 1000 measurements, write the data to a file. (Originally, I'd write each pair of points to the file as they were read from the instrument). However, for some reason, the voltage reading is fine, but the value in timenow[arraycount} appears to stay constant (within a few milliseconds) until the elapsed time of the experiment reaches whatever the value is. For example, if the value in timenow[arraytime] is 30 seconds, the array is filled with 30 until 30 seconds has passed, at which point it fills correctly.

However, the point plotted on my graph is corr
ect (i.e. if 10 seconds has passed and my y value is 25 mV, then the point 10, 25 is plotted while the value 30,25 is saved to my file).

If anyone has any ideas what I may be doing wrong, or why things are behaving this way, I would be much obliged for your comments.

thank you,

John Nordling
0 Kudos
Message 1 of 2
(2,499 Views)
Sorry all. I figured it out (finally). It was a mistake in the way that I was controlling the rate at which data was gathered. Sorry to bother y'all. (i'm teaching myself C as I go, so sometimes I still make foolish mistakes.)

-John
0 Kudos
Message 2 of 2
(2,499 Views)