LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Problem with the Datalog example-times were not same

I'm running the Write and Read Datalog Example.vis and have a question
about the time stamping issue.

1. Write Datalog File : How can I display absolute time in x-axis? Strating time
on the x-axis should be same as record time on the front panel but it is different.

2. Read Datalog Fie :Same as Wrire Datalog File. X-axis of graph does not start with
the time when the data was written.

Could anyone explain and how to correct this?
0 Kudos
Message 1 of 11
(3,799 Views)
I modified the example I think you are referring to.
I added a property node by right clicking the graph in the block diagram. Then you change the property node to write. Then you select X scale->then Offset.

You could also use a waveform chart in place of the graph and add a property node in the block diagram. With the chart you have an additional property for history. It might be better to use a chart when you open the data log file.
0 Kudos
Message 2 of 11
(3,791 Views)
To fentester,
Thank you for the syggestion.

My another concern is the ReadDataLog.
Could you tell me how to plot the stored data
(created with Write DataLog File.vi)plotted with
the absolute time (time of data generated) x-axis?
0 Kudos
Message 3 of 11
(3,777 Views)
Hello,

It sounds like you need to keep track of the timing information in the file as well. You don't have to use a datalog file, rather, you can write the start time to file and then your data. You will then be able to read that file; first you would read the start time, then the data. This would be sufficient especially if you know the time between data samples (you could write that to file too if necesssary). You can change the axis appropriately using a property node as in the example posted!

If you have any questions about how to do this definitely repost!

Thank you,

Best Regards,

JLS
Best,
JLS
Sixclear
0 Kudos
Message 4 of 11
(3,768 Views)
Dear JLS,
Could you post an example for a reading.vi.
Thank you.
0 Kudos
Message 5 of 11
(3,751 Views)
Hello,

I posted an example which does the following:

1. opens/creates a file
2. writes a start time to file and update the offset of the waveform graph inside the loop
3. writes the number of samples to be obtained to file
4. writes 100 samples five times to a waveform graph and to file
5. closes the file
6. opens the file
7. reads the start time from file and sets the x-axis offset of a waveform chart
8. reads the number of samples from file
9. uses that number of samples to read the data from file
10. displays all the data in a waveform chart and closes the file

Hopefully this helps. I realize the start time might not be precisely the time the loop starts iterating since the writes to file that are outside the loop take place in parallel to the writes inside the loop, but the idea of file writing and reading using scalars and arrays in the same file is hopefully clear. Notice that I do, by dataflow, use the start time to ensure that the loops don't start iterating ("acquiring data") until at least after the start time has been taken 😉 Also, notice that all the data is read at once while it is written in pieces; you don't have to read it all at once, but it shows you can. Of course, notice that the read part can be in a totally separate VI.

Repost if you have any other questions!

Thank you,

JLS
Best,
JLS
Sixclear
0 Kudos
Message 6 of 11
(3,735 Views)
oops, here's the VI 🙂

JLS
Best,
JLS
Sixclear
0 Kudos
Message 7 of 11
(3,734 Views)
I'm sorry but could you convert it into version 7.0?
Thank you.
0 Kudos
Message 8 of 11
(3,724 Views)
Saved to 7.0

Scott Y
NI
0 Kudos
Message 9 of 11
(3,708 Views)

This sounds similar to an issue which I am trying to resolve as well... could someone please post the example saved as a 6.0.2 version? some parts probably will not transfer very well, but I am hoping this is a fairly simple program, as I only have the Base Package without all the fancy stuff... (I am envious of the additional tools which I only hear about. )

Thanx,
Paul

0 Kudos
Message 10 of 11
(3,669 Views)