LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Real time labels on x-axis

Hi all

I thought I had cracked the business of putting realtime labels on the
x-axis of Labview charts but today I found that the way I had done it
was failing at any times between midnight and 01:00.

In the past I have used a property node for my chart or graph (not sure
which) and initialised it with the current PC time. I'd set the x-axis
format to be time & date. This seemed to work but I had noticed that,
when daylight saving was active, that Labview would try to correct for
this. (I'm GMT, London so occasionally go GMT +1). So I'd added a
correction to subtract the "error". This works fine apart from between
midnight and 01:00. At these times my correction results in a negative
number which Labview cannot interpret as a time (not surprised by this)
and so it plots Neg on the x-axis until the time changes to past
00:59:59. The PC time zone setting also causes a problem that I hadn't
appreciated until I started looking at this.

In the Labview examples for real time graph axis, NI have used an x-axis
formatted decimal and then selected realtime from the radio boxes below.
This works OK, and is immune to DST and time zone offsets but doesn't
look like a proper time at times between midnight and 01:00.

So the only way I can get a nice looking display and for it not to
misbehave at times between midnight and 01:00 is to set the PC system
clock for GMT:Casablanca,Monrovia. This time zone has no offset or
daylight saving activity.

Have I missed something or is this way harder than it should be?

Many thanks in advance for any help or advice.

Regards

Bill

mailto:wsymonds@clara.co.uk



0 Kudos
Message 1 of 14
(4,330 Views)

Hi Bill,

What version of LabVIEW are you using?

Have you seen this Knowledge Base article: "How Do I Set the Time and Date on the X-axis of a Graph in LabVIEW ?"

http://digital.ni.com/public.nsf/websearch/0A4899EF6D01B9C5862568B70074F989?OpenDocument

You may find it of use.

In order to advise any further it would be useful if you posted your VI.

Regards

Emma Rogulska

NIUK & Ireland

 

 

0 Kudos
Message 2 of 14
(4,296 Views)
In article <1145893211183-355878@exchange.ni.com>, x@no.email (EmmaR)
wrote:

Hi Emma

Thanks for the reply.

> What version of LabVIEW are you using?

A mixture but mostly 6i.

> Have you seen this Knowledge Base article: "How Do I Set the Time and
> Date on the X-axis of a Graph in LabVIEW ?"
> You may find it of use.

No, I will have a look and see if it helps.

> In order to advise any further it would be useful if you posted your
> VI.
> Regards
> Emma Rogulska
> NIUK & Ireland

Directly onto here?

Regards

Bill
0 Kudos
Message 3 of 14
(4,287 Views)


@Bill Symonds wrote:
In article <1145893211183-355878@exchange.ni.com>, x@no.email (EmmaR)
wrote:

> In order to advise any further it would be useful if you posted your
> VI.
> Regards
> Emma Rogulska
> NIUK & Ireland

Directly onto here?

Regards

Bill



Below the Message Body box there is a box labeled Attachment. Use the Browse.. button to locate your VI.

0 Kudos
Message 4 of 14
(4,284 Views)

Hi

Sorry, was posting from a newsgroup didn't realise this was web based too.

In my example

timeongrapghs+dst correction.vi

where the chart x-axis is formatted to be date and time, for some reason Labview adds an offset according to the time zone and/or
whether or not daylight saving is active. I had corrected this offset by using a simple subtraction but at midnight the hour value is zero so, as I said in my initial post, Labview does not recognise -1 as a time and so causes the x-axis labels to be in error (they actually say Neg). My example shows this. If you set your PC clock time to e.g. 00:12 and your PC's time zone to GMT, London. If you change the PC date to be in or out of daylight saving (Apr-Oct daylight saving is active) you will see the problem come and go.

So I looked at the Labview example and they use the decimal formatted x-axis with realtime selected from the radio buttons
underneath. I tried this approach on my example (timeongrapghs decimal x axis correction.vi) and this does not seem to suffer from an offset introduced from the time zone and/or whether daylight saving is active but at midnight the time displayed on the x-axis reads without zeros, so 00:14:45 reads 14:45 - misleading.

I found that setting your PC clock to GMT:Casablanca,Monrovia results in my example behaving perfectly around the midnight time. This time zone has no offset or daylight saving activity.

timeongrapghs NEEDS GMT CASA.vi

Finally I looked at the example you linked too and although that works (but I don't understand it happy smiley ), I want my display to fill from the far left to the far right, and once the x-axis is full, for the display to scroll across from right to left. If you look at my examples, they do this, although I noticed that using them in LV 7 (they were written in 6i) automatically seems to switch the autoscale x-axis on for the chart - you need to switch autoscaled x-axis off to see how I want my charts to appear. The example you linked doesn't do this, and turning off the autoscaling seems to stop the data from being displayed. Can you change the example you linked so that the chart behaves like my examples but without the time zone/DST problem - if so can you make it so I can plot more than one data set on the y-axis (same time resolution of data)?

Thanks for helping

 

Bill

0 Kudos
Message 5 of 14
(4,267 Views)
Bump!!!
0 Kudos
Message 6 of 14
(4,234 Views)

Well, I did what you asked and posted my VIs but I've heard nothing since doing so. Did I do something wrong? Or is my mistake so stupid that I'm beyond hope? What's going on Emma?

Thanks

Bill

0 Kudos
Message 7 of 14
(4,189 Views)

Bill,

Would using Get Date/Time in Seconds to set the x-scale offset (instead of using the current hh:mm:ss on 1-Jan-04) give the results you're looking for?

=====================================================
Fading out. " ... J. Arthur Rank on gong."
0 Kudos
Message 8 of 14
(4,151 Views)

Thanks for that, I will try your suggestion when I'm back at work and let you know.

Cheers

Bill

 

0 Kudos
Message 9 of 14
(4,134 Views)

Hi Bill,

Sorry for not getting back to you sooner.

Do you still require help with your application or has Donalds suggestion worked for you?

Regards

Emma Rogulska

NIUK & Ireland

0 Kudos
Message 10 of 14
(4,115 Views)