receive_data — 使用通用套接字连接从外部设备或应用程序接收任意数据。
receive_data receives arbitrary data over a generic socket
connection. The received data is converted from a binary network
packet to a value (or a tuple of values) using the parameter Format
as specification and is well-suited to communicate with external devices or
applications. This operator does not support the standard 'HALCON'
protocol, but is intended for arbitrary data transfer.
The received data is converted to a value or tuple of values using the
parameter Format. It is possible to specify multiple formats. In
this case the From parameter will contain a 3rd value which tells
you which format has been used to convert the data. To decide which format to
use the size of the necessary data for each format is calculated initially.
When data is received, the first format string with the matching size is used
to convert the data to values.
The parameter From contains the IP address or hostname and port of
the communication partner. For UDP connections it can be used in the
send_data operator to send a response.
Please see send_data for a detailed description of the format.
Socket (输入控制) socket → (handle)
Socket number.
Format (输入控制) string(-array) → (string)
Specification how to convert the data to tuples.
默认值: 'z'
Data (输出控制) string → (string / real / integer / handle)
Value (or tuple of values) holding the received and converted data.
From (输出控制) string → (string / integer)
IP address or hostname and network port of the communication partner.
open_socket_connect,
socket_accept_connect,
get_socket_param,
set_socket_param
基础