LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Acquisition time recording problem...

Hi buddies!
 
I have to do a program which permits me to get some datas from multimeter measurement. This program contains a delay time for the acquisition datas which are written both in a spreadsheet file and in a table.
My problem? In my table and in the created excel file, i don't get the data acquisition time but just the datas (that's not so bad). In the excel file i have the Universel time linked with my computer and in my table there is a date which is
 
"12/31/1903"
 
so : ??????
 
First, I'd like to change that and just have both a real date (not 31/12/1903 but for instance a date i can change to the current date) and the acquisition time of my program ie from the moment i decided to run it till end of acquisition i have decided either by stopping manually the programm or by the number of acquisitions. And if it were possible, having that both in my excel file and in my tablewould be perfect.
 
Thank you in advance, and i hope i have been well understood lol!
 
Daron
 
 
 
 
0 Kudos
Message 1 of 11
(5,537 Views)
Hi Daron,

I ran your code on my system and didn't see anything out of the ordinary. The time axis in the Excel spreadsheet had numbers with the following format: 06-01 14h27m05. That seems to be what you specified.

If you open the mesure.xls file in Notepad or some basic text editor, do you see anything weird? I'm wondering if this is some strange setting in Excel.

Could you maybe include a screenshot or an example of the text file that demonstrates the weird behavior?
Jarrod S.
National Instruments
0 Kudos
Message 2 of 11
(5,519 Views)
Daron,

For some reason I cannot open your vi (just plain won't open), but 12/31/1903 is the default that LabVIEW uses for time.  "Get Date/Time in seconds" returns a "timestamp of the current time measured as the number of seconds that have elapsed since 12:00 AM, January 1, 1904" (which is the 'same' as 12/31/1903).

Maybe you've got the timestamp wired up in some way that would produce your error?

Just something that occurred to me.
0 Kudos
Message 3 of 11
(5,515 Views)
Hi Jarrod and Novatron!
 
First of all, thanks a lot guys for having answered me.
I have changed my program, it runs better. Concerning the excel file i succeeded in changing some things in my loop. Now i just want to had a fisrt line in my excel file, but as soon as the program running acquires the datas, the rpogram adds the first line i want him to written just one time.
I mean I just want in the first row, the topic of each column.
I just want this line to be written one time, and then every datas must be written in rows, each data for each column The example explains it very well.
 
Then i always get the same problem about the Universal time 12/31/1903 in my front panel and i don't know how to manage that.
I have tried to access to the write a table sub vi but no such a parameter can be changed... 😞
 
Thanks for your help
 
I'm waiting for your suggestions...Smiley Wink
 
Sincerely
 
Daron
 
PS : Jarrod enclosed the screenshot showing my problem concerning the time...
0 Kudos
Message 4 of 11
(5,506 Views)
Once again, for some strange reason I can't open your vi...  Is it in version 8?  It doesn't give me the error message about being created in a newer version though.

Anyways, just looking at your excel data, I got the impression that the "Date, Acq. Time, Delay, Measure" is inside the same loop as the data.  If that is the problem, remove it from the loop and re-add it before the loop, so that it is only included in the data to be written once.




Message Edited by Novatron on 06-02-2006 03:37 PM

0 Kudos
Message 5 of 11
(5,498 Views)
Ok Daron, your problem is much clearer now. First, concerning the Excel file, you keep rewriting Date, Acq Time and Delay every iteration of the loop, so that's why it shows up in every row of your Excel file. Only write the header information once outside the loop where you open the file, and inside the loop only write your data values. That will solve this problem.

Second, concerning the XY table, you have selected in the Build XY Graph Express VI (Construire une Table) to include time information in the XY graph, but then you didn't wire in any time information. You only wire in a 1D array of scalar values. The include time information option tries to obtain this time information from the data itself, not from the current date/time. To use this option, you will need to wire in data to the express VI that includes time information, such as Waveform data. Waveform data includes not only the 1D array of Y-values, but also a t0 (initial time) and dt (time between acquisitions) value. Look in the Waveform palette for the Build Waveform VI. This function operates much like the Bundle function for clusters, and will help you build a waveform from your 1D array.

Alternatively, you can just build the XY data yourself and not bother with this Express VI. All a table is a 2D string array. All you need to do is convert your data into strings. I will include an example of both these options. Because you are using the French version, it might not be able to find my Build Table Vi (I couldn't find your Construire une Table VI), so just ignore it and replace it with "Construire...". But you will get the idea of what to do.

Jarrod S.
National Instruments
0 Kudos
Message 6 of 11
(5,473 Views)

Dear Novatron,

Thanks for your help

Actually i'm using the labview 8.0 version. Dunno if this helps for you.

For the moment i haven't been able to solve the problem about my first row in excel, i don't know how and where to wire... :s

Thank you

 

Daron

0 Kudos
Message 7 of 11
(5,453 Views)

Hi Jarrod!

Thank you very much!!!! :d

I succeded in writing my datas in excel thanks to you, but know i have just a problem concerning the data acquisition time which is acquired.
First, i can just have information of elapsed time in seconds but i would like it to be in milliseconds too.
Second, there is a delay between the moment i click to run the program and the effective measurements (about 1second, it is visible in the two first rows in my excel file).
 
Third, i have also seen that there is a delay too when i want to change the delay time whereas the program runs...
Furtheremore, if my delay time is under 500ms, the data acquisition time is false
Thus, how can I make it better? How can I say to my program to be more precise about the synchronisation? (till "100ms" measurements or less??)
 
Endly, as i have said to Novatron, my first row isn't written yet 😞 I don't know where to wire it... sorry for being such a noob, but you guys are my only source of inspiration :d
 
Do you have something which can help me for that?
 
Thank you
 
Daron
Download All
0 Kudos
Message 8 of 11
(5,452 Views)
Hey!!
 
Well guys i succeded in introducing the first row.
 
My only one problem now is the switching of "delay acquisition time" during acquisition. The delay between two differents "delay acquisition time"  is so long that my program makes two measurements with a wrong "delay acqusition time". With the program enclosed, we are able to see that if we switch the "Delay Acquisition Time" after 20 measurements for instance from 500ms to 1000ms, thanks to the data acquisition time record in the excel file, we can see that there is a delay...
 
If you can help me to change that it will be very good.
 
In the same time, the precision of the measurements when converted in the excel file are just 10^-3 i mean for a 0.0254893mV measure, i get 0.025 in Excel. Is it possiple to have a better precision? How?
 
Thank you in advance
 
Best regards
 
Daron
0 Kudos
Message 9 of 11
(5,435 Views)
When you convert the numeric data to a string using Number to Fractional String (je ne sais pas, que l'on dit en francais), you have an input called Precision. Set that to a higher number for more precision.

I'm sorry, but I really don't understand the other question about the delay. Could you give an example?
Jarrod S.
National Instruments
0 Kudos
Message 10 of 11
(5,429 Views)