LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Graph output from two for loops

Solved!
Go to solution

I would like to see a graph of the output generated within two for loops.

X: steps (i x i of both loops)

Y: Y1 should graph the polar output

    Y2 should graph the azimuthal output

Probably very simple to solve/set up.  (The output file works great.)

 

Thanks,

 

Kevin

 

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

Hey Kevin,

 

This seems like a fairly straight forward problem, but unfortunately I can't completely understand what is output from the two loops (especially since you did not attach the text file that the data is generated from).  Can you add an indicator for the azimuthal output (y2) at step i and one for the polar (y1)?  This would help clear up any confusion, I think.

 

Cheers, Matt

Message 2 of 4
(3,169 Views)
I fooled around with it a bit and found a reasonably satisfactory solution.  Graphically it depicts what I want people to visualize.
0 Kudos
Message 3 of 4
(3,150 Views)
Solution
Accepted by topic author atomless

Good job Kevin.

 

I have a couple of suggestions for you though (I don't know what this will ultimately be for, so maybe these are off base):

  • If the data is not changing with time, you can use a graph rather than a chart; either way, reduce the processing power needed by updating the two plots only once for a full execution of the outer loop (see below) 
  • You have a bunch of indicators that are not obviously necessary (they simply output what the control puts out - Stop 4; Stop 5; Polar; Azimuthal, etc).  When submitting here, the cleaner the code is the easier it is to understand and the faster you get a response Smiley Surprised (minimal documenting also helps us understand what everything is for).
  • Use the Decrement vi rather than subtracting 1 (reduces code bloat).
  • Avoid coercion - explicitly cast I32 to doubles so that no call has to be made to the memory manager at run time (will reduce your codes memory footprint).
  • File writes are CU intensive and build arrays generally dynamically allocate memory - try to avoid these as much as possible.  In your VI, you could write to the file once after all iteration are complete.  This will reduce the execution time of the VI.

Anyway, there are a whole bunch of thoughts that you probably didn't care to hear, but I hope they were useful.

 

Cheers, Matt

 

npmc.png

Message 4 of 4
(3,128 Views)