SendByte

SendByte 1:

SendByte sends a single character to the interface that corresponds to the input variable TxBuffer (of type ComBuffer).

As long as the send data buffer can still accept data, more than one character can be sent in a single PLC cycle. This is, however, only worthwhile if the buffered characters will be transmitted to the hardware by a faster communication task.

SendByte 2: Inputs

VAR_INPUT
  SendByte           : BYTE;
END_VAR

Name

Type

Description

SendByte

BYTE

Das zu sendende Zeichen/Byte.

SendByte 3: Inputs/outputs

VAR_IN_OUT
  TxBuffer         : ComBuffer;
END_VAR

Name

Type

Description

TxBuffer

ComBuffer

Send data buffer that corresponds to the interface used.

SendByte 4: Outputs

VAR_OUTPUT
  Busy            : BOOL;
  Error           : ComError_t;
END_VAR

Name

Type

Description

Busy

BOOL

For as long as the output Busy=TRUE, the transmission is not completed. The character was successfully sent when Busy=FALSE and Error=0.

The output Busy does not become TRUE, if the character could already be sent with the first call.

Error

ComError_t

If a fault occurs, Error will contain an error code.

Requirements

Development environment

Target platform

PLC libraries to include

TwinCAT v3.1.4012

PC or CX (ARM, x86, x64)

Tc2_SerialCom