LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Can't get my x-y plot to work correctly

Solved!
Go to solution

I have followed the x-y example in the example finder and think i've done everything correctly but all i get when i run my RT vi is a vertical line jumping up and down as the x and y values change. I would like to have a decent x-y plot like the example shows. Attached is the portion of the code i wrote. The portion resides in a while loop. Also, the data wired to the bundle have been manipulated (i.e. i applied a formula to the raw signals i get from my encoder and pressure sensor (so i'm trying to get actual pressure vs crank angle). Can someone let me know what the possible issues could be? Thanks.

0 Kudos
Message 1 of 14
(3,501 Views)

here is a small example of a xy-graph hope it helps:

 

 

Harold Timmis
htimmis@fit.edu
Orlando,Fl
*Kudos always welcome:)
Message 2 of 14
(3,497 Views)

try putting you biuld array in pront of the bundle cluster.

 

 

Harold Timmis
htimmis@fit.edu
Orlando,Fl
*Kudos always welcome:)
Message 3 of 14
(3,489 Views)
That is one of the most useless images I have ever seen posted here. The build array make no sense and there is nothing else to view. Post the actual VI if you really want some help.
0 Kudos
Message 4 of 14
(3,488 Views)
Thanks Harold. I already tried the array in front of the bundle method, but no luck. The shift registers you used in the second example are the only thing i haven't tried yet. I'll try that and let you know if it works. Thanks for your help.
0 Kudos
Message 5 of 14
(3,459 Views)
Take it easy Dennis. Obviously, there are people here who are able to help with the little info i gave rather than get all pissed up about it. I already left my windows workstation for the night and don't have the vi on my mac. However, attached is a picture that shows more of the vi. Believe me, if this doesn't show you what you need to be able to help, then uploading the entire vi would make no difference.
0 Kudos
Message 6 of 14
(3,450 Views)

it would be nice to see your code only to try and fix it from this small bit you have givin us I can see a ton of confusing wires so if you could tomorrow or somthing post your code so ppl can go through it, and trust me most the ppl on this forum are here to help.

 

have a good one,

Harold Timmis
htimmis@fit.edu
Orlando,Fl
*Kudos always welcome:)
0 Kudos
Message 7 of 14
(3,445 Views)

Hi jaydee1,

what you are doing now is building a "single X-Y point" plot and overwriting the graph for every iteration of the loop. All previous values are lost. Not really nice to see.

 

Harold already put you on the right way with his second post: build the arrays maintaining all previous data. However, probably in the hurry of writing the example, he overlooked some details, so in my opinion a couple of corrections are needed:

1) the Y array (below) is built backwards with respect to the X array and this is not good

2) it's by far better (although not necessary in some cases) to initialize the shift registers with empty arrays in order to clear them every time the loop is run

 

Hope this helps

Paolo
-------------------
LV 7.1, 2011, 2017, 2019, 2021
Message 8 of 14
(3,430 Views)
thanks paolo
Harold Timmis
htimmis@fit.edu
Orlando,Fl
*Kudos always welcome:)
0 Kudos
Message 9 of 14
(3,424 Views)
There are people who could answer your problem immediately if you provide the correct information. Your first picture required some guessing. That is just wasting time. Upi might just have well said my VI does not work and left it at that. If you want help, provide a bit more detail than a an image that does not show how you are creating the x and y values. I now know what you've done wrong. It's obvious.
0 Kudos
Message 10 of 14
(3,403 Views)