LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I plot individual points along with my current plot?

I am using an XY graph with two plots. I wish to include two more plots of separate color as individual points. Picture one thin lined plot of the current temperature with time. On top of this plot is to be red or green dots that correspond to a pass or fail of my test. In the end, I should be able to see green or red dots along my current temperature, thus giving me a convenient visual aid to my other data.


My problem can be seen in the attached .vi. When I am running my test, I think my problem is overlapping plots. When I have a pass, the "pass" plot shows on the top and so the red dots are underneath. When I have a fail, the red plot shows on top and no green is seen.

The attached .vi is large, so disregard all but the top loop which does the actual plotting.
0 Kudos
Message 1 of 3
(2,754 Views)
Does this help...

Looking at your "OR" logic, if any one input "fails" while any one input "suceeds" then you will be trying to plot a red and a green point in exactly the same position - inevitably one plot's dot will sit on top of anothers' - when there are two plots, one plot will always sit on top of the other, the precedence is defined by the plot order.

A usefull tip: When ploting your red and green points - where you want a green point to show, set the value of the red plot to "NaN" (not a number), then the red point will not be plotted (and vice versa) point).

Not sure this helps?
0 Kudos
Message 2 of 3
(2,743 Views)
Yes, graphing NaN is one way to create gaps in a plot. It is especially useful if the plot is set to "lines". (Your error plot is set to points so we don't really care because points will not be connected by lines anyway.) In this case you only need it for the failed trace, because it is on top of the success trace. Since your temperature is an integer, you need to set the time to NaN (or make the temperature a DBL).
See attached quick modification (LabVIEW 7.1), many improvements are still possible and there are many other ways to do this.

Alternative: Since you are using an x-y graph with only points, you could also just accumulate the failed and succeeded arrays separately in shift registers.


Some general comments:
  • Use local variables instead of value property. They are much more efficient.
  • Your system is overdetermined because you "OR" the failures and "OR" the successes. If only some fail, both will be true. I'd suggest to only OR the failures and plot red if at least one failed.
  • Your cursor property handling is extremely convoluted. For example for the locking, you use a case structure with 10 sequence frames in each case and a total of 20 property nodes. This entire monster can be replaced with a single FOR loop containing one single property node!
  • Property nodes should only be called if needed. The locking nodes only need to execute if the boolean has changed and not at every iteration of the loop.
  • Your arrays in the shift registers grow without bounds. This ca cause memory and performance problems during long runs.
  • You might want to initialize your shift registers with empty arrays, else the above issue remains even if you stop and restart the VI.
  • To simplify wiring, consider array inputs for the cursor positions in "Temp diff compare..." subVI.
  • etc...

    The attached VI incorporates some of these suggestions. Modify as needed.

    Message Edited by altenbach on 06-01-2005 09:53 AM

  • 0 Kudos
    Message 3 of 3
    (2,740 Views)