LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to get sample index continuously?

Hi, I am working in data acquisition of data translation dt9816. My problem is how to get the sample index?

 

I need the sample index for time stamp count from 0:

the calculation of time stamp is t_sample= t0 + i / sample rate ( where i = sample index)

 

I also attach my block diagram.

Best regards, citra

0 Kudos
Message 1 of 2
(2,290 Views)

I will rephrase: Do you need the number of samples already read before current iteration?

 

If you do not fix the number of samples read each time, you can calculate it, using array size, then add via shift registers

 

Several notes:

1) Your timing is set in hardware (via sample rate), and you use software timing functions to record time - use time calculations from index, according to your formula.

2) You read multiple samples (2D array supposes that), and add only 1 time point - you need to make an array of times.

3) As I suppose, the channels should be in columns, and time increase - in rows. So, when you add time points for samples, you should add column to the array - 2 transposes.

4) Your rate is rather high, besides you write strings, and you reopen file on each iteration. it is better to use streaming (open file before the loop, close after).

5) Do not you lose data when converting from double to decimal string?

0 Kudos
Message 2 of 2
(2,274 Views)