LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

tektronix 3052b timestamp question

Solved!
Go to solution

I think this question will apply to many if not all scopes' interface to LabView, but this is the one I happen to be using.  I have managed to connect the scope to LabView through the network, and can run the demo applications pretty well. 

The particular test that I'm running is one that waits for a particular trigger to come along, after which is captures 10,000 samples in increments of 1 microsecond each. 

If I bypass LabView and directly export the data file, it has a timestamp that is accurate; recording begins at -40 microseconds (that is the point that the scope begins to save the sample) and runs out through the following ten milliseconds of time.

The timestamp that is acquired by LabView, though, is formatted in this format:

7:00:00.009 PM
12/31/1903

 

I have been able to noodle around with settings in the Waveform Time to Date Time String block diagram, and get the display on the screen to show microseconds by entering a string "%6u" in the format date/time string time format string.  However, there are two remaining issues:

 

1. the string that is exported to Excel ends up still displaying the calendar stuff.  No amount of playing with settings in Excel will permit me to reduce the string to a simple integer representing the number of microseconds that have elapsed

2. the starting point - t0 - always defaults to '0', which means that the data are not aligned to the correct microsecond in the graph of the waveform.

 

 

I have seen some examples in the support files online, and this is how I got to the point of being able to display microseconds.  Nobody seems to have grappled, though, with the problem of simply permitting the number output by the scope as "t0" to be passed through to the spreadsheet file.  Anyone got any ideas?  It's kind of getting to me...

 

Thanks,

 

Danielle

 

Thought this might help; the graph on the screen updates correctly, but the spreadsheet contains too much junk and not the right format or starting point on time (see attachment)

 

Message Edited by danielleoh on 01-07-2010 02:40 PM
0 Kudos
Message 1 of 6
(3,605 Views)
That pdf file tells us nothing on how you are formatting the data or writing the file. LabVIEW does not acquire any timestamp unless you write the code to do so. It appears that you are not and are not correctly passing the data to whatever file write function that you are using. Posting an image (con't convert to pdf) or better yet, the actual code would help.
0 Kudos
Message 2 of 6
(3,591 Views)

I am a newbie so please forgive me if this is obvious.

 

First image, below is the standard implementation of a waveform graph, as included in the scope driver files.  The cluster consists of two dbl and one 1D array of dbl.  The two dbl are x start value and x increment; the array is the waveform array.  The second image shows exactly what I want to be able to output to my spreadsheet (as two columns); the waveform with proper time stamp that is simply the starting x, incremented the correct number of times by x-increment value.

I've tried a number of things but they were all complete failures.  Most recently I was trying to tap directly into the cluster that is being sent to the Waveform Graph and translate it into an array, using Cluster-to-Array.  The data types don't match, apparently, so it doesn't work.  Other attempts included using sample code to extract a time stamp, but this gives me a date and does not refer to x start or x increment (note that the time is in microseconds, so the date is kind of beside the point).  Any thoughts?

 

Thanks,

 

Danielle

 

 

waveform graph use.JPG

scopescreen.JPG

0 Kudos
Message 3 of 6
(3,545 Views)

The key is to avoid the Write to Measurement File or Export Waveforms to Spreadsheet File functions. These convert the x start and x increment to timestamps and this is not what you want. The solution below creates an array of relative times and uses the Write to Spreadsheet File so nothing gets converted to something else. You did not specify the version of LabVIEW so I saved it to 8.2.

 

 

0 Kudos
Message 4 of 6
(3,541 Views)

Thanks Dennis.  That fixed the initial problem; one more issue, though.  The output is now fixed at three digits past the decimal point.  Can I make that six?  If not, is there a way to manipulate the numbers (multiply by 1,000,000) and then have the list state the time in microseconds? 

 

Thanks!

 

Danielle

0 Kudos
Message 5 of 6
(3,492 Views)
Solution
Accepted by topic author danielleoh

You can have whatever precision you want. Just change the format specifier.

 

If you have no idea what that means, turn on context help (which you should have on at all times, anyway), and move your mouse over the Write to Spreadsheet File.

0 Kudos
Message 6 of 6
(3,486 Views)