National Instruments NI-VXI User Manual
National Instruments NI-VXI User Manual

National Instruments NI-VXI User Manual

Ni-vxi user manual
Table of Contents

Advertisement

NI-VXI

User Manual

July 1996 Edition
Part Number 371702A-01
© Copyright 1996 National Instruments Corporation.
All Rights Reserved.

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the NI-VXI and is the answer not in the manual?

Questions and answers

Summary of Contents for National Instruments NI-VXI

  • Page 1: User Manual

    ™ NI-VXI User Manual July 1996 Edition Part Number 371702A-01 © Copyright 1996 National Instruments Corporation. All Rights Reserved.
  • Page 2 Mexico 95 800 010 0793, Netherlands 0348 433466, Norway 32 84 84 00, Singapore 2265886, Spain 91 640 0085, Sweden 08 730 49 70, Switzerland 056 200 51 51, Taiwan 02 377 1200, U.K. 01635 523545 National Instruments Corporate Headquarters 6504 Bridge Point Parkway Austin, TX 78730-5039 Tel: (512) 794-0100...
  • Page 3: Important Information

    National Instruments Corporation. Trademarks LabVIEW ® , NI-488.2 ™ , NI-VISA ™ , NI-VXI ™ , and VXIpc ™ are trademarks of National Instruments Corporation. Product and company names listed are trademarks or trade names of their respective companies.
  • Page 4: Table Of Contents

    Commander/Servant Hierarchies... 1-4 Interrupts and Asynchronous Events... 1-4 MXIbus Overview ... 1-5 MXI-2 Overview ... 1-5 Chapter 2 Introduction to the NI-VXI Functions Function Groups ... 2-1 VXI/VME Function Groups... 2-1 VXI-Only Function Groups ... 2-3 Calling Syntax ... 2-3 LabWindows/CVI...
  • Page 5 Header Files... 2-9 The datasize.h File ... 2-9 The busacc.h File ... 2-10 The devinfo.h File... 2-10 The Beginning and End of an NI-VXI Program ... 2-10 System Configuration Tools... 2-11 Word Serial Communication... 2-13 Master Memory Access... 2-14 Slave Memory Access ... 2-16 Interrupts and Signals ...
  • Page 6 WSSLsendResp ... 3-21 WSSnoResp... 3-22 WSSrd ... 3-22 WSSsendResp ... 3-22 WSSwrt ... 3-22 High-Level VXI/VMEbus Access Functions ... 3-23 Programming Considerations ... 3-23 VXIin... 3-24 VXIinReg ... 3-24 VXImove... 3-24 © National Instruments Corporation Table of Contents NI-VXI User Manual...
  • Page 7 Programming Considerations ... 3-38 WaitForSignal Considerations... 3-39 DefaultSignalHandler... 3-40 DisableSignalInt ... 3-40 EnableSignalInt ... 3-40 GetSignalHandler ... 3-41 RouteSignal ... 3-41 SetSignalHandler... 3-41 SignalDeq... 3-42 SignalEnq ... 3-42 SignalJam ... 3-42 WaitForSignal ... 3-42 NI-VXI User Manual viii © National Instruments Corporation...
  • Page 8 RouteVXIint ... 3-49 SetVXIintHandler... 3-50 VXIintAcknowledgeMode ... 3-50 VXI Trigger Functions ... 3-51 Capabilities of the National Instruments Triggering Hardware ... 3-52 External Controller/VXI-MXI-1 Trigger Capabilities ... 3-53 Embedded, External MXI-2, and Remote Controller Trigger Capabilities ... 3-54 Acceptor Trigger Functions... 3-54 AcknowledgeTrig...
  • Page 9 SetSoftResetHandler ... 3-66 SetSysfailHandler... 3-66 SetSysresetHandler... 3-66 VXI/VMEbus Extender Functions ... 3-67 MapECLtrig ... 3-67 MapTTLtrig... 3-67 MapUtilBus ... 3-68 MapVXIint ... 3-68 Appendix A Function Classification Reference Appendix B Customer Communication Glossary Index NI-VXI User Manual © National Instruments Corporation...
  • Page 10 Remote Controllers ... 2-7 Figure 3-1. Preemptive Word Serial Mutual Exclusion (Per Logical Address)... 3-9 Figure 3-2. NI-VXI Servant Word Serial Model ... 3-16 Figure 3-3. NI-VXI Interrupt and Signal Model... 3-39 Figure 3-4. NI-VXI Interrupt and Signal Model... 3-45 Tables Table A-1.
  • Page 11 This manual describes in detail the features of the NI-VXI software and the VXI/VME function calls in the C/C++ and BASIC languages. Organization of This Manual The NI-VXI User Manual for C/C++ and BASIC is organized as follows: © National Instruments Corporation...
  • Page 12: Conventions Used In This Manual

    Glossary. NI-VXI User Manual Appendix B, Customer Communication, contains forms you can use to request help from National Instruments or to comment on our manuals. The Glossary contains an alphabetical list and description of terms used in this manual, including abbreviations, acronyms, and metric prefixes.
  • Page 13: Related Documentation

    Customer Communication National Instruments wants to receive your comments on our products and manuals. We are interested in the applications you develop with our products, and we want to help if you have problems with them. To make it easy for you to contact us, this manual contains comment and configuration forms for you to complete.
  • Page 14: Vxibus Overview

    NI-VXI application programmer’s interface (API). Comprehensive functions for programming the VXIbus/VMEbus are included with the NI-VXI software. They are available for a variety of controller platforms and operating systems. Among the compatible platforms are the National Instruments line of embedded controllers and external computers that have a MXIbus interface.
  • Page 15: Register-Based Devices

    Chapter 1 Overview of NI-VXI VXI Configuration Space • Upper 16 KB of A16 space reserved for VXI configuration space • 64 bytes per device • 8-bit logical address specifies base address for each device • 256 devices per VXI system...
  • Page 16: Message-Based Devices

    This protocol is functionally very similar to the IEEE 488 protocol, which transfers data messages to and from devices one byte (or word) at a time. Thus, VXI message-based devices communicate in © National Instruments Corporation Device- Specific Protocols...
  • Page 17: Interrupts And Asynchronous Events

    Chapter 1 Overview of NI-VXI a fashion very similar to IEEE 488 instruments. In general, message-based devices typically contain some level of local intelligence that uses or requires a high level of communication. In addition, the Word Serial Protocol has messages for configuring message-based devices and system resources.
  • Page 18: Mxibus Overview

    April 1989 as an open industry standard. MXI-2 Overview MXI-2 is the second generation of the National Instruments MXIbus product line. The MXIbus is a general-purpose, 32-bit, multimaster system bus on a cable. MXI-2 expands the number of signals on a...
  • Page 19 The new synchronous MXI block protocol increases MXI-2 throughput to a maximum of 33 MB/s between two MXI-2 devices. All National Instruments MXI-2 boards are capable of initiating and responding to synchronous MXI block cycles.
  • Page 20: Vxi/Vme Function Groups

    This chapter concludes with an overview on using the NI-VXI application programming interface. The NI-VXI functions are a set of C/C++ and BASIC language functions you can use to perform operations with a VXI/VME system. The NI-VXI C/C++ language interface is consistent across hardware platforms and operating systems.
  • Page 21 Chapter 2 Introduction to the NI-VXI Functions Note: Although signals are defined in the VXI specification, VME customers may still use the signal register available on any VXI/VME/MXI hardware. This register provides a simple notification mechanism that can be used by any bus-master.
  • Page 22: Vxi-Only Function Groups

    Servant Word Serial Protocol Functions—Servant Word Serial functions allow you to communicate with the message-based Commander of the local CPU (the device on which the NI-VXI interface resides) using the Word Serial, Longword Serial, or Extended Longword Serial protocols. These capabilities include command/query handling and buffer reads/writes.
  • Page 23: Input Versus Output Parameters

    All of the NI-VXI functions described in this manual are completely compatible with LabWindows/CVI. Type Definitions The following data types are used for all parameters in the NI-VXI functions and in the actual NI-VXI library function definitions. NI-VXI uses this list of parameter types as an independent method for specifying data type sizes among the various operating systems and target CPUs of the NI-VXI software interface.
  • Page 24: Return Values And System Errors

    If you have a multiple-mainframe VXI/VME system, please continue with the following sections. If you have a single-mainframe system, you can skip to the Using NI-VXI section later in this chapter. Controllers A controller is a device that is capable of controlling other devices. A...
  • Page 25: Figure 2-1. An Embedded Controller Connected To Other Frames Via

    Chapter 2 Introduction to the NI-VXI Functions In general, a multiple mainframe VXI/VME system will have one of the following controller configurations: Extender Only Embedded Controller NI-VXI User Manual cable connected towards the root frame) in the frame acts as a remote controller.
  • Page 26: The Extender And Controller Parameters

    Remote Controller Controller and Extender The extender and controller Parameters In NI-VXI, some functions require a parameter named extender or controller. Since some extenders act as controllers, there is often confusion concerning what logical addresses should be passed to these functions.
  • Page 27 Chapter 2 Introduction to the NI-VXI Functions Most functions that take a controller parameter will allow you to pass (-1) as the logical address. This selects the default controller for the system. Notice that the default controller is determined by the following factors: Notice that -1 is never a valid value for the extender parameter.
  • Page 28: Using Ni-Vxi

    NI-VXI, the software distribution actually includes several additional header files along with type definitions and macros that can make using NI-VXI easier, and make the code more portable across different platforms. The three main files of interest are The datasize.h File...
  • Page 29: The Busacc.h File

    NI-VXI interface operational. When other functions can access information obtained by VXIbus Resource Manager, as well as use other NI-VXI features such as interrupt handlers and windows for memory access. The second function destroys this structure and frees the associated memory. All programs using NI-VXI must call other NI-VXI function.
  • Page 30: System Configuration Tools

    The outcome of all of this is that when exiting a program, you should call number of times that you have called In environments where all applications share NI-VXI, and hence the Caution: internal structure (such as Microsoft Windows), it can be dangerous for any one application to call because this can close out the structure from under another application.
  • Page 31 Chapter 2 Introduction to the NI-VXI Functions For example, all VXI devices have at least one logical address by which they can be accessed. However, it is simple to change the logical address of most devices. Therefore, any program that uses a constant as a logical address of a particular device can fail if that device is reassigned to a different logical address.
  • Page 32: Word Serial Communication

    Commander. However, there are times when you want the controller to operate as a Word Serial Servant. NI-VXI allows for the controller to accept Word Serial commands from a Commander. This chapter also different set of functions that a Servant uses for message-based communication with its Commander.
  • Page 33: Master Memory Access

    Notice that there is no bus error handler installed by the program (See the Interrupts and Signals section). Instead, the program uses the NI-VXI default bus error handler. This handler automatically increments the C/C++ Example: #include <nivxi.h>...
  • Page 34 (VXIpoke) (addrptr, 2, 0); instead of VXIpoke (addrptr, 2, 0); © National Instruments Corporation Chapter 2 These can be found in the NI-VXI header files */ AccessP_Priv(NonPriv_DATA) | AccessP_BO(MOTOROLA_ORDER) | AccessP_Owner(0), addr, timeout, &window1, &ret); macros and functions in NI-VXI instead.
  • Page 35: Slave Memory Access

    Chapter 2 Introduction to the NI-VXI Functions On modern, 32-bit operating systems running on high-performance Note: processors (such as Microsoft Windows NT on a Pentium or Solaris 2 on a SPARC), we have found no performance gained by using macros instead of functions.
  • Page 36: Interrupts And Signals

    = CloseVXIlibrary(); Interrupts and Signals In NI-VXI, you can set up your controller to function as both an interrupt handler and an interrupter. You can also have your controller respond to writes to its signal register. Signaling another device requires the high-level or low-level VXI/VMEbus access functions, as discussed earlier.
  • Page 37 EnableSignalInt() function will be invoked when the event occurs. Installing and using callback handlers is very simple with NI-VXI because all of the operating system interaction is handled for you. The following section of code gives an example of using an callback handler.
  • Page 38: Triggers

    The addition of trigger lines to the VMEbus is one improvement the VXIbus has over VME in the field of instrumentation. To take advantage of this feature, NI-VXI has a wide selection of functions you can use to set up your controller to both source and acknowledge trigger lines.
  • Page 39: Software Overview

    Initializing and closing the NI-VXI software interface, and getting information about devices in the system are among the most important aspects of the NI-VXI software. All applications need to use the system configuration functions at one level or another. When the NI-VXI RM runs, it logs the system configuration information in the RM table file, resman.tbl...
  • Page 40: Closevxilibrary

    CloseVXIlibrary and disable interrupts. Failure to call when terminating your application can cause CloseVXIlibrary creates a new entry in the dynamic NI-VXI RM table SetDevInfo VXIedit completely initializes the RM table to how the RM CreateDevInfo...
  • Page 41: Getdevinfo

    A field value of zero (0) specifies to return a structure containing all possible information about the specified device. GetDevInfoLong (la, field, longvalue) GetDevInfoLong the NI-VXI RM table. The field parameter specifies the attribute of the information to retrieve. GetDevInfo the fieldvalues of fields of the VXI address base and size allocated to the device by the RM.
  • Page 42: Initvxilibrary

    RM table according to how the RM configured the VXI system. No initial changes are necessary for VXI devices. SetDevInfoLong (la, field, longvalue) SetDevInfoLong the NI-VXI RM table. The field parameter specifies the attribute of the information to change. SetDevInfo the fieldvalues of fields of the VXI address base and size allocated to the device by the RM.
  • Page 43: Setdevinfoshort

    SetDevInfoShort (la, field, shortvalue) SetDevInfoShort the NI-VXI RM table. The field parameter specifies the attribute of the information to change. SetDevInfo the fieldvalues of fields of the Commander’s logical address, mainframe number, slot, manufacturer ID number, model code, device class, VXI address space allocated, VXI interrupt lines/handlers allocated, protocols supported, and so on.
  • Page 44 WR Violation. After the Servant asserts the ERR* bit, the application can determine the actual error that occurred by sending a Read Protocol Error query to the Servant. The NI-VXI Word Serial functions query the Servant automatically and return the appropriate error codes to the caller, at which time the Servant deasserts the ERR* bit.
  • Page 45: Programming Considerations

    16-bit transfers of the Word Serial Protocol. The VXIbus specification, however, provides no common command usages for these protocols. The commands are either VXI Reserved or User-Defined. The NI-VXI interface gives you the ability to send any one of these commands. Programming Considerations The Commander Word Serial functions provide a flexible, easy-to-use interface.
  • Page 46: Single-Tasking Operating System Support

    Unrecognized Command events from a device. When an Unrecognized Command event is received by the NI-VXI interrupt or Signal interrupt handler, Word Serial command transfer in progress that caused the generation of the Unrecognized Command event.
  • Page 47: Figure 3-1. Preemptive Word Serial Mutual Exclusion (Per Logical Address)

    The amount of time for which the process is suspended is dependent upon the operating system. When the original process is resumed, the polling will continue. The polling will continue © National Instruments Corporation WStrg WSrd, WSrdf Rd/Wrt/Trg Exclusion Read held off if write or trigger underway.
  • Page 48: Wsabort

    Serial commands Byte Available (BAV), Byte Request (BREQ), Trigger, or Clear. All of these Word Serial commands require different Response register polling techniques. NI-VXI User Manual aborts the Commander Word Serial operation(s) in progress operation aborts read, write, and trigger operations...
  • Page 49: Wsecmd

    WSLresp Protocol query from a VXI message-based Servant. Note: This function is intended only for debugging purposes. © National Instruments Corporation sends an Extended Word Serial command or query to a sends the command by writing the Data Extended WSEcmd...
  • Page 50: Wsrd

    WSresp (la, response) WSresp query from a VXI message-based Servant. This function is intended only for debugging purposes. Note: NI-VXI User Manual WSLcmd WSLresp polls the RR bit before reading the response from WSLresp is the word serial buffer read function.
  • Page 51: Wssettmo

    Ready (DIR) and Write Ready (WR)—until asserted. The modevalue parameter in the call specifies whether to send BAV only or BAV with END for the last byte of the transfer. © National Instruments Corporation function to send Word Serial WScmd...
  • Page 52: Wswrtf

    VXI message-based devices within the VXI Commander/Servant hierarchy. The local CPU (the CPU on which the NI-VXI functions are running) uses the Servant Word Serial functions to perform VXI message-based Servant Word Serial communication with its Commander. These functions are needed only in the case where the local CPU is not a top-level Commander (probably not the Resource Manager), such as in a multiple CPU situation.
  • Page 53: Programming Considerations

    Word Serial Protocol. The VXI specification, however, provides no common command usages for these protocols. The commands are either VXI Reserved or User-Defined. The NI-VXI interface gives you the ability to receive and process any one of these commands. Programming Considerations Most of the Servant Word Serial functions require an interrupt handler.
  • Page 54: Figure 3-2. Ni-Vxi Servant Word Serial Model

    Local VXI Communication Registers Write Data Read Data High High Read Command WSS? WSSL? WSSE? WSSsendResp() WSSLsendResp() WSSrdHandler WSScmdHandler SetWSScmdHandler() GetWSScmdHandler() DefaultWSScmdHandler() Figure 3-2. NI-VXI Servant Word Serial Model 3-16 Response ERR* RespProtError() WSSnoResp() WSSLnoResp() ERROR GenProtError() WSSLcmdHandler WSSEcmdHandler SetWSSLcmdHandler() SetWSSLcmdHandler() GetWSSLcmdHandler()
  • Page 55: Defaultwsscmdhandler

    DefaultWSScmdHandler (cmd) DefaultWSScmdHandler interrupt, which initializes the NI-VXI software. The current whenever the local CPU Commander sends any Word Serial Protocol command or query (other than BAV or BREQ). While Word Serial operations are enabled, the time a Word Serial command is received (other than BAV if a...
  • Page 56: Defaultwssrdhandler

    WSSrdDoneCount use the DefaultWSSwrtHandler (status, count) DefaultWSSwrtHandler interrupt, which initializes the NI-VXI software. When count or an error occurs, it calls the status of the call. The default handler sets the global variables WSSwrtDone use the variable Afterwards, you can inspect...
  • Page 57: Getwssecmdhandler

    (other than BAV if a or BREQ if a DefaultWSScmdHandler and is automatically installed when © National Instruments Corporation returns the address of the current interrupt handler will be called every time an Extended WSSEcmd returns the address of the current...
  • Page 58: Setwssecmdhandler

    NI-VXI software. InitVXIlibrary replaces the current WSSrd InitVXIlibrary replaces the current WSSwrt WSSwrt automatically installs a default handler, InitVXIlibrary , when it initializes the NI-VXI software. 3-20 interrupt handler WSSEcmd is called. InitVXIlibrary interrupt handler WSSLcmd DefaultWSSLcmdHandler interrupt handler with...
  • Page 59: Wssabort

    Word Serial command to the Data Low register or reading a response from the Data Low register. By default, the Servant Word Serial functions are disabled. At any time after initializes the NI-VXI software, you can call processing of Servant Word Serial commands and queries. WSSLnoResp () WSSLnoResp Longword Serial commands.
  • Page 60: Wssnoresp

    DOR to prevent another BREQ from being sent before the application is able to handle the BREQ properly. NI-VXI User Manual sets the WR bit so that it is ready to accept any further WSScmd after processing a Word Serial command (it calls for a Word Serial query, which requires a response).
  • Page 61: High-Level Vxi/Vmebus Access Functions

    VXI/VMEbus addresses. These are required in many situations, including the following: Low-level and high-level access to the VXI/VMEbus, as the NI-VXI interface defines them, are very similar. Both sets of functions can perform direct reads of and writes to any VXI/VMEbus address space with any privilege state or byte order.
  • Page 62: Vxiin

    The srcaddr and destaddr parameters specify the offset within the particular NI-VXI User Manual reads a single byte, word, or longword from a particular reads a single 16-bit value from a particular VXI device’s traps the bus error condition and indicates the error through .
  • Page 63: Vxiout

    A16 address of the VXI device’s register and calls Note: VXIoutReg and therefore is not applicable to VME devices. © National Instruments Corporation traps the bus error condition and indicates the error VXImove writes a single byte, word, or longword to a particular VXIout writes a single word to a particular VXI device’s VXI...
  • Page 64: Low-Level Vxi/Vmebus Access Functions

    Some of the situations that require direct reads and writes to the different VXI/VMEbus address spaces include the following: Low-level and high-level access to the VXI/VMEbus, as the NI-VXI interface defines them, are very similar in nature. Both sets of functions can perform direct reads of and writes to any VXI/VMEbus address space with any privilege state or byte order.
  • Page 65: Programming Considerations

    NI-VXI uses a term within this chapter called the hardware (or window) context. The hardware context for window to VXI/VME consists of the VXI/VME address space being accessed, the base offset into the address space, the access privilege, and the byte order for the accesses through the window.
  • Page 66: Multiple-Pointer Access For A Window

    Access-Only Privilege A process can obtain Access-Only Privilege by requesting access-only privileges in the NI-VXI User Manual MapVXIAddress SetByteOrder function can change the settings of the MapVXIAddress call (via the accessparms parameter).
  • Page 67 MITE, you should not need these functions. © National Instruments Corporation No processes are mapped for the window (first caller for Access-Only Privilege for this window). The hardware context is set as requested in the call. The call returns a successful status and a valid C pointer and windowId for Access-Only Privilege.
  • Page 68: Getbyteorder

    You can use this function for simple polled operations. NI-VXI User Manual retrieves the byte/word order of data transferred into retrieves all of the hardware interface settings (context)
  • Page 69: Getvxibusstatusind

    When a request for Owner Privilege is granted, you can also use this window identifier with calls such as SetPrivilege © National Instruments Corporation retrieves information about the current state of retrieves the range of addresses that a particular call.
  • Page 70: Mapvxiaddresssize

    VXI/VME address spaces (obtained from making a window (and possibly calls to you can call SetContext NI-VXI User Manual sets the size for mapping user windows. The will attempt to map a window of MapVXIAddress MapVXIAddressSize MapVXIAddress MapVXIAddress function.
  • Page 71: Setprivilege

    C language interfaces, however, that you use pointer, as it supports portability between different platforms and programming languages. © National Instruments Corporation sets the VXI/VMEbus windowing hardware to access . Nonprivileged Data transfers must be supported reallocates the window mapped using the function.
  • Page 72: Local Resource Access Functions

    Local Resource Access Functions Local resources are hardware and/or software capabilities that are reserved for the local CPU (the CPU on which the NI-VXI interface resides). You can use these functions to gain access to miscellaneous local resources such as the local CPU register set and the local CPU Shared RAM.
  • Page 73: Vxiinlr

    VXImemFree operating system’s dynamic memory pool. © National Instruments Corporation reads a single byte, word, or longword from the local CPU is designed to read these local registers. The VXIinLR allocates physical RAM from the operating system’s...
  • Page 74: Vxioutlr

    Signal register generates a local CPU interrupt, and the local CPU then acquires the signal value in some device-specific manner. All National Instruments hardware platforms have a hardware FIFO to accumulate signal values while waiting for the local CPU to retrieve them.
  • Page 75 8 bits are device dependent. Consult your device manual for definitions of these values. Two methods are available to handle VXI signals under the NI-VXI software interface. Signals can be handled either by calling a handler or by queuing on a global signal queue.
  • Page 76: Programming Considerations

    If the signals were routed to the Unrecognized Command Events from message-based devices perform no operation. Unrecognized Command Events call the function WSabort NI-VXI User Manual is called to inhibit more signals DisableSignalInt , the DisableSignalInt DefaultSignalHandler to abort the current Word Serial operation in progress.
  • Page 77: Waitforsignal Considerations

    Figure 3-3 provides a graphical overview of the NI-VXI interrupt and signal functions. Hardware VXI/VME Interrupts 1-7 Get Status/Id VXIintAcknowledgeMode() EnableVXIint() RouteVXIint() DisableVXIint() NI-VXI Software User VXIintHandlers (1 per VXI/VME interrupt level) ISRs SetVXIintHandler() GetVXIintHandler() User DefaultVXIintHandler() Application WaitForSignal Considerations...
  • Page 78: Defaultsignalhandler

    EnableSignalInt begin the reception of signals. Calls to SetSignalHandler enabled to guarantee proper signal routing of the first signals. NI-VXI User Manual is the sample handler for VXI signals that function is called for every InitVXIlibrary to abort the current Word Serial transfer in...
  • Page 79: Getsignalhandler

    CPU is not the Resource Manager or VME devices not listed in the Non-VXI Device Editor in handle these signals via the global signal queue or the WaitForSignal © National Instruments Corporation returns the address of the current signal handler ), the signal handler for a specific logical EnableSignalInt...
  • Page 80: Signaldeq

    A multitasking operating system lets you have any number of WaitForSignal permits only one pending NI-VXI User Manual retrieves signals from the global signal queue. Two function specifies which types of signals should be to selectively dequeue a signal off of the SignalDeq places signals at the end of the global signal queue.
  • Page 81: Vxi Interrupt Functions

    However, because VME interrupters may be present in a VXI system, the VXI/VME interrupt handler functions are included with the NI-VXI software. The the status/ID value should be handled as a signal or handled by a VXI/VME interrupt handler. Two methods are available to handle VXI signals.
  • Page 82 AcknowledgeVXIint interrupts that the local CPU is not enabled to automatically handle NI-VXI User Manual DefaultSignalHandler is called from the application for every VXI InitVXIlibrary function to selectively return a signal off a global signal WaitForSignal calls can be pending.
  • Page 83: Programming Considerations

    DeAssertVXIint debugging purposes. Programming Considerations Figure 3-4 is a graphical overview of the NI-VXI interrupt and signal model. Hardware VXI/VME Interrupts 1-7 Get Status/Id VXIintAcknowledgeMode() EnableVXIint() RouteVXIint() DisableVXIint() NI-VXI Software User VXIintHandlers (1 per VXI/VME interrupt level) ISRs SetVXIintHandler() GetVXIintHandler()
  • Page 84: Roak Versus Rora Vxi/Vme Interrupters

    AcknowledgeVXIint (controller, level, statusId) AcknowledgeVXIint (IACK cycle) on the backplane in the specified controller and VXI/VME interrupt level. Note: This function is intended only for debugging purposes. NI-VXI User Manual specifies whether a VXIintAcknowledgeMode EnableVXItoSignalInt performs a VXI/VME interrupt acknowledge 3-46 ©...
  • Page 85: Assertvxiint

    If VXI/VME interrupts are enabled (via VXI/VME interrupt handler for a specific logical address is called. You must first call callback handler (as opposed to the signal processing routine). © National Instruments Corporation . However, if the interrupts EnableVXIint GetVXIbusStatus...
  • Page 86: Disablevxiint

    VXI/VME interrupts or as VXI signals (the default is VXI signals). You must then call as VXI/VME interrupts (not as VXI signals). A -1 (negative one) or local logical address in the controller parameter specifies the local NI-VXI User Manual sets the global variables VXIintLevel SetVXIintHandler...
  • Page 87: Enablevxitosignalint

    VXI signals. Signals can be handled either by signal handlers (as signals) or by queueing on a global signal © National Instruments Corporation is used to sensitize the application to , the application can sensitize itself to interrupt to disable these VXI interrupts.
  • Page 88: Setvxiinthandler

    After device-specific interaction has caused the deassertion of the interrupt on the backplane, your application must call VXI/VME interrupt level. NI-VXI User Manual function specifies which types of signals RouteSignal EnableVXItoSignalInt RouteVXIint...
  • Page 89: Vxi Trigger Functions

    VXI devices. The following is a description of the four basic protocols. © National Instruments Corporation SYNC—SYNC protocol is the most basic protocol. SYNC protocol is a pulse of a minimum time (30 ns on TTL, 8 ns on ECL) on any one of the trigger lines.
  • Page 90: Capabilities Of The National Instruments Triggering Hardware

    You can use these protocols in any way that your application requires. You can use them for device synchronization, for stepping through tests, or for a command path. The NI-VXI trigger functions have been designed to accommodate all trigger lines and the protocols for all appropriate TTL and ECL VXI trigger lines (SYNC, ASYNC, SEMI-SYNC, START/STOP, and ON/OFF).
  • Page 91: External Controller/Vxi-Mxi-1 Trigger Capabilities

    VXI-MXI-1 and VXI-MXI-2 controllers that are configured for extender only (that is, not extending controllers), as well as external MXI-1 controllers, do not have trigger functionality. See the section, Multiple Mainframe Support, in Chapter 2, Introduction to the NI-VXI Functions, for more information. External Controller/VXI-MXI-1 Trigger...
  • Page 92: Embedded, External Mxi-2, And Remote Controller Trigger Capabilities

    Triggering with NI-VXI. Acceptor Trigger Functions The NI-VXI acceptor trigger functions act as a standard interface for sensing (accepting) TTL and ECL triggers, as well as for sending acknowledgments back to the sourcing device. These functions can sense any of the VXI-defined trigger protocols on the local embedded controller or external extended controller(s).
  • Page 93: Acknowledgetrig

    CPU interrupt is generated. The trigger handler installed is automatically called when a trigger interrupt occurs. © National Instruments Corporation performs the required trigger acknowledgments function. EnableTrigSense is the sample handler for the receiving .
  • Page 94: Gettrighandler

    The current handler is invoked regardless of whether WaitForTrig Map Trigger Functions You can use the NI-VXI map trigger functions as configuration tools for multiframe and local support for VXI triggers. You can configure the triggering hardware to route specified source trigger locations to...
  • Page 95: Unmaptrigtotrig

    Source Trigger Functions The NI-VXI source trigger functions act as a standard interface for asserting (sourcing) TTL and ECL triggers, as well as for detecting acknowledgments from accepting devices. These functions can source any of the VXI-defined trigger protocols from the local embedded controller or external extended controller(s).
  • Page 96: Trigger Configuration Functions

    Chapter 3 Software Overview Trigger Configuration Functions You can use the NI-VXI trigger configuration functions to configure not only the general settings of the trigger inputs and outputs, but also the TIC counter and tick timers. TrigAssertConfig (controller, trigline, mode) TrigAssertConfig for the TTL/ECL triggers.
  • Page 97: Trigtickconfig

    Sysreset, Bus Error, and/or Soft Reset interrupts. The NI-VXI software interface can handle all of these system conditions for the application through the use of callback routines. The NI-VXI software handles all system interrupt handlers in the same manner. Each type of interrupt...
  • Page 98: Assertsysreset

    DefaultBusErrorHandler exception, and is installed as a default handler when initializes the NI-VXI software. During an access to the VXI/VMEbus, the BERR* signal (bus error) is asserted to end the bus cycle if the address or mode of access is determined to be invalid. The bus error exception condition generates an exception on the local CPU, which can be trapped by the bus error handler.
  • Page 99: Defaultsoftresethandler

    DefaultSoftResetHandler () DefaultSoftResetHandler interrupt, and is installed as a default handler when initializes the NI-VXI software. It increments the global variable SoftResetRecv the local CPU is written, the VXI interface (if an embedded CPU) and the VXI register sets are reset (VXI logical address and address base are retained).
  • Page 100: Defaultsysresethandler

    Chapter 3 Software Overview DefaultSysresetHandler (controller) DefaultSysresetHandler interrupt, and is installed as a default handler when initializes the NI-VXI software. It increments the global variable SysresetRecv DisableACfail (controller) DisableACfail embedded controller or extended controller(s) ACfail conditions (dependent on the hardware platform). The VXI/VMEbus specification allows for a minimum amount of time after a power failure condition occurs for the system to remain operational.
  • Page 101: Disablesysreset

    EnableSysfail (controller) EnableSysfail embedded controller or extended controller(s) Sysfail conditions (dependent on the hardware platform and configuration). The VXIbus © National Instruments Corporation Chapter 3 desensitizes the application to Sysreset interrupts sensitizes the application to ACfail interrupts from sensitizes the application to Soft Reset conditions...
  • Page 102: Enablesysreset

    The automatically installs a default handler, when it initializes the NI-VXI software. It increments the global variable corresponding enable and disable function is not possible.
  • Page 103: Getsoftresethandler

    NI-VXI software. InitVXIlibrary returns the address of the current Sysreset InitVXIlibrary DefaultSysresetHandler replaces the current ACfail interrupt handler with , when it initializes the NI-VXI software. EnableACfail replaces the current bus error interrupt handler 3-65 Chapter 3 Software Overview...
  • Page 104: Setsoftresethandler

    SetSysresetHandler (func) SetSysresetHandler handler with an alternate handler. The automatically installs a default handler, when it initializes the NI-VXI software. Your application must then call interrupts to the local CPU. NI-VXI User Manual , when it initializes the NI-VXI software.
  • Page 105: Vxi/Vmebus Extender Functions

    The VXI/VMEbus extender functions are used to dynamically change the default RM settings if the application has such a requirement. Usually, the application never needs to change the default settings. Consult your utilities manual on how to use the NI-VXI resource editor utility, either default extender settings.
  • Page 106: Maputilbus

    Chapter 3 Software Overview you can use mapping. The NI-VXI Resource Manager automatically configures a default mapping based on the user-modifiable configuration files. The MapTTLtrig mapping. Only special circumstances should require any changes to the default configuration. MapUtilBus (extender, modes)
  • Page 107: Function Classification Reference

    Reference This appendix contains two tables you can use as a quick reference. Table A-1, Function Listing by Group, lists the NI-VXI functions by their group association. This arrangement can help you determine easily which functions are available within each group. Table A-2, Function Listing by Name, lists each function alphabetically.
  • Page 108 WSwrtf Servant Word DefaultWSScmdHandler Serial Protocol DefaultWSSEcmdHandler DefaultWSSLcmdHandler DefaultWSSrdHandler DefaultWSSwrtHandler GenProtError GetWSScmdHandler GetWSSEcmdHandler GetWSSLcmdHandler GetWSSrdHandler GetWSSwrtHandler RespProtError SetWSScmdHandler SetWSSEcmdHandler SetWSSLcmdHandler SetWSSrdHandler NI-VXI User Manual Table A-1. Function Listing by Group Function A - 2 C/C++ BASIC © National Instruments Corporation...
  • Page 109 VXIout VXIoutReg Low-Level GetByteOrder VXI/VMEbus GetContext Access GetPrivilege GetVXIbusStatus GetVXIbusStatusInd GetWindowRange MapVXIAddress MapVXIAddressSize SetByteOrder SetContext SetPrivilege UnMapVXIAddress VXIpeek VXIpoke © National Instruments Corporation Appendix A Table A-1. Function Listing by Group Function Function Classification Reference C/C++ BASIC NI-VXI User Manual...
  • Page 110 DefaultSignalHandler DisableSignalInt EnableSignalInt GetSignalHandler RouteSignal SetSignalHandler SignalDeq SignalEnq SignalJam WaitForSignal VXI/VME AcknowledgeVXIint Interrupt AssertVXIint DeAssertVXIint DefaultVXIintHandler DisableVXIint DisableVXItoSignalInt EnableVXIint EnableVXItoSignalInt GetVXIintHandler NI-VXI User Manual Table A-1. Function Listing by Group Function A - 4 C/C++ BASIC © National Instruments Corporation...
  • Page 111 SrcTrig TrigAssertConfig TrigCntrConfig TrigExtConfig TrigTickConfig UnMapTrigToTrig WaitForTrig System Interrupt AssertSysreset Handler DefaultACfailHandler DefaultBusErrorHandler DefaultSoftResetHandler DefaultSysfailHandler DefaultSysresetHandler DisableACfail DisableSoftReset DisableSysfail © National Instruments Corporation Appendix A Table A-1. Function Listing by Group Function Function Classification Reference C/C++ BASIC NI-VXI User Manual...
  • Page 112 EnableACfail (continued) EnableSoftReset EnableSysfail EnableSysreset GetACfailHandler GetBusErrorHandler GetSoftResetHandler GetSysfailHandler GetSysresetHandler SetACfailHandler SetBusErrorHandler SetSoftResetHandler SetSysfailHandler SetSysresetHandler VXI/VMEbus MapECLtrig Extender MapTTLtrig MapUtilBus MapVXIint NI-VXI User Manual Table A-1. Function Listing by Group Function A - 6 C/C++ BASIC © National Instruments Corporation...
  • Page 113: Table A-2. Function Listing By Name

    DefaultSignalHandler DefaultSoftResetHandler DefaultSysfailHandler DefaultSysresetHandler DefaultTrigHandler DefaultTrigHandler2 DefaultVXIintHandler DefaultWSScmdHandler DefaultWSSEcmdHandler DefaultWSSLcmdHandler DefaultWSSrdHandler DefaultWSSwrtHandler © National Instruments Corporation Appendix A Table A-2. Function Listing by Name Group Triggers VXI/VME Interrupt System Interrupt Handler VXI/VME Interrupt System Configuration System Configuration VXI/VME Interrupt System Interrupt...
  • Page 114 EnableACfail EnableSignalInt EnableSoftReset EnableSysfail EnableSysreset EnableTrigSense EnableVXIint EnableVXItoSignalInt FindDevLA GenProtError GetACfailHandler GetBusErrorHandler GetByteOrder NI-VXI User Manual Table A-2. Function Listing by Name Group System Interrupt Handler VXI Signal System Interrupt Handler System Interrupt Handler System Interrupt Handler Triggers VXI/VME Interrupt...
  • Page 115 GetSysfailHandler GetSysresetHandler GetTrigHandler GetVXIbusStatus GetVXIbusStatusInd GetVXIintHandler GetWindowRange GetWSScmdHandler GetWSSEcmdHandler GetWSSLcmdHandler GetWSSrdHandler GetWSSwrtHandler © National Instruments Corporation Appendix A Table A-2. Function Listing by Name Group Low-Level VXI/VMEbus Access System Configuration System Configuration System Configuration System Configuration Local Resource Access Low-Level...
  • Page 116 MapVXIint ReadMODID RespProtError RouteSignal RouteVXIint SetACfailHandler SetBusErrorHandler SetByteOrder SetContext SetDevInfo SetDevInfoLong SetDevInfoShort SetDevInfoStr SetMODID SetPrivilege NI-VXI User Manual Table A-2. Function Listing by Name Group System Configuration VXI/VMEbus Extender Triggers VXI/VMEbus Extender VXI/VMEbus Extender Low-Level VXI/VMEbus Access Low-Level VXI/VMEbus Access...
  • Page 117 SetWSSwrtHandler SignalDeq SignalEnq SignalJam SrcTrig TrigAssertConfig TrigCntrConfig TrigExtConfig TrigTickConfig UnMapTrigToTrig UnMapVXIAddress VXIin VXIinLR © National Instruments Corporation Appendix A Table A-2. Function Listing by Name Group VXI Signal System Interrupt Handler System Interrupt Handler System Interrupt Handler Triggers VXI/VME Interrupt...
  • Page 118 VXIoutReg VXIpeek VXIpoke WaitForSignal WaitForTrig WSabort WSclr WScmd/ WSEcmd/ WSLcmd WSgetTmo WSresp/ WSLresp WSrd / WSrdi / WSrdl NI-VXI User Manual Table A-2. Function Listing by Name Group Access High-Level VXI/VMEbus Access VXI/VME Interrupt Local Resource Access Local Resource Access...
  • Page 119 WSSnoResp/ WSSLnoResp WSSrd / WSSrdi / WSSrdl WSSsendResp/ WSSLsendResp WSSwrt / WSSwrti / WSSwrtl WStrg WSwrt / WSwrti / WSwrtl WSwrtf © National Instruments Corporation Appendix A Table A-2. Function Listing by Name Group Commander Word Serial Protocol Servant Word Serial...
  • Page 120: Customer Communication

    Electronic Services Bulletin Board Support National Instruments has BBS and FTP sites dedicated for 24-hour support with a collection of files and documents to answer most common customer questions. From these sites, you can also download the latest instrument drivers, updates, and example programs. For recorded instructions on how to use the bulletin board and FTP services and for BBS automated information, call (512) 795-6990.
  • Page 121: Telephone And Fax Support

    Telephone and Fax Support National Instruments has branch offices all over the world. Use the list below to find the technical support number for your country. If there is no National Instruments office in your country, contact the source from which you purchased your software to obtain support.
  • Page 122: Technical Support Form

    National Instruments for technical support helps our applications engineers answer your questions more efficiently. If you are using any National Instruments hardware or software products related to this problem, include the configuration forms from their user manuals. Include additional pages if necessary.
  • Page 123: Documentation Comment Form

    Documentation Comment Form National Instruments encourages you to comment on the documentation supplied with our products. This information helps us provide quality products to meet your needs. Title: NI-VXI™ User Manual Edition Date: July 1996 Part Number: 371702A-01 Please comment on the completeness, clarity, and organization of the manual.
  • Page 124 (either AC line source or power supply malfunction), or if it is necessary to disable the power supply (such as for a high temperature condition). address Character code that identifies a specific location (or series of locations) in memory. © National Instruments Corporation Glossary Value NI-VXI User Manual...
  • Page 125 A specified address that is combined with a relative address (or offset) to determine the absolute address of a data location. All VXI address windows have an associated base address for their assigned VXI address spaces. NI-VXI User Manual memory locations differentiated from other such sets in © National Instruments Corporation...
  • Page 126 Motorola ordering stores the most significant byte (MSB) or word first, followed by the least significant byte (LSB) or word. Intel ordering stores the LSB or word first, followed by the MSB or word. © National Instruments Corporation Glossary NI-VXI User Manual...
  • Page 127 VXI chassis, a VXI-MXI, and a VME-MXI may all be controllers depending on the configuration of the VXI system. Carriage Return; the ASCII character 0Dh. NI-VXI User Manual In Word Serial Protocol, a 16-bit imperative to a servant from its Commander (written to the Data Low register);...
  • Page 128 See Data Transfer Bus. Emitter-Coupled Logic embedded controller A computer plugged directly into the VXI backplane. An example is the National Instruments VXIpc-850. Signals the end of a data string. © National Instruments Corporation Glossary NI-VXI User Manual...
  • Page 129 Response register bits. FIFO First In-First Out; a method of data storage in which the first element stored is the first one retrieved. GPIB General-Purpose Interface Bus; the industry-standard IEEE 488 bus. NI-VXI User Manual © National Instruments Corporation...
  • Page 130 Extensions for Instrumentation: VXIbus. IEEE 488 Standard 488-1978, which defines the GPIB. Its full title is IEEE Standard Digital Interface for Programmable Instrumentation. Also referred to as IEEE 488.1 since the adoption of IEEE 488.2. © National Instruments Corporation Glossary NI-VXI User Manual...
  • Page 131 A form of Word Serial communication in which Commanders and Protocol Servants communicate with 32-bit data transfers instead of 16-bit data transfers as in the normal Word Serial Protocol. low-level Programming at the system level with machine-dependent commands. NI-VXI User Manual © National Instruments Corporation...
  • Page 132 CPU resources. MXIbus Multisystem eXtension Interface Bus; a high-performance communication link that interconnects devices using round, flexible cables. Milliseconds © National Instruments Corporation Glossary NI-VXI User Manual...
  • Page 133 Glossary NI-VXI The National Instruments bus interface software for VME/VXIbus systems. nonprivileged access One of the defined types of VMEbus data transfers; indicated by certain address modifier codes. Each of the defined VMEbus address spaces has a defined nonprivileged access mode.
  • Page 134: Remote Controllers

    VXI interrupts, indicating that a Servant has a need for service. resman The name of the National Instruments Resource Manager application in the NI-VXI bus interface software. See Resource Manager. Resource Manager A message-based Commander located at Logical Address 0, which...
  • Page 135 The memory block acts as the medium for the protocol transmission. short integer Data type of 16 bits, same as word. NI-VXI User Manual G-12 © National Instruments Corporation...
  • Page 136 A VMEbus signal that is used by a device to indicate a system reset or power-up condition. system clock driver A VMEbus functional module that provides a 16 MHz timing signal on the utility bus. © National Instruments Corporation G-13 Glossary (n-1) NI-VXI User Manual...
  • Page 137 Servant has a Commander. A Commander can in turn be a Servant to another Commander. Trigger Interface Chip; a proprietary National Instruments ASIC used for direct access to the VXI trigger lines. The TIC contains a 16-bit counter, a dual 5-bit tick timer, and a full crosspoint switch.
  • Page 138 VXI Interactive Control program, a part of the NI-VXI bus interface software package. Used to program VXI devices, and develop and debug VXI application programs. Called VICtext when used on text- based platforms. Versa Module Eurocard or IEEE 1014 VMEbus Class device Also called non-VXIbus or foreign devices when found in VXIbus systems.
  • Page 139 If a Commander attempts to write a command or query to a Servant that is not Write Ready (already has a command or query pending), a Write Ready protocol violation may be generated. See Word Serial Protocol NI-VXI User Manual G-16 © National Instruments Corporation...
  • Page 140 Index callback handlers handling signals or interrupts, 2-18 system-dependent behavior (note), 2-19 CloseVXIlibrary function description, 3-2 requirements for NI-VXI programs, 2-10 to 2-11 Commander/Servant hierarchies, 1-4 Commander Word Serial communication Extended Longword Serial Protocol, 3-7 Longword Serial Protocol, 3-7 overview, 2-13, 3-5 to 3-7...
  • Page 141 DefaultSignalHandler function, 3-40 DefaultSoftResetHandler function, 3-61 DefaultSysfailHandler function, 3-61 to 3-63 DefaultTrigHandler function, 3-55 DefaultTrigHandler2 function, 3-55 DefaultVXIntHandler function, 3-47 to 3-48 NI-VXI User Manual DefaultWSScmdHandler function, 3-17 DefaultWSSEcmdHandler function, 3-17 DefaultWSSLcmdHandler function, 3-17 to 3-18 DefaultWSSrdHandler function, 3-18 DefaultWSSwrtHandler function, 3-18 devinfo.h file, 2-10...
  • Page 142 MXI-2 (figure), 2-7 fax and telephone support, B-2 FaxBack support, B-2 FindDevLA function, 3-2 FTP support, B-1 functions. See NI-VXI functions; specific groups of functions. GenProtError function, 3-18 GetACfailHandler function, 3-64 GetBusErrorHandler function, 3-64 GetByteOrder function, 3-30...
  • Page 143 GetWindowRange, 3-31 MapVXIAddress, 3-28, 3-29, 3-31 MapVXIAddressSize, 3-32 multiple-pointer access for window, 3-28 to 3-29 Access-Only Privilege, 3-28 to 3-29 NI-VXI User Manual Owner Privilege, 3-28 overview, 2-2, 3-26 to 3-27 programming considerations, 3-27 SetByteOrder, 3-32 SetContext, 3-32 SetPrivilege, 3-33...
  • Page 144 2-14 to 2-16 slave memory access, 2-16 to 2-17 system configuration tools, 2-11 to 2-12 triggers, 2-19 Word Serial communication, 2-13 NI-VXI functions. See also specific groups of functions. alphabetical list, A-9 to A-14 calling syntax, 2-3 classification reference, A-1 to A-7...
  • Page 145 Word Serial Protocol, 3-14 Servant Word Serial Protocol functions alphabetical list (table), A-2 to A-3 DefaultWSScmdHandler, 3-17 DefaultWSSEcmdHandler, 3-17 DefaultWSSLcmdHandler, 3-17 to 3-18 DefaultWSSrdHandler, 3-18 NI-VXI User Manual DefaultWSSwrtHandler, 3-18 GenProtError, 3-18 GetWSScmdHandler, 3-18 GetWSSEcmdHandler, 3-19 GetWSSLcmdHandler, 3-19 GetWSSrdHandler, 3-19...
  • Page 146 2-11 to 2-12 C/C++ example, 2-12 overview, 2-1, 3-1 SetDevInfo, 3-4 SetDevInfoLong, 3-4 SetDevInfoShort, 3-5 SetDevInfoStr, 3-5 © National Instruments Corporation system interrupt handler functions alphabetical list (table), A-6 AssertSysreset, 3-60 DefaultACfailHandler, 3-60 DefaultBusErrorHandler, 3-60 to 3-61 DefaultSoftResetHandler, 3-61 DefaultSysfailHandler, 3-61 to 3-63...
  • Page 147 2-2, 3-43 to 3-44 programming considerations, 3-45 ROAK versus RORA VXI/VME interrupts, 3-46 RouteVXIint, 3-43, 3-44, 3-49 to 3-50 SetVXIintHandler, 3-50 NI-VXI User Manual VXIintAcknowledgeMode, 3-46, 3-50 VXI-only function groups, 2-3 VXI signal functions alphabetical list (table), A-4 DefaultSignalHandler, 3-40...
  • Page 148 VXImove function, 3-24 to 3-25 VXIout function, 3-25 VXIoutLR function, 3-36 VXIoutReg function, 3-25 VXIpeek function de-referencing pointers, 3-28 description, 3-33 © National Instruments Corporation VXIpoke function de-referencing pointers, 3-28 description, 3-33 WaitForSignal function description, 3-42 programming considerations, 3-39 to 3-40...
  • Page 149 Index WSSLnoResp function, 3-21, 3-22 WSSLsendResp function, 3-21 WSSrd function, 3-22 WSSsendResp function, 3-22 WSSwrt function, 3-22 WStrg function, 3-13 WSwrt function, 3-13 WSwrtf, 3-14 NI-VXI User Manual I-10 © National Instruments Corporation...

Table of Contents