Exception System.IO.IOException - CLR_E_UNAUTHORIZED_ACCESS (9)

Hi community.
We have an application that runned fine, until yesterday.
Suddenly the following exeption error came and the program hung itself.

#### Exception System.IO.IOException - CLR_E_UNAUTHORIZED_ACCESS (9) ####
#### Message: 
#### System.IO.FileSystemManager::AddToOpenList [IP: 007e] ####
#### System.IO.FileStream::.ctor [IP: 0052] ####
#### System.IO.FileStream::.ctor [IP: 0010] ####
#### WCR_SD.SDdrv::LogTemp2Reading [IP: 013b] ####
#### FEZ_Domino_xxx_Application1.Program::runT2PIDheat [IP:0104] ####

++Error: Temperature 2 reading not written!!
#### Exception System.NullReferenceException - CLR_E_NULL_REFERENCE (9) ####
#### Message:
#### WCR_SD.SDdrv::Close [IP: 0029] ####
#### WCR_SD.SDdrv::LogTemp2Reading [IP: 0163] ####
#### FEZ_Domino_xxx_Application1.Program::runT2PIDheat [IP:0104] ####
Uncaught exception

The line: “++Error: Temperature 2 reading not written!!” comes from the logging to an SD card.

This error did occur always since yesterday. Before that, we have never seen it.
MFDeploy is always connected with the system, so we are sure, this never occurred before.
The error always occurred on a sudden spot in the program where a valve (12 Volt coil) was disengaged.

We could not find a fault in the hardware or in the software.

Then… we have pulled out the micro sd card to save all files.
Windows encountered an error on the card. We have formatted it again after copying the content to a hard disk.
Now everything runs fine again.

Is there someone in the community that can explain this behavior.

Cu, Wim.

SD card got corrupt - random spike on power. It happens…

That was/is my guess too.

But the application is writing to the sd card every 5 seconds, to log some temperatures.
No problems while writing at start-up an during the first 15-20 minutes.
Then there is a phase where the equipment enters the next step and engages the coil.
This step takes roughly one minute. No problems until then.
But at the moment that the coil disengages, there was the error.

I’m guessing: a small power drop during the disengagement of the coil?
Just a small bump to stop logging, but keep the processor going without reset?

Cu, Wim.

Is this repeatable? ie does it do it now every time?

Is the machine controlled by Fez? Are the relays controlled by Fez?

What is powering the Fez? What isolation is in between Fez and the machine?

Yes it was repeatable.

Now it is ok again, after formatting the SD card.

The complete machine is controlled by a FEZ-Domino.

Yes, all solenoids are controlled by FEZ-outputs through a solid state relay. No connection from input side to output side.

FEZ is controlled by a separate 7 Volt supply.
Outputs are controlled by another supply.
Negatives are bound together.

Don’t know what you mean exactly.

Cu, Wim

by repetable I mean if you fire off the relay portion of the code now the SD card does fail in the same way. From what I have gathered, that’s not the case now you’ve reformatted?

isolation meaning opto-isolators and other electrical isolation; you could also talk about what protection diodes you have in place?

After formatting the SD card, I cannot reproduce the fault anymore, before formatting it could be reproduced by 100% from 50 tries.

All coils (relays, solenoids and valves) are isolated by solid state relays from the FEZ.
Maybe there is some opto-isolator built inside.
SSR is: Crydom DMO063 [url]http://www.crydom.com/en/Products/Catalog/dm_o.pdf[/url]
Resistance between load and control is infinite.

All coils (relays, solenoids and valves) have freewheel diodes in (anti)parallel.

Cu. Wim.

coils means EMF which could corrupt a SD it it gets too close.