MC_AxRtLoggerRead_BkPlcMc (from V3.0)
The function block reads a message from the LogBuffer of the library. Further information about creating a log buffer can be found under FAQ #10 in the Knowledge Base.
This function block is used by diagnostics tools via ADS. A direct call from the PLC application generally makes no sense. |
Inputs/outputs
VAR_INOUT
Entry: INT:=0;
pBuffer: POINTER TO ST_TcPlcMcLogBuffer;
pEntry: POINTER TO ST_TcPlcMcLogEntry;
END_VAR
Name | Type | Description |
---|---|---|
Entry | INT | The number of the message to be read. |
pBuffer | POINTER | Here the address of a variable of type ST_TcPlcMcLogBuffer is to be transferred. |
pEntry | POINTER | Here, the address of a variable of type ST_TcPlcMcLogEntry should be transferred as target. |
Outputs
VAR_OUTPUT
Result: DWORD:=0;
END_VAR
Name | Type | Description |
---|---|---|
Result | DWORD | Here, a coded cause of error is provided. |
Behavior of the function block
The function block checks the transferred input values with each call. Two problems can be detected during this process:
- If Entry is not in the valid range (1..20), the function block returns dwTcHydAdsErrInvalidIdxOffset as Result.
- If pBuffer or pEntry are not defined, the function block returns dwTcHydAdsErrNotReady as Result.
If no problem was detected during the check, the function block copies the message selected by Entry from the LogBuffer pBuffer into the message structure addressed with pEntry. Entry is understood as a relative age specification: Entry:=1 selects the last message entered, Entry:=2 the next older one, etc. If the required message is not available, an empty message is provided.