I made a small function block library that makes the logging of a message easier, But noticed a problem when writing messages to the logger. When a short message is written after sending a longer message part of the old message still shows.
This problem only occures when writing from the library, not when the function block internals are copy pasted in a program.
These messages show the difference where the bottom two are written form the library function block and the top two are from a program.

I thought the problem lies somwhere in the buffer that is used to write the message as ASCII data.
So instead of just using the following code snippet.
![]()
and then calling the write function like this:
To try and fix the issue I tried resetting and writing to the buffer with the memset function.
![]()
![]()
With these i can see that the buffer is reset correctly after each message but in the logbook the problem persists.
Does anyone know a possible fix for this or is it not possible to write from a logbook like this?
