04-06-2023 01:19 AM
Hello,
Attached is picture the I coded.
I found this example here: https://forums.ni.com/t5/Example-Code/Waveform-Data-Plot-to-XY-Graph/ta-p/3524278
But, in the example it has a for loop which I removed, see my picture. The trouble with the one I coded up is that the data is centered at zero. For example, if the waveform goes from 0-4, the XYGraph goes from -2 to 2. What do I do so that the X range is the same as in the waveform?
I also circled the upper shift register, in the image, because it doesn't seem to have any purpose?
thanks
04-06-2023 02:42 AM
Hi Jose,
@Jose_LabVIEW wrote:
I also circled the upper shift register, in the image, because it doesn't seem to have any purpose?
IMO the upper shift register is ok, but the lower one is problematic!
The whole FOR loop should be replaced by the WfmGetTimeArray function: this one is delivered and tested by NI…
04-07-2023 10:59 AM - edited 04-07-2023 11:07 AM
Can you explain the point of all this?
Why do all that data gymnastic just to display data that has constant dx on an xy graph where a simple waveform graph would show exactly the same?
(I hate to tell you, but "NI verified" does not really mean much in terms of reasonable code, it just means that certain cosmetic requirements are met)
If it is really just for an xy graph, here's what I would probably do.
Note that for an array of waveforms, you would need another bundle, of course.
Also note that for very large waveforms, the constant addition of dt has the potential of accumulating more rounding errors due the the limitations of computer math. it might be safer to multiply dt with [i] and add t0. No shift register needed.