05-09-2011 01:53 PM
I would appreciate if someone got experience about overlapping several plots on top of the each other.
What problem I have? I scan certain measurement data from 0 to FULL RANGE and plot it on the PlotXY graph.
I use retain data feature and plot is retained. Then I want to make another full measurement scan and overlapp on the existing one to see measurement repeatability. Problem is when I plot another graph it plots strait line from the very last point left on plot1 to the very first point of the plot2. So I got messy graphing. How I can get rid of this strait line?
Thanks
05-09-2011 02:27 PM
Hi,
obviously this is not the expected behavior. For a more detailed analysis you might want to post the relevant section of the code.
05-10-2011 10:09 AM
Miki,
This does sound like odd behavior. Either showing screenshots of the behavior or including the code which creates this issue would be very handy.
Regards,
Kyle Mozdzyn
Applications Engineering
National Instruments
05-11-2011 10:22 PM
Hi Kyle,
Here is function I use:
plotHandle = PlotXY (panelHandle, PANEL_GRAPH, EE_IndexArrayData,
CapMeasureArrayData1, u16_DataIndexX,
VAL_UNSIGNED_SHORT_INTEGER,
VAL_UNSIGNED_SHORT_INTEGER, VAL_FAT_LINE,
VAL_EMPTY_SQUARE, VAL_SOLID, 1, VAL_BLUE);
1. I plotted 500 array elements in first measurement cycle. Graph pen pointer is at the last ploted point.
2. 5s later when second measurement cycle is finished , above function is called again to plot fresh data.
3. As result there is straight line connecting last ploted pont of the first cycle plot and very first point of the second cycle plot.
Everything else regarding plot is fine.
I assume I need to tell graph panel after each array is plotted to freeze or finish that plot so I could overlap next one
on the same graph? Question is how?
Thanks,
Miki
05-11-2011 11:52 PM - edited 05-11-2011 11:56 PM
From what you say, I can imagine that you are accumulating data sequentially in 2 arrays that store blocks of 500 measures one after the other.That is, arrays are as follows:
EE_IndexArrayData[ ] = { data0, data1, ... data499, data500, data501, ..., data999, data1000, data1001, ... data1499 }
If this is so and based on your code, every time you call PlotXY you are plotting the whole set of data; in the above example you are plotting:
In this hypothesis you should modify your code as follows:
- first call: PlotXY (..., ..., EE_IndexArrayData, CapMeasureArrayData1, 500, ......); - second call: PlotXY (..., ..., EE_IndexArrayData + 500, CapMeasureArrayData1 + 500, 500, ......); - third call: PlotXY (..., ..., EE_IndexArrayData + 1000, CapMeasureArrayData1 + 1000, 500, ......); - and so on
You may keep an 'offset' variable to increment after each call by the amount of data plotted, so that at each iteration you plot only the last data and not all the set of measures:
PlotXY (..., ..., EE_IndexArrayData + offset, CapMeasureArrayData1 + offset, u16_DataIndexX, ......); offset += u16_DataIndexX;
05-17-2011 08:49 AM
Thanks Roberto,
Your suggestion fixed issue. Great forum!
Regards,
Miki