Contents

memread

High-level memory read from VXI register

Syntax

out = memread(obj)
out = memread(obj,offset)
out = memread(obj,offset,'precision')
out = memread(obj,offset,'precision','adrspace')
out = memread(obj,offset,'precision','adrspace',size)

Arguments

obj

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

offset

Offset for the memory address space.

'precision'

The number of bits to read from the memory address.

'adrspace'

The memory address space.

offset

Offset for the memory address space.

size

The size of the data block to read.

out

An array containing the returned value.

Description

out = memread(obj) reads a uint8 value from the A16 address space with an offset of 0 for the object obj.

out = memread(obj,offset) reads a uint8 value from the A16 address space with an offset specified by offset. You must specify offset as a decimal value.

out = memread(obj,offset,'precision') reads the number of bits specified by precision from the A16 address space. precision can be uint8, uint16, or uint32, which instructs memread to read 8-, 16-, or 32-bit values, respectively. precision can also be single, which instructs memread to read single-precision values.

out = memread(obj,offset,'precision','adrspace') reads the specified number of bits from the address space specified by adrspace. adrspace can be A16, A24, or A32. The MemorySpace property indicates which VXI address spaces are used by the instrument.

out = memread(obj,offset,'precision','adrspace',size) reads a block of data with a size specified by size.

Examples

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

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

Perform a high-level read of the first instrument register.

reg1 = memread(vv,0,'uint16')
reg1 =
       53247

Perform a high-level read of the next three instrument registers.

reg24 = memread(vv,2,'uint16','A16',3)
reg24 =
       20993
       50012
       40960

Disconnect vv from the instrument.

fclose(vv)

Refer to Using High-Level Memory Functions for a description of the first four registers of the E1432A digitizer.

More About

expand all

Tips

Before you can read data from the VXI register, 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 read memory while obj is not connected to the instrument.

Was this topic helpful?