01-30-2023 09:58 AM
Hello!
I'm using Waveform Chart (LabView 2015 SP1) to plot data from temperature sensor and need to modify the way it is pictured:
- maximum timestamp: the nearest half-an-hour ahead
- minimum timestamp: 3 hours back from the maximum
- time ticks on the x-Scale: every 15 minutes
I found post (https://stackoverflow.com/questions/32822008/labview-how-to-set-the-time-range-in-a-waveform-chart) which suggested to use properties Nodes, and I tried to do it this way:
But it doesn't seem to work:
- full scale for some reason is only approx. 17 minutes
- shown time is approx 2.5 h back from current system time
- end time is still not a nearest half-an-hour
What is wrong?
Solved! Go to Solution.
01-30-2023 10:15 AM - edited 01-30-2023 10:17 AM
First of all, please attach your VI instead of pictures. we cannot debug pictures.
What is the value of the "reading interval" control? That determines the multiplier (i.e. time spacing between points) you need to set. Are you sure it is set correctly. (We cannot tell from a picture!!!)
A chart has a fixed history and after the history is full, the oldest values are discarded. while the x keeps incrementing, so setting a max and min will not be useful. Maybe you want to implement your own buffer and use a plain graph instead.
01-31-2023 02:11 AM
Please, find the vi-file attached (is there a way to edit original post?).
01-31-2023 02:50 AM
Hi Ye,
when you need full control over the X axis then you should use a graph instead of a chart…
01-31-2023 04:47 AM
Hi, YePererva!
If I understand correctly, you need some "free space" on the Chart after the current measurement time (time ahead). And some history before.
- maximum timestamp: the nearest half-an-hour ahead
- minimum timestamp: 3 hours back from the maximum
- time ticks on the x-Scale: every 15 minutes
Try the attached code. For simplicity I set time ahead to 30s, and history time to 180s. I hope this is what you mean...
Perhaps the variant, proposed by @altenbach and @GerdW - using a separate buffer for collecting data and displaying them on a Waveform Graph, or even on XYGraph instead of a Chart would be more preferable.
How to determine the exact period of markers spacing along the X axis of a Chart - I do not know.
01-31-2023 07:51 AM
Thank you! I'll test it. I need some time to understand how does it work.
02-01-2023 03:06 AM
Sorry, I'm not getting this part, where you've set up the Offset and Multiplier. Could you explain me that?
P.S. Regarding time ranges: not exactly what I needed. Apparently, my original part should work, but I messed up at choosing Quotient & Remainder. I selected Reminder for further calculations instead of Quotient.
02-01-2023 12:41 PM - edited 02-01-2023 12:46 PM
This is due to the nature of the LabVIEW Chart control.
All points of the Chart are stored as an array of Y-values (Chart history). And the X-axis is actually the index of this array.
But the Chart has the ability to shift the values displayed on the X-axis using Offset and
set the distance between the displayed points using the Multiplier.
When your X-axis is in DateTime format, you can apply an offset using the current time when you start the program.
If left at zero, the displayed value will be the beginning of 1904.
You also have the refresh rate of incoming data - set it as a Multiplier and the displayed time intervals will correspond to reality.
PS: X AutoScale disabled in my example.