COM_REC

../_images/bf2c5989e38964540a33139000eba54e
Parameter Value
Library_File_Name ASCII_AC500_V10.lib
Firmware V1.0
Type Type_Function_Block_History
Group ASCII communication

The Function Block COM_REC is used for receiving data via a serial interface in “free mode”. The number of COM_REC Function Blocks within a project as well as their distribution (i.e. assignment) to different user tasks is not restricted. However, it has to be observed that the Function Blocks are mutually interlocked, i.e. it must be ensured that only one Function Block is active at the same time. To avoid the loss of telegram parts and to prevent that telegrams are evaluated incorrectly or not at all, a change of activity between two COM_REC Function Blocks should only occur if the Function Block to be deactivated has signalized the termination of the receive process by setting DONE = TRUE and if the received telegram has been evaluated. It is essential to ensure that all Function Block instances are inactive prior to initiating an activity change. Thus, it is strongly recommended to use only one COM_REC Function Block within a project. This way, any responsibility conflicts can be avoided.

With a FALSE -> TRUE edge at Function Block input EN, the Function Block checks the input values. If they are valid, the Function Block reads the receiving buffer of the corresponding COMx interface one-time.

By specifying the length of the memory address for the received data, the format of the telegram is not restricted in any way. The length of the received data block is limited to a maximum of 256 bytes and is output at LEN.

Note

During project planning it has to be observed that enough free memory space is reserved starting at address DATA for storing the received data (e.g. ARRAY [1..256] OF BYTE).

If a valid received telegram is available in the memory area starting at DATA, this is always indicated by DONE = TRUE.

The inputs can neither be duplicated nor negated/inverted.

Receive error

Possible receive errors are detected by the Function Block and indicated by ERR = TRUE. In this case, an error number is output at ERNO. The Function Block recognizes overflow, parity and framing errors. In this case, the communication parameters (baud rate, char length, no. of stop bits, parity) of the communication partners have to be checked.

Times

There is no particular Function Block available for setting the times in transmitting and receiving direction. This is done in AC500_Product_Namecontroller configuration: plcconf/PLCConfiguration