Main Content

memmap

(To be removed) Map memory for low-level memory read and write operations

This visa object function will be removed in a future release. Use visadev object functions instead. For more information, see Version History.

Syntax

memmap(obj,'adrspace',offset,size)

Arguments

obj

A VISA-VXI or VISA-GPIB-VXI object.

'adrspace'

The memory address space.

offset

Offset for the memory address space.

size

Number of bytes to map.

Description

memmap(obj,'adrspace',offset,size) maps the amount of memory specified by size in address space, adrspace with an offset, offset. You can configure adrspace to A16 (A16 address space), A24 (A24 address space), or A32 (A32 address space).

Examples

Create the VISA-VXI object vv associated with a VXI chassis with index 0, and a Keysight® E1432A digitizer with logical address 130.

vv = visa('keysight','VXI0::130::INSTR');
fopen(vv)

Use memmap to map 16 bytes in the A16 address space.

memmap(vv,'A16',0,16)

Read the first and second instrument registers.

reg1 = mempeek(vv,0,'uint16');
reg2 = mempeek(vv,2,'uint16');

Unmap the memory and disconnect vv from the instrument.

memunmap(vv)
fclose(vv)

Tips

Before you can map memory, obj must be connected to the instrument with the fopen function. A connected interface object has a Status property value of open. An error is returned if you attempt to map memory while obj is not connected to the instrument.

To unmap the memory, use the memunmap function. If memory is mapped and fclose is called, the memory is unmapped before the object is disconnected from the instrument.

The MappedMemorySize property returns the size of the memory space mapped. You must map the memory space before using the mempoke or mempeek function.

Version History

Introduced before R2006a

collapse all

R2021a: visa object interface will be removed

Use of this function with a visa object will be removed. To access a VISA resource, use a visadev object with its functions and properties instead.

The recommended functionality has additional capabilities and improved performance. See Transition Your Code to visadev Interface for more information about using the recommended functionality.