LogAdd2 (FUN)
FUNCTION LogAdd2 : RTS_IEC_RESULT
<SIL2/> Add a new log entry to the log buffer.
If the buffer is full when this function is called, the oldest log entry in the buffer will be overwritten.
- InOut:
Scope
Name
Type
Comment
Return
LogAdd2RTS_IEC_RESULTReturns the runtime system error code (see CmpErrors.library)
Input
hLoggerRTS_IEC_HANDLEHandle to the logger which was retrieved by LogCreate() or LogOpen(). Use LogConstant.LOG_STD_LOGGER as a pseudo handle to add this log entry to the standard plc logger.
udiCmpIDUDINTComponentID. This ID consists of the VendorID (as HiWORD), the Library ID (as LoWORD) and in the LoWORD the bit to mark, that this is an IEC library. Example:
VendorID OR ComponentID.CMPID_IecCode OR libraryId
ComponentID.CMPID_IecCode: see Component Manager library
the VendorID can be 0xFFFF if unknown
the LibraryID must be unique for each vendor
NOTE: That the correct component name is displayed in the logger, you have to register your ComponentID first at the component manager:
hCmp := CMAddComponent(sCmpName, udiCmpId, udiCmpVersion, ADR(Result));
- You have to remove the handle if your library is unloaded in the runtime system (e.g. in FB_Exit() method):
CMRemoveComponent(hCmp);
udiClassIDUDINTClassID of the logger. See LogClass.
udiErrorIDUDINTErrorID of the log entry. See CmpErrors.library.
udiInfoIDUDINTID of the info text to enable multiple language error texts
pszInfoSTRING
Logger text which is displayed in the logger