Skip to content

read_memory_blockReadMemoryBlockReadMemoryBlockread_memory_blockT_read_memory_block🔗

Short description🔗

read_memory_blockReadMemoryBlockReadMemoryBlockread_memory_blockT_read_memory_block — Read a memory block from a file.

Signature🔗

read_memory_block( filename.read FileName, out memory_block MemoryBlockHandle )void ReadMemoryBlock( const HTuple& FileName, HTuple* MemoryBlockHandle )static void HOperatorSet.ReadMemoryBlock( HTuple fileName, out HTuple memoryBlockHandle )def read_memory_block( file_name: str ) -> HHandle

Herror T_read_memory_block( const Htuple FileName, Htuple* MemoryBlockHandle )

void HMemoryBlock::HMemoryBlock( const HString& FileName )

void HMemoryBlock::HMemoryBlock( const char* FileName )

void HMemoryBlock::HMemoryBlock( const wchar_t* FileName ) (Windows only)

public HMemoryBlock( string fileName )

void HMemoryBlock::ReadMemoryBlock( const HString& FileName )

void HMemoryBlock::ReadMemoryBlock( const char* FileName )

void HMemoryBlock::ReadMemoryBlock( const wchar_t* FileName ) (Windows only)

void HMemoryBlock.ReadMemoryBlock( string fileName )

Description🔗

The operator read_memory_blockReadMemoryBlock reads the file FileNamefileNamefile_name and creates a new memory block in MemoryBlockHandlememoryBlockHandlememory_block_handle that is an identical copy of the bytes in the file.

The default HALCON file extension for memory block files is '.bin'.

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.

This operator returns a handle. Note that the state of an instance of this handle type may be changed by specific operators even though the handle is used as an input parameter by those operators.

Parameters🔗

FileNamefileNamefile_name (input_control) filename.read → (string)HTuple (HString)HTuple (string)strHtuple (char*)

Name of the file.

Default: 'memory_block.bin'"memory_block.bin"
File extension: .bin

MemoryBlockHandlememoryBlockHandlememory_block_handle (output_control) memory_block → (handle)HTuple (HHandle)HMemoryBlock, HTuple (IntPtr)HHandleHtuple (handle)

Memory block handle.

Result🔗

The operator read_memory_blockReadMemoryBlock returns the value 2 (H_MSG_TRUE) if the named file was found and correctly read. Otherwise, an exception is raised.

Combinations with other operators🔗

Combinations

Possible successors

get_memory_block_ptrGetMemoryBlockPtr, compare_memory_blockCompareMemoryBlock, memory_block_to_imageMemoryBlockToImage

See also

write_memory_blockWriteMemoryBlock

Module🔗

Foundation