0
Answered

MDL2 Log Error - Failed writing

Rick 3 years ago in Master modules updated by Gustav Widén (System support) 3 years ago 5

A 5 year old MDL2 is giving us this exact (system) pop-up message:

"

Log error

Failed writing. The log has been stopped!

"


My guess is that the (flash?) memory is full or corrupted, so system events like a startup or sensor error can't be written anymore. Not a big deal, but:

* How to get rid of the message

* In case the log memory is corrupt, would that also threaten other memories? In other words, should we replace this MDL2?


As far as I can see, this a fixed system message, not a custom pop-up.

Under review

Yes, this is a system generated message.

It is not the message for a normal log full (that one will eventually get if the log is not set to recycle), the writing has failed for another reason.


When I have seen this in the past, it has been enough to restart the module, and then it has been possible to read the old log records and to continue to log.


What I would also recommend is to upgrade the application to 3.19.7 or later. In that version we made a small improvement to retry if writing if a log event failed. But if there is an actual fault in the log memory you could still get this also in later versions.


A question about the application is, do you have only event logs, or do you also have statistics logs? In general, the statistics logs will cause more write operations.

No, faults in the flash for log memory does not affect the flash where the application is stored.



There are no additional logs, just the default system one. But I do know there the majority is because if "Division by Zero" events (which would be nice to disable optionally btw). So, it likely has logged that many thousands times through the years. Could it be the memory is just "worn off"? Because in that case... I'm afraid a lot more machines will follow.


Is there a way to fully supress this message? We are still using IQAN 2.6 for that MDL2 -didn't want to take risks migrating old machines. The user complains the pop-up keeps coming back, and the only solution I can think of now is to replace it with a new MDL2. Shouldn't be needed for a log function we don't really use...




A flash memory will wear out with repeated write operations to the same positions, but a 2.x application, the log will not automatically wrap around, it will fill up and stop. To repeat the writing to the same positions you would have to keep clearing it, a lot.


The MDL2 has got 16 MB of log memory, each holding about 40000 events, and in version 2 there was no property to control the size of the log, so in this case with only the system log, all of it is available for the system log. That is a lot of individual events before filling it up completely. One speculation is that perhaps the MDL2 only just now got into an area that it cannot write to. In that case, just attempting to clear the log would be worth trying.


You can disable the dialog about failed writing by disabling the system log, there is an enable property on the logs:


To avoid the division by zero you could put it inside an if statement that checks if the denominator is zero before performing the division. This is a good method when using Qcode in 4.x.


To avoid division by zero in a 2.x system using object list, you can implement it like this:


avoid division by zero.ida

Didn't know the system log could be disabled, but that sounds like a soltion, thanks!