mvm_gui_send_tuple — Send a tuple to a webclient.
mvm_gui_send_tuple( : : ServerHandle, ConnectionHandle, Id, Tuple : )
Sends a tuple in Tuple via a server specified by ServerHandle to a connected webclient specified by ConnectionHandle.
Multiple connections can be specified as tuple. A ConnectionHandle with the value 'all' means that the message is sent to all connected clients and is the default. A value of 'first' addresses only the first connection. Additionally, an optional custom error handling can be specified in ConnectionHandle.
For further explanations on connection handles and custom error handling, see the MachineVisionMakers / HDevGUI chapter documentation for this extension package.
The message ID by which the message will be received on client side has to be given in Id. The ID must be a valid C identifier which consists of letters, digits, and underscores and must start with a letter or underscore.
It is up to the UI element on how the value in Tuple is handled:
<div>, <span>, <h1>, <h2>, <h3>, <h4>, <h5>, <h6>, <h7>, <h8>, <h9>, <p data-bind="my_id">:
String values are set as the plain literal text.
<input type="text" data-bind="my_id">:
String values are set as plain literal value for the attribute "value".
<select data-bind="my_id"><option value="my_tuple"></option></select>:
String values which match the "value" attribute of an "option" element are selected.
<input type="checkbox" data-bind="my_id">:
The values 'true', 'true', 1, and all other positive integers are interpreted as checked. The values 'false', 'false', 0 are interpreted as unchecked.
<input type="radio" data-bind="my_id">:
String values which match the "value" attribute of a radio button are interpreted as checked.
<input type="range" data-bind="my_id">:
The corresponding value is set as value for the "value" attribute.
<ul class="listview" data-bind="my_id">:
The corresponding array of strings is used to add the same amount of li elements containing the corresponding plain literal text.
<div class="status-indicator" data-bind="my_id">:
The corresponding string value is set as background color (CSS style "background-color") for the status indicator circle. Example values: 'red', '#007F00'.
If the option ackTimeoutMillis is set to a positive value (default), the operator mvm_gui_send_tuple waits for an acknowledge package from the client. If there is no acknowledge package within the given
timeout the operator mvm_gui_send_tuple returns with error code HDGERR_SERVER_ACK_TIMEOUT. If the ID was not handled by the client scripting code, the error code HDGERR_SERVER_ACK_NOT_HANDLED will be returned.
ServerHandle (input_control) serial → (handle)
GUI server handle
ConnectionHandle (input_control) socket(-array) → (handle / string)
The destination connection handle
Default value: 'all'
List of values: 'ack_error_ignore', 'ack_error_lowlevel', 'ack_error_raise', 'all', 'connection_error_ignore', 'connection_error_lowlevel', 'connection_error_raise', 'first'
Id (input_control) proc_name → (string)
message ID
Tuple (input_control) integer(-array) → (string / integer / real)
The tuple to be sent
mvm_gui_send_tuple (ServerHandle, 'all', 'result1', NumRegions) mvm_gui_send_tuple (ServerHandle, 'all', 'checkbox1', true) mvm_gui_send_tuple (ServerHandle, 'all', 'alert', 'could not open File device.')
mvm_gui_send_image,
mvm_gui_set_html
Foundation