write_message🔗
Short description🔗
write_message — Write a message to a file.
Signature🔗
write_message( message MessageHandle, filename.write FileName, attribute.name GenParamName, attribute.name GenParamValue )
Description🔗
write_message writes the message denoted by the
MessageHandle to the file given by FileName.
The default HALCON file extension for a message is 'hmsg'.
If MessageHandle contains a handle that can not be serialized or
that has been freed already, an exception is raised per default.
This behavior is controlled by GenParamName
'raise_error_if_content_not_serializable', and the corresponding
GenParamValue can take the following values:
-
'true': The default: Errors are raised and the writing process aborted.
-
'low_level': Only low level errors are raised. Instead of the handle concerned an empty handle is written in
FileNameand the writing process will be continued. The behavior regarding HALCON low level errors is determined by 'do_low_error' inset_system. -
'false': The errors are suppressed. Instead of the handle concerned an empty handle is written in
FileNameand the writing process will be continued.
Execution information🔗
Execution information
-
Multithreading type: reentrant (runs in parallel with non-exclusive operators).
-
Multithreading scope: global (may be called from any thread).
-
Processed without parallelization.
Parameters🔗
MessageHandle (input_control) message → (handle)
Message handle.
Number of elements: MessageHandle == 1
Restriction: MessageHandle != 0
FileName (input_control) filename.write → (string)
File name.
File extension: .hmsg
GenParamName (input_control) attribute.name(-array) → (string)
Name of the generic parameter.
Default: []
List of values: 'raise_error_if_content_not_serializable'
GenParamValue (input_control) attribute.name(-array) → (string / integer / real)
Value of the generic parameter.
Default: []
Suggested values: 'true', 'false', 'low_level'
Result🔗
If the parameters are valid, the operator write_message returns
the value 2 (H_MSG_TRUE). If necessary an exception is raised.
Combinations with other operators🔗
Combinations
Possible predecessors
read_message, deserialize_handle, create_message
Possible successors
See also
Module🔗
Foundation