09-17-2024 09:55 AM
Hi guys,
I am struggling with time displays on my waveform chart.
You may or may not like the code I have done but I was told not to use DAQ assistant or waveform data wire, so this is the result 😁
In "labview hard coded time.png" you can see, the chart starts at 14:46:00.000 and ends at 14:48:00.000
However, in "labview time changed.png" you can see the time is now 14:47:08.030 and ends at 14:49:08.030
Clearly, there is a 2 minute difference with both the hard coded time, and the 'changed time' picture. However, the 2 minute time window has shifted, as the time in real life passed 14:48:00.000. It will constantly update the graph, but keep a 2 minute window.
Is there anyway to hard code it so that it NEVER changes the time, i.e. it stays at 14:46:00.000 - 14:48:00.000 ? But the date will change each day?
Solved! Go to Solution.
09-17-2024 10:11 AM
We are missing all your subVIs and cannot tell what happens in there.
If you want a fixed x axis, you should not use a chart at all. A chart has a history buffer (in your case 100 points) and once you run out ,the oldest points get discarded but the time t0 is still based on the first point.
09-17-2024 10:45 AM
@altenbach wrote:
We are missing all your subVIs and cannot tell what happens in there.
If you want a fixed x axis, you should not use a chart at all. A chart has a history buffer (in your case 100 points) and once you run out ,the oldest points get discarded but the time t0 is still based on the first point.
Hi Altenbach,
I have attached all the VIs now. I had issues saving them and opening them on a Labview 2010 PC, as they are labview 8.5 but saving all individually as opposed to the 'save hierarchy' now works hopefully..
Ok so with a chart, it will start plotting 100 based on t0, then after 100, it will use like the 1st point t0 and point 101, and then 2nd point t0 with 102, etc?
How can I just lock the graph so that it only stays at that X value range
09-17-2024 08:05 PM
As altenbach suggested, you should not use a chart. Use a graph instead.
You can use a shift register or a feedback node to store the data. LabVIEW 8.5 is too old. My LabIEW crashed when trying to save as 8.5
I can only provide my implementation as images.
09-18-2024 06:55 AM
Hi Zyong, I have implemented your code. It is nice that it can wipe the graph clear.
However, the times are not correct. Despite wiring a single waveform to the graph, the time on the graph is 00:00:00 01/01/1904. Then, it works from there, and future times will be e.g. 00:00:01 01/01/1904 .....
despite that, the waveform when broken down, shows a t0 accurate to the real time (12:55 18/09/2024)
09-18-2024 10:00 AM
@lorc34 wrote:
Hi Zyong, I have implemented your code. It is nice that it can wipe the graph clear.
However, the times are not correct. Despite wiring a single waveform to the graph, the time on the graph is 00:00:00 01/01/1904. Then, it works from there, and future times will be e.g. 00:00:01 01/01/1904 .....
despite that, the waveform when broken down, shows a t0 accurate to the real time (12:55 18/09/2024)
If you have implemented code and it does not work as expected, you need to attach it again.
How do you define the formatting of the time axis (absolute? relative?) and is "ignore waveform timestamp checked or not?
09-19-2024 04:53 AM
Hi Altenbach,
Thank you, ignore time stamp was not clicked.
I appear to have the correct behaviour working now using waveform graph and shift register as Zy showed in pictures. Thank you