Welcome to our new forum
All users of the legacy CODESYS Forums, please create a new account at account.codesys.com. But make sure to use the same E-Mail address as in the old Forum. Then your posts will be matched. Close

Writing to devices log

brendang
2016-03-30
2017-02-14
  • brendang - 2016-03-30

    Hi

    I see there is a log for the device (RPI). Is there any way to write to the same log location or is this dedicated for the device only information.

    Thanks

     
  • eschwellinger

    eschwellinger - 2016-04-01

    Hi
    Attached an Example for writing,
    Errors,Warnings,Debug Messages into the plc log.

    BR
    Edwin

    CmpLog_Example.project [74.34 KiB]

     
  • brendang - 2016-04-01

    Thanks Edwin

    I just have a couple of questions:

    Does this log information get stored in a file?

    If the RPI reboots, will this information be rewritten?

    What is "Offline-Logging"

    Much appreciated!

     
  • eschwellinger

    eschwellinger - 2016-04-01

    Hi,

    by Default it is a 'ring-buffer' (alive as Long the runtime runs)
    you could activating to write the log file to the runtime Directory
    by uncommend the following section in /etc/CODESYSControl.cfg:
    (restart plc is needed after doning this)

    ->remove the ';' to activate:

    [CmpLog]
    ;Logger.0.Name=StdLogger
    ;Logger.0.Enable=1
    ;Logger.0.MaxEntries=100000
    ;Logger.0.MaxFileSize=500000
    ;Logger.0.MaxFiles=3
    ;Logger.0.Backend.0.ClassId=0x0000010B
    ;Logger.0.Backend.1.ClassId=0x00000104
    ;Logger.0.Filter=0xFFFFFFFF

    the you
    BR
    Edwin

    IMG: PlcLog.jpg

     
  • Anonymous - 2017-02-14

    Originally created by: OE9SBV

    Hello!

    I have a little problem with your example project.
    I tried to make a status message with:

    stdLogger.AddLogEntry(CmpLog.LogClass.LOG_USER_NOTIFY, Errors.ERR_FAILED, 0, 'server started');
    

    but I only got the message "LOGGING BUFFER OVERFLOW;LOG MESSAGE DISMISSED" in the log file.
    Maybe anyone can help me?

    Best regards,
    Samuel

     

Log in to post a comment.