SendString

SendString 1:

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

SendString 2:

Alternative

SendString has a standard length of 80 characters. For some applications a longer string is desirable. In this case the function block SendString255 can be used. The only difference is a length of 255 characters to the SendString.

SendString 3: Inputs

VAR_INPUT
  SendString         : STRING;
END_VAR

Name

Type

Description

SendString

STRING

The character string to be sent.

SendString 4: Inputs/outputs

VAR_IN_OUT
  TxBuffer         : ComBuffer;
END_VAR

Name

Type

Description

TxBuffer

ComBuffer

Send data buffer that corresponds to the interface used.

SendString 5: 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 data has successfully been sent when Busy=FALSE and Error=0.

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

Busy becomes FALSE as soon as the data has been sent or an error or timeout has occurred.

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