4. Configuration
219
message with a resolution of milliseconds where the event was registered. The date and time
information is also used in the formation of the names of the log files.
The UserLogAdd function can be used to enter multiple messages within a single task and also in
different application tasks. However independent of each execution of the function in the application,
being on the same task or on different tasks, all use the same feature to record the desired messages.
For this reason it is recommended that the addition of messages using the UserLogAdd function in
the application be held every 50 ms to prevent the return of buffer overload. If the function is
performed in periods shorter than the indicated, but respect the average time of 50 ms between each
message addition at the end of the interval for the task, also prevents the return of buffer overload. So
that the logs are added correctly, it is important to respect time limits when the card is inserted and at
startup of the CPU, mentioned in chapter Configuration Memory Card. After the operation the
function returns the options for the given type USER_LOG_ERROR_CODES as Table 4-157. When
the function return is not USER_LOG_OK, the message was not registered and the function
UserLogAdd should be re-executed with the desired message. In case of return of consecutive
writing failures, the memory card can be damaged. The replacement by a healthy memory card
ensures that the latest logged messages will be recorded on the card that is not damaged, since the
CPU is not restarted.
The Figure 4-115 represents the function UserLogAdd and Table 4-158 the input parameters:
Figure 4-115. UserLogAdd Function