LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to display X-scale chart limits in format HH:MM:SS at all times

Hi,

 

I am wondering if there is any way to display the x-scale limits of a chart in the format HH: MM: SS at all times without the format automatically switching to MM: SS: mSmS before an hour has passed. Currently I am using the code below to do this: 

labview query.png

 

I feel as if this is unneccesary and that there is probably a setting somewhere which I am missing to ensure the display format, as set in the chart properties menu, does not automatically adjust to a new format before an hour has passed. If anybody has a way of doing this without using property nodes (or ideally coding anything), that would be fantastic.

 

0 Kudos
Message 1 of 10
(5,147 Views)

I think buddy there is a option of relative tome as well as absolute time in Chart<<properties<<Display Format<<Type(Scroll it down)....... i Hope this will work .....

0 Kudos
Message 2 of 10
(5,125 Views)

Thanks for the suggestion. Unfortunately, I have tried that already, the problem is that when using the format '%<%H:%M:%S>t' which I believe should be relative time in format hours:minutes:seconds it gives the relative time in minutes:seconds:milliseconds until an hour has passed which is not suitable for my application. Sorry for not making the issue clearer originally, thanks again.

0 Kudos
Message 3 of 10
(5,119 Views)

Hi Moreilly91,

 

I'm Chiara, an Applications Engineer here at NI and I've been looking in to this for you.  Unfortunately, I can't immediately find anything which would solve this for you - it's a very interesting quirk of LabVIEW, and one that I've not noticed before, but I think that your workaround may be the simplest way of ensuring that the X Axis stays the way you want it to.  I'll keep looking to see if I can find anything more, but having spoken to a couple of people, it's not something that's really come up in the past that we can see, and I haven't found any other way around it yet.

 

Best wishes, 

 

Chiara A
Applications Engineer with NI UK & Ireland
0 Kudos
Message 4 of 10
(5,084 Views)

Thanks Chiara,

 

The application is an ongoing project so let me know if anything comes up Smiley Happy.

0 Kudos
Message 5 of 10
(5,061 Views)

Hi, 

 

I've been playing around with this for a couple of days, and I think I've found a solution: you have to directly associate a timestamp with the waveform to get the amount of time that's passed; otherwise, the time you're currently showing on the graph isn't time from a clock at all, but based upon the relative run speeds of the loop and the computer.  Also, this works better with a waveform graph than a chart - and it does mean you no longer need to use any property nodes at all to clear the history etc.  I attach my VI that I think manages to do what you need it to: effectively, you have to subrtact the time at which you start the VI from each iteration of the loop to get the amount of time that's passed. 

 

Hopefully this works for you! 

 

Best wishes, 

Chiara A
Applications Engineer with NI UK & Ireland
Message 6 of 10
(5,035 Views)

Below is a screenshot of the simplest way I've found to create a waveform chart with PC time.  Works great regardless of loop dt.PC Time Chart

Message 7 of 10
(5,021 Views)

Oops, forget to handle the 'dt'.

PC Time Chart

Message 8 of 10
(5,011 Views)

Why the formula node?  You should just be dividing by 1000.

0 Kudos
Message 9 of 10
(5,001 Views)

Personal preference.  The formula node is equivalent to dividing by 1000.  Aesthetically it looks cleaner to me.  Smiley Wink

0 Kudos
Message 10 of 10
(4,990 Views)