SendData

SendData 1:

SendData sends the content of a variable of any type to the interface that corresponds to the input variable TxBuffer (of type ComBuffer).

SendData 2: Inputs

VAR_INPUT
  pSendData           : POINTER TO BYTE;
  Length              : UDINT;
END_VAR

Name

Type

Description

pSendData

POINTER TO BYTE

pSendData is the address of the send data, and is determined by means of ADR(send data).

The send data may not be changed as long as Busy=TRUE and the data has not yet been sent completely.

Length

UDINT

Length is the number of data bytes to be sent, and can be smaller than or equal to the size of the data structure being used. If the entire contents of a variable are to be sent, then the length can be determined using SIZEOF(send data).

SendData 3: Inputs/outputs

VAR_IN_OUT
  TxBuffer         : ComBuffer;
END_VAR

Name

Type

Description

TxBuffer

ComBuffer

Send data buffer that corresponds to the interface used.

SendData 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 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