LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Can't get my XY graph to work

 My x axis and y axis are moving all over the place. I would like them to be fixed. I would like the Y axis  (force) to start at -100 and go to 100 with 0 being in the middle. For my x axis (linear displacement) I would like that to go from -1.5 to 1.5 with 0 in the middle.

 

Also, my current graph doesn't actually plot anything. All that happens is that my x and y axis values keep moving all over the place.

 

How do I plot a certain number over values over a certain amount of time with a fixed x and y axis?

 

This is an example of how I would like my plot to look;

 

This is how my plot looks;

Cap1.PNG

 

This is an example of how my plot looks when the x and y values change;

Cap2.PNG'

Here is my block diagram;

cap.PNG

 

Any feedback would be highly appreciated.

 

Thanks

0 Kudos
Message 1 of 7
(5,503 Views)

To fix your axes' scales, you can disable auto-scaling and set the range. To do this, right click on the graph and select Properties. Go to the Scales tab and uncheck the 'Autoscale' box, and set appropriate Minimum and Maximum values. You'll want to do this for both of your axes (the dropdown box at the top allows you to change which axis you're modifying the properties of).

 

If you want to do it programmatically, to set specific (but varying) axes (you don't at the moment, but might in the future) then you can use a Property Node. Right clicking on the graph and going to Create > Property Node > X Scale (or Y Scale) > Range will show your options.


GCentral
0 Kudos
Message 2 of 7
(5,495 Views)

Thank you cbutcher,

 

I know have a scaled x and y axis. My graph now shows a white dot moving around in relation to the x and y values.

 

How do you suggest I go about actually plotting these points? I am so close!

0 Kudos
Message 3 of 7
(5,488 Views)

Check on your Build XY graph by double clicking it.

 

I'd bet you have the checkbox checked that clears data on each call.  Uncheck it.

 

Or you could wire a False constant to the Reset input of that Express VI.

0 Kudos
Message 4 of 7
(5,467 Views)

Hi RavensFan,

 

I tried what you said but I couldn't get it to work. A resource I reached out to recommended moving the build XY graph and the graph outside the loop but now I am running into an issue where I cant connect the two different types of wires. I tried looking this up but cant seem to find a solid solution. This is what the error looks like.

 

idkkkkkkkkkkkkkkkkkkk.png

0 Kudos
Message 5 of 7
(5,441 Views)

Build XY graph is meant to be inside the loop.  It is basically internally concatenating the data to build a history.  I don't know what resource told you to move it outside, but don't listen to them.

 

I don't know why you couldn't get it to work.   If you attached your actual VI and not just shown a picture, I could have confirmed what the problem was and the solution before I posted it.  I would have been able to see how each of your Express VI's are actually configured.  I am still about 90% I gave you the solution.  But I can't tell you what is going wrong without seeing the VI.

0 Kudos
Message 6 of 7
(5,436 Views)

Hi RavensFan, 

 

You were right. My problem lied in the DAQassistant settings. I had to change the samples to continuous.

 

At the moment I am having trouble selecting the right kind of frequency and the number of samples to take. It seems to be laggy and wont take as many plots as I would like in a second for example.

0 Kudos
Message 7 of 7
(5,412 Views)