LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Problem displaying correct x-axis/y-axis data

Solved!
Go to solution

Hello,

I'm a labview beginner..I have a problem with an xy graph of a cluster of 2x 1D Arrays. x-axis is a time axis and it starts at 45 sec, then 75, 105,....The arrays have the size of 1008678. Problem:The graph links an incorrect order of the x-values to the given y-values. I tried to plot the graph with another time values but with the same delta-t (30sec) starting from 0 sec, just to show u here how i expect my graph to look like. I hope that u can help me! thanks!

0 Kudos
Message 1 of 17
(4,670 Views)

Hi sarah,

 

the problem should be within your VI. You need to debug your VI!

 

Well, you could attach your VI here so we could look into it too - but you didn't so far…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 2 of 17
(4,649 Views)

Looking like the x and y arrays are exchanged (Guessing, try interchanging and see if it works)
-Post VI to check exactly not image.

-Start with below links to learn about LabVIEW programming and post VI/snippet which you tried and where you are stuck exactly.

NI Learning Center

NI Getting Started

-Hardware Basics

-LabVEW Basics

-DAQ Application Tutorials

 

3 Hour LabVIEW Introduction

6 Hour LabVIEW Introduction

LabVIEW Graphical Programming Course

Thanks
uday
Message 3 of 17
(4,628 Views)

Are you sure you want to show the lines and not just use it as a scatter plot?  Click the little picture of a while zig-zag up near "plot 0" and you can turn off the lines, and increase the size of the points.

 

Alternately, you could sort the arrays so that the values all come in the order you want them in.  There's a pre-made VI to sort a 1D array.  If you want to use it to sort 2 linked 1D arrays, you have to bundle each point into a cluster and then sort the cluster of arrays.  It'll sort based on whichever element in the cluster is at the top of the bundle function.

Message 4 of 17
(4,621 Views)

Thank you very much for your reply. sub vi is attached!

0 Kudos
Message 5 of 17
(4,599 Views)

thank you for your reply and for the links. no, they are not exchanged.. thought that too at the beginning. sub vi is attached!

0 Kudos
Message 6 of 17
(4,596 Views)

thank you for your reply. I want to show the lines not the points. I zoomed the curve and saw that the order of the points is not correct..and that is only when I take this 1D array as an x-axis. It works normally with other values of other input arrays to the sub vi (i use the vi for other input x and y axes). I will try the sorting, but I can see the correct order inside the array when I indicate it .. so how comes that the order is not correct?

0 Kudos
Message 7 of 17
(4,591 Views)

Hi max,

 

does it makes sense to plot a million points (or even "lines connecting points"!) on a graph which is only ~200pixels wide?

Does it make sense to wire a numeric array to the "attributes" input of a BuildWaveform node?

Why do the index arrays not use the I32 datatype?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 8 of 17
(4,589 Views)

1. hi! no it actually doesn't. Question: is there any method to plot so many points? and why do I get such an xy graph (right) where the sequence of the points is incorrect?

2. Does it make sense to wire a numeric array to the "attributes" input of a BuildWaveform node? also no. I just made this to show how I expect my xy graph to look like.. but I normally don't use it.

thank you.. and please excuse my beginner mindset:)

 

0 Kudos
Message 9 of 17
(4,581 Views)

Hi max,

 

why do I get such an xy graph (right) where the sequence of the points is incorrect?

In which way is the "sequence" incorrect?

See the attachment, reduced to examine just this graph…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 10 of 17
(4,576 Views)