PortInWords Procedure

Reads words (16 bits) of data from the specified input port.

Syntax

[ lInBytes = ] PortInWords ( nPort, pDst [, lWords ] )

The PortInWords procedure syntax has the following parts:

 

Name

Type

Description

lInBytes

Long

Returned number of bytes read

nPort

Val Short

Input port number (address)

pDst

Var Any

Receive data buffer

lWords

Val Long

Number of words to read. The default value is -1 - read the number of words as defined in pDst.

Comments

The function, which may be used to read data from I/O-mapped, PC-based instruments, returns words of data read from nPort. nPort can be any number in the range 0x0000 - 0xFFFF.

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 reads 100 words from the address 0x311 to the pDst data buffer:

lInWords = PortInWords (0x311, pDst, 100)

See Also

PortInBytes, PortInWord, PortOutWord, PortOutWords