Academic Company Events NI Developer Zone Support Solutions Products & Services Contact NI MyNI
3 rating:
 1.66 out of 5     Rate this Document

Basics of Setting Up Dual-Ported or Shared Memory on a VXI Controller

Primary Software: Driver Software>>NI-VXI/VISA
Primary Software Version: 3.4
Primary Software Fixed Version: N/A
Secondary Software: N/A
Hardware: VXI/VME/MXI>>VXI Controllers, VXI/VME/MXI>>VME Controllers

Problem:
How do I set up dual-ported or shared memory on a VXI Controller?

Solution:
For a detailed description of how to configure and use shared memory from a National Instruments VXI/VME bus controller, see Application Note 158 which is linked below. This application note applies to NI-VXI versions 1.5 and higher and contains both LabVIEW and C programming examples and a troubleshooting and common questions section.

The remainder of this KnowledgeBase document revolves around the NI-VXI utilies that were available in NI-VXI 1.5 or earlier.

You will need to configure certain parameters in VXIEdit or VXITedit to share (dual-port) your host's RAM.
  1. You will need to set the Address Space parameter in the Logical Address Configuration page to A16/A24 or A16/A32 for inward cycles instead of the default of A16.

  2. Next set the VXI Shared RAM Size parameter to program the registers to map cycles inward. It is recommended to make this excessively large because excess doesn't matter unless you run out of memory space in the A24 space (max = 16MB) . For example, choosing 8 MB or more if your system allows it is fine even though you only want to request 128kB. This allows more choices for VXIMemAlloc to find a portion of memory that is available from the OS and at the same time has the registers mapping the VXI cycles inward. If you only choose 1MB as the VXI Shared RAM Size and you indeed want to dual-port 1MB, VXIMemAlloc will probably not give you the entire 1MB since this memory must be contiguous.

    On some systems, 2 separate windows may be used for inward cycles. Consult your Getting Started manual. For MXI-2 platforms, you will need to designate System RAM for the host's memory as compared to Onboard RAM which is a plug-in SIMM on the PCI-MXI-2 or AT-MXI-2. In addition, you may designate that one or both windows automatically swap bytes for inward cycles.

  3. Under Win3.x and Win95, you will also have the option of setting the Shared RAM Pool. Upon booting into Windows a device driver, NIVXIPhm.386, will request that the Windows operating system set aside some memory in a contiguous chunk. This makes it easier for VXIMemAlloc to allocate contiguous memory rather than waiting until we have already fragmented the memory by running an app or two. This doesn't apply to other operating systems like Solaris or DOS or Macintosh. Ideally, you will want this value to be about 2X the amount of RAM to dual-port. You will need to re-run Windows (reboot Win95) and run VXIInit for this to take effect. If the device driver is unable to set aside the requested memory in the Shared RAM Pool setting, you will see a message flash on the screen as you enter Windows. If you see an error message, you will need to set Shared RAM Pool to a smaller value until you succeed.

  4. Now you are ready to run your application. Keep in mind that if VXIMemAlloc fails you should request less memory. Whether you can directly dereference the pointer or you must use VXIMemCopy to access the data on the application side is system dependent.


Related Links:
Application Note 158: Configuring and Using Shared Memory From a National Instruments VXI/VME Bus Controller
Getting Started With Your PCI-Based MXI-2 Interface For Windows 2000/NT/Me/9X

Attachments:





Report Date: 09/05/1996
Last Updated: 08/22/2007
Document ID: 0P498RSR

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