LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

cRIO 9068 config file corruption on power loss - best practices?

I am using a cRIO 9068 to control and monitor a process on some remote jobs. Since various settings and other attributes tend to change, I periodically save the config file, in this case every 10 seconds, while the job is running. Since often times the equipment gets unplugged or power is disconnected without regard to this xml config file write process, I alternate my writes between two configuration files so if one is corrupted and errors out, it triggers an event to use the alternate. 

 

I have been having issues loading corrupted config files despite this approach, so I am curious if it is possible that the file operation could be corrupting multiple files located in the same folder, or if this is unlikely. I use the Write to XML file for my config file saves, which is a Create or Replace file save, followed by a binary write, then a file ref close. I am not flushing anything. 

 

In the error positive events I have been able to reproduce, a probe of the Read XML on my config file (a LV cluster typedef, full of various arrays and other custom typedefs and timestamps) will show all the information, but with a large chunk of spaces in front of everything, which I believe is where it hangs up on parsing it. 

 

I have considered the use of a 24VDC UPS, but the particular use case (read: time frame) of our scenario makes the inherent equipment cost and size a bit of a constraint with the current physical aspect of the enclosure. 

 

Some suggestions/thoughts would be appreciated. 

 

Thanks,

R

0 Kudos
Message 1 of 7
(2,985 Views)

From the title I would have recommended using two files and alternate for each update, but you seem to have already done that.

 

So...

 

Are you saying that BOTH files are corrupted at the same time?

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 2 of 7
(2,977 Views)

That's correct. The last time I was able to reproduce the issue, both config files contained corrupt data. 

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

While I did see an issue with LV 7.0 having trouble with files opening and closing quickly and get corruption across multiple files, I have not read of or seen any issues with file writing.

 

If you would like someone to review your code for possible issues, please post the related code and someone may be able to take a look.

 

With that said the only other item worth mentioning is the SSD drives do have a limited number of cycles and they can wear out. See here to read the fine print.

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 4 of 7
(2,961 Views)

I'll work on isolating the relevant snippet and getting it posted. In the meantime, I will say the size of the config file is roughly 45kB.

0 Kudos
Message 5 of 7
(2,949 Views)

This is a stripped down example (LV2k15). The or gate on the seemingly strange characters are just things I've seen in the past that I thought might not error out. 

 

0 Kudos
Message 6 of 7
(2,932 Views)

Most cRIOs have 2 power inputs. You can detect from the code which is active (in most cases).

I have had a similar issue in the past where I wired some circuitrickery around the 2nd input, big caps mostly.

 

If the RIO lost its primary power I could detect it, and would have enough juice on power2 to abort code and close off file references.

 

Easy except I just read this: http://digital.ni.com/public.nsf/allkb/3F83FB05752ACA698625754E007CFABF

 

Looks like the 9068 will be a pain in the arse....

 

Ask NI about the car and see what they suggest.

 

0xDEAD

0 Kudos
Message 7 of 7
(2,929 Views)