Add own log messages discussion

Page 1.0 of 1.32
  • aliazzz

    aliazzz - 2019-05-18

    Nice posting! Thank you for this

     
  • mr337 - 2020-07-28

    Is the project file corrupted some how? Getting the following when trying to open in CodeSys 3.5 SP11

     
  • aliazzz

    aliazzz - 2020-07-29

    I think this example is for SP14 or SP15, you use SP11.

     
  • mr337 - 2020-07-30

    Dang, thanks for the info!

     
  • pcimatti78 - 2020-10-08

    hi,
    why <>
    IF udiCmpId*** <> ***0 THEN
    Component_Manager.CMAddComponent2('User Application', 16#00000001, ADR(udiCmpId), 0);
    END_IF

    does this operation be executed only the first time?

    BR, Paolo

     
    • andi - 2022-01-28

      Hi, the correct statement should be
      IF udiCmpId = 0 THEN
      so that it will called once at the beginning

       
      • hermsen

        hermsen - 2022-01-28

        True, but it makes more sense that this code needs to be executed in implicitly available methods:

            FB_init
            FB_reinit
            FB_exit
        

        If those methods are used, the code will be robust and only called once per triggering event (Init, Re-Init or exit) and can be tailored accordingly.

         
  • sgronchi - 2021-08-06

    Do you know why DTClogger seems not to work if passed a custom logger with these options?
    DM1_logOptions : CmpLog.LogOptions :=
    (szName := 'J1939_DM1',
    bEnable := 1,
    uiType := CmpLog.LogTypes.LT_NORMAL OR CmpLog.LogTypes.LT_TIMESTAMP_RTC OR CmpLog.LogTypes.LT_NO_DISABLE OR CmpLog.LogTypes.LT_DUMP_ALWAYS, // LT_DUMP_ASYNC as in LT_STD results in the same
    uiFilter := CmpLog.LogClass.LOG_INFO OR CmpLog.LogClass.LOG_WARNING OR CmpLog.LogClass.LOG_ERROR OR CmpLog.LogClass.LOG_EXCEPTION,
    iMaxEntries := 1000,
    iMaxFileSize := 50000,
    iMaxFiles := 20);

    'J1939_DM1' log is always empty, but DTCs end up in the device-specific log (I think thanks to DM1 read...)

     

Log in to post a comment.