LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

PlotXY - multiple overlapped plots ?

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

0 Kudos
Message 1 of 6
(3,158 Views)

Hi,

 

obviously this is not the expected behavior. For a more detailed analysis you might want to post the relevant section of the code.

0 Kudos
Message 2 of 6
(3,155 Views)

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

Regards,

Kyle M.
Applications Engineering
National Instruments
0 Kudos
Message 3 of 6
(3,140 Views)

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

0 Kudos
Message 4 of 6
(3,123 Views)

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:

  • on the first call from data0 to data499
  • on the second call from data0 to data999 (including the line from data499 to data500 which causes the 'rollback' effect you are seeing)
  • on the third call from data0 to data1499 (including the lines data499-data500 and data999-data1000)
  • and so on

 

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;

 

 



Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
0 Kudos
Message 5 of 6
(3,121 Views)

Thanks Roberto,

 

Your suggestion fixed issue.  Great forum!

 

Regards,

Miki

0 Kudos
Message 6 of 6
(3,102 Views)