08-03-2010 02:41 AM
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
Solved! Go to Solution.
08-03-2010 08:15 AM
Anyone ?
08-03-2010 08:19 AM - edited 08-03-2010 08:20 AM
@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.
08-03-2010 01:27 PM
Sorry about that. I'm in France and I forgot that current time is not the same all over the world!
It shoud be though....
Anyway, I understood what you've just said but I don't know how to apply your solution, programmatically speaking...
08-03-2010 02:19 PM - edited 08-03-2010 02:20 PM
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:
Here is another problem. You don't need all those local variables. You don't even need the case structure:
One more thing. Put small delays, Wait(ms), in your loops to avoid using 100% CPU time.
08-04-2010 08:06 AM
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
08-04-2010 12:02 PM
@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.