Function Description
INPUT_BYTE
is used to send an array
of bytes read request to a character mode communication module. The
message received is stored in an array of bytes.
INPUT_BYTE
provides same
feature like INPUT_CHAR
but it allows
to pass a table off bytes instead of a string as output parameter.
Because of this, it is possible to read a 0 (NULL) byte value in a
byte stream from a serial port.For Premium PLCs, this function is used to receive up to 4 Kbytes (120 bytes for the terminal port).
For Modicon M340 and M580 CPU, this function is used to receive up to 1024 bytes.
2 exclusive possibilities are available:
Read a number of bytes: No condition should be configured.
Read a message: A stop condition should be configured in the configuration screen.
The additional parameters EN
and ENO
can be configured.
FBD Representation
Representation:

LD Representation
Representation:

IL Representation
Representation:
LD Address
INPUT_BYTE Raz, Buffer_Length, Management_Param, Received_Data
ST Representation
Representation:
INPUT_BYTE(Address, Raz, Buffer_Length, Management_Param, Received_Data);
Parameter Description
The following table describes the input parameters:
Parameter |
Type |
Comment |
---|---|---|
|
ARRAY [0..5] OF ARRAY [0..7] OF |
For Premium PLC:
For Modicon M340 PLC:
For Modicon M580 CPU:
|
|
|
Reset. This parameter is used to reset the coupler's receive memory.
NOTE: For terminal port communications of Premium PLCs, the value must be 1. NOTE: On Modicon M340 and M580 CPU, the INPUT_BYTE EF can be programmed with or without this parameter. |
|
|
Length of the buffer or number of bytes to be received.
NOTE: For terminal port communications of Premium PLCs, 0 is the only value authorized. Here, the default end of message character is a carriage return (CR). |
The following table describes the input/output parameters:
Parameter |
Type |
Comment |
---|---|---|
|
|
Exchange management table consisting of the following words:
For detailed information, refer to section Structure of the Management Parameters. |
The following table describes the output parameters:
Parameter |
Type |
Comment |
---|---|---|
|
|
Bytes received. This is then stored
in a NOTE: The size of
the data received (in bytes) is written automatically by the system
in the fourth word of the management table.
|
Programming rules
When
several INPUT_BYTE
are launched simultaneously,
the RAZ
parameter must be set to 0
(module's receive memory not reset).
A request may be made to reset the module's memory for the next message in order to avoid receiving old data.
When the RAZ
parameter is set to 1, the INPUT_BYTE
function must be launched before sending the data.
On Premium PLCs, it takes several PLC cycles to receive a byte 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 receives the string consistently over several fragments.
On Modicon M340 and M580 CPU, it takes only one CPU cycle to receive a byte string of a maximum length of 1024 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_BYTE
function has been sent and is still
pending.