09-22-2018 10:41 AM
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.
Solved! Go to Solution.
09-22-2018 11:27 AM - edited 09-22-2018 11:37 AM
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.
09-22-2018 11:38 AM - edited 09-22-2018 11:41 AM
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.
09-22-2018 12:20 PM
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
09-22-2018 12:39 PM
@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)
09-22-2018 01:02 PM
@Bob_SchorAltenbach 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
09-22-2018 01:46 PM
Because they are all time waveforms in the waveform palettes.
The FFT is not a time based waveform but a frequency based waveform.
09-24-2018 12:16 PM
Thanks altenbach, very clear and complete.
Additional question, is it possible to set dt a negative value?
09-24-2018 12:21 PM - edited 09-24-2018 12:26 PM
@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! :))