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

How to use Cmplog Lib?

pangwei
2012-07-31
2012-08-03
  • pangwei - 2012-07-31

    In my application ,i want to save some debug messages into a file.
    Now , i can write message into a logger named PlcLogger,and it can display it in codesys,but i can not find the file in my root.
    Do you have any examples?

    Best regards

     
  • TimvH

    TimvH - 2012-07-31

    You can use the CAA_FILE library.
    See the CoDeSys help for detailed information about this library and an example.

     
  • pangwei - 2012-08-01

    Thanks!
    This is not my means.
    I wanted to save messages into the loger file .The message also include the PLC system info.Like this:
    00000980: Cmp=JBL_UTIL, Class=1, Error=0, Info=0, pszInfo= EVT_DenyStart received: App=Application, bDeny=0
    00000980: Cmp=MIO_PLC, Class=1, Error=0, Info=0, pszInfo= EVT_DenyStart received: App=Application, bDeny=0
    00000981: Cmp=JBL_UTIL, Class=1, Error=0, Info=0, pszInfo= EVT_DenyStop received: App=Application, Reason=4, bDeny=0
    00000981: Cmp=MIO_PLC, Class=1, Error=0, Info=0, pszInfo= EVT_DenyStop received: App=Application, Reason=4, bDeny=0
    00000981: Cmp=JBL_UTIL, Class=1, Error=0, Info=0, pszInfo= EVT_PrepareStop received: App=Application, Reason=4
    00000981: Cmp=MIO_PLC, Class=1, Error=0, Info=0, pszInfo= EVT_PrepareStop received: App=Application, Reason=4
    00000981: Cmp=JBL_UTIL, Class=1, Error=0, Info=0, pszInfo= EVT_StopDone received: App=Application, Reason=4
    00000981: Cmp=MIO_PLC, Class=1, Error=0, Info=0, pszInfo= EVT_StopDone received: App=Application, Reason=4

    Do you have any ideas?

     
  • zhanjun717 - 2012-08-03

    you can configure the logging of PLC by editing COdesysSP.cfg file,the component can configure like below:
    [CmpLog]
    Logger.0.Name = "your file name"
    Logger.0.Enable= 1
    ...

     

Log in to post a comment.