background image

Chapter 3

Developing Your Application

PCI-Based MXI-2 Interface for Windows

3-8

ni.com

Note

viMemAlloc()

or

VXImemAlloc()

returns 32-bit aligned, page-locked,

continuous buffers which work efficiently with the move operations.

Shared Memory

In the

Hardware Configuration

settings of the PCI-MXI-2 and

PCI-MXI-2 Universal in MAX, you can share memory on your computer
or from DRAM added to the PCI-MXI-2 and PCI-MXI-2 Universal.
Right-click any of the settings or refer to the help in MAX for more
information. You can access shared memory on your computer using

VXImemAlloc()

in NI-VXI and

viMemAlloc()

in VISA.

NI-VXI API Notes

The following sections apply only if you are using the NI-VXI API. NI
recommends that all new VXI/VME applications use the NI-VISA API,
but you can still develop with the older NI-VXI API for compatibility with
legacy code.

Compiler Symbols

You may need to define certain compiler symbols so that the NI-VXI
library can work properly with your program. The required symbol
indicates your operating system platform; for example,

VXINT

designates

the application as a Windows 2000/NT/Me/98 application.

Note

LabWindows/CVI automatically defines the correct symbol. You do not need to

define

VXINT

when using LabWindows/CVI.

The additional symbol

BINARY_COMPATIBLE

is optional. It ensures that

the resulting application is binary compatible with other National
Instruments VXI controllers using the same operating system. This symbol
may cause a slight performance degradation when you use low-level
VXIbus access functions.

You can define these symbols using

#define

statements in your source

code or using the appropriate option in your compiler (typically either

-D

or

/D

). If you use

#define

statements, they must appear in the code

before the line that includes the NI-VXI API header

nivxi.h

.

Summary of Contents for MXI-2

Page 1: ...MXI TM Getting Started with Your PCI Based MXI 2 Interface for Windows PCI Based MXI 2 Interface for Windows August 2002 Edition Part Number 321712C 01...

Page 2: ...8 14 24 24 Germany 089 741 31 30 Greece 01 42 96 427 Hong Kong 2645 3186 India 91 80 4190000 Israel 03 6393737 Italy 02 413091 Japan 03 5472 2970 Korea 02 3451 3400 Malaysia 603 9596711 Mexico 001 800...

Page 3: ...aintenance instructions owner s modification of the product owner s abuse misuse or negligent acts and power failure or surges fire flood accident actions of third parties or other events outside reas...

Page 4: ...ments could void the user s authority to operate the equipment under the FCC Rules Class A Federal Communications Commission This equipment has been tested and found to comply with the limits for a Cl...

Page 5: ...ncludes a DoC for most every hardware product except for those bought for OEMs if also available from an original manufacturer that also markets in the EU or where compliance is not required as for el...

Page 6: ...tional Instruments Application Software 1 5 Chapter 2 Setup Configuring the Hardware 2 1 Installing the Hardware 2 1 Installing Your PCI Based MXI 2 Interface 2 1 Installing Your Mainframe Extender 2...

Page 7: ...r Windows viii ni com NI VXI API Notes 3 8 Compiler Symbols 3 8 Compatibility Layer Options 3 9 Debugging 3 10 Appendix A Default Settings Appendix B Common Questions Appendix C Technical Support and...

Page 8: ...I MXI 2 or VME MXI 2 which plugs into your VXI or VME mainframe and links your computer to the VXIbus or VMEbus respectively The kit also contains a PCI MXI 2 PCI MXI 2 Universal or PXI 8320 interface...

Page 9: ...software default settings and to find the answers for commonly asked questions The MXI 2 Configuration Reference Manual contains information on configuring installing and cabling your MXI 2 hardware U...

Page 10: ...ugh nested menu items and dialog box options to a final action The sequence File Page Setup Options directs you to pull down the File menu select the Page Setup item and select Options from the last d...

Page 11: ...read this manual ANSI IEEE Standard 1014 1987 IEEE Standard for a Versatile Backplane Bus VMEbus ANSI IEEE Standard 1155 1993 IEEE VMEbus Extensions for Instrumentation VXIbus ANSI VITA 1 1994 VME64...

Page 12: ...The following flowchart shows where to turn for more details on configuring and using the hardware and software Notice that for hardware configuration you should refer to the MXI 2 Configuration Refe...

Page 13: ...VISA software for Windows are as follows VXI PCI8000 containing a PCI MXI 2 or PCI MXI 2 Universal and a C or B size VXI MXI 2 VXI PXI8000 containing a PXI 8320 and a C or B size VXI MXI 2 VME PCI800...

Page 14: ...dule is an extended class register based VXIbus device with optional VXIbus Slot 0 capability so that it can reside in any slot in a C or D size chassis Optionally you can use the VXI MXI 2 B which ca...

