Poke Procedure

Write data to the specified physical memory address.

Syntax

[ lStatus = ] Poke (dwAddress, pSrc, [lBytes], [lElementSize] )

The Poke procedure syntax has the following parts:

 

Name

Type

Description

lStatus

 Long

Return status. -1 for error.

ddwAddress

Val DDWord

Physical address to write to.

pSrc

Val Any

Data buffer to write.

lBytes

Val Long

Optional. Number of bytes to read. The default value is -1 for using the size of pSrc.

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.

Comments

The function is used to write data to 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 write bytes, words or double word from the board, if lElementSize does not match to the board write 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)

Example

The following example write one word to the address 0xED000002r:

Poke(0xEc000002, 0x22w)

See Also

Peek