Reads data from the specified physical memory address.
[ lStatus = ] Peek (dwAddress, pDst, [lBytes], [lElementSize] )
The Peek procedure syntax has the following parts:
Name |
Type |
Description |
lStatus |
Long |
Return status. -1 for error. |
ddwAddress |
Val DDWord |
Physical address to read from. |
pDst |
Var Any |
Receive data buffer. |
lBytes |
Val Long |
Optional. Number of bytes to read. The default value is -1 for using the size of pDst. |
lElementSize |
Val Long |
Optional. Element read size can be -1, 1, 2 or 4. The default value is -1 for using element size of pDst. |
The function is used to read data from physical memory. This memory typically reside on a PC boards (e.g. PCI board). The memory space that is used by a PC board can be retrieved by using the Windows Control Panel Device Manager applet or for PCI boards by using Marvin Test Solutions's PXI/PCI Explorer (can be open also from the Windows Control Panel).
Use the lElementSize size to read bytes, words or double word from the board, if lElementSize does not match to the board reading size the data received may be not correct. When using the default value -1 for lElementSize the element size of the pDst is used. For Bool, WChar, BString, Word and Short 2 is used, for DWord, Long and Float 4, and for all other types 1 is used.
Note: Physical memory and Port I/O access is a privileged instruction and require special access code from MTS. Contact MTS for obtaining the access code (ATEasy 2023/v12.0)
The following example reads one double word from the address 0xED000000 to the dwData DWord variable:
Peek(0xEc000000, dwData)