DTCBufferWriter (FB)ΒΆ
FUNCTION_BLOCK DTCBufferWriter EXTENDS DTCHandlerBase
This function block can be connected to a DM1_Read or DM2_Read function block. As long as xEnable
is TRUE
it receives DTCs and writes it to a memory buffer provided by pDTCBuffer
.
If a complete diagnostic message was received output xReceived
becomes TRUE
for one cycle and pDTCBuffer
contains received DTCs.
If buffer is too small DTCs can be lost (see output udiDTCLostCount
).
Note
Output values and Data in pDTCBuffer
is only valid as long as xReceived
is TRUE
(for one cycle).
- InOut:
Scope
Name
Type
Comment
Inherited from
Input
xEnable
BOOL
TRUE
: Action startsFALSE
: Action stops, outputsxDone
,xBusy
,xError
are resettedLTrig
Output
xDone
BOOL
TRUE
: Action successfully completedLTrig
xBusy
BOOL
TRUE
: Function block activeLTrig
xError
BOOL
TRUE
: Error occurred, function block aborts actionFALSE
: No errorLTrig
Input
itfDTCHandlerList
IDTCHandlerList
DMx_Read instance
DTCHandlerBase
Output
eError
detailed error information if xError is TRUE
DTCHandlerBase
Input
pDTCBuffer
POINTER TO DTC
Pointer to ARRAY OF DTC
. IfxReceived
isTRUE
buffer contains received DTC information. Note: Data is only valid as long as xReceived isTRUE
.udiDTCBufferCount
UDINT
Number of DTCs fitting into
pDTCBuffer
Output
udiDTCReceiveCount
UDINT
Number of DTCs written to
pDTCBuffer
. Only valid ifxReceived
isTRUE
.udiDTCLostCount
UDINT
Number of dismissed DTCs. If greater 0 buffer is too small.
xReceived
BOOL
TRUE
for one cycle if a diagnostic message was received. pDTCBuffer contains DTC information.