Any workarounds to get old error numbers (0-65535) into Event Logs

Is there any way to use the ArEventlog library to write in the old error numbers (for example from the FileIO library).

I’m writing a function block that does some directory path creation/intialization, and if I get an unexpected File IO error, I want to write the FileIO library error into the logbook.

In AS 4.x, there may have been a workaround to write them with AsArLog, but that doesn’t exist in 6.0. I’m stuck writing a bunch of custom error numbers or using them as a piece of data into a UserLog entry?

Hi Matt,

You have developed so many libraries in AS so I’m sure I don’t get your request, sorry about that…there is a tricky point behind that…hehe

I want to write the FileIO library error into the logbook

Once you get the error number from FileIO Fub you can save that information into User logger, normally for that I use the UserLog library developed by Tyler : GitHub - tmatijevich/UserLog: Write to user logbooks synchronously · GitHub

Ciao
Valerio

Hi,

you could use the error number as the code part of the event id:

The code part of event id accepts UINT value, but the event id has to be decoded to see the error number directly (I’m not 100% sure, but I think that the AS logger has a view that shows the decoded event id).
Or you just write the error number as string into the additional data of your logger entry using ArEventLogWrite.addData ( B&R Online Help).

Best regards!