From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
03-25-2015 12:59 PM
Hello,
I'm using the DSC module and the Citadel database to create a data log for a period of time. To log the data I use "shared variable" enabling log in options and etc.
However when I have a power problem and the computer turns off suddenly, I lose all data since the last time I turned on the computer and ran the program. If the computer is shut down properly the data is written to the database correctly.
How can I do to solve this "data loss"?
03-25-2015 01:45 PM
If the data is held in memory and only written when a "Close" command is given, then one way to handle this is to periodically issue Close, issue (Re-)Open, process the existing data so you can "append" data, then continue. Depending on your data rate and its periodicity, this may "always work", "sometimes work" or "never work". Optimistic situations are where the sampling is very slow (say, 1/minute, so you have plenty of time between samples to do a Close/ReOpen cycle) or is episodic, say multiple "trials" that have high data rates, but have time between successive trials for the Close/ReOpen cycle.
Bob Schor
03-25-2015 02:28 PM
03-25-2015 02:37 PM
Hello,
How can a I "Close"?
The first time the data stay in Citadel, but the second time the data is lost. I get a 1 sample per second.
Thank you.
03-25-2015 10:38 PM
I assume your code is simply writing to a variable that has logging enabled. What are the logging resolution and deadband settings for the variable?
If you open MAX and use the historical data viewer to view your trace, do you see it updating in real-time while your program runs?
I'll second the UPS option too. Data loss is frustrating, but complete database corruption can be much worse!
03-29-2015 06:14 PM
Hello,
I'm using shared variable to log data. I configured the deadband to 0.1%. I can see the variable value and the graphic using MAX.
If I turnoff the PC in rigth mode, the log data stay in database CItadel memory. But if the pc turn off sudenly the data is lost since the last time I turn on the PC.
I tried open and close the database, but don't work. I tried use simple write trace (open trace, write trace, close trase every second) but the same result.
I think it's critical problem to Citadel database. I can lost an hour of data for example, it's no problem, but lost data since the last time I turn on the PC is much.
I will use UPS, but if occurs any problems with the PC I will lost all my data?
03-29-2015 09:23 PM
Your problems all seem to be related to your comp crashing.
If you don't want to program in a way that saves data more frequently, why not just get a computer that's more stable?
03-30-2015 03:29 PM
03-30-2015 04:27 PM
When you close the program correctly, the Citadel database is saved as you'd desire correct?
If that's the only way your database will update, just write a VI that closes out periodically with another set to open it. It's not a DSC issue
03-31-2015 07:21 AM
Hello natasftw,
This is the problem. If I close my program correctly and if before 1 hours my PC turn off suddenly I lost all data since last PC start up. How can I save the CItadel data?