LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Waveform convert to XY Graph

Hello,

Attached is picture the I coded.

 

Jose_LabVIEW_0-1680761744532.png

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

 

0 Kudos
Message 1 of 3
(746 Views)

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…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 3
(727 Views)

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.

 

altenbach_0-1680883131713.png

 

Note that for an array of waveforms, you would need another bundle, of course.

 

altenbach_0-1680883392512.png

 

 

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.

 

 

0 Kudos
Message 3 of 3
(684 Views)