LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Changing the colours on multicomponent XY graphs.

Hello,

I know this should be easy and I even looked at the XY graph example that Labview offers. However, I am not having much success when I try to change the colours of two datasets plotted on the *same* XY graph. I've placed two VI's here that I have been working on. The first (graph.vi) plots the two datasets but I can only get one colour. In the second VI (graph2.vi) I can change the colours of each dataset but if the program is run continuously it hangs. Can anyone have a look at these and correct me on my mistake(s)?

Thanks!
Download All
0 Kudos
Message 1 of 5
(2,901 Views)
When I run your first VI, I can see two different colors - a yellow one and a green one. Are you wanting to be able to change the colors programatically? Also, using the build array function inside a while loop does not use LabVIEW memory very efficiently so if you run either program long enough, I would expect some memory problems.
0 Kudos
Message 2 of 5
(2,901 Views)
Dear Remington,

I'm not sure what you wanted with your code and which your question is related with the VIs.

1. You mentioned a graph2.vi, but there is a graph.vi and a graph1.vi which are nearly the same.

2. I will describe what you have programmed. You have an outer while loop running until you abort the VI. This while loop contains a "left" while loop and a "right" while loop. The "left" while loop runs only once generating 4 random numbers. The autoindexing gives you 4 arrays existing of one element each. Two of them were bundled togther giving one plot consisting of one point. These two plots were given to the "right" while loop. In the loop you add them to an existing array coming from the shift register. The output and there the sh
ift registers contains an array of plots which is a valid data type for a multi plot xy-graph. After the first iteration you have an array of two elements each representing a plot. In the next iteration you will add 2 new plots so you have 4 plots to print, next iteration 2 new plots so 6 to print and so on. Your program dosen't hang. You have defined a point style only for the first two plots. since each plot is only one point long the graph could not draw any line so the other plots will not be seen.

3. I have changed your VI so it will add a new point to the two plots on each iteration of the outer most loop.

Waldemar
Waldemar

Using 7.1.1, 8.5.1, 8.6.1, 2009 on XP and RT
Don't forget to give Kudos to good answers and/or questions
Message 3 of 5
(2,901 Views)
Hello Waldemar,

Thanks for the explanation. I made a typo when I said graph2.vi - it should have been graph1.vi. What I wanted was to plot an XY graph for two datasets with each dataset in a different colour and for the points to be "remembered" on the graph. I tried following the Labview "XY graph" example but your answer indicates that it requires much more than it shows.

Thanks again!
0 Kudos
Message 4 of 5
(2,901 Views)
Hello Dennis,

I am trying to plot two datasets on an XY graph such that the data is "remembered" on the graph and that each dataset be represented by a different colour. Forget the graph1.vi I sent - I just realized it is not that different from graph.vi. Is there a way to do what I just described?

Thanks.
0 Kudos
Message 5 of 5
(2,901 Views)