Add own log messages

Download Example

CODESYS includes a logger, where system components and fieldbusses are issuing status and error messages.

But this functionality is not limited to internal features. Every application and every library has access to the logger. You simply need to register a component, that you can identify yourself against the logger.

Component_Manager.CMAddComponent2('User Application', 16#00000001, ADR(udiCmpId), 0);

After that you can freely issue LogAdd to write new messages to the PLC log.

CmpLog.LogAdd2(CmpLog.LOG_STD_LOGGER, udiCmpId, CmpLog.LogClass.LOG_INFO, 1, 1, 'Test Message');

Posted by Ingo 2019-05-10 | Draft

Log in to post a comment.