Data Points is how MPJ saves in memory the plotted data so that it can be redrawn or refreshed. When plotting values, the entire plot including all analog traces are redrawn as new data is plotted. In order to do this the data is held in the Data Points.
This maximum value is set by default at 10,000. It can be changed in the Settings accessed via the pop-up menu, through properties, or using code:
!plot.maxDataPoints=20000
On the plot's upper-right corner, a progress bar shows the amount of data points used. While each channel of plotted data can vary in the number of data points used, the graph shows the highest amount used by all channels.
When this value reaches the maximum, the oldest data will be deleted and no longer redrawn.
This value can be in the millions, but be aware that memory usage will increase and the time it takes to redraw the traces on the plot, slowing operation of the software. To optimize speed, points off the plot are not redrawn and the redraw time is based most significantly on the points that need to appear on the plot itself.
In order to increase speed and amount of data that can be held, a property called noChangeSkip allows data that does not change to NOT be stored except at the defined number of points plotted. For example, setting it to 50 (the default is 20), if the data does not change for a channel, data will only be stored every 50th time it is received, but will be redrawn between the stored points. To not skip any, change this values to 0.
Because some channels may change more frequently than others, this may lead to some traces not fully showing if they begin before the minimum time of the plot as those points are not plotted.
Another factor is using the the csvChx value which returns all the stored data for a channel as comma separated values. Math functions may call these values for calculations.
? { mean([plot.csvCh0]) }
Such as the above would return the mean of all data stored for a channel. If noChangeSkip is not zero, all data is NOT stored and returned and would possibly skew the mean result.
Note that operation on tens of thousands of data points is a time consuming operation and will cause lag of a few seconds in processing.
|