Function Description
The OUT_IN_CHAR
function is used to send a string
of a maximum of 210 bytes (120 for the terminal port), followed by
a message receive request (send only or receive only is also possible).
The character string may be contained in a static variable or stipulated in the form of an immediate value (series of bytes between apostrophes, e.g.: 'Message to be sent').
These character strings
may contain special characters, and must start with the character $
followed by the hexadecimal value of the character to
be sent, for example $0D
.
Certain special characters may be used, such as:
$R = CR
(carriage return), $L = LF
(line feed), $N = CR+LF
.
The additional parameters EN
and ENO
can be configured.
FBD Representation
Representation:

LD Representation
Representation:

IL Representation
Representation:
LD Address
OUT_IN_CHAR Mode, Data_to_Send, Management_Param, Received_Data
ST Representation
Representation:
OUT_IN_CHAR(Address, Mode, Data_to_Send, Management_Param, Received_Data);
Parameter Description
The following table describes the input parameters:
Parameter |
Type |
Comment |
---|---|---|
|
ARRAY [0...5] OF |
Address of the destination entity
of the exchange. Only those addresses ending in |
|
|
Operating mode:
|
|
|
Character string to send. It is essential for this character string to exist when the function is called, even if there is no data to send (for example in receive only mode). |
The following table describes the input/output parameters:
Parameter |
Type |
Comment |
---|---|---|
|
ARRAY [0...3] OF |
The following table describes the output parameters:
Parameter |
Type |
Comment |
---|---|---|
|
|
Character string received. It is essential for this character string to exist when the function is called, even if there is no data to receive (for example in send only mode). |
To send character strings containing end of string characters (ZERO). You must:
Use localized STRINGS.
Initialize the last word of the exchange management table with the number of characters to send. If you initialize this word with the value 0, the string that is sent will stop at the first ZERO character it encounters. If you initialize it will a value, the length of the character string sent will be equal to this value.