01-14-2011 07:32 PM
Solved! Go to Solution.
01-14-2011 10:44 PM - edited 01-14-2011 10:46 PM
Read about the state machine architecture. That's what you need and store the array in a shift register. A shift register is basically a spot in memory that holds your data (array, numeric value, cluster etc). So, whatever you wire into the shift register will be stored there to be accessed on your next loop iteration. The initializing an array method is fine, and in fact prefered especially on systems where memory management is important (i.e. cRIO, or any RTOS). If you are on a windows machine, you rpobably don't need to worry about this unless your array is going to be massive. Assuming your data is doubles just initialize with NaN instead of 0. Then it won't show the points on the plot.
01-15-2011 01:39 AM - edited 01-15-2011 01:43 AM
@Rgann wrote:
Our old program initialized a 2D array, with one column being the DAC ramp and the other holding all zeros.
You should initialize the 2D array with the ramp for x and the y row containing all NaN. Any point containing a NaN will not be shown on the graph.
I usually prefer to keep the x range constant instead of rescaling with every new point, but if you want to keep the x scale tight, you could update the range min and max using property nodes depending on the current insert point.
You already must be using a shift register (or feedback node) to contain your array, so that should be OK as is.
Also remember that if the ramp is linearly spaced, you can use a waveform graph. You simply need to set x0 and dx accordingly. (An xy graph is only needed if the points are not spaced equally in x.)