PcComControl

PcComControl 1:

Interface

VAR_INPUT
    COMin : PcComInData;
END_VAR
VAR_IN_OUT
    COMout : PcComOutData;
    TxBuffer: ComBuffer;
    RxBuffer: ComBuffer;
END_VAR

Description

The PcComControl function block controls the data transfer between the data buffers TxBuffer and RxBuffer internal to the PLC and the hardware. The data structures PcComInData and PcComOutData are declared globally, and are linked in the TwinCAT System Manager with the PC interface.

PcComControl is always called, regardless of whether there is any intention to send or receive data (Background Communication). This block should be called in a task that is fast enough to achieve an effective baud rate close to the physically determined baud rate.

Note

The function blocks for background communication are preferably handled in a fast task. The demands placed on the task cycle time by the serial PC interface are considerably less than those of the serial bus terminal, so that a special fast communication task for the serial PC interface is often not necessary (compare Supported Hardware).

This block is replaced by SerialLineControl from version 2 of the communication library.