Instrument Control Toolbox    
mempeek

Low-level memory read from VXI register

Syntax

Arguments

obj
A VISA-VXI or VISA-GPIB-VXI object.
offset
The offset in the mapped memory space from which the data is read.
'precision'
The number of bits to read from the memory address.
out
An array containing the returned value.

Description

out = mempeek(obj,offset) reads a uint8 value from the mapped memory space specified by offset for the object obj. The value is returned to out.

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

Remarks

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

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

offset indicates the offset in the mapped memory space from which the data is read. For example, if the mapped memory space begins at 200H, the offset is 2, and the precision is uint8, then the data is read from memory location 202H. If the precision is uint16, the data is read from 202H and 203H.

To increase speed, mempeek does not return error messages from the instrument.

Example

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

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

Perform a low-level read the first and second instrument registers.

Unmap the memory and disconnect vv from the instrument.

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

See Also

Functions

fopen, memmap, mempoke, memunmap

Properties

MappedMemorySize, MemoryIncrement, Status


  memmap mempoke