LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

waveform offset

Hi,
 
I'm currently using a HP 8594E Spectrum Analyzer in my vi. The point of my vi is to plot whatever is on the Spec. Anal. screen onto the front panel of my vi and then save that plot's data into a file. I wanted to compare the graphs of the plotted waveform with that of the saved waveform. They look the same, however the saved waveform has an offset. It seems to start at 0 and not at the start frequency that is on my spec. anal. Do you know what could be the problem? I've attached a picture of this issue and my vi.
Thanks,
Sammy
 
 
Download All
0 Kudos
Message 1 of 9
(4,196 Views)
It would be helpful if you would include all of your VI, specially the ones that do the read and write. A sample of a data file would help. It would seem that the t0 and dt are not being being read or written.
0 Kudos
Message 2 of 9
(4,181 Views)
Hi Dennis,
 
I've included the vis for the read from masurement. Both of the vis for the write are the same. I didn't configure any of the internal settings for the read from measurement vis. The only thing I changed was the "call setup" when I right clicked the vi and I selected the "reload for each call" to avoid the EOF error. Hope this helps.
 
- Sammy
Download All
0 Kudos
Message 3 of 9
(4,172 Views)
Oh yea, also the lvm file that I write to actually has the correct X0 and dX. Could it be the build waveform vi in the top case structure? Maybe it doesn't allow you to plot negative x-axis values because it assumes that you're plotting time.
 
- Sammy
 
P.S. Attached is my lvm file that I write to. I saved it as a txt file b/c this forum does not allow me to attach lvm files.
0 Kudos
Message 4 of 9
(4,169 Views)
Smiley Surprised oops. i forgot to include the txt file. ha...sorry
 
Thanks!
Sammy
0 Kudos
Message 5 of 9
(4,168 Views)
I'm not sure if any of the express VIs are suitable to what you want to do. Using dynamic data or waveform data where conversions back and forth between numbers and time stamps can cause problems. You are right that you cannot have a negative time so when you do the first build waveform, it might all be lost there and certainly later when you read it back and then write again.

I'm curious why you even need to read it back and rewrite the file. The save to file case could simply have a file copy function in it.
0 Kudos
Message 6 of 9
(4,156 Views)
Hi Dennis,
 
Do you know how I should save negative frequencies from a spectrum analyzer? All the waveforms or graphs aren't really made for a frequency axis (especially for negative frequencies).
 
I read it back because my vi functions to let the user save what he has plotted onto the vi. I wanted to give the user the option to save what he's plotted when he wants to. Maybe if what he plots isn't what he likes, then he doesnt have to save it.
 
Since my vi is in a while loop, i had to create a temporary file for the plot to be saved in so I don't lose the graph's data points when the user does want to save the graph into a file. However, after reading your post. I think I'll just use a copy function. I didn't even know that there was one. I'll look into that. That actually makes things a lot easier. Smiley Happy
 
Do you have any ideas as to how I can plot negative frequencies and SAVE negative frequencies into a file where I can analyze using Matlab?
 
Thanks,
Sammy
0 Kudos
Message 7 of 9
(4,145 Views)
You might just want to use some of the other file write functions. You can write a header with Write Text file and the data with Write to Spreadsheet File. These don't require any conversion to timestamps. It seems like the data is being plotted correctly when you bundle the data from the spec analyzer. I think it's just the dynamic and waveform data types that are messing you up.
0 Kudos
Message 8 of 9
(4,139 Views)
The LabVIEW timestamp format is capable of negative values - it is a signed, 128-bit fixed point number.  However, its integration into LabVIEW is still not complete, so you occasionally run into problems like this.  You can try the NI-HWS format.  It was written after the timestamp was introduced, so should handle negative values correctly.  You can find NI-HWS on your driver CD (all versions after fall 2004).

Why, you may ask, does the format handle negative numbers.  There are two reasons.  First, it was conceived as an absolute timestamp, and dates before Jan 1, 1904 do exist and scientists and engineers do use them.  Second, it is also being used as a relative timestamp.  For example, almost all relative timestamps from the NI-SCOPE API end up being negative.  You have a third use case - not a timestamp at all.  Be aware that is it a fixed point number with resolution on the order of 5e-20 and maximum value about 2e19.
0 Kudos
Message 9 of 9
(4,121 Views)