Page 15: ...then can properly configure the various device specific VME address spaces and VME interrupt lines Notice that the VME MXI 2 itself does conform to the VXIbus register set and is therefore configured...

Page 16: ...ll execute Resman independently to configure your instruments after a power cycle But you also can perform resource manager operations directly from MAX or configure it to run Resman automatically at...

Page 17: ...vironment designed for building virtual instrument applications LabWindows CVI delivers a drag and drop editor for building user interfaces a complete ANSI C environment for building your test program...

Page 18: ...figuration Reference Manual fully describes the configuration and installation of each MXI 2 board discussed in this getting started manual Refer to the MXI 2 Configuration Reference Manual if you wan...

Page 19: ...st slot of a VXI chassis or install the VME MXI 2 in the first slot of a VME chassis The VXI VME MXI 2 default configuration automatically detects whether it should be the VXI VMEbus system controller...

Page 20: ...or a software update or to reinstall software in the event that your files were accidentally erased Some of the utilities rely on the LabWindows CVI Run Time Engine This software is installed if neces...

Page 21: ...he license agreement Note If Setup detects an earlier version of the NI VXI software it prompts you to remove it Setup can quit so you can uninstall the old software or install the new version over th...

Page 22: ...tware run MAX It will prompt you to run Resman You must run Resman every time the chassis power is cycled so that the application can access devices in the VXI VME chassis You also can configure MAX t...

Page 23: ...is the National Instruments implementation of the VISA I O standard which is a common interface to many types of instruments such as VXI GPIB PXI Serial TCP IP etc NI VXI is optimized for use through...

Page 24: ...not require you to specify any settings it automatically performs the VXI resource management whenever you run it Note Power cycling resets all devices so you must run Resman to reconfigure your syste...

Page 25: ...se MAX to view specific information about each device in the system The default MAX view of a VXI system shows the General tab window which contains a summary of key information about each device incl...

Page 26: ...VISAIC In the tree view navigate using your mouse to the VISA resource for your controller probably VXI0 0 INSTR representing the VXI system 0 logical address 0 instrument resource refer to Figure 3...

Page 27: ...VXI devices in the system by opening the devices in VISAIC Try reading a register from each device listed in the MAX view of the VXI system This way you can verify that the VXI controller can access e...

Page 28: ...t provides a common interface to many types of instruments such as VXI GPIB PXI Serial TCP IP etc and therefore is especially useful in situations in which you are using multiple types of instruments...

Page 29: ...bit data whenever possible Use VXI block access privileges to significantly improve performance to devices that are capable of accepting block transfers To optimize move performance on virtual memory...

Page 30: ...I API for compatibility with legacy code Compiler Symbols You may need to define certain compiler symbols so that the NI VXI library can work properly with your program The required symbol indicates y...

Page 31: ...XI API with regard to these settings In particular if you are receiving triggers on an external controller you may need to modify the trigger configuration on the extender module using MAX In general...

Page 32: ...XI and NI 488 NI Spy highlights functions that return errors so during development you can quickly spot which functions failed during a program s execution NI Spy can log the calls the program makes t...

Page 33: ...ional Instruments Corporation 3 11 PCI Based MXI 2 Interface for Windows VISAIC discussed in the Device Interaction section is an excellent platform for quickly testing instruments and learning how to...

Page 34: ...nual for your hardware reference and the MAX help for your software reference PCI MXI 2 PCI MXI 2 Universal PXI 8320 This section summarizes the hardware and software default settings for the PCI MXI...

Page 35: ...POS OFF Do not alter this setting SW1 Switch 4 CT ON Do not alter this setting DRAM SODIMM installed Per customer order Table A 3 PXI 8320 Hardware Default Settings Hardware Component Default Setting...

Page 36: ...emory Shared RAM size 0 KB Reserved physical memory 0 KB Lower half window byte swapping Disabled Lower half window memory selection System memory Upper half window byte swapping Disabled Upper half w...

Page 37: ...Unlimited MXI CLK10 signal Receive Table A 7 PCI Tab Default Settings Editor Field Default Setting Low level register access API support Enabled User window size 64 KB Expansion ROM Enabled Table A 8...

Page 38: ...ed Configuration EEPROM U35 Switches 3 and 4 User modifiable factory settingsprotected bothswitches set to NO DRAM SIMMs installed Per customer order SIMM size configuration S6 OFF if SIMMS are 4 M 32...

Page 39: ...sprotected bothswitches set to OFF Table A 10 VME MXI 2 Hardware Default Settings Hardware Component Default Setting A16 base address U20 Hex C040 VME MXI 2 intermodule signaling W2 No user defined pi...

Page 40: ...te posting Disabled Interlocked mode Disabled Assumes no DRAM is installed If DRAM is installed the Address space should be A32 and Requested memory should match the amount of DRAM If you install the...

