LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Time Stamp in Write LVM

How can the date/time stamp be reset when writing an LVM file.  The new_input starts a new file, but the date/time stamp is not reset (the first sample time of the new file is offset from the previous file).
 
The date/time stamp is reset when the the program is stopped and restarted, but I would like to do this programmatically.
 
Mike
0 Kudos
Message 1 of 5
(3,304 Views)
Hello,
 
If I understand you correctly, you are saying that the date/time stamp is current at all times, but you'd like to be able to change it or programmatically write it to some time, perhaps in the past, to account for conditions in your application.  One thing you could do, since you seem to be starting and stopping the application, is to use the get date/time function in labview at the start of your program, and then programmatically parse and replace the lvm file timestamp with your own after the file has been written.  You can do this with the File I/O VIs and the string parsing VIs.  If you have trouble doing this, or this is not an acceptable workaround, repost and we'll explore other options!
 
Best Regards,
 
JLS
Best,
JLS
Sixclear
0 Kudos
Message 2 of 5
(3,288 Views)

Let me add some details to the problem.... My observation is that the Write LVM Express VI on its first call writes the header which includes the date/time stamp.  If waveforms are present at that first call, it will write them along with their date/time stamp.  If the waveform date/time stamp is equal to the LVM header date/time stamp, the first "X" value will be 0.  The X values are the offset by: 

(the waveform date/time stamp + sample*dt)- LVM header date/time stamp 

On the second thru n call of the Write LVM VI, the waveforms are written with the X value following the equation above.  The process of writing the LVM file works great if the VI is currently stopped, run VI, VI writes data, and then Stop VI.  The next running of this sequence will correctly write the new file.

My issue is that I can not execute the Start/Stop VI sequence.  My Write LVM VI is in a loop with the Write LVM VI loop selected by a case structure.  What I need is to be able to emulate a first call to the Write LVM VI which will  assign the new filename and write the header properly (i.e. assigning a new date/time stamp based on the first call).  I've tried combinations of the new_filename and reset inputs to the VI, but these do not reset the date/time stamp in the header.   Any ideas to make the Write LVM work in this manner?  I would prefer to modify the existing Express VI or put some shell around it to perform this function. 

Thanks,

Mike.

0 Kudos
Message 3 of 5
(3,277 Views)
Hello,
 
Ok, if you'd like to update the date/time section of the header in your lvm file, you can use the attached file.  It will update it with the current date/time and use the same format as the lvm express VI.  Basically it scans for 8 linefeed characters, and then replaces the next two lines with an updated date and time.
 
I hope this helps!
 
Best Regards,
 
JLS
Best,
JLS
Sixclear
0 Kudos
Message 4 of 5
(3,264 Views)

Unfortunately, this doesn't help my problem.  This doesn't change the values in the X Value column as described in my previous note. The solution has to be in the way the Write LVM is executed in order to control the first call of this reentrant routine. 

Does anybody have any ideas?

Mike

0 Kudos
Message 5 of 5
(3,258 Views)