LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Data logging and power outages

Hello All,
I have a vi that collects data from 3 counters and logs it to a file. This vi is supposed to run 24 Hrs a day. The way I have set things up now is that a new file is created at midnight and data is logged to this file every hour (to reduce disk i/O operations).
I am wondering what happens when there is a power failure. The way things are now, if the power fails at x minutes past the hour, all data collected for the past x minutes is lost. What is the easy solution to this problem? The only thing I can think of is to write data every second, but does this constant read/write on a file matter/ hinder performance/ reduse HDD life?
I have attached a portion of the vi as a jpeg file and the complete vi. Than
ks.

KB
Download All
0 Kudos
Message 1 of 4
(2,900 Views)
> I am wondering what happens when there is a power failure. The
> way things are now, if the power fails at x minutes past the hour,
all
> data collected for the past x minutes is lost. What is the easy
> solution to this problem? The only thing I can think of is to write
> data every second, but does this constant read/write on a file
matter/
> hinder performance/ reduse HDD life?


If your data is too important to risk losing during a power outage, you
should get a UPS. Even an inexpensive "office" UPS will give you minutes to
save your data. Make sure the UPS includes a cord to the computer and
software to shutdown the system automatically.

The event structure allows you to capture (filter) and discard the
application close event. Th
is would give you an opprotunity to save your
data and then close LabVIEW yourself.

My computer didn't finish shutting down when I tested this. You might be
able to have the UPS issue multiple shutdown commands, such as 5 minutes
after the power outage and again when the battery is at 30%.
0 Kudos
Message 2 of 4
(2,900 Views)
How do you use event structure to know/register/poll for application close event?
0 Kudos
Message 3 of 4
(2,900 Views)
I've attached my test vi (Requires LV 7 full ed. or later).

"Grass_Pitch" wrote in message
news:506500000005000000BBB30100-1079395200000@exchange.ni.com...
> How do you use event structure to know/register/poll for application
> close event?



[Attachment Shutdown test.vi, see below]
0 Kudos
Message 4 of 4
(2,900 Views)