03-24-2023 01:49 AM
Hello all
The program performs frequency sweeps, say f1 to fn, which have a constant duration. During the sweep it plots onto a waveform chart the measurments as a function of frequency not time. I've used the offset and multiplers to have the chart plot each measurement point at its assigned frequency. Using the scope update mode I will get sweep by sweep plotted as I need it. Amplitude over Frequency, for those familiar, similiar to a network analyser.
Now I'd like to plot multiple sweeps as such. That is, I'd like that after the first sweep is ploted, the second, third and so on will be stacked onto the same chart however keeping the same x-axis and not sliding.
I've tryed the to use a graph but I can seem to find a "native" - I can envision a solution using a python node - labview solution that would dynamically [sweep after sweep] add the results of each sweep to the graph. Can anyone suggest anything? Thanks D.
Solved! Go to Solution.
03-24-2023 02:30 AM
Hi Daniel,
@Daniel_Novo wrote:
Now I'd like to plot multiple sweeps as such. That is, I'd like that after the first sweep is ploted, the second, third and so on will be stacked onto the same chart however keeping the same x-axis and not sliding.
This is not supported (in a good way) by a chart. (You might try to reach this goal with an array of waveforms…)
@Daniel_Novo wrote:
I've tryed the to use a graph but I can seem to find a "native" - I can envision a solution using a python node - labview solution that would dynamically [sweep after sweep] add the results of each sweep to the graph.
Why do you think you need a Python code to add plots to a graph?
Build an array of waveforms and plot it on a waveform graph!
03-24-2023 06:37 AM
Because in python I can see a path to slicing up the data streaming in from the sweeps into new arrays and stackin'm up the way I need them to be plotted. I'm not saying it is a sure thing. Specially because I would need to figure out how to get labview's APIs to plot the data as I want it. Having the python node do the ploting is something I can't imagine. But it would open up all the possibilities of matplotlib .
It was already a bit of misuse to get the chart to plot amplitude over frequency the way I need it. I'm inexperienced with labview and through there was a hack out there.
Thanks.
D.
03-24-2023 06:56 AM
Hi Daniel,
@Daniel_Novo wrote:
Because in python I can see a path to slicing up the data streaming in from the sweeps into new arrays and stackin'm up the way I need them to be plotted.
Each sweep should result in a waveform. All you need to do for "stackin'm up" is to create an array of waveforms…
03-27-2023 04:20 AM
Slicin'em up seems to work fine using the wafeform work around. It might not be as intuitive as using indexes but using time instead to perform the slicing works just fine.
The stackin'em up bit took me a while also. Not as intuitve. You need a feedback node to get the append API to do its thing.
Slicin' - waveform
stackin' - feedback node ond the append api.
Those are the workarounds to avoid a python node.
Thanks. D.
03-27-2023 04:52 AM
Hi Daniel,
@Daniel_Novo wrote:
The stackin'em up bit took me a while also. Not as intuitve. You need a feedback node to get the append API to do its thing.
Slicin' - waveform
stackin' - feedback node ond the append api.
Unfortunately you forgot to attach your code aka VI: what is the "append API"?
@Daniel_Novo wrote:
Those are the workarounds
to avoid a python node.
to implement basic LabVIEW code…
03-27-2023 06:12 AM
Well... sorry. I meant "build array".
03-27-2023 06:21 AM
03-29-2023 12:37 AM
Hello GerdW,
Any tips on how to clear the content of the appended array? It seems only when I shut down the VI it get's cleared. I've tryed passing the content to an array indicator and then reseting, deleting, assigning a empty array constant to it but nothing seems to erase the pre-existing wafeforms from the array. The waveform history is always cleared. The graph is "reset" or cleared on command. But as soon as I restart to sweep, all the old sweeps get plotted once again. I wanted it to start anew.
I thought of trying to pass the content of this dynamic array into a sub-VI called when the sweeping starts and then kill it when the sweeping stops to make sure the memory slot used by sub-VI is not there anymore. But I wondered if there is a more elegant way of dealing with this "ghost" data.
Thanks. BR, D.
03-29-2023 12:43 AM
Hi Daniel,
@Daniel_Novo wrote:Any tips on how to clear the content of the appended array?
There are no "ghost data"!
LabVIEW basics: Data are stored in wires and feedback nodes/shift registers!
Please THINK DATAFLOW: you need to clear the content of the feedback node by writing an empty array into it…