LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Could waveform X-axis be other than time?

Solved!
Go to solution

I want to plot a scan waveform, the x-axis is current and y-axis is voltage. The current scan is linear so I just need to know X0 and dX, the voltage is an array of float data. It seems right to build a waveform with t0, dt and Y array, but seems build waveform only accept timestamp as x-axis input. Sure I can use xy graph instead, anyway,I feel un-necessary to save all the x data.

0 Kudos
Message 1 of 9
(3,770 Views)

Alternatively, you can set x0 and dx via a property node. You can also create a cluster of two scalars and an array (1D or 2D) to graph with the desired x-scaling [x0,dx,data]. You can convert any number to a timestamp, of course.

0 Kudos
Message 2 of 9
(3,761 Views)
Solution
Accepted by topic author mangoal

Here are three possibilities. All give the same result. (I typically use the middle solution)

Now all you need is to label the x-axis differently.

 

XScaling.png

0 Kudos
Message 3 of 9
(3,759 Views)

In Altenbach's post, notice the wire color of his three Waveform-like Clusters.  One is a 2-element Cluster (lacking X0) of Dbls, so is "reasonably" an Orange wire/indicator; one is a three-part Cluster of Dbls that includes X0, and it has a pink wire and indicator; and the last has the X0 value converted to a Timestamp, and has the brown appearance of a waveform.

 

Altenbach prefers the pink solution -- so does NI!  If you look in the Waveform Palette, you can find a routine that does an FFT of a Waveform and outputs a pink Cluster with components f0, df, and an array for spectrum magnitude.  Makes sense to me, too.

 

Bob Schor 

0 Kudos
Message 4 of 9
(3,739 Views)

@Bob_Schor wrote:

One is a 2-element Cluster (lacking X0) of Dbls, so is "reasonably" an Orange wire/indicator;  


No, the first one is a plain 1D array, setting the scaling with property nodes. (there is no 2-element cluster on my diagram)

0 Kudos
Message 5 of 9
(3,735 Views)

@Bob_Schor

 Altenbach prefers the pink solution -- so does NI!  If you look in the Waveform Palette, you can find a routine that does an FFT of a Waveform and outputs a pink Cluster with components f0, df, and an array for spectrum magnitude.  Makes sense to me, too.

 

Bob Schor 


Are you sure NI prefers the pink solution? I know I do, but when I look at the Waveform Measurements or Conditioning Palettes they all have the brown wire for the input.

 

mcduff

0 Kudos
Message 6 of 9
(3,728 Views)

Because they are all time waveforms in the waveform palettes.

 

The FFT is not a time based waveform but a frequency based waveform.

Message 7 of 9
(3,723 Views)

Thanks altenbach, very clear and complete. 

Additional question, is it possible to set dt a negative value?

0 Kudos
Message 8 of 9
(3,672 Views)

@mangoal wrote:

Additional question, is it possible to set dt a negative value?


Yes, but be aware that autoscaling might not work correctly under some conditions. (And don't try it for the waveform).

 

(It would have been faster to just test instead of asking here. Just reverse the ramp! :))

0 Kudos
Message 9 of 9
(3,670 Views)