|| 3.43 out of 5
Accessing Hardware Registers and Physical Memory in Windows NT/2000/XP with LabVIEW
Primary Software Version:
Primary Software Fixed Version:
I want to access my hardware directly in Windows NT/2000/XP. How can I communicate directly with hardware I/O registers and physical memory?
Developer Zone Example: Port and Memory Utilities for Windows
KnowledgeBase 2RCK8PTL: How Can I Write and Read from I/O and Memory Space in CVI?
Products and Services: NI Measurement Hardware DDK (Driver Development Kit)
KnowledgeBase 2QKEQHPG: Measurement Hardware Driver Development Kit (MHDDK) Frequently Asked Questions
- Accessing hardware registers in Windows NT/2000/XP using LabVIEW
Hardware registers are accessed using the In Port and Out Port VIs in LabVIEW. These are not available in Windows Vista or Windows 7. See the heading for your version of LabVIEW below for more details:
LabVIEW 8 and later
LabVIEW 8 maintains the functionality available in LabVIEW 7.x, but the In Port and Out Port VIs are now found on the Functions palette at Functions» Connectivity» Port I/O.
LabVIEW 7.x ships with In Port and Out Port VIs which work in Windows NT/2000/XP. These are found on the Functions palette at All Functions» Advanced» Port I/O. It is not necessary to install the AccessHW libraries to access hardware registers. The new VIs are polymorphic, allowing you to choose between 8, 16, or 32 bit operations, and are not pin compatible with the VIs from previous versions of LabVIEW. Due to this, minor changes will be necessary when converting applications from LabVIEW 6.1 to LabVIEW 7.x which utilize the In Port and Out Port VIs.
LabVIEW 4.0 - 6.1
The In Port and Out Port VIs that ship with LabVIEW 4.0 through 6.1 do not work on Windows NT/2000/XP because they are not kernel mode routines, which are required for direct hardware access. To work around this, download and install the AccessHW library found at the Port and Memory Utilities for Windows link below. This will install replacement In Port and Out Port VIs which will work in Windows NT/2000/XP. The replacement VIs will be found in the installed directory and can then be used instead of normal In Port and Out Port VIs. If converting existing code, you will need to manually replace each existing In Port and Out Port VI with the newly installed replacements.
- Accessing memory-mapped devices or other locations in physical memory
LabVIEW does not have native support for physical memory access. A library called AccessHW is available which provides this functionality by installing VIs which call LabWindows/CVI functions to allow direct memory access. The AccessHW library can be found at the Port and Memory Utilities for Windows link found below. The AccessHW installation will install the necessary LabWindows/CVI components, and does not require you to own LabWindows/CVI.