ComReset

ComReset 1:

ComReset resets the connected serial hardware. This clears the internal hardware send and receive buffers. The function block supports a variety of serial hardware, such as the serial PC interface and the KL6xxx Serial Bus Terminals.

In Version 2.0 and above, the function block replaces the KL6Init function block.

Note: The function block does not clear the data buffer of type ComBuffer internal to the PLC. For initialisation purposes, this can be separately cleared with the ClearComBuffer function block.

Interface

VAR_INPUT
    Execute     : BOOL;
    pComIn      : POINTER TO BYTE
    pComOut     : POINTER TO BYTE
    SizeComIn   : UINT;
END_VAR
VAR_OUTPUT
    Done        : BOOL;
    Busy        : BOOL;
    Error       : BOOL;
    ErrorID     : UDINT;
END_VAR

Execute: A rising edge at the Execute input resets the connected serial hardware.

pComIn: Universal pointer to the input variable of the process data for the serial hardware (data types KL6inData, KL6inData5b, PcComInData). The pointer is assigned with the ADR() function.

pComOut: Universal pointer to the output variable of the process data for the serial hardware (data types KL6outData, KL6outData5b, PcComOutData). The pointer is assigned with the ADR() function.

SizeComIn: Size of the input process image of the serial hardware being used. The size is determined and assigned with the SIZEOF() function.

Done: The Done output becomes TRUE when the function has been carried out without error.

Busy: The Busy output becomes TRUE in response to rising edge at Execute, and remains TRUE for as long as the block is performing its function.

Error: The Error output becomes TRUE as soon as an error occurs.

ErrorID: The ErrorID output provides an error code when an error occurs.