Binary Data not showing as ASCII data using ArEventLog library

Hi B&R community

I am working on creating a functionblock that logs a message in a custom log module.
A message is created and logged in a module, a description in Binary Data is added to that log and all this is displayed in the logger.

The problem is that the binary data does not show up as ASCII Data.
I would like to avoid using the UserEventText.tmx file to manualy add descriptions to each message and to instead give te description to the message in a task using this functionblock. I think im doing something wrong with the buffer which is now just an empty UDINT variable. but the Binary Data of the message does show in the log.

This is the code in the functionblock

Where the function is called using the following.
image

and this results in these messages.
image

If someone could help that would be great.

Hi,

Try using as .Format := arEVENTLOG_ADDFORMAT_TEXT (instead of _CODED).
As I remember, you also have to provide the string length then as data length, more details about can be found here.

Best regards.

Wow I forgot to change that value during testing when calling the ArEventLogWrite.
It works now thank you

1 Like

Hi @Axel_van_Straaten ,

If you want there is a great library on Loupe Team github : GitHub - loupeteam/LogThat: AR Library for adding diagnostic information into the CPU's logger

It’s simple to implement :slight_smile:

Regards,
Florent