LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Lock time on waveform graph

Solved!
Go to solution

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?

0 Kudos
Message 1 of 7
(177 Views)

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.

0 Kudos
Message 2 of 7
(168 Views)

@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

0 Kudos
Message 3 of 7
(158 Views)
Solution
Accepted by topic author lorc34

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.

ZYOng_0-1726621413507.png

ZYOng_2-1726621538433.png

 

 

-------------------------------------------------------
Control Lead | Intelline Inc
0 Kudos
Message 4 of 7
(107 Views)

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)

0 Kudos
Message 5 of 7
(82 Views)

@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?

0 Kudos
Message 6 of 7
(73 Views)

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

0 Kudos
Message 7 of 7
(63 Views)