Reads a word (16 bits) of data from the specified input port.
[ 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) |
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).
The following example reads a word from address 0x302 to nWord:
nWord = PortInWord(0x302)