08-03-2017 01:57 AM
Hi, I want to save mili second time in text file.
I make VI and attach my VI.
My Vi receive data every 2ms.
But, time stamp is not saved every 2ms.
I attach my data file. why is this error occur?
08-03-2017 02:19 AM
Hi Sangkyu,
that's how you calculate your "timestamp":
From timestamp (in seconds since 1.1.1900) you subtract an arbitrary number, then you multiply by 1000 (to convert to milliseconds?), then round down to nearest.
But in your datafile you get numbers like "1501773199168.680660"!? Why do you save the timestamp with format "%f", when you round to nearest? Why are there fractions at all, when you used round to nearest?
Beside these questions: GetDateTimeInSeconds uses the system clock and depends on the resolution of the system clock. Windows used to use a resolution of 15ms in ancient versions, now it uses 1ms.
Are you sure you get a new value each 2ms? Just transfering 17 bytes at 115.2kbaud takes 1.5ms - without any processing overhead…
08-03-2017 02:40 AM
I save the mili second time due to synchronize with android smart phone.
Android system time since 1940 years so i subtract 2082812409 and
multiply 1000 for mili second scale.
I don't need below mili second scale, so i round my time stamp.
I test my system send 2ms well.
My desktop OS is window 7.
System clock of Win 7 is 15ms?
Is this occur error saving mili second scale?
I have Win 10 laptop.
In Win 10 system, Time stamp save every 1ms?
08-03-2017 03:07 AM
08-03-2017 03:46 AM
In my file
Saved data is
1501773199169.68
1501773199169.68
1501773199169.68
1501773199169.68
1501773199169.68
1501773199169.68
1501773199169.68
1501773199170.68
1501773199170.68
1501773199170.68
1501773199170.68
1501773199170.68
1501773199170.68
1501773199170.68
1501773199170.68
1501773199170.68
1501773199170.68
1501773199170.68
1501773199170.68
1501773199171.68
1501773199171.68
1501773199171.68
1501773199171.68
1501773199171.68
1501773199171.68
1501773199171.68
.
.
.
actually, the time will save 2ms interval....
08-03-2017 03:59 AM
08-03-2017 05:00 AM
I make VI which is receive by VISA.
I send data every 2ms.
My data is 10 Channel , Fs=500Hz, T=1.024s square wave.
The data length calculate in Mathlab, is 10.442 sec.
L=5222(number of data)
T=1/Fs;
t=(L-1)*T;
But, The timestamp which 'Get date/time in seconds function' in Labview is 9.316740478515625sec
The value was Last Value - first Value of time stamp.
I think data of 'Get date/time in seconds function' is saved every 2ms, but the saved data is very strange.
The same data is stored multiple times.
I test this VI both Win7 PC and Win 10 PC.
Why 'Get date/time in seconds function' not return the value at every while loop?
I attach my VI and data file.
08-03-2017 05:10 AM
any difference to your other post?
https://forums.ni.com/t5/LabVIEW/Error-of-Get-date-time-in-seconds-function/td-p/3669957
08-03-2017 05:13 AM
Attached data file is different.
I think that this data file will explain my problem well.
08-03-2017 05:16 AM
can't open your vi, i guess because of the "strange" characters.
please use only ASCII in filenames since it saves a lot of trouble.