Page 41: ...2 Bus Tab Default Settings Editor Field Default Setting System controller Auto detect Bus timeout value 1 ms MXI 2 auto retry Disabled MXI transfer limit Unlimited MXI fair requester Disabled Perform...

Page 42: ...ruments hardware VXItedit This was a console based version of VXIedit VIC This utility interactively communicates with VXI devices over the VXIbus using the NI VXI API VICtext This was a console based...

Page 43: ...ppened to VXIinit You no longer need to run VXIinit to initialize settings on the hardware NI takes care of loading hardware settings in the driver completely eliminating the need for VXIinit Where do...

Page 44: ...tell MAX to run Resman when the computer first boots In this case you may never need to run Resman explicitly again This is common when you use an embedded PC such as the VXIpc 860 You can configure t...

Page 45: ...ftware in the Configuration panel and select NI VISA The version information appears in the Attributes panel You can find version information about the NI VXI driver by running the VIC utility program...

Page 46: ...also can configure Resman to run automatically at computer startup What can I do to make sure my system is up and running The fastest method for testing the system is to run Resman This program attemp...

Page 47: ...is plugged in and that the end labeled Connect this end to the device closest to the MXIbus System Controller is connected to the MXIbus system controller by default the PCI MXI 2 PCI MXI 2 Universal...

Page 48: ...the VXI MXI 2 or VME MXI 2 or another device outside the chassis Are the VXI MXI 2 and PCI MXI 2 PCI MXI 2 Universal or PXI 8320 two devices or one with respect to the VXIbus The PCI MXI 2 PCI MXI 2...

Page 49: ...t you can increase the size of your user window through MAX if you expect to initiate transfers to a wide variety of addresses in both A24 and A32 address spaces What is shared memory and dual ported...

Page 50: ...so on Assisted Support Options Contact NI engineers and other measurement and automation professionals by visiting ni com ask Our online system helps you define your question and connects you to the...

Page 51: ...address space equivalent to the VME 16 MB standard address space A32 space VXIbus address space equivalent to the VME 4 GB extended address space ACFAIL A VMEbus backplane signal that is asserted when...

Page 52: ...signals B B bytes backplane An assembly typically a printed circuit board with 96 pin connectors and signal paths that bus the connector pins A C size VXIbus system will have two sets of bused connec...

Page 53: ...rough 12 on P2 It is distributed to each slot as a single source single destination signal with a matched delay of under 8 ns Commander A message based device that is also a bus master and can control...

Page 54: ...onds at Logical Address 255 during a priority select cycle The Resource Manager subsequently assigns it a new logical address which the device responds to until powered down E ECL Emitter Coupled Logi...

Page 55: ...ned to control a specific instrument or family of instruments and any necessary related files for LabWindows CVI or LabVIEW interrupt A means for a device to request service from another device interr...

Page 56: ...onal Instruments custom ASIC a sophisticated dual channel DMA controller that incorporates the Synchronous MXI and VME64 protocols to achieve high performance block transfer rates MXI 2 The second gen...

Page 57: ...age the device the VXIbus backplane or both O Onboard RAM The optional RAM installed into the SIMM slots of the MXI 2 board P PCI Peripheral Component Interconnect The PCI bus is a high performance 32...

Page 58: ...of a MXI VME VXIbus device that detects data transfer cycles initiated by a VMEbus master and responds to the transfers when the address specifies one of the device s registers slave mode operation A...

Page 59: ...0 for use via the NI VXI low level function calls MapVXIAddress uses this address space to allocate regions for use by the VXIpeek and VXIpoke macros V VIC VXI Interactive Control Program a part of th...

Page 60: ...e into any other slot can damage the device the VMEbus VXIbus backplane or both VXIbus VMEbus eXtensions for Instrumentation W Word Serial Protocol The simplest required communication protocol support...

Page 61: ...8320 hardware settings A 1 MAX settings A 2 VXI VME MXI 2 hardware settings A 4 MAX settings A 7 diagnostic resources C 1 documentation flowchart for using manual 1 1 how to use documentation set x o...

Page 62: ...cal address in multiple mainframe system B 8 M mainframe extender installing 2 2 MAX changing configuration settings 2 1 default settings PCI MXI 2 PCI MXI 2 Universal PXI 8320 A 2 VXI VME MXI 2 A 7 o...

Page 63: ...esource Manager operations B 5 running B 3 testing your system B 5 troubleshooting hangups B 6 when to use B 3 Resource Manager See Resman rugged chassis B 7 S settings See default settings setup See...

Page 64: ...ing with PCI based MXI 2 interface 1 4 VME MXI 2 See VXI VME MXI 2 VXI VME LED B 7 VXI VME MXI 2 hardware description 1 3 hardware settings A 4 LEDs on front panel B 7 MAX settings A 7 VXIedit utility...

Reviews: