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 starts FALSE: Action stops, outputs xDone, xBusy, xError are resetted |
LTrig |
Output |
xDone |
BOOL |
TRUE: Action successfully completed |
LTrig |
xBusy |
BOOL |
TRUE: Function block active |
LTrig |
|
xError |
BOOL |
TRUE: Error occurred, function block aborts action FALSE: No error |
LTrig |
|
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. If xReceived is TRUE buffer contains received DTC information. Note: Data is only valid as long as xReceived is TRUE. |
|
udiDTCBufferCount |
UDINT |
Number of DTCs fitting into pDTCBuffer |
||
Output |
udiDTCReceiveCount |
UDINT |
Number of DTCs written to pDTCBuffer. Only valid if xReceived is TRUE. |
|
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. |