LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

elapsed hours

I am using Labveiw 7 with the DSC module. How can I get an elapsed hour meter to start where it left off after the computer has been shut down and restarted? I already write to a tag and then read from the same tag and that works until the computer is restarted.
0 Kudos
Message 1 of 9
(4,265 Views)
Is your tag set up to be logged (correct deadband, etc)? Are you reading the tag in from the Citadel database?

If you're just writing to the tag without logging it and reading it from the RTDB, the tag value will disappear when the DSC Engine and LabVIEW shut down.
=====================================================
Fading out. " ... J. Arthur Rank on gong."
0 Kudos
Message 2 of 9
(4,265 Views)
Donald,
I believe the tag is set up correctly, I am using a memory tag and I can see it in the Citadel database. When I make the memory tag in the tag configuration editor there are not many choices, tag access says "memory tag", everthing else is grayed out under the "connection" tab. The deadband is set to 1%, with both boxes that say log/print data checked under the "operations" tab, the initial value box is not checked. There is no scaling and no alarms.
0 Kudos
Message 3 of 9
(4,265 Views)
What you're trying to do definitely is possible, but to figure out what's wrong, some background info would help:

-What do you mean by 'start where it left off'. Are you trying to have
a) elapsed time=10.0 hrs, computer down for 2.0 hour, elapsed time=10.0 when restarted;
or
b) elapsed time=10.0 hrs, computer down for 2.0 hour, elapsed time=12.0 when restarted.

-What happens when you restart? Does your elapsed time go to zero or some incredibly silly high number?
=====================================================
Fading out. " ... J. Arthur Rank on gong."
0 Kudos
Message 4 of 9
(4,265 Views)
I am building an application for a rock crusher and in that I have an elapsed hour meter that runs any time the crusher is running. I am trying to prepare for the inevitable of when we lose power to the computer, I never intend to shut the computer off but I am sure that it will happen at some time. What happens during my trials is the elapsed hour meter would work properly when the crusher was running and it would stop when the crusher was stopped. When I would shut my computer down for the night and restarted the next day the elapsed hour meter was back to zero even though it may of had 3:23:35 (hours:minutes:seconds)on my digitl display in my VI before I shut down.
0 Kudos
Message 5 of 9
(4,265 Views)
> hour meter was back to zero even though it may of had 3:23:35
> (hours:minutes:seconds)on my digitl display in my VI before I shut
> down.

You will want to write the value out to disk periodically. If you write
it every ten minutes, then a power outage can only introduce a possible
loss of 9:59. So, decide how often you want to open with overwrite,
write, and close the file. If you intend to leave it open, use seek to
the front of the file and flush to make sure the data is actually written.

Greg McKaskle
0 Kudos
Message 6 of 9
(4,265 Views)
Miksum,

I think Greg may have missed that you're using the DSC module. If the tag is set up correctly, it's already going to disk periodically to Citadel.

You said you can see your tag "in the Citadel database". What happens to the value before and after shutdown? If it goes to zero, you may have an unintended write to the memory tag somewhere your logic.

If you're using "Read Tag" when your LV program starts up instead of using "Read Trace" and extracting the last logged value, there definitely will be a problem.

Is your elapsed hour meter intended to measure each rock crusher session (i.e it goes to zero when the crusher is off) or is it for total hours of crushing for multiple sessions. I'm just tryi
ng to sort out what kind of logic is in your program.
=====================================================
Fading out. " ... J. Arthur Rank on gong."
0 Kudos
Message 7 of 9
(4,265 Views)
Donald,
I have been studying the information in the Citidel, as far as I can tell the elapsed time information is there until the computer is shut off, then the value starts back at zero. The elapsed hour meter only goes back to zero when I shut down the computer, not when I start and stop the tag engine.

I am using a "Read Tag" in my program, I cannot find the "Read Trace" that you refer to.

As for the elapsed hour meter, look at like an odometer in your car, it is never reset. It is used to schedule maintenance, and check performance.
0 Kudos
Message 8 of 9
(4,265 Views)
miksum wrote:
> Donald,
> I have been studying the information in the Citidel, as far as I can
> tell the elapsed time information is there until the computer is shut
> off, then the value starts back at zero. The elapsed hour meter only
> goes back to zero when I shut down the computer, not when I start and
> stop the tag engine.

I think what you see is the separation of the real time tag buffer and
the historical tag information. The real time tag buffer maintains the
latest value and timestamp for each tag so that when you read a tag you
get the latest value without LabVIEW DSC needing to query the historical
database first. As long as the Tag Engine stays in memory, the real time
tag buffer is
not cleared except for tags you may have set to initialise
on startup to a particular value.

SCADA systems usually do NOT reinitialize the real time tag buffer from
the historical data at all, but if you want to do that you need to do it
on your own. On startup read the historical tag information for that tag
and write the last value back into the tag, updating effectively the
real time tag database.

> I am using a "Read Tag" in my program, I cannot find the "Read Trace"
> that you refer to.

Read Tag reads the real time tag buffer. Read Trace or maybe a slightly
different name is in the Historical Data function group.

Rolf Kalbermatter
Rolf Kalbermatter  My Blog
DEMO, Electronic and Mechanical Support department, room 36.LB00.390
0 Kudos
Message 9 of 9
(4,265 Views)