01-25-2013 04:16 PM
Hi,
I'm trying to programmatically set the chart to display a 30 minute, or 60 minute range. I can do this by setting the following properties in a case handler if the user presses a button to apply the settings of the chart (with absolute time display format):
Input: chart time = 30 minutes, or 60 minutes
Properties (in order):
Scalefit set to 0 (no autoscale)
Offset set to "Get Current time" timestamp
StartRange set to "Get Current time" timestamp
Multiplier to 1/(1000 Samples)
Minimum to "Get Current time" timestamp
Maximum to "Get Current time" + 1800s (for chart time = 30)
Loosefit set to true
Result:
While I can get the offset output to the chart correctly, the time range is always set at 40 minutes.
I poll these same settings in the chart later on in the loop and the min, max values are completely different - only offset is consistent.
Here is a sample run: chart time = 60,
Minimum = 3:01 pm Jan 25, 2013
Maximum = 4:01 pm Jan 25, 2013
Offset = Minimum
Output:
Minimum = 3:02 pm Jan 25, 2013
Maximum = 3:42 pm Jan 25, 2013
Offset = 3:01 pm Jan 25, 2013
I'm confused because I haven't set these chart properties in my code otherwise. Any idea where these are coming from? One solution is to take the code out of the case handler, but I would like to refrain from doing that since it would use up more memory. Thanks!
Solved! Go to Solution.
01-26-2013 01:43 PM
Could you post a snippet of our VI? That would be very helpful.
Just off the top of my head, I'm thinking that you could be having a problem with the amount of data in the chart and that affecting the size. You may also need to set the chart history length.
You might be better off using a waveform graph instead of chart. It is much easier to control the data in a graph since you explicitly set all of the data instead of letting LV append it all automatically.
01-28-2013 10:48 AM
Hi,
Thanks for the reply:
Please see the two screenshots for the setting of the properties and the polling of them. They are within the main while loop, and the input to one of the setting of the chart property node that's outside of the screen is the "sampling rate". Chart itself is named "V Chart Channel 0"
Chart history length = 2400000.
I hope this helps, please let me know if I could provide more information. Thanks!
01-28-2013 10:54 AM
A snippet is created by selecting Edit>Create VI Snippet from Selection. It is a special png that allows you to drag it to a block diagram and it turns into a VI. The actual VI would have been just as useful. The images you posted - not so much.
01-28-2013 11:20 AM
Oh interesting - here are the snippets~!
01-31-2013 11:18 AM
Hi, I think that I will need to stick with using a chart due to the buffering capabilities. I will try and adjust the chart history length to see if that helps. Thanks.
01-31-2013 02:59 PM
Hi,
Yes, the problem was simply due to the chart history length being maxed out, as it was set to 40 mins. I've modified it now to an appropriate upper bound. Thanks!