PortInWord Procedure

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

Syntax

[ nInWord = ] PortInWord ( nPort )

The PortInWord procedure syntax has the following parts:

 

Name

Type

Description

nInWord

Short

Returned word read from the port

nPort

Val Short

Input port number (address)

Comments

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

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 a word from address 0x302 to nWord:

nWord = PortInWord(0x302)

See Also

PortInByte, PortInWords, PortOutWord, PortOutWords