write_memory_blockT_write_memory_blockWriteMemoryBlockWriteMemoryBlockwrite_memory_block (Operator)

Name

write_memory_blockT_write_memory_blockWriteMemoryBlockWriteMemoryBlockwrite_memory_block — Write a memory block to a file.

Signature

write_memory_block( : : MemoryBlockHandle, FileName : )

Herror T_write_memory_block(const Htuple MemoryBlockHandle, const Htuple FileName)

void WriteMemoryBlock(const HTuple& MemoryBlockHandle, const HTuple& FileName)

static void HOperatorSet.WriteMemoryBlock(HTuple memoryBlockHandle, HTuple fileName)

def write_memory_block(memory_block_handle: HHandle, file_name: str) -> None

Description

The operator write_memory_blockwrite_memory_blockWriteMemoryBlockWriteMemoryBlockWriteMemoryBlockwrite_memory_block writes the byte content of the memory block MemoryBlockHandleMemoryBlockHandleMemoryBlockHandleMemoryBlockHandlememoryBlockHandlememory_block_handle to the file FileNameFileNameFileNameFileNamefileNamefile_name. The memory block can be read again with read_memory_blockread_memory_blockReadMemoryBlockReadMemoryBlockReadMemoryBlockread_memory_block.

The default HALCON file extension for memory block files is '.bin', but any file extension can be chosen, including none.

Attention

Choosing a file extension that does not fit the byte content of the memory block MemoryBlockHandleMemoryBlockHandleMemoryBlockHandleMemoryBlockHandlememoryBlockHandlememory_block_handle only changes the name of the file, not the bytes written to disk.

Execution Information

Parameters

MemoryBlockHandleMemoryBlockHandleMemoryBlockHandleMemoryBlockHandlememoryBlockHandlememory_block_handle (input_control)  memory_block HMemoryBlock, HTupleHHandleHTupleHtuple (handle) (IntPtr) (HHandle) (handle)

Memory block handle.

FileNameFileNameFileNameFileNamefileNamefile_name (input_control)  filename.write HTuplestrHTupleHtuple (string) (string) (HString) (char*)

Name of the file.

Default value: 'memory_block.bin' "memory_block.bin" "memory_block.bin" "memory_block.bin" "memory_block.bin" "memory_block.bin"

File extension: .bin

Result

The operator write_memory_blockwrite_memory_blockWriteMemoryBlockWriteMemoryBlockWriteMemoryBlockwrite_memory_block returns the value 2 (H_MSG_TRUE) if the passed handle is valid and if the memory block was successfully written into the named file. Otherwise, an exception is raised.

Possible Predecessors

create_memory_block_externcreate_memory_block_externCreateMemoryBlockExternCreateMemoryBlockExternCreateMemoryBlockExterncreate_memory_block_extern, create_memory_block_extern_copycreate_memory_block_extern_copyCreateMemoryBlockExternCopyCreateMemoryBlockExternCopyCreateMemoryBlockExternCopycreate_memory_block_extern_copy, image_to_memory_blockimage_to_memory_blockImageToMemoryBlockImageToMemoryBlockImageToMemoryBlockimage_to_memory_block

See also

read_memory_blockread_memory_blockReadMemoryBlockReadMemoryBlockReadMemoryBlockread_memory_block

Module

Foundation