Function Description
For Premium PLCs, the PRINT_CHAR
function is used
to send a character string of a maximum of 4 Kbytes, 120 bytes at
the terminal port, to be transmitted on a character mode link.
For Modicon M340 and M580 CPU, the PRINT_CHAR
function is used to send
a character string of a maximum of 1,024 bytes.
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.
WARNING | |
---|---|
FBD Representation
Representation:

LD Representation
Representation:

IL Representation
Representation:
LD Address
PRINT_CHAR String_to_Send, Management_Param
ST Representation
Representation:
PRINT_CHAR(Address, String_to_Send, Management_Param);
Parameter Description
The following table describes the input parameters:
Parameter |
Type |
Comment |
---|---|---|
|
ARRAY [0..5] OF ARRAY [0..7] OF |
The following statements are true only for Premium PLC:
The following statements are true only for Modicon M340 PLC:
The following statements are true only for Modicon M580 CPU:
|
|
|
Character string to send. This is either latched in a character string or provided as an immediate value. Note: this character string must exist, even if there is no data to be sent. |
The following table describes the input/output parameters:
Parameter |
Type |
Comment |
---|---|---|
|
ARRAY [0..3] OF |
Exchange management table consisting of the following words:
For detailed information, refer to section Structure of the Management Parameters. |
Programming Rules
Special
characters are preceded by the character $
in the
string to be transmitted. The $
characters are not
transmitted by the sender, and must therefore not be counted during
the initialization of the length parameter.
The spaces between two characters are counted in a byte.
Therefore, for the example PRINTING IN PROGRESS$L$R
, the length of the data to be sent
is 22 bytes.
On Premium PLCs, it takes several PLC cycles to send a character string of more than 240 bytes (the string is fragmented). It is therefore important to make sure that the management data is not modified during the processing of the function. The system transmits the string consistently over several fragments, but does not prohibit the transmission of another character string between two fragments.
On Modicon M340 and M580 CPU, it takes one CPU cycle to send a character string of a maximum length of 1,024 bytes. It is important to make sure that the management data is not modified during the processing of the function.
The Modicon M340 PLC's serial
port is full duplex, so a PRINT_CHAR
function can
be sent even when an INPUT_CHAR
function has been
sent and is still pending.
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 with a value, the length of the character string sent will be equal to this value.