LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

saving absolute time for multi-channel acquisition

Hello,

I wrote a three channel data acquisition vi which you
can find the screenshot attached. My sample rate is 440 and number of
samples is 1300.I acquire 1300/3=433 samples per
channel. I'm saving the record time as you can see below. If you look at my saved
data you'll see that the time value do
not change very often.


Date Time Marker ECG BR GSR
28.12.2004 21:36:12.29 0 0,000000 0,170000 0,155000
28.12.2004 21:36:12.29 0 -0,030000 0,060000 0,075000
28.12.2004 21:36:12.29 0 -0,040000 0,110000 0,155000
28.12.2004 21:36:12.29 0 0,110000 0,165000 0,140000
28.12.2004 21:36:12.29 0 0,025000 0,055000 0,070000
28.12.2004 21:36:12.29 0 0,010000 0,115000 0,160000
28.12.2004 21:36:12.29 0 0,110000 0,160000 0,130000
28.12.2004 21:36:12.29 0 0,035000 0,055000 0,070000
28.12.2004 21:36:12.29 0 0,095000 0,120000 0,165000
28.12.2004 21:36:12.29 0 0,220000 0,155000 0,120000
28.12.2004 21:36:12.29 0 0,090000 0,050000 0,070000
28.12.2004 21:36:12.29 0 0,080000 0,130000 0,175000
28.12.2004 21:36:12.29 0 0,155000 0,155000 0,110000
28.12.2004 21:36:12.29 0 0,095000 0,050000 0,075000
28.12.2004 21:36:12.29 0 0,175000 0,140000 0,175000
28.12.2004 21:36:12.29 0 0,195000 0,145000 0,1050






Each change corresponds to the
acquisition of 433 samples in about 2.954 secons
(1300/440=2.954)
I want absolute time stamps of each 433 samples. I know that the way to do it is to grab the system time only once on triggering the acquisition. Then use the actual rate to generate a time increment and add to the trigger time for each data point. So the absolute time for any given data point would be:

Trigger Time + Sample Number* Sample Period

But I don’t know how to implement this to my vi.
I need your help.
0 Kudos
Message 1 of 5
(2,877 Views)
That's a modified version of part of your vi. Read the time only ONCE, then increment it before converting it to the time stamp string.

I believe you'll be able to adapt it...

CC
Chilly Charly    (aka CC)
Message 2 of 5
(2,867 Views)
Thanks it works.

But there is a little problem. Between 433th sample and 434th sample there is 2 seconds delay as you can see in the attachment. Is there a way to fix this.
0 Kudos
Message 3 of 5
(2,863 Views)
As I told you before, you are asking for 440 samples/s on 3 channels. Means that you will get a new value each 1/(440/3) seconds = 0.00681818 s, instead of 0.00227 s !!!!
That should solve your pb.

CC
Chilly Charly    (aka CC)
Message 4 of 5
(2,855 Views)
Oooops you're right,thanks.
By the way I kept my promise;)
0 Kudos
Message 5 of 5
(2,842 Views)