08-12-2003 04:00 AM
08-12-2003 06:43 AM
08-12-2003 08:37 AM
08-12-2003 09:06 AM
08-13-2003 07:36 AM
08-14-2003 01:41 AM
05-20-2021 10:09 AM
If I understand Ogulcan correctly, I am trying to do something very similar. I want to draw lines numbered 1 to 250 in XY format and then "erase" line number 1 before I draw line 251, erase line 2 before drawing 252 and so on. Erasing them all and starting over will not work because the operator will not see the full envelope of xy data as it changes over time.
In the past I have "erased" lines individually by redrawing them in the color of the background. Perhaps one could set up a double buffering scheme with 2 plots so that at any particular time, one plot is drawing the new data line by line while the other plot is being redrawn line by line in the color of the background.
I've been working on a solution like this with the xy graph but now I'm wondering if drawing lines in a picture control as Greg suggested would prove easier. The limits of my x and y data are fixed so there is no need to grow or autoscale the plot. If I "grabbed" the image of the xy graph after the first 250 points were drawn, it would save me the trouble of creating numeric scales and tick marks in a picture manually. Then I could overwrite (erase) and draw lines manually within that image going forward. I would need to omit grid lines or devise some way of refreshing them. I will have to look at the examples Greg suggested and go from there. I welcome any comments or suggestions.
05-20-2021 11:08 AM
@skinnedknuckles wrote:
If I understand Ogulcan correctly, I am trying to do something very similar. I want to draw lines numbered 1 to 250 in XY format and then "erase" line number 1 before I draw line 251, erase line 2 before drawing 252 and so on. Erasing them all and starting over will not work because the operator will not see the full envelope of xy data as it changes over time.
So what you really want is a XY Chart.
05-21-2021 10:25 AM
Is there a way to have the XY Chart erase line 1 before drawing line 251 and so on? Can you direct me to an example?
06-09-2021 01:05 PM
It turned out to be easier than I thought. I used the complex number type (x + yi) because it allowed me to handle 2 dimensional data with1D arrays. All I did was use the array builder as new data accumulated up to 250 samples. I used the Build cluster array function to feed the array of clusters (1D in this case) to the XY graph. After the complex array has reached 250 elements, instead of the array builder I switched to the Replace Array Subset function and replaced elements of the complex array as new data appeared. I ended up with a 3-case State machine with the cases: BuildArray, OverwriteA and OverwriteB. I only used a single plot but this method should work fine with multiple plots as well. The random number generators simulate small variations in the data over time. The attached code was created with an evaluation version of LabView. I don't know if that will cause issues or not.