Hi All,
I wonder which way is correct or better?
I would like to register my own component in order to use it in CMPLog. I can use CMAddComponent() or CMAddComponent2() to do it. The main difference is whether I provide udiCmpId myself or it will be generated by runtime. But I don't know which way is correct. Please look at those two examples below.
I don't know if CMAddComponent2() is newer and then should be used?
CMAddComponent() + providing my own udiCmpId
//16#FFFF0000 for unknownmyVendorId:=16#FFFF0000;myLibId:=1;myComponentId:=myVendorIdORCMPID_IecCodeORmyLibId;componentHandle:=CMAddComponent(pszComponent:='myComponent',udiCmpId:=myComponentId,udiVersion:=1,pResult:=ADR(result));IFcomponentHandle<>RTS_INVALID_HANDLEANDresult=CmpErrors.Errors.ERR_OKTHENLogAdd2(hLogger:=STD_LOGGER,udiCmpID:=myComponentId,udiClassID:=CmpLog.LogClass.LOG_ERROR,udiErrorID:=0,udiInfoID:=0,pszInfo:='myComponent regidtered succsefull.');ELSELogAdd2(hLogger:=STD_LOGGER,udiCmpID:=CMPID_CmpMgr,udiClassID:=CmpLog.LogClass.LOG_ERROR,udiErrorID:=0,udiInfoID:=0,pszInfo:='Error while regidtering myComponent.');END_IF
Hi All,
I wonder which way is correct or better?
I would like to register my own component in order to use it in CMPLog. I can use CMAddComponent() or CMAddComponent2() to do it. The main difference is whether I provide udiCmpId myself or it will be generated by runtime. But I don't know which way is correct. Please look at those two examples below.
I don't know if CMAddComponent2() is newer and then should be used?
CMAddComponent() + providing my own udiCmpId
CMAddComponent2() + udiCmpId generated by runtime
Last edit: FPawlak 2 hours ago