ni.com is currently undergoing scheduled maintenance.

Some services may be unavailable at this time. Please contact us for help or try again later.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Graphing a Customizable Circle

Hello,

I'm new to LabVIEW and am looking for some help graphing a circle in an XY-plot. I created a For Loop which graphs a simple circle (see attached image). However, I'd like to make some additions to my program:

  1. I want to create arrays of X and Y (using the For Loop) so that the user can choose the number of elements they would like the arrays to have (up to 360)
  2. I would also like to limit the radius of the circle to between 1 and 10.
  3. Finally, I would like to slow down the program so that the user can see the circle being drawn.

If anyone could suggest ways to go about making these additions, I would really appreciate it. Thanks!

0 Kudos
Message 1 of 4
(3,749 Views)

Please attach screenshots taken from the PC in PNG format rather than 7 MB JPEG pictures!

 

1&2

You can set the limits that numeric controls can have.  From X (3?) up to 360 for number of segments,and 1 to 10 for radius.  On the control, right click > Properties >  Data Entry tab.

 

3.  You'll need to put the graph in the For Loop and build the arrays inside the For Loop instead of auto-indexing on a tunnel.  Put a Wait function inside the loop to slow down the execution.

0 Kudos
Message 2 of 4
(3,743 Views)

xy graphs "understand" complex, so all you need is an angle ramp as follows:

 

DrawCircle.pngTO

 

draw incrementally, just place the indicator inside a loop and draw an increasing subset based on [i]. 

 

DrawCircleSlowly.png

 

...and if you want to draw it in the other direction or from a different starting angle, shift/negate the ramp as needed.

0 Kudos
Message 3 of 4
(3,727 Views)

Quick example (I add one extra point because the first and last point overlap):

 

 

Message 4 of 4
(3,704 Views)