Chapter
4
Reference Manual
IVC-2D
184
©
SICK AG • Advanced Industrial Sensors • www.sick.com • All rights reserved
Communication
Read Ethernet Bytes Formatted
This tool is used for receiving a number of bytes from another device over an Ethernet
connection.
The received values are stored in the table as numerical values. The first received value is
stored in table row
Table index
, the next value in row
Table index
+1 etc, until all values
specified in the
Format string
have been received.
If the other device sends more data than expected, the remaining bytes are queued and
will be read the next time a 'Read Ethernet' tool is used with the connection.
In order to receive data from another device, a connection to that device must have been
opened with the 'Open Ethernet Raw' tool. The program step in which the connection was
opened is used as the parameter
Open step
.
Formatting string
The format of the information to receive is specified in a string where the type and preci-
sion is specified for each value. The binary data is formatted according to the IEEE-754
standard. The following formats are available:
Format Description
Ix
Integer with x bytes (1, 2 or 4 bytes)
Fy
Float with y bytes (4 or 8 bytes)
Uz
Unsigned integer with z bytes (1, 2 or 4 bytes)
Pn
Pad with n bytes (0-999 bytes). The padded bytes will be set to 0.
For padding bytes, no table cell is accessed.
Example:
If the telegram holds two integers with 2 bytes, one integer with 4 bytes and three floats
with 4 bytes, the string shall have the following format:
I2I2I4F4F4F4
Input Parameters
01=Open step
The program step in which the connection was opened.
02=Timeout
The time in milliseconds during which the camera will try to
receive data. This includes the time it takes to establish the
connection, if necessary.
03=Table index
Table row in which to store the first received value.
04= Format string
A string specifying how the values shall be formatted. See table
above.
05= Endian
Controls Little or Big Endian for the byte order of the received
data.
Returned Values
01=Received bytes
The total number of bytes that have been received.
Error Messages
Err. = 1
The program step referred to by
Open step
is not an 'Open
Ethernet Raw' step.
The Emulator does
not emulate this
tool. See section
Handling the
Emulator for more
information.