Data transfer via communication ports
736
Part III FP Instructions
EXAMPLE
Transmit the characters "ABCDEFGH" to an external device connected to COM port 1. For start code and end
code the default settings "No-STX" and "CR" are selected.
(
C
R
)
ON
OFF
ON
OFF
0 2 3 4
ABCDE
FGH
Offset
Transmission data
Execution condition
Transmission
F159_MTRN execution
“Transmission done” flag
POU Header and LD Body
ST Body
When the variable bSend is set to TRUE, the function F10_BKMV copies the characters of the string
sSendData to the buffer awSendBuffer beginning at awSendBuffer[1].
Then, F159_MTRN sends the data from the first element of the send buffer (awSendBuffer[0]) as specified by
s_Start. The length of the string to be sent (8 bytes) is set at n_Number (using the function LEN to calculate
the number of bytes). The data is output from COM port 1 as specified by d_Port.