LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

change order of data in XY Graph

Hello to everyone,

 

I am not sure if i put the right name for this subject but i will try to explain my proble below:

 

We have a sensor and we are reading the voltage of the sensor and is 4.5v and we have another sensor which measuring the distance is going to be made from the other sensor.

 

When the first sensor starting to move the voltage starts from 4.5v and when it detects a metal plate the voltage starting to decrease and when is right above the metal plate is almost zero and when starting to pass above the metal plate the voltage increase again and reaches to 4.5v. With the other sensor we are measuring the distance made by the first sensor from the starting point (voltage of the sensor is 4.5v)  to the end point (the voltage of the sensor is  again 4.5v) and we want to create a XY Graph to correspondence the voltage to distance. The total length of the movement of the sensor is 0 mm Starting point to 240 mm End point. In the first pass of the sensor above the metal plate I am taking this image (see image XY Graph first iteration) which is what i expected, but when the sensor returning back to the starting point and passing again above the metal plate I am taking something I don’t like (see image XY GRAPH).The reason I am taking this is because the sensor which measure the distance starts from 240 to 0 which is correct but what I want to see in my XY GRAPH is:

 

First passing above the plate x-axis distance 0-240 , second passing above the plate return to starting point x-axis distance 240-480,third passing above the plate x-axis distance 480-720 ,fourth passing above the plate return to starting point x-axis distance 720-960 and so on.

 

So the question is how can I do that? Can please someone provide a code solution for that?I am also posting the vi I am using which will help more i think.

0 Kudos
Message 1 of 12
(4,355 Views)

Just add 240 to your second iteration's X-values, then 480 to the third iteration, and 640 to the 4th iteration X-values.

0 Kudos
Message 2 of 12
(4,326 Views)

Ok that's a thought,but how you can do that?I want to this done automatically not manual.

0 Kudos
Message 3 of 12
(4,322 Views)

Add 240*i to your X values.  i is your iteration index and multiplying it by 240 will iterate your starting X values in 240 steps.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 4 of 12
(4,314 Views)

Ok now i understand your meaning.I also have to change by a property node the x scale multiplier or not?

 

0 Kudos
Message 5 of 12
(4,311 Views)

i also notice by doing what you propose that my graph did not start from zero but from 1858? i don't understand why that?any suggestions?

0 Kudos
Message 6 of 12
(4,309 Views)

Hello and Good Morning,

 

I just try your suggestion crossrulz but it's not working as expected.The  data in the XY GRAPH are not presented in the right way i think,do a small example like the vi i give and you will see what is the proble.Any other possible solutions,suggestions please? 

0 Kudos
Message 7 of 12
(4,270 Views)

XY GRAPH PICTURE

0 Kudos
Message 8 of 12
(4,259 Views)

Hello to All,

 

The friend crossrulz propose a solution but after doing what you propose i multiply i*240 and add this to my X values it seams this is not working propelry.Am i doing something wrong?I am sending a photo of what i am seeing in my graph rigth now (name of photo XY GRAPH 1).What i would like to see is shown in the photo (IDEAL WAVEFORM).Can anyone suggest a code solution for my problem?I have try many things but still i can solve my problem. In the begging of this subject i post the code i am using right now.

Download All
0 Kudos
Message 9 of 12
(4,239 Views)

Hello to All,

 

The friend crossrulz propose a solution but after doing what you propose i multiply i*240 and add this to my X values it seams this is not working propelry.Am i doing something wrong?I am sending a photo of what i am seeing in my graph rigth now (name of photo XY GRAPH 1).What i would like to see is shown in the photo (IDEAL WAVEFORM).Can anyone suggest a code solution for my problem?I have try many things but still i can solve my problem. In the begging of this subject i post the code i am using right now.

Download All
0 Kudos
Message 10 of 12
(4,238 Views)