08-06-2010 10:30 AM
You have your char length set to 1024, right click the chart on the front panel, click Chart History Length and set it to 60.
08-06-2010 10:45 AM
Also, if you turn on Autoscale X the chart will scale the x-axis to always put the latest point on the very right side of the chart. So if you have less than 60 data points, the chart will still take up the whole space and it will just auto-scale to fit more points as they're added, up to 60 points total, or however many you set the chart length to.
If you turned on Autoscale X as you have it set up now, it will change the scale until 1024 points are displayed!
09-17-2010 10:23 AM
I am back and I brought my dead horse along to give it a good beating....
Anyway I thought I had this all fingered out but here I am a month later and my code does not work anymore.
I have gone though this thread again and again and my charts X-axis still runs off into the future even with my chart history length set to 60.
As you can see in screen.jpg it was 8:11AM and the chart X-axis spans from 8:11 to 8:22 the distance into the future seems to increase as time goes by.
09-17-2010 10:48 AM
I don't see where your chart history length is set to 60. I see the Xscale.Multiplier is set to 60.
09-17-2010 10:53 AM - edited 09-17-2010 10:53 AM
I could not find chart history length in the properties, so I clicked on the chart it's self and set it that way.
09-17-2010 11:08 AM
Right click the chart on the front panel to set the Chart Length.
Also, you should only set the Offset once right at the beginning of the code. The offset should be the very earliest time that you started taking data, not necessarily the first point that appears on the chart.
For ex: I took 75 data points with chart length = 60. The lowest point displayed is #15 even though the offset is 0. If I set Offset = 15, then it would appear that I would be looking at points 30-89.
Since you're setting the offset inside the loop, it will appear that you're looking at points that don't exist yet.