Counter/Timer

cancel
Showing results for 
Search instead for 
Did you mean: 

How to log corresponding time of readouts using the C code

Hi Joe,

 

Your point is well taken. But the problem is whatever the setting of the sampling rate, the start and end times are showing to be the same.

 

Now I'm suspecting this..... You could comment on it though.

 

The code runs for 10 seconds. And the sampling rate is 1000 smaples per second. So in 10 seconds run, I get a total of 10,000 samples.

What I want is actually the beginning or end time of each second of the ten seconds. What it given me is the beginning or end time of the

whole ten seconds run.

 

Regards,

Kichew

0 Kudos
Message 11 of 14
(2,838 Views)

Hey Kichew,

 

Where are you setting the endTime in your program? I couldn't seem to find it. And what are the actual values you are getting for the startTime and endTime? Are you still just getting 0? Even if you are getting the time for the whole ten seconds, you should still be able to get the elapsed time and then divide by the total samples (10,000 samples) and get the increments that you need.

 

Let me know.

 

Joe S

Applications Engineer

National Instruments

 

0 Kudos
Message 12 of 14
(2,823 Views)

Dear Joe,

 

What actually happens is that both the endTime and startTime are the same numbers. If I had got a different number for the endTime, right then I could divide it with the number of samples. But I get the same number so dif =0.

 

Regards,

Kichew

0 Kudos
Message 13 of 14
(2,819 Views)

Hey Kichew,

 

I wasn't able to find where you set endTime in the code that you posted earlier. Are you still using that same code? Where are you setting the endTime at?

 

Joe S

Applications Engineer

National Instruments

 

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