From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
07-04-2005 04:53 AM
Dear all,
07-04-2005 05:58 AM
I'm not sure I understand your problem.
The VI builds an array of points which are put into a graph. It keeps the last N points in memory and displays them, along with the new data point, so it simulates the behavior of a chart. Each element (point) is a cluster of 2 elements - an X value and a Y value.
To set the chart length, simply look at the example - a number is wired into the "Chart Length (Points)" input. If that number is changed, the length of the array stored inside the VI changes accordingly. The fact that the VI is reentrant means that you can use multiple copies of it at the same time, to plot several charts. If you place probes on the wires in the example, you can see exactly what data the wires are passing.
07-04-2005 09:09 AM
Thanks tst, however, I clicked the wrong rating button for your reply.
It says: ‘If the locally stored chart array is not equal to the chart length, it is expanded to that length by replicating the most recently acquired point. Data in excess of the history length is discarded’.
What is the size of the locally stored chart array, if I use a while loop to acquire data? I am not clear in case 1, if the array is smaller, it replicates the most recently point, the displayed data is correct or not? I have thought the displayed data should be what the card is reading at the moment.
If the array is larger than the history length, dose it mean the most recently acquired data will be missing?
Therefore, Can I just set my history length to be exactly the size of the locally stored chart array?
07-04-2005 09:52 AM
07-04-2005 10:14 AM
Thanks again for your detailed explanation, although it is a bit complex to me. Therefore, I can still set whatever value for the history length according to your reply. Can I find a more elegant and straightforward x-y chart type of vi, as I just want to output my data in x y chart without data missing.
07-04-2005 12:32 PM
07-05-2005 05:03 AM
I used chart at the very beginning. However, I was not sure how to set the node properties for the chart when I was trying to output a relative time in a loop in a real time manner. Sometimes, I changed the sampling frequency when the program was running, however, time axis could not adjust accordingly and displayed the wrong time without stopping the program (in fact, I found it is the number of data acquired). Therefore, I stupidly turned to x-y chart, which I thought could be simple and straightforward by deducting the starting time outside the loop from current time within the loop.
I do not know whether they supply a detailed instruction about the property node for various vi.?
Thanks.
07-05-2005 06:37 AM
The chart needs a constant frequency (the multiplier) because the points don't hold time data, just their position in the X-array and their Y value. You can change the multiplier in the middle, but you will have to recalculate the offset and it will change the time for the older points.
You can get a description for each property if you right click the property node and select Help For property name (but the description for the multiplier property is not a very good one).
This interested me a bit, so I wrote a VI to do this buffering. Note that the loop in the subVI only runs once and the uninitialized shift register which keeps the array from the last time. Also, the VI is reentrant, so you can use it for multiple charts. I wrote this VI quickly, so it may have some bugs and it could definitely stand some improvement. For example, the first time the VI is run, it could be set to fill the array with the new element.
BTW, look at the difference between this VI and the example to see what I meant when I said the example is written terribly. This VI has straight wires, things aren't cramped together, you don't have things wired into corners. I'm not sure why NI publishes examples like these, instead of taking an extra 2 minutes to clean up the diagram, but I suggest you try to keep your VIs clean. It looks better and it's easier to read.
07-05-2005 08:56 AM
Thanks a lot! I am trying to digest your vi. And probably replace its original buffer chart with yours.