Academic Company Events Community Support Solutions Products & Services Contact NI MyNI
60 ratings:
 3.43 out of 5   

Archived: Accessing Hardware Registers and Physical Memory in Windows NT/2000/XP with LabVIEW

This document has been archived and is no longer updated by National Instruments

Primary Software:
Primary Software Version: 4.0
Primary Software Fixed Version: N/A
Secondary Software: N/A

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?

  1. 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

    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.

  2. 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.

Related Links:
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


Report Date: 10/02/2002
Last Updated: 06/15/2011
Document ID: 2Q1FC3K8

Your Feedback! poor Poor  |  Excellent excellent   Yes No
 Document Quality? 
 Answered Your Question? 
  1 2 3 4 5
Please Contact NI for all product and support inquiries.submit