LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Problem with displaying current time on a chart

Solved!
Go to solution

Hello,

 

I'm strugglering with my software to make it work correcly.

I just got one problem left: I'm programming a software to record temperature through thermocouples. The thing is, I used a property node to display current on my chart...So far, no problem. But when I press a button which record the temperature, I pass in the next case of my case structure where chart is represented by a local variable, and then the time dispalyed by the chart is not the current time anymore. Ideally, chart shoud display the current time at any time on the chart.

I don't know if my explication is clear so you can find my program in attached file.

 

Any help would be much appreciated, I'm desperate.

 

Thanks a lot

 

 

0 Kudos
Message 1 of 7
(3,767 Views)

Anyone ?

0 Kudos
Message 2 of 7
(3,749 Views)

@Keno wrote:

Hello,

 

I'm strugglering with my software to make it work correcly.

But when I press a button which record the temperature, I pass in the next case of my case structure where chart is represented by a local variable.

  


Probably a race condition. I can't open your code but I'm guessing that's the problem. The variable is being read to the property node BEFORE the variable is updated  (written to) elsewhere. Someone I'm sure will verify this.

 

Also, don't beg for answers, you posted at 2:15 a.m. in the US. The majority of people on these forums are from the US and we also like to sleep.

0 Kudos
Message 3 of 7
(3,747 Views)

Sorry about that. I'm in France and I forgot that current time is not the same all over the world!Smiley Wink It shoud be though....

Anyway, I understood what you've just said but I don't know how to apply your solution, programmatically speaking...

0 Kudos
Message 4 of 7
(3,732 Views)
Solution
Accepted by topic author Keno

You are writing to a waveform chart property node in parallel to writing data to the chart.  You should write to the property node BEFORE writing data,  The following picture shows your way on the left and a better way on the right:

 

20517iBB8ACC4018B60C20

 

Here is another problem.  You don't need all those local variables.  You don't even need the case structure:

 

20519i550E6D540D768183

One more thing.  Put small delays, Wait(ms), in your loops to avoid using 100% CPU time.

 

- tbob

Inventor of the WORM Global
Message 5 of 7
(3,721 Views)

Thanks a lot! It works perfectly!

I jsut got some left problem with the seconds displayed: it seems to me that seconds are displayed too fast.

Anyway, thanks a lot for the answer and the others advices about my software; it is very kind of you!

 

Cheers

0 Kudos
Message 6 of 7
(3,700 Views)

@Keno wrote:

I jsut got some left problem with the seconds displayed: it seems to me that seconds are displayed too fast.


 

Without a real time operating system, the time functions will not be very accurate.  Windows will go off and do its own thing, pre-empting Labview, so the actual reading of the time may not be exactly at every second.  You could see a slight lag between one second to the next, then a fast update to catch up.  That is because of the Windows operating system.  Using a Timed Loop may help make things more accurate.  Timed Loops run at a higher priority so that the timing can be more accurate.  In other words, Windows won't pre-empt a timed loop as much as regular code.

- tbob

Inventor of the WORM Global
0 Kudos
Message 7 of 7
(3,680 Views)