NI-DAQ™ Function Reference Manual for PC Compatibles Version 6.1 Data Acquisition Software for the PC NI-DAQ FRM for PC Compatibles April 1998 Edition Part Number 321645C-01 © Copyright 1991, 1998 National Instruments Corporation. All rights reserved.
Internet Support E-mail: support@natinst.com FTP Site: ftp.natinst.com Web Address: www.natinst.
Important Information Warranty The media on which you receive National Instruments software are warranted not to fail to execute programming instructions, due to defects in materials and workmanship, for a period of 90 days from date of shipment, as evidenced by receipts or other documentation. National Instruments will, at its option, repair or replace software media that do not execute programming instructions if National Instruments receives notice of such defects during the warranty period.
Contents About This Manual How to Use the NI-DAQ Manual Set ..............................................................................xiii Organization of This Manual ...........................................................................................xiii Conventions Used in This Manual...................................................................................xiv MIO and AI Device Terminology .....................................................................
Contents AI_VScale ....................................................................................................................... 2-20 Align_DMA_Buffer ........................................................................................................ 2-22 AO_Calibrate................................................................................................................... 2-25 AO_Change_Parameter........................................................................................
Contents DIG_Block_Check...........................................................................................................2-147 DIG_Block_Clear ............................................................................................................2-148 DIG_Block_In .................................................................................................................2-149 DIG_Block_Out...................................................................................................
Contents RTSI_Clock..................................................................................................................... 2-287 RTSI_Conn...................................................................................................................... 2-289 RTSI_DisConn ................................................................................................................ 2-291 SC_2040_Config .......................................................................................
Contents WFM_DB_Transfer.........................................................................................................2-415 WFM_from_Disk.............................................................................................................2-417 WFM_Group_Control .....................................................................................................2-420 WFM_Group_Setup.........................................................................................................
Contents Figure 2-6. Figure 2-7. Figure 2-8. Figure 2-9. Figure 2-10. Figure 2-11. Figure 2-12. Figure 2-13. Figure 2-14. Figure 2-15. Figure 2-16. Figure 2-17. Figure 2-18. Figure 2-19. Figure 2-20. Figure 2-21. Figure 2-22. Figure 2-23. Figure 2-24. Figure 2-25. Figure 2-26. Figure 2-27. Figure 2-28. Figure 2-29. Figure 2-30. Figure 2-31. Figure 2-32. Figure 2-33. Figure 2-34. Figure 2-35. Figure 2-36. Figure 2-37. ND_INSIDE_REGION.........................................................................
Contents Table 2-1. Table 2-2. Table 2-3. Table 2-4. Table 2-5. Table 2-6. Table 2-7. Table 2-8. Table 2-9. Table 2-10. Table 2-11. Table 2-12. Table 2-13. Table 2-14. Table 2-15. Table 2-16. Table 2-17. Table 2-18. Table 2-19. Table 2-20. Table 2-21. Table 2-22. Table 2-23. Table 2-24. Table 2-25. Table 2-26. Table 2-27. Table 2-28. Table 2-29. Table 2-30. Table 2-31. Table 2-32. Table 2-33. Table 2-34. Table 2-35. Table 2-36. Table 2-37. Table 2-38. Parameter Settings for AI_Configure...................
Contents Table 2-39. Table 2-40. Table 2-41. Table 2-42. Table 2-43. Data Ranges for the Buffer Parameter for DAQArb 5411 Devices........ 2-426 Mode Values for the Count Parameter for DAQArb 5411 Devices ....... 2-427 Mode Values for the Iterations Parameter for DAQArb 5411 Devices........................................................................... 2-428 Array Structures for DDS Mode ............................................................. 2-430 Array Structures for ARB Mode...................
About This Manual The NI-DAQ Function Reference Manual for PC Compatibles is for users of the NI-DAQ software for PC compatibles version 6.1. NI-DAQ software is a powerful application programming interface (API) between your data acquisition (DAQ) application and the National Instruments DAQ boards for ISA, PCI, PXI, XT, PC Card (PCMCIA), VXIbus, EISA, and USB bus computers. How to Use the NI-DAQ Manual Set You should begin by reading the NI-DAQ User Manual for PC Compatibles.
About This Manual • Appendix B, Analog Input Channel, Gain Settings, and Voltage Calculation, lists the valid channel and gain settings for DAQ boards, describes how NI-DAQ calculates voltage, and describes the measurement of offset and gain adjustment. • Appendix C, NI-DAQ Function Support, contains tables that show which DAQ hardware each NI-DAQ function call supports.
About This Manual Am9513-based device These devices are the AT-MIO-16, AT-MIO-16F-5, AT-MIO-16X, AT-MIO-16D, and AT-MIO-64F-5. bold Bold text denotes the names of menus, menu items, parameters, dialog boxes, dialog box buttons or options, icons, windows, Windows 95 tabs or pages, or LEDs. bold italic Bold italic text denotes a note, caution, or warning. DAQArb 5411 device Refers to the AT-5411 and PCI-5411. DAQCard-500/700 Refers to the DAQCard-500 and DAQCard-700.
About This Manual MIO-F-5/16X device Refers to the AT-MIO-16F-5, AT-MIO-16X, and the AT-MIO-64F-5. MIO-16/16D device Refers to the AT-MIO-16 and AT-MIO-16D. MIO-16XE-50 device Refers to the AT-MIO-16XE-50, DAQPad-MIO-16XE-50, and NEC-MIO-16XE-50, and PCI-MIO-16XE-50. MIO-64 Refers to the AT-MIO-64F-5, AT-MIO-64E-4, PCI-6031E, PCI-6033E, PCI-6071E, VXI-MIO-64E-1, and VXI-MIO-64XE-10.
About This Manual Simultaneous sampling device Refers to the PCI-6110E, PCI-6111E, PCI-4451, PCI-4452, PCI-4551, and PCI-4552. VXI-MIO device Refers to the VXI-MIO-64E-1 and VXI-MIO-64XE-10. VXI-SC-1102/B/C Refers to the VXI-SC-1102, VXI-SC-1102B, and VXI-SC-1102C. MIO and AI Device Terminology This manual uses generic terms to describe groups of devices whenever possible.
About This Manual Table 1. MIO and AI Devices (Continued) Device Number of SE Channels Bit Type Functionality Series NEC-AI-16XE-50 16 16-bit NEC AI E Series NEC-MIO-16E-4 16 12-bit NEC MIO E Series NEC-MIO-16XE-50 16 16-bit NEC MIO E Series PCI-6031E (MIO-64XE-10) 64 16-bit PCI MIO E Series PCI-6032E (AI-16XE-10) 16 16-bit PCI AI E Series PCI-6033E (AI-64XE-10) 64 16-bit PCI AI E Series PCI-6071E (MIO-64E-1) 64 12-bit PCI MIO E Series PCI-6110E 4 diff.
About This Manual About the National Instruments Documentation Set The NI-DAQ Function Reference Manual for PC Compatibles is one piece of the documentation set for your DAQ system. You might have any of several types of manuals, depending on the hardware and software in your system. Use these manuals as follows: • Your SCXI hardware user manuals—If you are using SCXI, read these manuals next for detailed information about signal connections and module configuration.
About This Manual Related Documentation The following documents contain information you may find useful as you read this manual: For detailed hardware information, refer to the user manual included with each board.
Chapter 1 Using the NI-DAQ Functions This chapter contains important information about how to apply the function descriptions in this manual to your programming language and environment. When you are familiar with the material in the NI-DAQ User Manual for PC Compatibles, you can use this manual for detailed information about each NI-DAQ function.
Chapter 1 Using the NI-DAQ Functions use the configuration utility to verify your device numbers. You can use multiple DAQ devices in one application; to do so, simply pass the appropriate device number to each function. If you are using SCXI, you must pass the chassis ID that you assigned to your SCXI chassis in the configuration utility to the SCXI functions that you use. For many of the SCXI functions, you must also pass the module slot number of the module you want to use.
Chapter 1 Using the NI-DAQ Functions Table 1-2. Primary Type Names (Continued) Type Type Name Description Range C/C++ Visual BASIC Pascal (Borland Delphi) u16 16-bit unsigned integer 0 to 65,535 unsigned short for 32-bit compilers Not supported by BASIC. For functions that require unsigned integers, use the signed integer type instead. See the i16 description.
Chapter 1 Using the NI-DAQ Functions The previous example describes a parameter that can accept an array of signed integers or an array of floating-point numbers. Programming Language Considerations Apart from the data type differences, there are a few language-dependent considerations you need to be aware of when you use the NI-DAQ API. Read the following sections that apply to your programming language.
Chapter 1 Using the NI-DAQ Functions NI-DAQ Constants Include File The file NIDAQCNS.INC contains definitions for constants required for some of the NI-DAQ functions. You should use the constants symbols in your programs; do not use the numerical values. In Visual Basic for Windows, you can add the entire NIDAQCNS.INC file into your project. You then will be able to use any of the constants defined in this file in any module in your program. To add the NIDAQCNS.INC file for your project in Visual Basic 3.
Chapter 1 Using the NI-DAQ Functions Table 1-3 shows how the LabWindows/CVI function panel tree is organized, and the NI-DAQ function name that corresponds to each function panel. Table 1-3.
Chapter 1 Using the NI-DAQ Functions Table 1-3.
Chapter 1 Using the NI-DAQ Functions Table 1-3.
Chapter 1 Using the NI-DAQ Functions Table 1-3.
Chapter 1 Using the NI-DAQ Functions Table 1-3.
Chapter 1 Using the NI-DAQ Functions Table 1-3.
Chapter 1 Using the NI-DAQ Functions Table 1-3.
Chapter 1 Using the NI-DAQ Functions Initialization/Utilities is a class of functions used for general board initialization and configuration, for configuration retrieval, and for setting NI-DAQ properties. This class also contains several useful utility functions. Board Config & Calibrate is a class of functions that perform calibration and configuration that is specific to a single type of board. The Analog Input class contains all of the classes of functions that perform A/D conversions.
Chapter 1 Using the NI-DAQ Functions Counter/Timer is a class of function panels that perform counting and timing operations. DAQ-STC Counters (GPCTR) is a subclass of Counter/Timer that contains functions that perform operations on the DAQ-STC counters on the E Series devices. Am9513 Counters (CTR) is another subclass of Counter/Timer that contains functions that perform operations on the Am9513 counters on the Am9513-based devices, and the PC-TIO-10.
Chapter 2 Function Reference This chapter contains a detailed explanation of each NI-DAQ function. The functions are arranged alphabetically. AI_Change_Parameter Format status = AI_Change_Parameter (deviceNumber, channel, paramID, paramValue) Purpose Selects a specific parameter for the analog input section of the device or an analog input channel. You can select parameters related to analog input not listed here through the AI_Configure function.
Chapter 2 Function Reference — AI_Change_Parameter • Pascal programmers—NIDAQCNS.PAS Legal values for channel depend on the type of device you are using; analog input channels are labeled 0 through n – 1, where n is the number of analog input channels on your device. You can set channel to –1 to indicate that you want the same parameter selection for all channels. Note For the 611X devices, specify ND_PFI_0 for channel when setting coupling of the PFI_0 line for the analog trigger.
Chapter 2 Function Reference — AI_Check AI_Check Format status = AI_Check (deviceNumber, readingAvailable, reading) Purpose Returns the status of the analog input circuitry and an analog input reading if one is available. AI_Check is intended for use when A/D conversions are initiated by external pulses applied at the EXTCONV* pin or, if you are using the E Series devices, at the pin selected through the Select_Signal function; see DAQ_Config for information on enabling external conversions.
Chapter 2 Function Reference — AI_Check Using This Function AI_Check checks the status of the analog input circuitry. If the device has performed an A/D conversion, AI_Check returns readingAvailable = 1 and the A/D conversion result. Otherwise, AI_Check returns readingAvailable = 0. AI_Setup, in conjunction with AI_Check and AI_Clear, is useful for externally timed A/D conversions. Before you call AI_Setup, you can call AI_Clear to clear out the A/D FIFO of any previous conversion results.
Chapter 2 Function Reference — AI_Clear AI_Clear Format status = AI_Clear (deviceNumber) Purpose Clears the analog input circuitry and empties the FIFO memory. Parameters Input Name deviceNumber Type i16 Description assigned by configuration utility Using This Function AI_Clear clears the analog input circuitry and empties the analog input FIFO memory. AI_Clear also clears any analog input error conditions.
Chapter 2 Function Reference — AI_Configure AI_Configure Format status = AI_Configure (deviceNumber, chan, inputMode, inputRange, polarity, driveAIS) Purpose Informs NI-DAQ of the input mode (single-ended or differential), input range, and input polarity selected for the device. Use this function if you have changed the jumpers affecting the analog input configuration from their factory settings.
Chapter 2 1: 2: Function Reference — AI_Configure Referenced Single-Ended (RSE) configuration (used when the input signal does not have its own ground reference. The negative input of the instrumentation amplifier is tied to the instrumentation amplifier signal ground to provide one). Nonreferenced Single-Ended (NRSE) configuration (used when the input signal has its own ground reference.
Chapter 2 Function Reference — AI_Configure Table 2-1. Parameter Settings for AI_Configure (Continued) Analog Input Range Device LPM Devices (RSE inputMode only) Possible Values for inputMode inputRange polarity Resulting Analog Input Range ignored 5 unipolar 0 to +5 V 5 bipolar –2.5 to +2.5 V 10 unipolar 0 to +10 V 10 bipolar –5 to +5 V Software Configurable No (PC-LPM-16) Yes (PC-LPM-16PnP) 516 Devices, DAQCard-500 1 10 bipolar –5 to 5 V N/A DAQCard-700 0, 1 5 bipolar –2.
Chapter 2 Function Reference — AI_Configure Using This Function When you attach an SC-2040 or SC-2042-RTD to your DAQ device, you must configure channels 0 through 7 for differential mode. When you attach an SC-2043-SG or any SCC accessories to your DAQ device, you must configure these channels for nonreferenced single-ended mode.
Chapter 2 Function Reference — AI_Mux_Config AI_Mux_Config Format status = AI_Mux_Config (deviceNumber, numMuxBrds) Purpose Configures the number of multiplexer (AMUX-64T) devices connected to the MIO and AI devices and informs NI-DAQ of the presence of any AMUX-64T devices attached to the system (MIO and AI devices only).
Chapter 2 Function Reference — AI_Mux_Config For the AT-MIO-64F-5, AT-MIO-64E-3, PCI-6031E (MIO-64XE-10), PCI-6033 (AI-64XE-10), and PCI-6071E (MIO-64E-1), you also must call MIO_Config if you plan to use AMUX-64T channels. Refer to the MIO_Config function for further details. Note Some of the digital lines of port 0 on the MIO or AI device with AMUX-64T devices are reserved for AMUX device control.
Chapter 2 Function Reference — AI_Read AI_Read Format status = AI_Read (deviceNumber, chan, gain, reading) Purpose Reads an analog input channel (initiates an A/D conversion on an analog input channel) and returns the unscaled result.
Chapter 2 Note Function Reference — AI_Read NI-DAQ does not distinguish between the low-gain and high-gain versions of the AT-MIO-16. If you enter a gain of 10 and you have a device with gains of 1, 2, 4, and 8, a gain of 2 actually is used and no error is returned. reading is the integer in which NI-DAQ returns the 12-bit or 16-bit result of the A/D conversion. Range: 0 to 4,095 (12-bit devices, unipolar mode). –2,048 to 2,047 (12-bit devices, bipolar mode). 0 to 65,535 (16-bit devices, unipolar mode).
Chapter 2 Function Reference — AI_Read_Scan AI_Read_Scan Format status = AI_Read_Scan (AI_Read_Scan (deviceNumber, reading) Purpose Returns readings for all analog input channels selected by SCAN_Setup (E Series devices only, with or without the SC-2040 accessory).
Chapter 2 Function Reference — AI_Setup AI_Setup Format status = AI_Setup (deviceNumber, chan, gain) Purpose Selects an analog input channel and gain setting for externally pulsed conversion operations. Parameters Input Name Type Description deviceNumber i16 assigned by configuration utility chan i16 analog input channel number gain i16 gain setting to be used Parameter Discussion chan is the analog input channel number.
Chapter 2 Function Reference — AI_Setup Using This Function AI_Setup addresses the specified analog input channel and changes the input gain to the specified gain setting. AI_Setup, in conjunction with AI_Check and AI_Clear, is used for externally timed A/D conversions. If your application calls AI_Read with channel and gain parameters different from those used in the last AI_Setup call, you must call AI_Setup again for AI_Check to return data from the channel you want at the selected gain.
Chapter 2 Function Reference — AI_VRead AI_VRead Format status = AI_VRead (deviceNumber, chan, gain, voltage) Purpose Reads an analog input channel (initiates an A/D conversion on an analog input channel) and returns the result scaled to a voltage in units of volts.
Chapter 2 Function Reference — AI_VRead voltage is the floating-point variable in which NI-DAQ returns the measured voltage, scaled to units of volts. Note C Programmers—voltage is a pass-by-reference parameter. Using This Function AI_VRead addresses the specified analog input channel, changes the input gain to the specified gain setting, and initiates an A/D conversion. AI_VRead waits for the conversion to complete and then scales and returns the result.
Chapter 2 Function Reference — AI_VRead_Scan AI_VRead_Scan Format status = AI_VRead_Scan (deviceNumber, reading) Purpose Returns readings in volts for all analog input channels selected by SCAN_Setup (E Series devices only with or without the SC-2040 accessory).
Chapter 2 Function Reference — AI_VScale AI_VScale Format status = AI_VScale (deviceNumber, chan, gain, gainAdjust, offset, reading, voltage) Purpose Converts the binary result from an AI_Read call to the actual input voltage.
Chapter 2 Function Reference — AI_VScale gainAdjust is the multiplying factor to adjust the gain. Refer to Appendix B, Analog Input Channel, Gain Settings, and Voltage Calculation, for the procedure for determining gainAdjust. If you do not want to do any gain adjustment—for example, use the ideal gain as specified by the gain parameter—set gainAdjust to 1. offset is the binary offset that needs to be subtracted from the reading.
Chapter 2 Function Reference — Align_DMA_Buffer Align_DMA_Buffer Format status = Align_DMA_Buffer (deviceNumber, resource, buffer, count, bufferSize, alignIndex) Purpose Aligns the data in a DMA buffer to avoid crossing a physical page boundary. This function is for use with DMA waveform generation and digital I/O pattern generation (AT-MIO-16F-5 and AT-DIO-32F only).
Chapter 2 Function Reference — Align_DMA_Buffer buffer is the integer array of samples NI-DAQ uses in the waveform or pattern generation. The actual size of buffer should be larger than the number of samples to make room for possible alignment. If the actual size of the buffer is not big enough for alignment, the function returns a memAlignmentError. For Windows applications running in real or standard mode, a bufferSize of 2*count guarantees that there is enough room for alignment.
Chapter 2 Function Reference — Align_DMA_Buffer bufferSize ≥ count + 1. If neither form of alignment is possible, the function returns an error. If Align_DMA_Buffer partially aligned the data, the function returns a memPageError warning indicating that a page boundary is still in the data. Note Physical DMA page boundaries do not exist on EISA bus computers.
Chapter 2 Function Reference — AO_Calibrate AO_Calibrate Format status = AO_Calibrate (deviceNumber, operation, EEPROMloc) Purpose Loads a set of calibration constants into the calibration DACs or copies a set of calibration constants from one of four EEPROM areas to EEPROM area 1. You can load an existing set of calibration constants into the calibration DACs from a storage area in the onboard EEPROM.
Chapter 2 Function Reference — AO_Calibrate Using This Function When NI-DAQ initializes the AT-AO-6/10, the DAC calibration constants stored in EEPROMloc 1 (user calibration area 1) provide the gain and offset values used to ensure proper device operation. In other words, Init_DA_Brds performs the equivalent of calling AO_Calibrate with operation set to 1 and EEPROMloc set to 1.
Chapter 2 Function Reference — AO_Change_Parameter AO_Change_Parameter Format status = AO_Change_Parameter (deviceNumber, channel, paramID, paramValue) Purpose Selects a specific parameter setting for the analog output section of the device or an analog output channel. You can select parameters related to analog output not listed here through the AO_Configure function.
Chapter 2 Function Reference — AO_Change_Parameter Legal values for paramValue depend on paramID. The following paragraphs list features you can configure along with legal values for paramID with explanations and corresponding legal values for paramValue. Reglitching Every time you change the state of your DAC, a very small glitch is generated in the signal generated by the DAC.
Chapter 2 Function Reference — AO_Change_Parameter Table 2-4. Voltage or Current Output Parameters Device Type Per Channel Selection Possible PC-AO-2DC DAQCard-AO-2DC VXI-AO-48XDC Yes Legal Range for paramValue Default Setting for paramValue ND_CURRENT_OUTPUT ND_VOLTAGE_OUTPUT and ND_VOLTAGE_OUTPUT For the VXI-AO-48XDC device the paramID of ND_OUTPUT_TYPE is used in conjunction with the channel value to select the analog output channel to be affected.
Chapter 2 Function Reference — AO_Change_Parameter When using PCI E Series devices with DMA (default data transfer condition), the device has an effective FIFO size 32 samples larger than the FIFO size specified for the board. This is due to a 32-sample FIFO on the miniMITE, the onboard DMA controller used for DMA transfers. FIFO Transfer Count The FIFO transfer count specifies the number of samples to be transferred from the waveform buffer into the analog output FIFO when FIFO requests are generated.
Chapter 2 Function Reference — AO_Change_Parameter To change the FIFO transfer count, set paramID to ND_FIFO_TRANSFER_COUNT and use paramValue to pass in a 32-bit integer. Set channel to one of the channel numbers in your waveform group. For example, if you have configured group 1 to contain channels 0 and 1, you can set channel to 0 or 1. Note This option is valid only for PCI E Series devices.
Chapter 2 Function Reference — AO_Change_Parameter Output Enable On some of the devices, you can disable the output even when the waveform generation is in progress. You can use this feature to bring the output to a known level at any time. On DAQArb 5411 devices, there is a relay just in front of the I/O connector. By disabling the output, this relay switches so that the I/O connector output shorts to ground. The waveform generation can still continue, but no signal appears at the I/O connector output.
Chapter 2 Function Reference — AO_Change_Parameter Output Attentuation Some devices have attenuators after the final amplifier stage. By attenuating the output signal, you do not lose any dynamic range of the signal; that is, you do not lose any bits from the digital representation of the signal, because the attenuation is done after the DAC and not before it. Attenuation (in mdB) = - [20 log10 (Vo/Vi)]*1000 Vo = The voltage level that you want for the output signal. Vi = The input voltage level.
Chapter 2 Function Reference — AO_Change_Parameter Table 2-12. Parameter Setting Information for Frequency Correction for the Analog Filter Device Type DAQArb AT-5411 DAQArb PCI-5411 Per Channel Selection Possible Yes Legal Range for paramValue Default Setting for paramValue 0 through 16,000,000 0 Trigger Mode Some devices can generate the waveforms stored in the memory on board in different ways by setting the trigger mode parameter.
Chapter 2 Function Reference — AO_Change_Parameter Table 2-13. Parameter Setting Information for the Trigger Mode Device Type Per Channel Selection Possible DAQArb AT-5411 DAQArb PCI-5411 Yes Legal Range for paramValue ND_SINGLE ND_CONTINUOUS ND_BURST ND_STEPPED Default Setting for paramValue ND_CONTINUOUS PLL Reference Frequency On some of the devices, you can phase-lock the internal timebase to an external reference clock.
Chapter 2 Function Reference — AO_Change_Parameter paramValue to 0 or 100. By setting it to 0, the SYNC output goes to 0 V. If you set it to 100, it goes to +5 V. Table 2-15. Parameter Setting Information for the SYNC Duty Cycle Device Type Per Channel Selection Possible Legal Range for paramValue Default Setting for paramValue Yes 20 to 80 50 DAQArb AT-5411 DAQArb PCI-5411 Using This Function Use this function to customize the behavior of the analog output section of your device.
Chapter 2 Function Reference — AO_Change_Parameter Memory Transfer Width When doing waveform generation on PCI E Series boards that use the PCI-MITE for DMA transfers, NI-DAQ transfers data from host memory to the DAQ device 16 bits at a time. This allows for the finest level of control and is necessary to properly support features like old data stop and partial transfer stop (see the NI-DAQ function WFM_DB_Config).
Chapter 2 Function Reference — AO_Configure AO_Configure Format status = AO_Configure (deviceNumber, chan, outputPolarity, intOrExtRef, refVoltage, updateMode) Purpose Informs NI-DAQ of the output range and polarity selected for each analog output channel on the device and indicates the update mode of the DACs.
Chapter 2 Function Reference — AO_Configure outputPolarity indicates whether the analog output channel is configured for unipolar or bipolar operation. For the AT-AO-6/10 and MIO devices (except the MIO-16XE-50 devices): 0: Bipolar operation (default setting, output range is from –refVoltage to +refVoltage). 1: Unipolar operation (output range is from 0 to +refVoltage). For the Lab and 1200 Series analog output devices: 0: Bipolar operation (default setting, output range is from –5 to +5 V).
Chapter 2 Function Reference — AO_Configure If you make a reference voltage connection, you must assign refVoltage the value of the external reference voltage in a call to AO_Configure for the AO_VWrite and AO_VScale functions to operate properly. For devices that have no external reference pin, the output range is determined by outputPolarity, and NI-DAQ ignores this parameter. updateMode indicates whether an analog output channel is updated when written to: 0: Updated when written to (default setting).
Chapter 2 Function Reference — AO_Configure AO_Configure stores information about the analog output channel on the specified board in the configuration table for the analog channel. The analog output channel configuration table defaults tables default to the following: • MIO device and AT-AO-6/10: outputPolarity = 0: Bipolar. refVoltage = 10 V. updateMode = 0: Update when written to. • Lab and 1200 Series analog output devices: outputPolarity = 0: Bipolar (–5 to +5 V).
Chapter 2 Function Reference — AO_Update AO_Update Format status = AO_Update (deviceNumber) Purpose Updates analog output channels on the specified device to new voltage values when the later internal update mode is enabled by a previous call to AO_Configure. Parameters Input Name deviceNumber Type i16 Description slot or device ID number Using This Function AO_Update issues an update pulse to all analog output channels on the specified device.
Chapter 2 Function Reference — AO_VScale AO_VScale Format status = AO_VScale (deviceNumber, chan, voltage, binVal) Purpose Scales a voltage to a binary value that, when written to one of the analog output channels, produces the specified voltage.
Chapter 2 Function Reference — AO_VScale Notice that refVoltage is the value you specify in AO_Configure. Because you can independently configure the analog output channels for range and polarity, NI-DAQ can translate the same voltage to different values for each channel.
Chapter 2 Function Reference — AO_VWrite AO_VWrite Format status = AO_VWrite (deviceNumber, chan, voltage) Purpose Accepts a floating-point voltage value, scales it to the proper binary number, and writes that number to an analog output or current channel to change the output voltage.
Chapter 2 Function Reference — AO_VWrite If you set the output type to current by calling AO_Change_Parameter, the floating-point value indicates the current in amps. Default ranges (unipolar, internal voltage reference): AO-2DC device: 0 to 0.02 A VXI-AO-48XDC: 0 to 0.02047 A Using This Function AO_VWrite scales voltage to a binary value and then writes that value to the DAC in the analog output channel.
Chapter 2 Function Reference — AO_Write AO_Write Format status = AO_Write (deviceNumber, chan, value) Purpose Writes a binary value to one of the analog output channels, changing the voltage produced at the channel. Parameters Input Name Type Description deviceNumber i16 assigned by configuration utility chan i16 analog output channel number value i16 digital value to be written Parameter Discussion chan is the analog output channel number.
Chapter 2 Note Function Reference — AO_Write Some inaccuracy results when you use AO_Write on the VXI-AO-48XDC, because this device works with a larger analog output resolution than can be represented by the 16-bit value parameter. value represents the most significant 16 bits of the DAC, in order to minimize this inaccuracy. Use the AO_VWrite function to prevent this type of inaccuracy.
Chapter 2 Function Reference — Calibrate_1200 Calibrate_1200 Format status = Calibrate_1200 (device, calOP, saveNewCal, EEPROMloc, calRefChan, grndRefChan, DAC0chan, DAC1chan, calRefVolts, gain) Purpose The 1200 and 1200AI devices come fully equipped with accurate factory calibration constants.
Chapter 2 ! Function Reference — Calibrate_1200 Read the calibration chapter in your device user manual before using Calibrate_1200.
Chapter 2 Function Reference — Calibrate_1200 obtained during the process remain in use by the DACs until the device is initialized again. The ADC must be in referenced single-ended and bipolar mode and fully calibrated (using calOP = 2) for successful calibration of the DACs. Note 4: 5: 6: Reserved. Edit the default load table so that the set of constants in the area identified by EEPROMloc (1–6, 9 or 10) become the default calibration constants for the ADC.
Chapter 2 Function Reference — Calibrate_1200 ignored ignored ignored ignored 6 ignored 1–6, 9–10 ignored ignored ignored ignored ignored ignored gain ignored calRefVolts DAC0chan ignored DAC1chan grndRefChan 1–6, 9–10 EEPROMloc ignored saveNewCal 5 calOP calRefChan Table 2-16. Possible Calibrate_1200 Parameter Values (Continued) saveNewCal is valid only when calOP is 2 or 3. 0: Do not save new calibration constants.
Chapter 2 Function Reference — Calibrate_1200 DAC1chan is the analog input channel connected to DAC1 when calOP is 3. Range: 0 through 7. calRefVolts is the value of the DC calibration voltage connected to calRefChan when calOP = 2. Note If you are calibrating at a gain other than 1, make sure you apply a voltage so that calRefVolts * gain is within the upper limits of the analog input range of the device. gain is the device gain setting at which you want to calibrate when calOP is 2 or 3.
Chapter 2 Function Reference — Calibrate_1200 Next call this function again; for example: status = Calibrate_1200 (device, 5, 0, EEPROMloc, 0, 0, 0, 0, 0, 0) where the device and EEPROMloc are the same as in the first function call. NI-DAQ automatically modifies the ADC unipolar pointer in the default load table to point to user area 1. Step 2. Bipolar calibration—Change the polarity of your device to bipolar.
Chapter 2 Function Reference — Calibrate_DSA Calibrate_DSA Format status = Calibrate_DSA (deviceNumber, operation, refVoltage) Purpose Use this function to calibrate your DSA device. Parameters Input Name Type Description deviceNumber i16 assigned by configuration utility operation u32 operation to be performed refVoltage f64 DC calibration voltage Parameter Discussion The legal range for operation is given in terms of constants defined in a header file.
Chapter 2 Function Reference — Calibrate_DSA Using This Function Your device contains calibration D/A converters (calDACs) that are used for fine-tuning the analog circuitry. The calDACs must be programmed (loaded) with certain numbers called calibration constants. These constants are stored in nonvolatile memory (EEPROM) on your device.
Chapter 2 Function Reference — Calibrate_DSA Restoring Factory Calibration To restore the factory value of the internal reference voltage after an external calibration, set operation to ND_RESTORE_FACTORY_CALIBRATION. You might want to do so if you made a mistake while performing the external calibration, or if you did not want to perform the external calibration at all.
Chapter 2 Function Reference — Calibrate_E_Series Calibrate_E_Series Format status = Calibrate_E_Series (deviceNumber, calOP, setOfCalConst, calRefVolts) Purpose Use this function to calibrate your E Series device and to select a set of calibration constants to be used by NI-DAQ. ! Caution Read the calibration chapter in your device user manual before using Calibrate_E_Series. Note Analog output channels and the AO and WFM functions do not apply to the AI E Series devices.
Chapter 2 Function Reference — Calibrate_E_Series setOfCalConst selects the set of calibration constants to be used by NI-DAQ. These calibration constants reside in the onboard EEPROM or are maintained by NI-DAQ. Range: ND_FACTORY_EEPROM_AREA: Factory calibration area of the EEPROM. You cannot modify this area, so you can set setOfCalConst to ND_FACTORY_EEPROM_AREA only when calOP is set to ND_SET_DEFAULT_LOAD_AREA.
Chapter 2 Function Reference — Calibrate_E_Series the default load area is the area that contains the calibration constants obtained by calibrating the device in the factory. NI-DAQ automatically loads the relevant calibration constants stored in the load area the first time you call a function (an AI, AO, DAQ, SCAN and WFM function) that requires them.
Chapter 2 Function Reference — Calibrate_E_Series Example: You want to perform self-calibration of your device and you want to store the new set of calibration constants in the user area of the EEPROM. You should make the following call: Calibrate_E_Series(deviceNumber, ND_SELF_CALIBRATE, ND_USER_EEPROM_AREA, 0.0) The EEPROM user area becomes the default load area. Performing External Calibration of the Board Set calOP to ND_EXTERNAL_CALIBRATE to perform external calibration of your device.
Chapter 2 Function Reference — Calibrate_E_Series Calibration Constant Loading by NI-DAQ NI-DAQ automatically loads calibration constants into calDACs whenever you call functions that depend on them (AI, AO, DAQ, SCAN, and WFM functions). The following conditions apply: 12-bit E Series Devices • The same set of constants is correct for both polarities of analog input. • One set of constants is valid for unipolar, and another set is valid for bipolar configuration of the analog output channels.
Chapter 2 Function Reference — Config_Alarm_Deadband Config_Alarm_Deadband Format status = Config_Alarm_Deadband (deviceNumber, mode, chanStr, trigLevel, deadbandWidth, handle, alarmOnMessage, alarmOffMessage, callbackAddr) Purpose Notifies NI-DAQ applications when analog input signals meet the alarm-on or alarm-off condition you specified. Also, NI-DAQ sends your application a message or executes a callback function that you provide.
Chapter 2 Function Reference — Config_Alarm_Deadband The channel string has one of the following formats: xn SCn!MDn!CHn AMn!n where x: n: SC: MD: CH: AM: !: AI for analog input channel. Analog channel, digital port, SCXI chassis, SCXI module number, or AMUX-64T device number. Keyword stands for SCXI chassis. Keyword stands for SCXI module. Keyword stands for SCXI channel. Keyword stands for AMUX-64T device. Delimiter.
Chapter 2 Function Reference — Config_Alarm_Deadband alarmOnMessage and alarmOffMessage are messages you define. When the alarm-on condition occurs, NI-DAQ passes alarmOnMessage back to you. Similarly, when the alarm-off condition occurs, NI-DAQ passes alarmOffMessage back to you. The messages can be any value. In Windows, you can set the message to a value including any Windows predefined messages such as WM_PAINT.
Chapter 2 Function Reference — Config_Alarm_Deadband On: low alarm on Off: low alarm off off trigLevel + deadbandWidth/2 trigLevel trigLevel deadbandWidth/2 on Time Figure 2-2. Low Alarm Deadband Config_Alarm_Deadband is a high-level function for NI-DAQ event messaging.
Chapter 2 Function Reference — Config_ATrig_Event_Message Config_ATrig_Event_Message Format status = Config_ATrig_Event_Message (deviceNumber, mode, chanStr, trigLevel, windowSize, trigSlope, trigSkipCount, pretrigScans, postTrigScans, handle, message, callbackAddr) Purpose Notifies NI-DAQ applications when the trigger channel signal meets certain criteria you specify. NI-DAQ sends your application a message or executes a callback function that you provide.
Chapter 2 Function Reference — Config_ATrig_Event_Message chanStr is a string description of the trigger analog channel or digital port. The channel string has one of the following formats: xn SCn!MDn!CHn AMn!n where x: n: SC: MD: CH: AM: !: AI for analog input channel. Analog channel, digital port, SCXI chassis, SCXI module number, or AMUX-64T device number. Keyword stands for SCXI chassis. Keyword stands for SCXI module. Keyword stands for SCXI channel. Keyword stands for AMUX-64T device. Delimiter.
Chapter 2 Function Reference — Config_ATrig_Event_Message windowSize is the number of volts below trigLevel for positive slope or above the analog trigger level for negative slope that the input signal must go before NI-DAQ recognizes a valid trigger crossing at the analog trigger level. trigSlope is the slope the input signal should trigger on. 0: Trigger on either positive and negative slope. 1: Trigger on positive slope. 2: Trigger on negative slope.
Chapter 2 Function Reference — Config_ATrig_Event_Message P: positive trigger point N: negative trigger point trigLevel + windowSize trigLevel P N trigLevel - windowSize Time Figure 2-3. Analog Trigger Event Config_ATrig_Event_Message is a high-level function for NI-DAQ event messaging.
Chapter 2 Function Reference — Config_DAQ_Event_Message Config_DAQ_Event_Message Format status = Config_DAQ_Event_Message (deviceNumber, mode, chanStr, DAQEvent, DAQTrigVal0, DAQTrigVal1, trigSkipCount, preTrigScans, postTrigScans, handle, message, callbackAddr) Purpose Notifies NI-DAQ applications when the status of an asynchronous DAQ operation (initiated by a call to DAQ_Start, DIG_Block_Out, WFM_Group_Control, and so on) meets certain criteria you specify.
Chapter 2 Function Reference — Config_DAQ_Event_Message Name Type Description message i16 user-defined message callbackAddr u32 user callback function address Parameter Discussion mode indicates whether to add a new message, remove an old message, or clear all messages associated with the given device. 0: Clear all messages associated with the device including messages configured with Config_Alarm_Deadband and Config_ATrig_Event_Message. 1: Add a new message. 2: Remove an existing message.
Chapter 2 Function Reference — Config_DAQ_Event_Message The following string specifies SCXI channel 1 in SCXI module 2 of SCXI chassis 4 as the trigger channel: SC4!MD2!CH1 The following specifies AMUX channel 34 on the AMUX-64T device 1 as the trigger channel: AM1!34 You can specify only one AMUX channel in the chanStr parameter. You also can specify more than one channel as the trigger channel by listing all the channels when specifying channel number.
Chapter 2 Function Reference — Config_DAQ_Event_Message Table 2-17. DAQEvent Messages DAQEvent Type Acquire or generate N scans Code 0 Description of Message Send exactly one message when an asynchronous operation has completed DAQTrigVal0 scans.
Chapter 2 Function Reference — Config_DAQ_Event_Message Table 2-17. DAQEvent Messages (Continued) DAQEvent Type Completed operation or stopped by error Description of Message Code 2 Send exactly one message when an asynchronous operation completes or is stopped for an error. chanStr indicates the type of channel or port, but the actual channel or port number is ignored.
Chapter 2 Function Reference — Config_DAQ_Event_Message Table 2-17. DAQEvent Messages (Continued) DAQEvent Type Code Analog positive slope triggering 5 Analog negative slope triggering 6 Digital pattern not matched 7 Description of Message Usable Devices Send a message when data from any channel in chanStr positively triggers on the hysteresis window specified by DAQTrigVal0 and DAQTrigVal1, where DAQTrigVal0 ≥ DAQTrigVal1.
Chapter 2 Function Reference — Config_DAQ_Event_Message Table 2-17. DAQEvent Messages (Continued) DAQEvent Type Digital pattern matched Description of Message Code 8 Send a message when data from any digital port in chanStr causes this statement to be true: data AND DAQTrigVal0 EQUAL DAQTrigVal1.
Chapter 2 Function Reference — Config_DAQ_Event_Message using. The PC-TIO-10 can have two of these event messages configured at the same time, therefore you must specify which pin you want to use on the PC-TIO-10 with the DAQTrigVal0 parameter. Table 2-18.
© National Instruments Corporation Table 2-19. Usable Parameters for Different DAQ Events Codes DAQEvent 2 3 4 5 chanStr (where n and m are numbers) AIn, DIn, DOn, SCn!..., AMn!m,AOn AIn, DIn, DOn, SCn!..., AMn!m, AOn AIn, AOn, DIn, DOn, SCn!..., AMn!m AIn, SCn!..., AMn!m AIn, SCn!..., AMn!m AIn, SCn!..., AMn!m DAQTrigVal0 no. of scans, must be greater than 0 no.
Chapter 2 Function Reference — Config_DAQ_Event_Message For the parameters that are ignored, set them to 0. For DAQEvent = 1, DAQTrigVal0 must be greater than zero. If you are using DMA with double buffers or a pretrigger data acquisition, DAQTrigVal0 must be an even divisor of the buffer size in scans. For DAQEvent = 1 on an analog output channel, DAQTrigVal0 must always be an even divisor of the buffer size or a multiple of it.
Chapter 2 Function Reference — Config_DAQ_Event_Message Event notification is done through the Windows API function PostMessage and/or a callback function that you define. When any trigger event happens, NI-DAQ calls PostMessage as follows: int PostMessage (HWND handle, UINT message, WPARAM wParam, LPARAM lParam) handle and message are the same handle and message as previously defined.
Chapter 2 Function Reference — Config_DAQ_Event_Message default: // handle other usual messages... return DefWindowProc (hWnd, uMsgId, wParam, lParam); } } Callback Functions To enable the callback function, you need to provide the address of the callback routine in callbackAddr. Therefore, you must write your application in a programming language that supports function pointers, such as C or Assembly. If you are using LabWindows/CVI, your callback function is called by means of messaging.
Chapter 2 Function Reference — Configure_HW_Analog_Trigger Configure_HW_Analog_Trigger Format status = Configure_HW_Analog_Trigger (deviceNumber, onOrOff, lowValue, highValue, mode, trigSource) Purpose Configures the hardware analog trigger. The hardware analog triggering circuitry produces a digital trigger that you can use for any of the signals available through the Select_Signal function by selecting source = ND_PFI_0).
Chapter 2 Function Reference — Configure_HW_Analog_Trigger lowValue and highValue specify the levels you want to use for triggering. For E Series devices, the legal range for the two values is 0 to 255 (0–4,095 for 16-bit boards). In addition, lowValue must be less than highValue.
Chapter 2 • Function Reference — Configure_HW_Analog_Trigger ND_BELOW_LOW_LEVEL—The trigger is generated when the signal value is less than the lowValue. highValue is unused. lowValue Trigger Figure 2-4. ND_BELOW_LOW_LEVEL • ND_ABOVE_HIGH_LEVEL—The trigger is generated when the signal value is greater than the highValue. lowValue is unused. highValue Trigger Figure 2-5.
Chapter 2 Function Reference — Configure_HW_Analog_Trigger • ND_HIGH_HYSTERESIS—The trigger is generated when the signal value is greater than the highValue, with hysteresis specified by lowValue. highValue lowValue Trigger Figure 2-7. ND_HIGH_HYSTERESIS • ND_LOW_HYSTERESIS—The trigger is generated when the signal value is less than the lowValue, with hysteresis specified by highValue. highValue lowValue Trigger Figure 2-8.
Chapter 2 Function Reference — Configure_HW_Analog_Trigger If you set trigSource to ND_THE_AI_CHANNEL, you can use the signal connected to one of the analog input pins for triggering. In this case, the signal is amplified on the device before it is used for trigger generation. You can use this source selection under the following conditions: • You want to perform data acquisition from a single analog input channel (the DAQ family of functions).
Chapter 2 Function Reference — Configure_HW_Analog_Trigger For example, if you set source to ND_THE_AI_CHANNEL, the channel you are interested in is in bipolar mode, you want a gain of 100, and you want to set the voltage window for triggering to +35 mV and +45 mV for your original signal (that is, signal before amplification by the onboard amplifier), you should make the following programming sequence: 12-bit boards: status = Configure_HW_Analog_Trigger (deviceNumber, ND_ON, 218, 243, mode, ND_THE_AI_CHA
Chapter 2 Function Reference — Configure_HW_Analog_Trigger If you apply any of the formulas and get a value equal to 256, use the value 255 instead; if you get 4,096 with the 16-bit boards, use 4,095 instead.
Chapter 2 Function Reference — CTR_Config CTR_Config Format status = CTR_Config (deviceNumber, ctr, edgeMode, gateMode, outType, outPolarity) Purpose Specifies the counting configuration to use for a counter.
Chapter 2 6: 7: 8: Function Reference — CTR_Config Active high on gate of next higher-order counter. Active high on gate of next lower-order counter. Special gating. outType selects which type of output is to be generated by the counter. The counters generate two types of output signals: TC toggled output and TC pulse output. 0: TC toggled output type used. 1: TC pulse output type used. outPolarity selects the output polarity used by the counter. 0: Positive logic output.
Chapter 2 Function Reference — CTR_EvCount CTR_EvCount Format status = CTR_EvCount (deviceNumber, ctr, timebase, cont) Purpose Configures the specified counter for an event-counting operation and starts the counter. Parameters Input Name Type Description deviceNumber i16 assigned by configuration utility ctr i16 counter number timebase i16 timebase value cont i16 whether counting continues Parameter Discussion ctr is the counter number.
Chapter 2 10: 11: 12: 13: 14: 15: Function Reference — CTR_EvCount SOURCE5 used as timebase if 1 ≤ ctr ≤ 5 or SOURCE 10 used as timebase if 6 ≤ ctr ≤ 10. GATE 1 used as timebase if 1 ≤ ctr ≤ 5 or GATE6 used as timebase if 6 ≤ ctr ≤ 10. GATE 2 used as timebase if 1 ≤ ctr ≤ 5 or GATE7 used as timebase if 6 ≤ ctr ≤ 10. GATE 3 used as timebase if 1 ≤ ctr ≤ 5 or GATE8 used as timebase if 6 ≤ ctr ≤ 10. GATE 4 used as timebase if 1 ≤ ctr ≤ 5 or GATE9 used as timebase if 6 ≤ ctr ≤ 10.
Chapter 2 Function Reference — CTR_EvRead CTR_EvRead Format status = CTR_EvRead (deviceNumber, ctr, overflow, count) Purpose Reads the current counter total without disturbing the counting process and returns the count and overflow conditions.
Chapter 2 Function Reference — CTR_EvRead Using This Function CTR_EvRead reads the current value of the counter without disturbing the counting process and returns the value in count. CTR_EvRead also performs overflow detection and returns the overflow status in overflow. Overflow detection and the significance of count depend on the counter configuration.
Chapter 2 Function Reference — CTR_FOUT_Config CTR_FOUT_Config Format status = CTR_FOUT_Config (deviceNumber, FOUT_port, mode, timebase, division) Purpose Disables or enables and sets the frequency of the 4-bit programmable frequency output.
Chapter 2 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: Function Reference — CTR_FOUT_Config Internal 1 kHz clock used as timebase (1 ms resolution). Internal 100 Hz clock used as timebase (10 ms resolution). SOURCE1 used as timebase if FOUT_port = 1 or SOURCE 6 used as timebase if FOUT_port = 2. SOURCE2 used as timebase if FOUT_port = 1 or SOURCE 7 used as timebase if FOUT_port = 2. SOURCE3 used as timebase if FOUT_port = 1 or SOURCE 8 used as timebase if FOUT_port = 2.
Chapter 2 Function Reference — CTR_Period CTR_Period Format status = CTR_Period (deviceNumber, ctr, timebase) Purpose Configures the specified counter for period or pulse-width measurement. Parameters Input Name Type Description deviceNumber i16 assigned by configuration utility ctr i16 counter number timebase i16 timebase value Parameter Discussion ctr is the counter number. Range: 1, 2, or 5 for an MIO device except the E Series devices. 1 through 10 for a PC-TIO-10.
Chapter 2 10: 11: 12: 13: 14: 15: Function Reference — CTR_Period SOURCE5 used as timebase if 1 ≤ ctr ≤ 5 or SOURCE 10 used as timebase if 6 ≤ ctr ≤ 10. GATE 1 used as timebase if 1 ≤ ctr ≤ 5 or GATE6 used as timebase if 6 ≤ ctr ≤ 10. GATE 2 used as timebase if 1 ≤ ctr ≤ 5 or GATE7 used as timebase if 6 ≤ ctr ≤ 10. GATE 3 used as timebase if 1 ≤ ctr ≤ 5 or GATE8 used as timebase if 6 ≤ ctr ≤ 10. GATE 4 used as timebase if 1 ≤ ctr ≤ 5 or GATE9 used as timebase if 6 ≤ ctr ≤ 10.
Chapter 2 Function Reference — CTR_Pulse CTR_Pulse Format status = CTR_Pulse (deviceNumber, ctr, timebase, delay, pulseWidth) Purpose Causes the specified counter to generate a specified pulse-programmable delay and pulse width. Parameters Input Name Type Description deviceNumber i16 assigned by configuration utility ctr i16 counter number timebase i16 timebase value delay u16 interval before the pulse pulseWidth u16 interval of the pulse Parameter Discussion ctr is the counter number.
Chapter 2 8: 9: 10: 11: 12: 13: 14: 15: Function Reference — CTR_Pulse SOURCE3 used as timebase if 1 ≤ ctr ≤ 5 or SOURCE 8 used as timebase if 6 ≤ ctr ≤ 10. SOURCE4 used as timebase if 1 ≤ ctr ≤ 5 or SOURCE 9 used as timebase if 6 ≤ ctr ≤ 10. SOURCE5 used as timebase if 1 ≤ ctr ≤ 5 or SOURCE 10 used as timebase if 6 ≤ ctr ≤ 10. GATE 1 used as timebase if 1 ≤ ctr ≤ 5 or GATE6 used as timebase if 6 ≤ ctr ≤ 10. GATE 2 used as timebase if 1 ≤ ctr ≤ 5 or GATE7 used as timebase if 6 ≤ ctr ≤ 10.
Chapter 2 Function Reference — CTR_Pulse Pulse Generation Timing Considerations Figure 2-9 shows pulse generation timing for both the TC toggled output and TC pulse output cases. These signals are positive polarity output signals. 11 units = timebase period Timebase Starting Signal pulse_width delay TC Toggle Output delay -- 11 TC Pulse Output pulse_width - 1 1 1 0 < sync period < 1 Figure 2-9.
Chapter 2 Function Reference — CTR_Pulse pulseWidth = 0 generates a special case signal as shown in Figure 2-10. 1 units = timebase period Timebase Starting Signal delay TC Toggle Output delay - 1 TC Pulse Output 1 0 < sync period < 1 Figure 2-10.
Chapter 2 Function Reference — CTR_Rate CTR_Rate Format status = CTR_Rate (freq, duty, timebase, period1, period2) Purpose Converts frequency and duty-cycle values of a selected square wave into the timebase and period parameters needed for input to the CTR_Square function that produces the square wave.
Chapter 2 3: 4: 5: Function Reference — CTR_Rate 100 µs. 1 ms. 10 ms. period1 and period2 represent the number of units of time (selected by timebase) that the square wave is high and low, respectively. The roles of period1 and period2 are reversed if the output polarity is negative. Range: 1 through 65,535. Note C Programmers—timebase, period1, and period2 are pass-by-reference parameters.
Chapter 2 Function Reference — CTR_Reset CTR_Reset Format status = CTR_Reset (deviceNumber, ctr, output) Purpose Turns off the specified counter operation and places the counter output drivers in the selected output state. Parameters Input Name Type Description deviceNumber i16 assigned by configuration utility ctr i16 counter number output i16 output state of the counter OUT signal driver Parameter Discussion ctr is the counter number.
Chapter 2 Function Reference — CTR_Restart CTR_Restart Format status = CTR_Restart (deviceNumber, ctr) Purpose Restarts operation of the specified counter. Parameters Input Name Type Description deviceNumber i16 assigned by configuration utility ctr i16 counter number Parameter Discussion ctr is the counter number. Range: 1, 2, or 5 for an MIO device except the E Series devices. 1 through 10 for a PC-TIO-10.
Chapter 2 Function Reference — CTR_Simul_Op CTR_Simul_Op Format status = CTR_Simul_Op (deviceNumber, numCtrs, ctrList, mode) Purpose Configures and simultaneously starts and stops multiple counters. Parameters Input Name Type Description deviceNumber i16 assigned by configuration utility numCtrs i16 number of counters to operate ctrList [i16] mode i16 array of counter numbers operating mode Parameter Discussion numCtrs is the number of counters to which the operation is performed.
Chapter 2 Note Function Reference — CTR_Simul_Op It is not necessary to call CTR_Simul_Op with mode set to 1 before calling CTR_Simul_Op with mode set to 4. That is, it is permissible to start two or more counters at different times and still latch their counts at the same time. Using This Function You can start multiple counters simultaneously for any combination of event counting, square wave generation, or pulse generation. The following sequence is an example of using CTR_Simul_Op: 1.
Chapter 2 Function Reference — CTR_Square CTR_Square Format status = CTR_Square (deviceNumber, ctr, timebase, period1, period2) Purpose Causes the specified counter to generate a continuous square wave output of specified duty cycle and frequency.
Chapter 2 8: 9: 10: 11: 12: 13: 14: 15: Function Reference — CTR_Square SOURCE3 used as timebase if 1 ≤ ctr v 5 or SOURCE 8 used as timebase if 6 ≤ ctr ≤ 10. SOURCE4 used as timebase if 1 ≤ ctr ≤ 5 or SOURCE 9 used as timebase if 6 ≤ ctr ≤ 10. SOURCE5 used as timebase if 1 ≤ ctr ≤ 5 or SOURCE 10 used as timebase if 6 ≤ ctr ≤ 10. GATE 1 used as timebase if 1 ≤ ctr ≤ 5 or GATE6 used as timebase if 6 ≤ ctr ≤ 10. GATE 2 used as timebase if 1 ≤ ctr ≤ 5 or GATE7 used as timebase if 6 ≤ ctr ≤ 10.
Chapter 2 Function Reference — CTR_Square When you use special gating (gateMode = 8), you can achieve gate-controlled pulse generation. When the gate input is high, NI-DAQ uses period1 to generate the pulses. When the gate input is low, NI-DAQ uses period2 to generate the pulses. If the output mode is TC Toggled, the result is two 50% duty square waves of difference frequencies. If the output mode is TC Pulse, the result is two pulse trains of different frequencies.
Chapter 2 Function Reference — CTR_State CTR_State Format status = CTR_State (deviceNumber, ctr, outState) Purpose Returns the OUT logic level of the specified counter. Parameters Input Name Type Description deviceNumber i16 assigned by configuration utility ctr i16 counter number Output Name outState Type Description i16 returns the logic level of the counter OUT signal Parameter Discussion ctr is the counter number. Range: 1, 2, or 5 for an MIO device except the E Series devices.
Chapter 2 Function Reference — CTR_Stop CTR_Stop Format status = CTR_Stop (deviceNumber, ctr) Purpose Suspends operation of the specified counter so that you can restart the counter operation. Parameters Input Name Type Description deviceNumber i16 assigned by configuration utility ctr i16 counter number Parameter Discussion ctr is the counter number. Range: 1, 2, or 5 for an MIO device except the E Series devices. 1 through 10 for a PC-TIO-10.
Chapter 2 Function Reference — DAQ_Check DAQ_Check Format status = DAQ_Check (deviceNumber, daqStopped, retrieved) Purpose Checks whether the current DAQ operation is complete and returns the status and the number of samples acquired to that point.
Chapter 2 Function Reference — DAQ_Check automatically rearranges the array upon completion of the acquisition so that the oldest data point is at the beginning of the array. Thus, retrieved always equals 0 upon completion of a pretrigger mode acquisition. Note C Programmers—daqStopped and retrieved are pass-by-reference parameters.
Chapter 2 Function Reference — DAQ_Clear DAQ_Clear Format status = DAQ_Clear (deviceNumber) Purpose Cancels the current DAQ operation (both single-channel and multiple-channel scanned) and reinitializes the DAQ circuitry.
Chapter 2 Function Reference — DAQ_Config DAQ_Config Format status = DAQ_Config (deviceNumber, startTrig, extConv) Purpose Stores configuration information for subsequent DAQ operations.
Chapter 2 Function Reference — DAQ_Config Using This Function DAQ_Config saves the parameters in the configuration table for future data acquisition. DAQ_Start and SCAN_Start use the configuration table to set the DAQ circuitry to the correct timing modes. If both startTrig and extConv are 0, A/D conversions begin as soon as you call DAQ_Start, SCAN_Start, or Lab_ISCAN_Start. When startTrig is 1, A/D conversions do not begin until NI-DAQ receives an external trigger pulse.
Chapter 2 Function Reference — DAQ_Config Note (PCI-6110E and PCI-6111E only) The only allowed values for extConv are 0 and 2. The conversions occur simultaneously for all channels and are controlled by the scan interval. The DSA devices cannot use externally controlled clocks, so extConv is ignored. The default settings for DAQ modes are as follows: startTrig = 0: DAQ sequences are initiated through software. extConv = 0: Onboard clock is used to time A/D conversions.
Chapter 2 Function Reference — DAQ_DB_Config DAQ_DB_Config Format status = DAQ_DB_Config (deviceNumber, DBmode) Purpose Enables or disables double-buffered DAQ operations. Parameters Input Name Type Description deviceNumber i16 assigned by configuration utility DBmode i16 enable or disable double-buffered mode Parameter Discussion DBmode indicates whether to enable or disable the double-buffered mode of acquisition. 0: Disable double buffering (default). 1: Enable double buffering.
Chapter 2 Function Reference — DAQ_DB_HalfReady DAQ_DB_HalfReady Format status = DAQ_DB_HalfReady (deviceNumber, halfReady, daqStopped) Purpose Checks whether the next half buffer of data is available during a double-buffered data acquisition. You can use DAQ_DB_HalfReady to avoid the waiting period that can occur because the double-buffered transfer function (DAQ_DB_Transfer) waits until the data is ready before retrieving and returning it.
Chapter 2 Function Reference — DAQ_DB_HalfReady Using This Function Double-buffered data acquisition cyclically fills a buffer with acquired data. The buffer is divided into two equal halves so that NI-DAQ can save data from one half while filling the other half. This mechanism makes it necessary to alternately save both halves of the buffer so that NI-DAQ does not overwrite data in the buffer before saving the data. Use the DAQ_DB_Transfer function to save the data as NI-DAQ acquires it.
Chapter 2 Function Reference — DAQ_DB_Transfer DAQ_DB_Transfer Format status = DAQ_DB_Transfer (deviceNumber, halfBuffer, ptsTfr, daqStopped) Purpose Transfers half of the data from the buffer being used for double-buffered data acquisition to another buffer, which is passed to the function, and waits until the data to be transferred is available before returning. You can execute DAQ_DB_Transfer repeatedly to return sequential half buffers of the data.
Chapter 2 Function Reference — DAQ_DB_Transfer after the acquisition has stopped, the last transfer of data to halfBuffer contains the number of valid points from the half of the circular buffer where acquisition stopped. daqStopped is a valid output parameter only if pretrigger mode acquisition is in progress. This parameter indicates the completion of a pretrigger mode acquisition by returning a one (it returns zero otherwise).
Chapter 2 Function Reference — DAQ_Monitor DAQ_Monitor Format status = DAQ_Monitor (deviceNumber, channel, sequential, numPts, monitorBuffer, newestPtIndex, daqStopped) Purpose Returns data from an asynchronous data acquisition in progress. During a multiple-channel acquisition, you can retrieve data from a single channel or from all channels being scanned. An oldest/newest mode provides for return of sequential (oldest) blocks of data or return of the most recently acquired (newest) blocks of data.
Chapter 2 Function Reference — DAQ_Monitor in Lab_ISCAN_Start. If you are using an AMUX-64T, channel can be equal to any one of the AMUX-64T channels. Range: –1 for data from all channels being sampled. n where n is one of the channels being sampled. sequential is a flag that enables or disables the return of consecutive or oldest blocks of data from the acquisition buffer.
Chapter 2 Function Reference — DAQ_Monitor Using This Function DAQ_Monitor is intended to return small blocks of data from a background acquisition operation. This is especially useful when you have put the acquisition in a circular mode by enabling either the double-buffered or pretrigger modes. The operation is not disturbed; NI-DAQ only reads data from the buffer being used by the acquisition. If the amount of data requested is not yet available, DAQ_Monitor returns the appropriate error code.
Chapter 2 Function Reference — DAQ_Op DAQ_Op Format status = DAQ_Op (deviceNumber, chan, gain, buffer, count, sampleRate) Purpose Performs a synchronous, single-channel DAQ operation. DAQ_Op does not return until NI-DAQ has acquired all the data or an acquisition error has occurred.
Chapter 2 Function Reference — DAQ_Op invalid gain, NI-DAQ will return an error. NI-DAQ ignores gain for 516 and LPM devices and the DAQCard-500/700. buffer is an integer array. buffer has a length equal to or greater than count. When DAQ_Op returns with an error number equal to zero, buffer contains the acquired data. count is the number of samples to be acquired (that is, the number of A/D conversions to be performed). Range: 3 through 232 – 1 (except for the Lab and 1200 Series and E Series devices).
Chapter 2 Function Reference — DAQ_Op Again, if you do not apply the stop trigger, DAQ_Op does not return control to your application. In any case, you can use Timeout_Config to establish a maximum length of time for DAQ_Op to execute.
Chapter 2 Function Reference — DAQ_Rate DAQ_Rate Format status = DAQ_Rate (rate, units, timebase, sampleInterval) Purpose Converts a DAQ rate into the timebase and sample-interval values needed to produce the rate you want.
Chapter 2 1: 2: 3: 4: 5: Function Reference — DAQ_Rate 1 µs. 10 µs. 100 µs. 1 ms. 10 ms. sampleInterval is the number of timebase units that elapse between consecutive A/D conversions. The combination of the timebase resolution value and the sampleInterval produces the DAQ rate you want. Range: 2 through 65,535. Note C Programmers—timebase and sampleInterval are pass-by-reference parameters.
Chapter 2 Function Reference — DAQ_Set_Clock DAQ_Set_Clock Format DAQ_Set_Clock (deviceNumber, group, whichClock, desiredRate, units, actualRate) Purpose Sets the scan rate for a group of channels (DSA devices only).
Chapter 2 Function Reference — DAQ_Set_Clock Using This Function DAQ_Set_Clock sets the specified clock rate for the next acquisition operation. Be sure to call DAQ_Set_Clock before DAQ_Start or SCAN_Start. When calling those functions, the timebase and interval parameters will be ignored.
Chapter 2 Function Reference — DAQ_Start DAQ_Start Format status = DAQ_Start (deviceNumber, chan, gain, buffer, count, timebase, sampInterval) Purpose Initiates an asynchronous, single-channel DAQ operation and stores its input in an array.
Chapter 2 Function Reference — DAQ_Start buffer is an integer array. buffer must have a length equal to or greater than count. The elements of buffer are the results of each A/D conversion in the DAQ operation. This buffer is often referred to as the acquisition buffer (or circular buffer when double-buffered mode is enabled) elsewhere in this manual. For DSA devices, buffer should be an array of i32. These devices return the data in a 32-bit format in which the data bits are in the most significant bits.
Chapter 2 Function Reference — DAQ_Start If you use external conversion pulses, NI-DAQ ignores the timebase parameter and you can set it to any value. For DSA devices, timebase is ignored. Use DAQ_Set_Clock to set the sampling rate. sampInterval indicates the length of the sample interval (that is, the amount of time to elapse between each A/D conversion). Range: 2 through 65,535. The sample interval is a function of the timebase resolution.
Chapter 2 Note Function Reference — DAQ_Start You need to apply a trigger that you select through the Select_Signal or DAQ_Config functions to initiate data acquisition. Be aware that if you do not apply the start trigger, DAQ_Op does not return control to your application. Otherwise, DAQ_Op issues a software trigger to initiate the DAQ operation.
Chapter 2 Function Reference — DAQ_StopTrigger_Config DAQ_StopTrigger_Config Format status = DAQ_StopTrigger_Config (deviceNumber, stopTrig, ptsAfterStoptrig) Purpose Enables the pretrigger mode of data acquisition and indicates the number of data points to acquire after NI-DAQ applies the stop trigger pulse at the STOPTRIG* input of the MIO-16/16D; the EXTTRIG* input of an AT-MIO-16F-5, AT-MIO-64F-5, or AT-MIO-16X or the EXTTRIG input of Lab and 1200 Series devices; or the PFI1 pin.
Chapter 2 Function Reference — DAQ_StopTrigger_Config apply a pulse at the STOPTRIG* input of the MIO-16/16D or the EXTTRIG* input of the AT-MIO-16F-5, AT-MIO-64F-5, or AT-MIO-16X or the EXTTRIG input of Lab and 1200 Series devices, NI-DAQ acquires an additional number of data points specified by ptsAfterStoptrig before the acquisition terminates.
Chapter 2 Function Reference — DAQ_to_Disk DAQ_to_Disk Format status = DAQ_to_Disk (deviceNumber, chan, gain, filename, count, sampleRate, concat) Purpose Performs a synchronous, single-channel DAQ operation and saves the acquired data in a disk file. DAQ_to_Disk does not return until NI-DAQ has acquired and saved all the data or an acquisition error has occurred.
Chapter 2 Function Reference — DAQ_to_Disk count is the number of samples to be acquired (that is, the number of A/D conversions to be performed). The length of your data file in bytes should be exactly twice the value of count upon completion of the acquisition. If you have previously enabled pretrigger mode (by a call to DAQ_StopTrigger_Config), NI-DAQ ignores the count parameter. Range: 3 through 232 – 1 (except the E Series devices). 2 through 224 (E Series devices).
Chapter 2 Function Reference — DAQ_to_Disk when you enable pretrigger mode. If you do not apply the stop trigger, DAQ_to_Disk returns control to your application because, you eventually will run out of disk space. In any case, you can use Timeout_Config to establish a maximum length of time for DAQ_to_Disk to execute.
Chapter 2 Function Reference — DAQ_VScale DAQ_VScale Format status = DAQ_VScale (deviceNumber, chan, gain, gainAdjust, offset, count, binArray, voltArray) Purpose Converts the values of an array of acquired binary data and the gain setting for that data to actual input voltages measured.
Chapter 2 Function Reference — DAQ_VScale gainAdjust is the multiplying factor to adjust the gain. Refer to Appendix B, Analog Input Channel, Gain Settings, and Voltage Calculation, for the procedure for determining gainAdjust. If you do not want to do any gain adjustment, (for example, the ideal gain as specified by the parameter gain) you must set gainAdjust to 1. offset is the binary offset that needs to be subtracted from reading.
Chapter 2 Function Reference — DIG_Block_Check DIG_Block_Check Format status = DIG_Block_Check (deviceNumber, group, remaining) Purpose Returns the number of items remaining to be transferred after a DIG_Block_In or DIG_Block_Out call.
Chapter 2 Function Reference — DIG_Block_Clear DIG_Block_Clear Format status = DIG_Block_Clear (deviceNumber, group) Purpose Halts any ongoing asynchronous transfer, allowing another transfer to be initiated. Parameters Input Name Type Description deviceNumber i16 assigned by configuration utility group i16 group Parameter Discussion group is the group involved in the asynchronous transfer. Range: 1 or 2 for most devices. 1 through 8 for the DIO-96.
Chapter 2 Function Reference — DIG_Block_In DIG_Block_In Format status = DIG_Block_In (deviceNumber, group, buffer, count) Purpose Initiates an asynchronous transfer of data from the specified group to memory. Parameters Input Name Type Description deviceNumber i16 assigned by configuration utility group i16 group count u32 number of items to be transferred Output Name buffer Type [i16] Description data obtained by reading the group Parameter Discussion group is the group to be read from.
Chapter 2 Function Reference — DIG_Block_In Using This Function DIG_Block_In initiates an asynchronous transfer of data from a specified group to your buffer. The hardware is responsible for the handshaking details. Call DIG_Grp_Config for the DIO-32F and the DIO 6533 (DIO-32HS), or DIG_SCAN_Setup for all other devices at least once before calling DIG_Block_In. DIG_Grp_Config and DIG_SCAN_Setup select the group configuration for handshaking.
Chapter 2 Function Reference — DIG_Block_In you must use the value of alignIndex return by Align_DMA_Buffer to access your data. In other words, data in an aligned buffer begins at buffer[alignIndex]. Data in an unaligned buffer begins at buffer [0]. Note DIG_Block_In will not work with groups of size = 1, because of a DMA limitation when using the AT-DIO-32F. Note If you are using an SCXI-1200 with remote SCXI, count is limited by the amount of memory made available on the remote SCXI unit.
Chapter 2 Function Reference — DIG_Block_Out DIG_Block_Out Format status = DIG_Block_Out (deviceNumber, group, buffer, count) Purpose Initiates an asynchronous transfer of data from memory to the specified group. Parameters Input Name Type Description deviceNumber i16 assigned by configuration utility group i16 group buffer [i16] array containing the user’s data count u32 number of items to be transferred Parameter Discussion group is the group to be written to.
Chapter 2 Function Reference — DIG_Block_Out If you use a DIO-32F or a DIO 6533 device, NI-DAQ writes all bytes in your buffer to the group regardless of the group size. If the group size is one (which is supported only by the DIO 6533), DIG_Block_Out writes the lower eight bits of buffer[0] to the group on the first write and the upper eight bits of buffer[0] to the group on the second write.
Chapter 2 Function Reference — DIG_Block_PG_Config DIG_Block_PG_Config Format status = DIG_Block_PG_Config (deviceNumber, group, config, reqSource, timebase, reqInterval, externalGate) Purpose Enables or disables the pattern generation mode of buffered digital I/O. When pattern generation is enabled, this function also determines the source of the request signals and, if these are internal, the signal rate and gating mode.
Chapter 2 2: Function Reference — DIG_Block_PG_Config Change detection (DIO 6533 (DIO-32HS) input groups only). The board generates an internal request whenever it detects a change on a significant input pin. When using internally generated requests (reqSource 0 or 2), the REQ signal is an output; do not drive any external signal onto the REQ pin of the I/O connector. NI-DAQ considers all of the group’s lines significant for change detection by default.
Chapter 2 Function Reference — DIG_Block_PG_Config DIG_Block_PG_Config enables or disabled the pattern generation mode of digital I/O. If the config parameter equals 1 or 2, any subsequent DIG_Block_In or DIG_Block_Out call initiates a pattern generation operation. Pattern generation mode overrides any two-way handshaking mode set by the DIG_Grp_Mode function.
Chapter 2 Function Reference — DIG_Block_PG_Config On the DIO 6533 (DIO-32HS), output is always double-buffered, thus minimizing the variability in update intervals. In addition, the ACK pulse irregularities are not present. Therefore, values 1 and 2 for the config parameter are equivalent for the DIO 6533.
Chapter 2 Function Reference — DIG_DB_Config DIG_DB_Config Format status = DIG_DB_Config (deviceNumber, group, dbMode, oldDataStop, partialTransfer) Purpose Enables or disables double-buffered digital transfer operations and sets the double-buffered options.
Chapter 2 Function Reference — DIG_DB_Config partialTransfer is a flag whose value enables or disables the mechanism whereby NI-DAQ can transfer a final partial half buffer to the digital output block through a DIG_DB_Transfer call. The function stops digital block output when NI-DAQ has output the partial half. This field is ignored for input groups. 0: Disallow partial half buffer transfer. 1: Allow partial half buffer transfer.
Chapter 2 Function Reference — DIG_DB_HalfReady DIG_DB_HalfReady Format status = DIG_DB_HalfReady (deviceNumber, group, halfReady) Purpose Checks whether the next half buffer of data is available during a double-buffered digital block operation. You can use DIG_DB_HalfReady to avoid the waiting period that can occur because DIG_DB_Transfer waits until NI-DAQ can transfer the data before returning.
Chapter 2 Function Reference — DIG_DB_HalfReady function, when called, waits until NI-DAQ can complete the data transfer before returning. During slower paced digital block operations this waiting period can be significant. You can use DIG_DB_HalfReady so that the transfer functions are called only when NI-DAQ can make the transfer immediately. Refer to Chapter 5, NI-DAQ Double Buffering, of the NI-DAQ User Manual for PC Compatibles for an explanation of double buffering.
Chapter 2 Function Reference — DIG_DB_Transfer DIG_DB_Transfer Format status = DIG_DB_Transfer (deviceNumber, group, halfBuffer, ptsTfr) Purpose For an input operation, DIG_DB_Transfer waits until NI-DAQ can transfer half the data from the buffer being used for double-buffered digital block input to another buffer, which NI-DAQ passes to the function.
Chapter 2 Function Reference — DIG_DB_Transfer size. NI-DAQ ignores this field for all other cases (input or output without partial transfers enabled) and the transfer count is equal to half the buffer size. Range: 0 to half the size of the digital block buffer. Using This Function If you have set the partial transfer flag for an output group, the ptsTfr field allows NI-DAQ to make transfers of less than half the buffer size to an output buffer.
Chapter 2 Function Reference — DIG_Grp_Config DIG_Grp_Config Format status = DIG_Grp_Config (deviceNumber, group, groupSize, port, dir) Purpose Configures the specified group for port assignment, direction (input or output), and size.
Chapter 2 groupSize = 2 groupSize = 4 Function Reference — DIG_Grp_Config port = 2 assigns port 2 (C). port = 3 assigns port 3 (D). port = 0 assigns ports 0 and 1 (A and B). port = 2 assigns ports 2 and 3 (C and D). port = 0 assigns ports 0, 1, 2, and 3 (A, B, C, and D). dir indicates the direction, input, or output for which the group is to be configured. 0: port is configured as an input port (default). 1: port is configured as an output port.
Chapter 2 Function Reference — DIG_Grp_Mode DIG_Grp_Mode Format status = DIG_Grp_Mode (deviceNumber, group, protocol, edge, reqPol, ackPol, delayTime) Purpose Configures the specified group for handshake signal modes.
Chapter 2 Function Reference — DIG_Grp_Mode edge indicates whether the group is to be configured for leading-edge or trailing-edge pulsed signals. edge is valid only if protocol = 1 or 2. 0: Group is configured for leading-edge pulsed handshake signals. 1: Group is configured for trailing-edge pulsed handshake signals. This setting does not support variable ACK pulse width (protocol = 2). reqPol indicates whether the group request signal is to be active high or active low.
Chapter 2 Function Reference — DIG_Grp_Mode ackPol = 0: Acknowledge handshake signal is not inverted (active high). delayTime = 0: Settling time is 0 ns. You need to call DIG_Grp_Mode only if you need a different handshake mode. Refer to your board’s user manual for information about handshake timing and mode information. Note (AT-DIO-32F Revision B boards only) Do not use a leading-edge, pulsed handshaking signal for an input group.
Chapter 2 Function Reference — DIG_Grp_Status DIG_Grp_Status Format status = DIG_Grp_Status (deviceNumber, group, handshakeStatus) Purpose Returns a handshake status word indicating whether the specified group is ready to be read (input group) or written (output group). For the DIO 6533 (DIO-32HS), this function also initiates the handshaking process if not previously initiated.
Chapter 2 Function Reference — DIG_Grp_Status DIG_In_Grp can fetch the data an external device has latched in. If the specified group is configured as an output group and DIG_Grp_Status returns handshakeStatus = 1, DIG_Out_Grp can write the next piece of data to the external device. If the specified group is not assigned any ports, NI-DAQ returns an error code and handshakeStatus = 0. You must call DIG_Grp_Config to assign ports to a group and to configure a group for data direction.
Chapter 2 Function Reference — DIG_In_Grp DIG_In_Grp Format status g DIG_In_Grp (deviceNumber, group, groupPattern) Purpose Reads digital input data from the specified digital group. Parameters Input Name Type Description deviceNumber i16 assigned by configuration utility group i16 group Output Name groupPattern Type i16 Description digital data read from the ports Parameter Discussion group is the group to be read from. Range: 1 or 2.
Chapter 2 Function Reference — DIG_In_Grp Using This Function DIG_In_Grp returns digital data from the group on the specified device. If the group is configured as an input group, reading that group returns the digital logic state of the lines of the ports in the group as some external device is driving them. If the group is configured as an output group and has read-back capability, reading the group returns the output state of that group.
Chapter 2 Function Reference — DIG_In_Line DIG_In_Line Format status = DIG_In_Line (deviceNumber, port, line, state) Purpose Returns the digital logic state of the specified digital line in the specified port.
Chapter 2 Function Reference — DIG_In_Line state returns the digital logic state of the specified line. 0: The specified digital line is at a digital logic low. 1: The specified digital line is at a digital logic high. Note C Programmers—state is a pass-by-reference parameter. Using This Function DIG_In_Line returns the digital logic state of the specified digital line in the specified port.
Chapter 2 Function Reference — DIG_In_Port DIG_In_Port Format status = DIG_In_Port (deviceNumber, port, pattern) Purpose Returns digital input data from the specified digital I/O port. Parameters Input Name Type Description deviceNumber i16 assigned by configuration utility port i16 digital I/O port number Output Name pattern Type i16 Description 8-bit digital data read from the specified port Parameter Discussion port is the digital I/O port number.
Chapter 2 Function Reference — DIG_In_Port four bits wide, only bits 0 through 3 of pattern reflect the digital state of these ports, while NI-DAQ sets all other bits of pattern to 0. Note C Programmers—pattern is a pass-by-reference parameter. Using This Function DIG_In_Port reads digital data from the port on the specified device. If the port is configured as an input port, reading that port returns the digital logic state of the lines as some external device is driving them.
Chapter 2 Function Reference — DIG_Line_Config DIG_Line_Config Format status = DIG_Line_Config (deviceNumber, port, line, dir) Purpose Configures a specific line on a port for direction (input or output). Parameters Input Name Type Description deviceNumber i16 assigned by configuration utility port i16 digital I/O port number line i16 digital line dir i16 direction, input, or output Parameter Discussion port is the digital I/O port number. Range: 0 for the E Series devices.
Chapter 2 Function Reference — DIG_Out_Grp DIG_Out_Grp Format status = DIG_Out_Grp (deviceNumber, group, groupPattern) Purpose Writes digital output data to the specified digital group. Parameters Input Name Type Description deviceNumber i16 assigned by configuration utility group i16 group groupPattern i16 digital data to be written Parameter Discussion group is the group to be written to. Range: 1 or 2. groupPattern is the digital data to be written to the specified port.
Chapter 2 Function Reference — DIG_Out_Line DIG_Out_Line Format status = DIG_Out_Line (deviceNumber, port, line, state) Purpose Sets or clears the specified digital output line in the specified digital port. Parameters Input Name Type Description deviceNumber i16 assigned by configuration utility port i16 digital I/O port number line i16 digital output line state i16 new digital logic state Parameter Discussion port is the digital I/O port number.
Chapter 2 Function Reference — DIG_Out_Line Using This Function DIG_Out_Line sets the digital line in the specified port to the specified state. The remaining digital output lines making up the port are not affected by this call. If the port is configurable and you have not configured the port as an output port, NI-DAQ does not perform the operation and returns an error.
Chapter 2 Function Reference — DIG_Out_Port DIG_Out_Port Format status = DIG_Out_Port (deviceNumber, port, pattern) Purpose Writes digital output data to the specified digital port. Parameters Input Name Type Description deviceNumber i16 assigned by configuration utility port i16 digital I/O port number pattern i16 8-bit digital pattern for the data written Parameter Discussion port is the digital I/O port number.
Chapter 2 Function Reference — DIG_Out_Port Using This Function DIG_Out_Port writes the specified digital data to the port on the specified device. If the specified port is configurable and you have not configured that port as an output port, NI-DAQ does not perform the operation and returns an error. You must call DIG_Prt_Config to make a configurable digital I/O port as an output port.
Chapter 2 Function Reference — DIG_Prt_Config DIG_Prt_Config Format status = DIG_Prt_Config (deviceNumber, port, mode, dir) Purpose Configures the specified port for direction (input or output). DIG_Prt_Config also sets the handshake mode for the DIO-24, AT-MIO-16D, AT-MIO-16DE-10, DIO-96, and Lab and 1200 Series devices.
Chapter 2 Function Reference — DIG_Prt_Config 1: Port is configured for handshaking (latched) mode. mode = 1 is valid only for ports 0 and 1 of the DIO-24 and Lab and 1200 Series devices; for ports 2 and 3 of the AT-MIO-16D and AT-MIO-16DE-10; and for ports 0, 1, 3, 4, 6, 7, 9, and 10 of the DIO-96. dir indicates the direction, input or output, to which the port is to be configured. Range: 0 through 3. 0: Port is configured as an input port (default). 1: Port is configured as a standard output port.
Chapter 2 Function Reference — DIG_Prt_Config After system startup, the digital I/O ports on all the boards supported by this function are configured as follows: dir = 0: Input port. mode = 0: No-handshaking mode. Also, ports on the DIO-24, AT-MIO-16D, DIO-32F, DIO 6533, DIO-96, and Lab and 1200 Series devices are not assigned to any group. If this is not the digital I/O configuration you want, you must call DIG_Prt_Config to change the port configuration.
Chapter 2 Function Reference — DIG_Prt_Status DIG_Prt_Status Format status = DIG_Prt_Status (deviceNumber, port, handshakeStatus) Purpose Returns a status word indicating the handshake status of the specified port. Parameters Input Name Type Description deviceNumber i16 assigned by configuration utility port i16 digital I/O port number Output Name Type handshakeStatus i16 Description handshake status Parameter Discussion port is the digital I/O port number.
Chapter 2 Function Reference — DIG_Prt_Status Using This Function DIG_Prt_Status reads the handshake status of the specified port and returns the port status in handshakeStatus. DIG_Prt_Status, along with DIG_Out_Port and DIG_In_Port, facilitates handshaking of digital data between systems. If the specified port is configured as an input port, DIG_Prt_Status indicates when to call DIG_In_Port to fetch the data that an external device has latched in.
Chapter 2 Function Reference — DIG_SCAN_Setup DIG_SCAN_Setup Format status = DIG_SCAN_Setup (deviceNumber, group, groupSize, portList, dir) Purpose Configures the specified group for port assignment, direction (input or output), and size.
Chapter 2 Function Reference — DIG_SCAN_Setup dir selects the direction, input or output, to which the group is to be configured. 0: Port is configured as an input port (default). 1: Port is configured as an output port. 2: Port is configured as a bidirectional port.
Chapter 2 Function Reference — DIG_SCAN_Setup Each output port also has a different Acknowledge Input (ACK*) control signal. • PC6 on the I/O connector is for port 0. • PC2 on the I/O connector is for port 1. On the DIO-96 I/O connector, you can find four different sets of PC pins. They are APC, BPC, CPC, and DPC. APC pins correspond to port 0 and port 1, BPC pins correspond to port 3 and port 4, CPC pins correspond to port 6 and port 7, and DPC pins correspond to port 9 and port 10.
Chapter 2 Function Reference — DIG_SCAN_Setup ACK* Port x 1 OBF* ACK* Port x 2 OBF* ACK* Port x n External Device OBF* (last port in portList) Figure 2-13. Digital Scanning Output Group Handshaking Connections For DIO-24 users, the correct W1 jumper setting is required to allow DIG_Block_In and DIG_Block_Out to function properly. If port 0 is configured as a handshaking output port, set jumper W1 to PC4; otherwise, set the jumper to PC6.
Chapter 2 Function Reference — DIG_Trigger_Config DIG_Trigger_Config Format status = DIG_Trigger_Config (deviceNumber, group, startTrig, startPol, stopTrig, stopPol, ptsAfterStopTrig, pattern, patternMask) Purpose Sets up trigger configuration for subsequent buffered digital operations with pattern generation mode only (either internal or external requests).
Chapter 2 Function Reference — DIG_Trigger_Config stopTrig specifies the source of the stop trigger. 0: None. 1: Hardware trigger. 2: Digital pattern trigger (input group only). stopPol specifies the polarity of the stop trigger. 0: Active high. 1: Active low. 2: Pattern matched. 3: Pattern not matched. ptsAfterStopTrig is the number of data points to acquire following the trigger. This parameter is valid only if stopTrig is not 0. If stopTrig is 2, this number will include the matching pattern.
Chapter 2 Function Reference — DIG_Trigger_Config If startTrig or stopTrig is 2, the operation starts or stops when the incoming data matches the pattern on all bits declared significant by lineMask. If startTrig or stopTrig is 3, the operation starts or stops when the incoming data ceases to match the pattern on all bits declared significant by lineMask. The lineMask also controls which bits are significant for change detection, if used. See DIG_Block_PG_Config for information about change detection.
Chapter 2 Function Reference — Get_DAQ_Device_Info Get_DAQ_Device_Info Format status = Get_DAQ_Device_Info (deviceNumber, infoType, infoValue) Purpose Allows you to retrieve parameters pertaining to the device operation.
Chapter 2 Function Reference — Get_DAQ_Device_Info infoType can be one of the following. infoType Description ND_ACK_REQ_EXCHANGE_GR1 ND_ACK_REQ_EXCHANGE_GR2 See the Set_DAQ_Device_Info function for details. ND_NOT_APPLICABLE if not relevant to the device.
Chapter 2 Function Reference — Get_NI_DAQ_Version Get_NI_DAQ_Version Format status = Get_NI_DAQ_Version (version) Purpose Returns the version number of the NI-DAQ library. Parameter Output Name version Type u32 Description version number assigned Using This Function Get_NI_DAQ_Version returns a 4-byte value in the version parameter. The upper two bytes are reserved and the lower two bytes contain the version number.
Chapter 2 Function Reference — GPCTR_Change_Parameter GPCTR_Change_Parameter Format status = GPCTR_Change_Parameter (deviceNumber, gpctrNum, paramID, paramValue) Purpose Selects a specific parameter setting for the general-purpose counter (E Series, 6602, and DSA devices only). Parameters Input Name Type Description deviceNumber i16 assigned by configuration utility gpctrNum u32 number of the counter to use paramID u32 identification of the parameter to change.
Chapter 2 Function Reference — GPCTR_Change_Parameter Table 2-20. Legal Values for gpctrNum Parameter All DSA and E Series Devices 6602 Devices ND_COUNTER_0 ND_COUNTER_1 ND_COUNTER_0 ND_COUNTER_1 ND_COUNTER_2 ND_COUNTER_3 ND_COUNTER_4 ND_COUNTER_5 ND_COUNTER_6 ND_COUNTER_7 Legal values for paramValue depend on paramID.
Chapter 2 Function Reference — GPCTR_Change_Parameter Note If you have configured an analog hardware trigger using the Config_HW_Analog_Trigger function, the resulting analog trigger circuitry output is available as ND_PFI_0. Table 2-22.
Chapter 2 Function Reference — GPCTR_Change_Parameter paramID = ND_START_TRIGGER (6602 and 455X devices only) This paramID allows you to change how a counter arms itself. If paramValue is set to ND_ENABLED, the counter will be armed using a hardware arm. If paramValue is set to ND_DISABLED, the counter will be armed using a software arm. ND_DISABLED is the default value. You can synchronize the arming of multiple counters using a hardware signal.
Chapter 2 Function Reference — GPCTR_Change_Parameter Synchronization on default Source and Up/Down pins is enabled when you call GPCTR_Change_Parameter with paramID = ND_INPUT_CONDITIONING and paramValue as any of the quadrature modes or the two-pulse counting mode. You can enable Z-Index pulse for quadrature encoders by making a GPCTR_Change_Parameter call with paramID = ND_INDEX_PULSE and paramValue = ND_YES. The Z-Index signal should be connected to default gate for the counter that is being used.
Chapter 2 Function Reference — GPCTR_Change_Parameter Output counterValue } GPCTR_Control (deviceNumber, gpctrNum, ND_RESET) paramID = ND_GATE This signal controls the operation of the general-purpose counter in some applications. The default values of paramValue for paramID = ND_GATE are shown in Table 2-24. Table 2-24. Legal Values for paramValue when paramID = ND_GATE E Series and 445X Devices ND_PFI_0 through ND_PFI_9—the 10 I/O connector pins.
Chapter 2 Function Reference — GPCTR_Change_Parameter Table 2-25.
Chapter 2 Function Reference — GPCTR_Change_Parameter paramID = ND_SECOND_GATE (6602 and 455X devices only) This signal controls the operation of the general-purpose counter in some applications. Corresponding legal values for paramValue are shown below: • ND_PFI_37, ND_PFI_33, ND_PFI_29, ND_PFI_25, ND_PFI_21, ND_PFI_17, ND_PFI_13, ND_PFI_9 • ND_RTSI_0 through ND_RTSI_6—the seven RTSI lines. • ND_OTHER_GPCTR_OUTPUT (See Table 2-22 for definition of the other counter).
Chapter 2 Function Reference — GPCTR_Change_Parameter Table 2-27. Legal Values for paramValue when paramID = ND_INITIAL_COUNT E Series and 445X Devices 0 through 224 – 6602 and 455X Devices 0 through 232 – 1 1 paramID = ND_COUNT_1, ND_COUNT_2, ND_COUNT_3, ND_COUNT_4 The general-purpose counter uses these numbers for pulse width specifications when the counter is configured for one of the simple pulse and pulse train generation applications.
Chapter 2 Function Reference — GPCTR_Change_Parameter Software Control This function lets you customize the counter for your application. You can use this function after the GPCTR_Set_Application function, and before GPCTR_Control function with action = ND_PREPARE or action = ND_PROGRAM. You can call this function as many times as you need to.
Chapter 2 Function Reference — GPCTR_Change_Parameter paramID = ND_OUTPUT_MODE This value changes the output mode from default toggle (the output of the counter toggles on each terminal count) to pulsed (the output of the counter makes a pulse on each terminal count). The corresponding settings of paramValue are ND_PULSE and ND_TOGGLE. Also, you might need to enable your output pin with Select_Signal.
Chapter 2 Function Reference — GPCTR_Config_Buffer GPCTR_Config_Buffer Format status = GPCTR_Config_Buffer (deviceNumber, gpctrNum, reserved, numPoints, buffer) Purpose Assigns a buffer that NI-DAQ will use for a buffered counter operation.
Chapter 2 Function Reference — GPCTR_Config_Buffer Using This Function You need to use this function to use a general-purpose counter for buffered operation. You should call this function after calling the GPCTR_Set_Application function. NI-DAQ transfers counted values into the buffer assigned by this function when you are performing a buffered counter operation.
Chapter 2 Function Reference — GPCTR_Control GPCTR_Control Format status = GPCTR_Control (deviceNumber, gpctrNum, action) Purpose Controls the operation of the general-purpose counter. Parameters Input Name Type Description deviceNumber i16 assigned by configuration utility gpctrNum u32 number of the counter to use action u32 the action NI-DAQ takes Parameter Discussion Legal ranges for the gpctrNum and action are given in terms of constants defined in a header file.
Chapter 2 Function Reference — GPCTR_Control Table 2-30. Legal Values for the action Parameter (Continued) action Description ND_DISARM Disarm the general-purpose counter ND_PROGRAM ND_PREPARE and then ND_ARM the counter ND_RESET Reset the general-purpose counter ND_COUNT_UP Change the counting direction to UP. See Using This Function below. ND_COUNT_DOWN Change the counting direction to DOWN. See Using This Function below.
Chapter 2 Function Reference — GPCTR_Read_Buffer GPCTR_Read_Buffer Format status = GPCTR_Read_Buffer (deviceNumber, gpctrNum, readMode, numPts, readOffSet, timeOut, buffer) Purpose Returns the data from a asynchronous counter input operation. The read mode and offset combined allow you to specify the location from which to read the data for 6602 and 455X devices only.
Chapter 2 Function Reference — GPCTR_Read_Buffer numPts is the number of points to retrieve from the buffer being used. This argument is passed by reference. When this function returns, numPts holds the value of actual number of inputs that were read. readOffSet is the offset that is added to the reading point specified by readMode to compute the location in the buffer from which data is to be read.
Chapter 2 Function Reference — GPCTR_Set_Application GPCTR_Set_Application Format status = GPCTR_Set_Application (deviceNumber, gpctrNum, application) Purpose Selects the application for which you use the general-purpose counter.
Chapter 2 Function Reference — GPCTR_Set_Application application can be one of the following. Table 2-31.
Chapter 2 Function Reference — GPCTR_Set_Application Using This Function NI-DAQ requires you to select a set of parameters so that it can program the counter hardware. Those parameters include, for example, signals to be used as counter source and gate and the polarities of those signals. A full list of the parameters is given in the description of the GPCTR_Change_Parameter function. By using the GPCTR_Set_Application function, you assign specific values to all of those parameters.
Chapter 2 Function Reference — GPCTR_Set_Application The following pseudo-code continuation of the example given earlier illustrates what you can do to read the counter value continuously (GPCTR_Watch function with entityID = ND_COUNT does this) and print it: Repeat Forever { GPCTR_Watch(deviceNumber, gpctrNum, ND_COUNT, counterValue) Output counterValue. } When the counter reaches terminal count (TC), it rolls over and keeps counting.
Chapter 2 Function Reference — GPCTR_Set_Application Figure 2-15 shows one possible scenario of a counter used for ND_SINGLE_PERIOD_MSR after the following programming sequence: GPCTR_Control(deviceNumber, gpctrNum, ND_RESET) GPCTR_Set_Application(deviceNumber, gpctrNum, ND_SINGLE_PERIOD_MSR)GPCTR_Set_Application GPCTR_Control(deviceNumber, gpctrNum, ND_PROGRAM) In Figure 2-15, the following behavior is present: • Gate is the signal present at the counter gate input.
Chapter 2 Function Reference — GPCTR_Set_Application until (counter_armed = ND_NO) GPCTR_Watch(deviceNumber, gpctrNumber, ND_COUNT, counted_value) To calculate the measured interval, you need to multiply the counted value by the period corresponding to the timebase you are using. For example, if your ND_SOURCE is ND_INTERNAL_20_MHZ, the interval will be 1/(20 MHz) = 50 ns. If the ND_COUNT is 4, (Figure 2-15), the actual interval is 4 * 50 ns = 200 ns.
Chapter 2 Function Reference — GPCTR_Set_Application measure a time interval between 100 ns and 0.8 s long.For the 6602 and 455X devices with counter width 32 bits, you can measure a time interval between 100 ns and 214 s long.
Chapter 2 Function Reference — GPCTR_Set_Application GPCTR_Watch(deviceNumber, gpctrNumber, ND_COUNT_AVAILABLE, count_available) } until (count_available = ND_YES) GPCTR_Watch(deviceNumber, gpctrNumber, ND_COUNT, counted_value) To calculate the measured interval, multiply the counted value by the period corresponding to the timebase you are using. For example, if your ND_SOURCE is ND_INTERNAL_20_MHZ, the interval will be 1/(20 MHz) = 50 ns.
Chapter 2 Function Reference — GPCTR_Set_Application action = ND_PROGRAM returns gateSignalError. If this happens, you should not rely on values returned by GPCTR_Watch. application = ND_TRIG_PULSE_WIDTH_MSR In this application, the counter is used for a single measurement of the time interval between two transitions of the opposite polarity of the gate signal.
Chapter 2 Function Reference — GPCTR_Set_Application Measured Interval Trigger Gate Source Count Count Available 0 NO 0 0 0 NO 1 0 NO 2 2 YES Figure 2-17. Single Triggered Pulse Width Generation Measurement Use the GPCTR_Watch function with entityID = ND_COUNT_AVAILABLE to monitor the progress of the counting process. This measurement completes when entityValue becomes ND_YES.
Chapter 2 Function Reference — GPCTR_Set_Application When the counter reaches terminal count (224 – 1 for E Series and 445X devices, and 232 – 1 for 6602 and 455X devices), it rolls over and keeps counting. To check if this occurred, use GPCTR_Watch function with entityID set to ND_TC_REACHED. Typically, you will find modifying the following parameters through the GPCTR_Change_Parameter function useful when the counter application is ND_TRIG_PULSE_WIDTH_MSR.
Chapter 2 Function Reference — GPCTR_Set_Application Figure 2-18 shows one possible use of a counter for ND_TWO_SIGNAL_EDGE_SEPARATION_MSR after the following programming sequence: GPCTR_Control (deviceNumber, gpctrNum, ND_RESET) GPCTR_Set_Application (deviceNumber, gpctrNum, ND_TWO_SIGNAL_EDGE_SEPARATION_MSR) GPCTR_Control (deviceNumber, gpctrNum, ND_PROGRAM) In Figure 2-18, the following behavior is present: • Gate is the signal present at the counter gate input.
Chapter 2 Function Reference — GPCTR_Set_Application { GPCTR_Watch (deviceNumber, gpctrNumber, ND_ARMED, counter_armed) until (counter_armed = ND_NO) GPCTR_Watch (deviceNumber, gpctrNumber, ND_COUNT, counted_value) To calculate the measured interval, multiply the counted value by the period corresponding to the timebase you are using. For example, if your ND_SOURCE is ND_INTERVAL_20_MHZ, the interval will be (1/20 MHz) = 50 ns.
Chapter 2 Function Reference — GPCTR_Set_Application For example, assume that you want to generate a pulse 200 ns long after 150 ns of delay. You need to set ND_COUNT_1 to 150 ns/50 ns = 3 and ND_COUNT_2 to 200 ns/50 ns = 4.
Chapter 2 Function Reference — GPCTR_Set_Application between 20 ns and 11.37 hours for 6602 and 455X devices. The timing resolution will be lower than if you are using the ND_INTERNAL_20_MHZ timebase. You can use the GPCTR_Change_Parameter function after calling GPCTR_Set_Application and before calling GPCTR_Control with action = ND_PROGRAM or ND_PREPARE.
Chapter 2 Function Reference — GPCTR_Set_Application In Figure 2-20, the following behavior is present: • Gate is the signal present at the counter gate input. • Source is the signal present at the counter source input. • Output is the signal present at the counter output. • Armed is the value you would read from the counter if you called the GPCTR_Watch function with entityID = ND_ARMED. The different values illustrate behavior at different times.
Chapter 2 Function Reference — GPCTR_Set_Application To provide your timebase, you can connect your timebase source to one of the PFI pins on the I/O connector and change ND_SOURCE and ND_SOURCE_POLARITY to the appropriate values. You also can configure the other general-purpose counter for ND_SINGLE_TRIG_PULSE_GNR and set ND_SOURCE of this counter to ND_OTHER_GPCTR_TC to generate pulses with delays and intervals longer than 160 s.
Chapter 2 Function Reference — GPCTR_Set_Application Gate Count_1=3 Count_2=4 Count_1=3 Count_1=3 Count_2=4 Count_2=4 Source Output Figure 2-21. Retriggerable Pulse Generation Use the GPCTR_Control function with action = ND_RESET to stop the pulse generation. Typically, you will find modifying the following parameters through the GPCTR_Change_Parameter function useful when the counter application is ND_RETRIG_PULSE_GNR.
Chapter 2 Function Reference — GPCTR_Set_Application With the default 20 MHz timebase, combined with the counter width (24 bits), you can generate trains consisting of pulses with delay and length between 100 ns and 0.8 s. For the 6602 devices, you can generate pulses with a delay and length between 100 ns and 214 s long. Assume that you want to generate a pulse train with the low period 150 ns long and the high period 200 ns long.
Chapter 2 Function Reference — GPCTR_Set_Application You can use the GPCTR_Change_Parameter function after calling GPCTR_Set_Application and before calling GPCTR_Control with action = ND_PROGRAM or ND_PREPARE. To provide your timebase, you can connect your timebase source to one of the PFI pins on the I/O connector and change ND_SOURCE and ND_SOURCE_POLARITY to the appropriate values.
Chapter 2 Function Reference — GPCTR_Set_Application In Figure 2-23, the following behavior is present: • Gate is the signal present at the counter gate input. • Source is the signal present at the counter source input. • Output is the signal present at the counter output. Gate Source 2 1 3 2 1 2 1 3 2 1 6 5 4 3 2 1 4 3 2 1 Output Figure 2-23. Frequency Shift Keying Use the GPCTR_Control function with action = ND_RESET to stop the pulse generation.
Chapter 2 Function Reference — GPCTR_Set_Application are the low-to-high transitions of the signal on the PFI9/GPCTR0_GATE I/O connector pin for general-purpose counter 0 and the PFI4/GPCTR1_GATE I/O connector pin for general-purpose counter 1. The counter counts up starting from 0; its contents are placed in the buffer after an edge of appropriate polarity is detected on the gate; the counter keeps counting without interruption.
Chapter 2 Function Reference — GPCTR_Set_Application Use the GPCTR_Watch function with entityID = ND_ARMED to monitor the progress of the counting process. This measurement completes when entityValue becomes ND_NO. You can do this as follows: Create u32 variable counter_armed. repeat { GPCTR_Watch(deviceNumber, gpctrNumber, ND_ARMED, counter_armed) } until (counter_armed = ND_NO) When the counter is disarmed, you can safely access data in the buffer.
Chapter 2 Function Reference — GPCTR_Set_Application 6602 and 455X devices with counter width 32 bits, you can generate pulses with a delay and length between 100 ns and 214 s long. Measured Period Measured Period Measured Period Gate Source 1 2 3 4 5 6 7 Buffer 1 2 3 4 5 6 1 7 2 3 4 7 7 6 6 4 Figure 2-25.
Chapter 2 Measured Period Function Reference — GPCTR_Set_Application Measured Period Measured Period Measured Period Gate Source 1 2 3 4 5 6 7 8 9 1 Buffer 2 3 4 5 9 6 1 2 3 4 9 9 9 9 9 9 9 9 4 The instant you arm the counter Warning Figure 2-26.
Chapter 2 ! Function Reference — GPCTR_Set_Application If gate edges arrive and no source edges are present between those gate edges, then the previously saved value is saved again, as shown by Figure 2-28. Please make sure that this condition does not occur during your measurement.
Chapter 2 Measured Pulse Width Function Reference — GPCTR_Set_Application Measured Pulse Width Measured Pulse Width Gate Source 1 2 1 3 2 3 3 Buffer 1 2 3 4 5 3 3 3 3 5 Figure 2-29. Buffered Pulse Width Measurement ! Note You must make sure that there is at least one source transition during the measured pulse and between consecutive measured pulses in order for this application to work properly.
Chapter 2 Function Reference — GPCTR_Set_Application application = ND_BUFFERED_TWO_SIGNAL_EDGE_SEPARATION_MSR Note This application is applicable only to 6602 and 455X devices. In this application, the counter is used for continuous measurement of the time interval between transitions of the gate and the second gate signal. Measurement starts when the gate signal is asserted and stops when the second gate signal is asserted.
Chapter 2 Function Reference — GPCTR_Set_Application Gate Second Gate Source 1 2 Buffer 3 1 2 3 3 4 3 4 Figure 2-31. Buffered Two-Signal Edge Separation Measurement Use the GPCTR_Watch function with entityID = ND_ARMED to monitor the progress of the counting process. This measurement completes when entityValue becomes ND_NO. You can do this as follows: Create U32 variable counter_armed. Create U32 variable counter_value.
Chapter 2 Function Reference — GPCTR_Set_Application • ND_SECOND_GATE to any legal value listed in the GPCTR_Change_Parameter function description. • ND_SECOND_GATE_POLARITY to ND_NEGATIVE. Measurement will be performed on the active low pulses. • ND_BUFFER_MODE to ND_DOUBLE for circular buffer operations.
Chapter 2 Function Reference — GPCTR_Watch GPCTR_Watch Format status = GPCTR_Watch (deviceNumber, gpctrNum, entityID, entityValue) Purpose Monitors state of the general-purpose counter and its operation.
Chapter 2 Function Reference — GPCTR_Watch entityID = ND_COUNT This is the counter contents. entityValue can be between 0 and 224 – 1 for E Series and 445X and between 0 and 232 – 1 for 6602 and 455X devices. entityID = ND_COUNT_AVAILABLE If the application is ND_TRIG_PULSE_WIDTH_MSR, ND_SINGLE_PULSE_WIDTH_MSR, or ND_SINGLE_PERIOD_MSR, this entityID allows you to see whether your measurement has completed.
Chapter 2 Function Reference — GPCTR_Watch entityID = ND_MAX_PRESCALE (6602 and 455X devices only) Indicates the maximum value of the prescale factor that can be applied to the source selection of a 6602 or 455X device. Note C Programmers—entityValue is a pass-by-reference parameter.
Chapter 2 Function Reference — ICTR_Read ICTR_Read Format status = ICTR_Read (deviceNumber, ctr, count) Purpose Reads the current contents of the selected counter without disturbing the counting process and returns the count. Parameters Input Name Type Description deviceNumber i16 assigned by configuration utility ctr i16 counter number Output Name count Type u16 Description current count Parameter Discussion ctr is the counter number. Range: 0 through 2.
Chapter 2 Note Function Reference — ICTR_Read BASIC Programmers—NI-DAQ returns count as a 16-bit unsigned number. In BASIC, integer variables are represented by a 16-bit two’s complement system. Thus, values grater than 32,767 are incorrectly treated as negative numbers.
Chapter 2 Function Reference — ICTR_Reset ICTR_Reset Format status = ICTR_Reset (deviceNumber, ctr, state) Purpose Sets the output of the selected counter to the specified state. Parameters Input Name Type Description deviceNumber i16 assigned by configuration utility ctr i16 counter number state i16 logic state to be reset Parameter Discussion ctr is the counter number. Range: 0 through 2. state is the logic state to which the counter is to be reset. Range: 0 or 1.
Chapter 2 Function Reference — ICTR_Setup ICTR_Setup Format status = ICTR_Setup (deviceNumber, ctr, mode, count, binBcd) Purpose Configures the given counter to operate in the specified mode.
Chapter 2 Function Reference — ICTR_Setup Clock WR Gate Output 6 5 4 3 2 1 0 (n = 6) A A+ B = n B Figure 2-32. Mode 0 Timing Diagram In mode 1, the output goes low on the count following the rising edge of the gate input and goes high on terminal count. The value of the counter before the rising edge of the gate input is undefined, Figure 2-33 shows the mode 1 timing diagram. Clock WR Gate Output 4 3 2 1 0 n=4 Figure 2-33.
Chapter 2 Function Reference — ICTR_Setup In mode 3, the output stays high for one half of the count clock pulses and stays low for the other half. Figure 2-35 shows the mode 3 timing diagram. Clock Gate 4 2 4 5 4 2 2 4 2 4 2 4 2 4 2 4 4 2 5 2 5 4 2 Output (n = 4) 5 2 5 Output (n = 5) Figure 2-35. Mode 3 Timing Diagram In mode 4, the output is initially high, and the counter begins to count down while the gate input is high.
Chapter 2 Function Reference — ICTR_Setup See the 8253 Programmable Interval Timer data sheet in your DAQCard-500/700 or Lab and 1200 Series user manual for a detailed description of these modes and the associated timing diagrams. count is the period from one output pulse to the next. Range for modes 0, 1, 4 and 5: 0 through 65,535 in binary counter operation. 0 through 9,999 in BCD counter operation. Range for modes 2 and 3: 2 through 65,535 and 0 in binary counter operation.
Chapter 2 Function Reference — Init_DA_Brds Init_DA_Brds Format status = Init_DA_Brds (deviceNumber, deviceNumberCode) Purpose Initializes the hardware and software states of a National Instruments DAQ device to its default state, and then returns a numeric device code that corresponds to the type of device initialized. Any operation that the device is performing is halted. This function is called automatically and does not have to be explicitly called by your application.
Chapter 2 Function Reference — Init_DA_Brds 14: 15: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 30: 31: 32: 33: 35: 36: 37: 38: 39: 40: 41: 42: 43: 44: 45: 46: 47: 48: 49: 50: 51: 52: 53: 54: 55: 56: 57: 58: 59: 60: 61: 62: PC-TIO-10. AT-AO-6. AT-MIO-16X. AT-MIO-64F-5. AT-MIO-16DL-9. AT-MIO-16DL-25. AT-MIO-16DH-9. AT-MIO-16DH-25. AT-MIO-16E-2. AT-AO-10. AT-A2150C. Lab-PC+. SCXI-1200. DAQCard-700. NEC-MIO-16E-4. DAQPad-1200. DAQCard-DIO-24. AT-MIO-16E-10. AT-MIO-16DE-10. AT-MIO-64E-3. AT-MIO-16XE-50.
Chapter 2 65: 66: 67: 68: 69: 75: 76: 200: 201: 202: 204: 205: 206: 207: 208: 209: 210: 211: 212: 215: 220: 221: 222: 223: 232: 233: 234: 235: 236: 240: 241: 244: Function Reference — Init_DA_Brds PC-DIO-24PnP. PC-DIO-96PnP. AT-DIO-32HS. PXI-6533. DAQArb AT-5411. DAQPad-6507/6508. DAQPad-6020E. PCI-DIO-96. PCI-1200. PCI-MIO-16XE-50. PCI-MIO-16XE-10. PCI-MIO-16E-1. PCI-MIO-16E-4. PXI-6070E. PXI-6040E. PXI-6030E. PXI-6011E. PCI-DIO-32HS. DAQArb PCI-5411. DAQCard-6533. PCI-6031E (MIO-64XE-10).
Chapter 2 Function Reference — Init_DA_Brds Using This Function Init_DA_Brds initializes the device in the specified slot to the default conditions. These conditions are summarized for each device as follows: • MIO and AI devices – Analog Input defaults: number of channels = 2. Mode = Differential. Range = 20 V (10 V for AT-MIO-16F-5, AT-MIO-64F-5, and 12-bit E Series).
Chapter 2 • Function Reference — Init_DA_Brds DIO-24/DIO-32F/DIO 6533 (DIO-32HS)/DIO-96 – Digital Input and Output defaults: Direction = Input. Handshaking = Disabled. Group assignments = No ports assigned to any group. • PC-TIO-10 – Analog Digital Input and Output defaults: Mode = Differential. Direction = Input. – Counter/Timer defaults: Gating mode = No gating. Output type = Terminal count toggled. Output polarity = Positive. Edge mode = Count rising edges. Count mode = Count once.
Chapter 2 Function Reference — Init_DA_Brds Start trigger = Disabled. External conversion = Stop trigger = Disabled. – Analog Output defaults: Mode = Bipolar (–5 to +5 V). Range = 20 Level = 0 V. – Digital Input and Output defaults: Direction = Input. Handshaking = Disabled. Group assignments = No ports assigned to any group. – Counter/Timer defaults: Output level = Logical low.
Chapter 2 • Function Reference — Init_DA_Brds AO-2DC devices – Analog Output defaults: Mode = Unipolar (0 to 10 V). Level = 0 V. – Digital Input and Output defaults: Direction = Input. • DAQArb 5411 devices – Defaults Analog filter = On. Digital filter = On. Frequency correction for analog filter = Disabled. Output attenuation = 0 decibels. Output enable = Off. Output impedance = 50 Ω. PLL reference frequency = 20 MHz. PLL reference source = Internal. RTSI clock source = Disabled.
Chapter 2 Function Reference — Init_DA_Brds Of all these defaults, you can alter only the analog input and analog output settings of the non-E Series MIO and AI devices, Lab-PC+, and PC-LPM-16 devices by setting jumpers on the device. If you have changed the jumpers from the factory settings, you must call either AI_Configure and/or AO_Configure after Init_DA_Brds so that the software copies of these settings reflect the true settings of the device.
Chapter 2 Function Reference — Lab_ISCAN_Check Lab_ISCAN_Check Format status = Lab_ISCAN_Check (deviceNumber, daqStopped, retrieved, finalScanOrder) Purpose Checks whether the current multiple-channel scanned data acquisition begun by the Lab_ISCAN_Start function is complete and returns the status, the number of samples acquired to that point, and the scanning order of the channels in the data array (DAQCard-500/700 and 516, Lab and 1200 Series, and LPM devices only).
Chapter 2 Function Reference — Lab_ISCAN_Check However, if pretrigger mode is enabled, retrieved returns the offset of the position in your buffer where NI-DAQ places the next data point when the function acquires. After the value of retrieved reaches count - 1 and rolls over to 0, the acquisition begins to overwrite old data with new data.
Chapter 2 Function Reference — Lab_ISCAN_Check sample from channel 1, the oldest data point belongs to channel 0. So finalScanOrder returns: finalScanOrder[0] = 0. finalScanOrder[1] = 2. finalScanOrder[2] = 1. So the first sample in the buffer belongs to channel 0, the second sample belongs to channel 2, the third sample belongs to channel 1, the fourth sample belongs to channel 0, and so on. Note C Programmers—daqStopped and retrieved are pass-by-reference parameters.
Chapter 2 Function Reference — Lab_ISCAN_Op Lab_ISCAN_Op Format status = Lab_ISCAN_Op (deviceNumber, numChans, gain, buffer, count, sampleRate, scanRate, finalScanOrder) Purpose Performs a synchronous, multiple-channel scanned data acquisition operation. Lab_ISCAN_Op does not return until NI-DAQ has acquired all the data or an acquisition error has occurred (DAQCard-500/700 and 516, Lab and 1200 Series, and LPM devices only).
Chapter 2 Range: Function Reference — Lab_ISCAN_Op 1 through 4 for the 516 and Lab and 1200 Series devices in differential mode. 1 through 8 for DAQCard-500 (single-ended mode only). 1 through 8 for DAQCard-700 in differential mode. 1 through 8 for the Lab and 1200 Series devices in single-ended mode. 1 through 16 for LPM devices or DAQCard-700 in single-ended mode. gain is the gain setting to be used for the scanning operation. The same gain is applied to all the channels scanned.
Chapter 2 Function Reference — Lab_ISCAN_Op finalScanOrder is an array that indicates the scan channel order of the data in the buffer passed to Lab_ISCAN_Op. The size of finalScanOrder must be at least equal to the number of channels scanned. This parameter is valid only when the error is returned to zero and is useful only when pretrigger mode is enabled (Lab and 1200 Series devices only). If you do not use pretrigger mode, the values contained in finalScanOrder are, in single-ended mode, n-1, n-2, ...
Chapter 2 Note Function Reference — Lab_ISCAN_Op If you have selected external start triggering of the data acquisition operation, a low-to-high edge at the EXTTRIG of the Lab and 1200 Series device I/O connector input initiates the operation. Be aware that if you do not apply the start trigger, Lab_ISCAN_Op does not return control to your application. Otherwise, Lab_ISCAN_Op issues a software trigger to initiate the data acquisition operation.
Chapter 2 Function Reference — Lab_ISCAN_Start Lab_ISCAN_Start Format status = Lab_ISCAN_Start (deviceNumber, numChans, gain, buffer, count, sampTimebase, sampInterval, scanInterval) Purpose Initiates a multiple-channel scanned data acquisition operation and stores its input in an array (DAQCard-500/700 and 516, Lab and 1200 Series, and LPM devices only).
Chapter 2 Function Reference — Lab_ISCAN_Start the NI-DAQ User Manual for PC Compatibles for more information on SCXI channel assignments. Range: 1 through 4 for the 516 and Lab and 1200 Series devices in differential mode. 1 through 8 for the DAQCard-500 (single-ended mode only). 1 through 8 for the DAQCard-700 in differential mode. 1 through 8 for the 516 and Lab and 1200 Series devices in single-ended mode. 1 through 16 for the DAQCard-700 and LPM devices in single-ended mode.
Chapter 2 Function Reference — Lab_ISCAN_Start where the sample timebase resolution is equal to one of the values of sampTimebase as specified above. For example, if sampInterval = 25 and sampTimebase = 2, the actual sample interval is 25 * 10 µs = 250 µs. The total sample interval (the time to complete one scan sequence) in seconds is the actual sample interval * number of channels scanned.
Chapter 2 Function Reference — Lab_ISCAN_Start For the Lab and 1200 Series devices, if you enable pretrigger mode, Lab_ISCAN_Start initiates a cyclical acquisition that continually fills the buffer with data, wrapping around to the start of the buffer once NI-DAQ has written to the entire buffer. When you apply the signal at the stop trigger input, Lab_ISCAN_Start acquires an additional number of samples specified by the ptsAfterStoptrig parameter in DAQ_StopTrigger_Config and then terminates.
Chapter 2 Function Reference — Lab_ISCAN_to_Disk Lab_ISCAN_to_Disk Format status = Lab_ISCAN_to_Disk (deviceNumber, numChans, gain, filename, count, sampleRate, scanRate, concat) Purpose Performs a synchronous, multiple-channel scanned data acquisition operation and simultaneously saves the acquired data in a disk file.
Chapter 2 Function Reference — Lab_ISCAN_to_Disk 1 through 8 for the DAQCard-700 in differential mode. 1 through 8 for the 516 and Lab and 1200 Series devices in single-ended mode. 1 through 16 for the DAQCard-700 and LPM devices in single-ended mode. gain is the gain setting to be used for the scanning operation. NI-DAQ applies the same gain to all the channels scanned.
Chapter 2 Function Reference — Lab_ISCAN_to_Disk Using This Function Lab_ISCAN_to_Disk initiates a synchronous process of acquiring A/D conversion samples and storing them in a disk file. Lab_ISCAN_to_Disk does not return control to your application until NI-DAQ acquires and saves all the samples you want (or until an acquisition error occurs). For the Lab and 1200 Series devices, when you use posttrigger mode, the process stores count A/D conversions in the file and ignores any subsequent conversions.
Chapter 2 Function Reference — Line_Change_Attribute Line_Change_Attribute Format status = Line_Change_Attribute (deviceNumber, lineNum, attribID, attribValue) Purpose Sets various options on an I/O connector and internal lines (6602 devices only).
Chapter 2 Function Reference — Line_Change_Attribute attribID = ND_LINE_FILTER (valid only for lineNum = ND_PFI_0 through ND_PFI_39) attribValue Description ND_SYNCHRONIZATION_ONLY Synchronizes the signal using the internal clock ND_100KHZ Filters the signal using a 100 kHz filter ND_500KHZ Filters the signal using a a 500 kHz filter ND_1MHZ Filters the signal using a 1 MHz filter ND_5MHZ Filters the signal using a 5 MHz filter ND_NONE (default) Uses no filtering or synchronization.
Chapter 2 Function Reference — LPM16_Calibrate LPM16_Calibrate Format status = LPM16_Calibrate (deviceNumber) Purpose Calibrates the LPM devices converter. The calibration calculates the correct offset voltage for the voltage comparator, adjusts positive linearity and full-scale errors to less than ±0.5 LSB each, and adjusts zero error to less than ±1 LSB.
Chapter 2 Function Reference — MIO_Calibrate MIO_Calibrate Format status = MIO_Calibrate (deviceNumber, calOP, saveNewCal, EEPROMloc, calRefChan, DAC0chan, DAC1chan, calRefVolts, refLoc) Purpose If you have an E Series device, use Calibrate_E_Series. Note You can use this function to calibrate your AT-MIO-16F-5, AT-MIO-64F-5, and AT-MIO-16X devices.
Chapter 2 Name Type Function Reference — MIO_Calibrate Description calRefChan i16 AI channel that the calibration voltage is connected to DAC0chan i16 AI channel that DAC0 is connected to DAC1chan i16 AI channel that DAC1 is connected to calRefVolts f64 DC calibration voltage refLoc i16 source of the internal voltage reference constants Parameter Discussion calOP determines the operation to be performed. 1: Load calibration constants from EEPROMloc.
Chapter 2 Function Reference — MIO_Calibrate For the AT-MIO-64F-5 and AT-MIO-16X: 1: User calibration area 1. 2: User calibration area 2. 3: User calibration area 3. 4: User calibration area 4. 5: User calibration area 5. 6: User calibration area 6. 7: User calibration area 7. 8: User calibration area 8 (initial load area). 9: Factory calibration area for unipolar (you cannot write to this area). 10: Factory calibration area for bipolar (you cannot write to this area).
Chapter 2 Function Reference — MIO_Calibrate Unless you have previously stored new internal voltage reference constants in refLoc (the user reference area) 1 or 2 by calling MIO_Calibrate with calOp set to 4, you must use refLoc 6 (the factory reference area) when performing an ADC or a DAC (calOp set to 2 or 3, respectively) calibration. A calibration performed in bipolar mode is not valid for unipolar and vice versa.
Chapter 2 Function Reference — MIO_Config MIO_Config Format status = MIO_Config (deviceNumber, dither, useAMUX) Purpose Turns dithering (the addition of Gaussian noise to the analog input signal) on and off, for an E Series device except the AT-MIO-16F-5, AT-MIO-64F-5, PCI-6110E, PCI-6111E, and Lab and 1200 Series devices (except the Lab-PC+). This function also lets you specify whether to use AMUX-64T channels or onboard channels for devices with 64 channels.
Chapter 2 Function Reference — MIO_Config Using This Function To use the AMUX-64T with devices with 64 channels, you must call this function to specify whether to use the AMUX-64T input channels or the onboard channels for these devices. For example, if you have one AMUX-64T device connected to the MIO connector of a 64 channel device, channel numbers 16 through 63 are duplicated. To use AMUX-64T channel 20, you must call MIO_Config with useAMUX set to 1.
Chapter 2 Function Reference — RTSI_Clear RTSI_Clear Format status = RTSI_Clear (deviceNumber) Purpose Disconnects all RTSI bus trigger lines from signals on the specified device.
Chapter 2 Function Reference — RTSI_Clock RTSI_Clock Format status = RTSI_Clock (deviceNumber, connect, dir) Purpose Connects or disconnects the system clock from the RTSI bus if the device can be programmed to do so. You can connect or disconnect the other device system clock signals to and from the RTSI bus using jumper settings.
Chapter 2 Function Reference — RTSI_Clock RTSI_Clock always returns an error if deviceNumber is not an AT-MIO-16X, AT-MIO-64F-5, AT-AO-6/10, or a DIO 6533 (DIO-32HS). To connect the system clock signal of any other device to the RTSI bus, you must change a jumper setting on the device. See the appropriate user manual for instructions. Note If you are using an E Series device, see the Select_Signal function.
Chapter 2 Function Reference — RTSI_Conn RTSI_Conn Format status = RTSI_Conn (deviceNumber, sigCode, trigLine, dir) Purpose Connects a device to the specified RTSI bus trigger line.
Chapter 2 Function Reference — RTSI_Conn The second call could access another non-E Series MIO or AI device and use parameters sigCode = 0, trigLine = 3, and dir = 0. This call configures the second non-E Series MIO or AI device RTSI interface to receive a signal from trigger line 3 and drive it onto the non-E Series MIO or AI device EXTCONV* signal.
Chapter 2 Function Reference — RTSI_DisConn RTSI_DisConn Format status = RTSI_DisConn (deviceNumber, sigCode, trigLine) Purpose Disconnects a device signal from the specified RTSI bus trigger line. Parameters Input Name Type Description deviceNumber i16 assigned by configuration utility sigCode i16 signal code number trigLine i16 RTSI bus trigger line Parameter Discussion sigCode is the signal code number of the device signal to be disconnected from the RTSI bus trigger line.
Chapter 2 Function Reference — SC_2040_Config SC_2040_Config Format status = SC_2040_Config (deviceNumber, channel, sc2040gain) Purpose Informs NI-DAQ that an SC-2040 Track-and-Hold accessory is attached to the device specified by deviceNumber and communicates to NI-DAQ gain settings for one or all channels.
Chapter 2 Function Reference — SC_2040_Config Example 1 You have selected set the jumper for a gain of 100 for all your SC-2040 channels. You should call SC_2040_Config as follows: SC_2040_Config(deviceNumber, -1, 100) Example 2 You have selected gain set the jumper for a gain of 100 for channels 0, 3, 4, 5, and 6 on your SC-2040, gain 200 for channels 1 and 2, and gain 500 for channel 7.
Chapter 2 Function Reference — SCAN_Demux SCAN_Demux Format status = SCAN_Demux (buffer, count, numChans, numMuxBrds) Purpose Rearranges, or demultiplexes, data acquired by a SCAN operation into row-major order (that is, each row of the array holding the data corresponds to a scanned channel) for easier access by C applications. SCAN_Demux does not need to be called by BASIC applications to rearrange two-dimensional arrays because these arrays are accessed in column-major order.
Chapter 2 Function Reference — SCAN_Demux numMuxBrds is the number of AMUX-64T devices used during the multiple-channel acquisition. NI-DAQ ignores this parameter for the DAQCard-500/700 and 516, Lab and 1200 Series, and LPM devices and DSA devices. Range: 0, 1, 2, or 4.
Chapter 2 Function Reference — SCAN_Op SCAN_Op Format status = SCAN_Op (deviceNumber, numChans, chans, gains, buffer, count, sampleRate, scanRate) Purpose Performs a synchronous, multiple-channel scanned data acquisition operation. SCAN_Op does not return until NI-DAQ has acquired all the data or an acquisition error has occurred (MIO, AI, and DSA devices only).
Chapter 2 Function Reference — SCAN_Op chans is an integer array of a length not less than numChans that contains the channel scan sequence to be used. chans can contain any onboard analog input channel number (Range: 0 through 7 differential, 0 through 15 single-ended) number in any order. For onboard analog input channel ranges, see Table B-1 in Appendix B, Analog Input Channel, Gain Settings, and Voltage Calculation.
Chapter 2 Function Reference — SCAN_Op Voltage Calculation , for valid gain settings. If you use an invalid gain, NI-DAQ returns an error. count is the number of samples to be acquired (that is, the number of A/D conversions to be performed). Range: 3 through 232 – 1 (except the E Series). 2 through 224 * (total number of channels scanned) or 232 – 1, whichever is less (E Series and DSA devices). For PCI-611X devices, count must be EVEN. sampleRate is the sample rate you want in units of pts/s.
Chapter 2 Note Function Reference — SCAN_Op If you have selected external start triggering of the data acquisition operation, a high-to-low edge at the STARTTRIG* pin on the I/O connector of the MIO-16 and AT-MIO-16D, or the EXTTRIG* pin on the AT-MIO-16F-5, AT-MIO-64F-5, and AT-MIO-16X initiates the data acquisition operation. If you are using an E Series device, you need to apply a trigger that you select through the Select_Signal or DAQ_Config functions to initiate data acquisition.
Chapter 2 Function Reference — SCAN_Sequence_Demux SCAN_Sequence_Demux Format status = SCAN_Sequence_Demux (numChans, chanVector, bufferSize, buffer, samplesPerSequence, scanSequenceVector, samplesPerChannelVector) Purpose Rearranges the data produced by a multi-rate acquisition so that all the data from each channel is stored in adjacent elements of your buffer.
Chapter 2 Function Reference — SCAN_Sequence_Demux chanVector contains the channels sampled in the acquisition that produced the data contained in buffer. It might be identical to the channel vector you used in the call to SCAN_Sequence_Setup, or it might contain the channels in a different order. SCAN_Sequence_Demux will reorder the data in buffer such that the data for chanVector[0] occurs first, the data for chanVector[1] occurs second, and so on. bufferSize is the number of samples in the buffer.
Chapter 2 Function Reference — SCAN_Sequence_Demux samplesPerChannelVector [1]) - 1 (index 11). The first sample for the channel listed in chanVector[2] (channel 7) begins at (samplesPerChannelVector [0] + samplesPerChannelVector [1]) (index 12) and ends at (samplesPerChannelVector [0] + samplesPerChannelVector [1] + samplesPerChannelVector [2]) - 1 (index 13).
Chapter 2 Function Reference — SCAN_Sequence_Retrieve SCAN_Sequence_Retrieve Format status = SCAN_Sequence_Retrieve (device, samplesPerSequence, scanSequenceVector) Purpose Returns the scan sequence created by NI-DAQ as a result of a previous call to SCAN_Sequence_Setup.
Chapter 2 Function Reference — SCAN_Sequence_Setup SCAN_Sequence_Setup Format status = SCAN_Sequence_Setup (device, numChans, chanVector, gainVector, scanRateDivisorVector, scansPerSequence, samplesPerSequence) Purpose Initializes the device for a multirate scanned data acquisition operation. Initialization includes selecting the channels to be scanned, assigning gains to these channels and assigning different sampling rates to each channel by dividing down the base scan rate.
Chapter 2 Function Reference — SCAN_Sequence_Setup gainVector contains the gain settings to be used for each channel in chanVector. The channel listed in entry i of chanVector will have the gain listed in entry i of gainVector. scanRateDivisorVector contains the scan rate divisors to be used for each channel. The sample rate for a channel equals the base scan rate (that is, the scan rate specified when SCAN_Start is called) divided by the scan rate divisor for that channel.
Chapter 2 Function Reference — SCAN_Sequence_Setup The scan sequence created by NI-DAQ looks like this: scan number: 1 2 3 4 channels sampled: 2, 5, 7, 2, 2, 5, 2 scansPerSequence = 4 samplesPerSequence = 7 If your base scan rate is 1,000 scans/s, channel 2 is sampled at 1,000 S/s, channel 5 is sampled at 500 S/s, and channel 7 is sampled at 250 S/s. ScansPerSequence and samplesPerSequence are used to calculate the size of your acquisition buffer.
Chapter 2 Function Reference — SCAN_Setup SCAN_Setup Format status = SCAN_Setup (deviceNumber, numChans, chanVector, gainVector) Purpose Initializes circuitry for a scanned data acquisition operation. Initialization includes storing a table of the channel sequence and gain setting for each channel to be digitized (MIO and AI devices only).
Chapter 2 Function Reference — SCAN_Setup devices), or the total number of channels scanned equals (4) * (numChans) * (num_mux_brds). For example, if you use one AMUX-64T and scan eight onboard channels, the total number of channels scanned equals (4) * (8) * (1) = 32. If you use one or more external multiplexer devices (AMUX-64Ts) with the MIO-64, the total number of channels scanned equals (4) * (numChans1) * (num_mux_brds) + numChans2, where: • 4 represents four-to-one multiplexer.
Chapter 2 Function Reference — SCAN_Start SCAN_Start Format status = SCAN_Start (deviceNumber, buffer, count, sampTimebase, sampInterval, scanTimebase, scanInterval) Purpose Initiates a multiple-channel scanned data acquisition operation, with or without interval scanning, and stores its input in an array (MIO, AI, and DSA devices only).
Chapter 2 Function Reference — SCAN_Start 2 through 224 * (total number of channels scanned) or 232 – 1, whichever is less for E Series and DSA devices. For PCI-611X devices, count must be EVEN. count must be an integer multiple of the total number of channels scanned. count refers to the total number of A/D conversions to be performed; therefore, the number of samples acquired from each channel is equal to count divided by the total number of channels scanned.
Chapter 2 0: 1: 2: 3: 4: 5: Function Reference — SCAN_Start External clock used as timebase (Connect your own timebase frequency to the internal scan-interval counter via the SOURCE5 input for the MIO devices or, by default, the PFI8 input for the E Series devices). 1 MHz clock used as timebase (1 µs resolution) (non-E Series only). 100 kHz clock used as timebase (10 µs resolution). 10 kHz clock used as timebase (100 µs resolution) (non-E Series only).
Chapter 2 Function Reference — SCAN_Start 1: 2: 3: 4: 5: 1 MHz clock used as timebase (1 µs resolution) (non-E Series only). 100 kHz clock used as timebase (10 µs resolution). 10 kHz clock used as timebase (100 µs resolution) (non-E Series only). 1 kHz clock used as timebase (1 ms resolution) (non-E Series only). 100 Hz clock used as timebase (10 ms resolution) (non-E Series only).
Chapter 2 Function Reference — SCAN_Start you cannot control the scan interval externally. In this case, NI-DAQ scans the channels repeatedly as fast as you apply the external conversion pulses. Note Simultaneous sampling devices ignore parameters for sampTimebase and sampInterval. These devices sample all channels simultaneously. The acquisition rate is controlled by scanTimebase and scanInterval; therefore, a scanInterval value of 0 is not allowed.
Chapter 2 Function Reference — SCAN_Start If you have selected external start triggering of the data acquisition operation, a high-to-low edge at the STARTTRIG* I/O connector input on the MIO-16/16D, or the EXTTRIG* connector on the MIO-F-5/16X initiates the data acquisition operation after the SCAN_Start call is complete. Otherwise, SCAN_Start issues a software trigger to initiate the data acquisition operation before returning.
Chapter 2 Function Reference — SCAN_to_Disk SCAN_to_Disk Format status = SCAN_to_Disk (deviceNumber, numChans, chans, gains, filename, count, sampleRate, scanRate, concat) Purpose Performs a synchronous, multiple-channel scanned data acquisition operation and simultaneously saves the acquired data in a disk file. SCAN_to_Disk does not return until all the data has been acquired and saved or an acquisition error has occurred (MIO and AI devices only).
Chapter 2 Function Reference — SCAN_to_Disk chans is an integer array of a length not less than numChans that contains the onboard channel scan sequence to be used. chans can contain any analog input channel number in any order. For channel number ranges, refer to Table B-1 in Appendix B, Analog Input Channel, Gain Settings, and Voltage Calculation. For example, if numChans = 4 and if chans[1] = 7, the second channel to be scanned is analog input channel 7, and NI-DAQ scans four analog input channels.
Chapter 2 Function Reference — SCAN_to_Disk count is the number of samples to be acquired (that is, the number of A/D conversions to be performed). The length of your data file should be exactly twice the value of count. If you have previously enabled pretrigger mode (by a call to DAQ_StopTrigger_Config), NI-DAQ ignores the count parameter. Range: 3 through 232 – 1 (except the E Series). 2 through 224 (E Series). For PCI-611X devices, count must be EVEN.
Chapter 2 Function Reference — SCAN_to_Disk when you enable pretrigger mode. If you do not apply the stop trigger, SCAN_to_Disk eventually returns control to your application because you eventually run out of disk space. In any case, you can use Timeout_Config to establish a maximum length of time for SCAN_to_Disk to execute. Note Simultaneous sampling devices do not use the sampleRate parameter.
Chapter 2 Function Reference — SCXI_AO_Write SCXI_AO_Write Format status = SCXI_AO_Write (SCXIchassisID, moduleSlot, channel, opCode, rangeCode, voltCurrentData, binaryData, binaryWritten) Purpose Sets the DAC channel on the SCXI-1124 module to the specified voltage or current output value. You can also use this function to write a binary value directly to the DAC channel, or to translate a voltage or current value to the corresponding binary value.
Chapter 2 Function Reference — SCXI_AO_Write 2: Translate a voltage or current value to binary, return in binaryWritten. rangeCode is the voltage or current range to be used for the analog output channel. 0: 0 to 1 V. 1: 0 to 5 V. 2: 0 to 10 V. 3: –1 to 1 V. 4: –5 to 5 V. 5: –10 to 10 V. 6: 0 to 20 mA. voltCurrentData is the voltage or current you want to produce at the DAC channel output. If opCode = 1, NI-DAQ ignores this parameter.
Chapter 2 Function Reference — SCXI_AO_Write The SCXI-1124 is shipped with a set of factory calibration constants in the factory-set EEPROM area and a copy of the factory constants in the EEPROM load area. You can recalibrate your module and store your own calibration constants in the EEPROM load area using the SCXI_Cal_Constants function. Refer to the SCXI_Cal_Constants function description for calibration procedures and information about the module EEPROM.
Chapter 2 Function Reference — SCXI_Cal_Constants SCXI_Cal_Constants Format status = SCXI_Cal_Constants (SCXIchassisID, moduleSlot, channel, opCode, calibrationArea, rangeCode, SCXIgain, DAQboard, DAQchan, DAQgain, TBgain, scaled1, binary1, scaled2, binary2, calConst1, calConst2) Purpose Calculates calibration constants for the given channel and range or gain using measured input value/binary pairs. You can use this with any SCXI analog input or analog output module.
Chapter 2 Name Type Function Reference — SCXI_Cal_Constants Description TBgain f64 SCXI terminal block gain, if any scaled1 f64 voltage/current/frequency corresponding to binary1 binary1 f64 binary value corresponding to scaled1 scaled2 f64 voltage/current/frequency corresponding to binary2 binary2 f64 binary value corresponding to scaled2 Output Name Type Description calConst1 f64 return calibration constant calConst2 f64 return calibration constant Parameter Discussion channel
Chapter 2 Function Reference — SCXI_Cal_Constants 5: Copy the entire calibration table in calibrationArea to driver memory so NI-DAQ can use the table in subsequent scaling operations in the current NI-DAQ session (SCXI-1122, SCXI-1124, SCXI-1126, and SCXI-1141 only). calibrationArea is the location NI-DAQ uses for the calibration constants.
Chapter 2 Function Reference — SCXI_Cal_Constants range and polarity settings for this channel. This applies only when opCode = 0, 1, 2, or 3 and moduleSlot is an analog input module. Otherwise, set to 0. DAQgain is the gain setting for DAQchan. It is used to scale calConst1 (binary offset). This applies only when opCode = 0, 1, 2, or 3 and moduleSlot is an analog input module. Otherwise, set to 0. TBgain is the terminal block gain applied to the SCXI channel, if any.
Chapter 2 Function Reference — SCXI_Cal_Constants milliamperes. If opCode = 3, you should pass your second calibration constant in calConst2 for NI-DAQ to store in calibrationArea. Note C Programmers—calConst1 and calConst2 are pass-by-reference parameters.
Chapter 2 Function Reference — SCXI_Cal_Constants 4. Ground your SCXI input channel. If you are using an SCXI-1100, SCXI-1122, or SCXI-1141, you can use the SCXI_Calibrate_Setup function to internally ground the module amplifier inputs. For other analog input modules, you need to wire the positive and negative channel inputs together at the terminal block. 5. Take several readings using the DAQ functions and average them for greater accuracy.
Chapter 2 Function Reference — SCXI_Cal_Constants use the endpoints of your expected input range as scaled1 and scaled2. Then you would be specifically calibrating your expected input voltage range. If you are using an SCXI-1100, SCXI-1122, SCXI-1126, or SCXI-1141, you can perform a one-point calibration to determine the binary offset; you can do this easily without external hookups using the SCXI_Calibrate_Setup function to internally ground the amplifier.
Chapter 2 Function Reference — SCXI_Cal_Constants calibrating, and then call SCXI_Cal_Constants again at the end of your calibration sequence with opCode = 4 to copy the user EEPROM area to the default load area. That way there will be two copies of your new constants and you can revert to the factory constants using opCode = 4 without wiping out your new constants entirely. Repeat the procedure above for each channel and range you want to calibrate.
Chapter 2 Function Reference — SCXI_Calibrate_Setup SCXI_Calibrate_Setup Format status = SCXI_Calibrate_Setup (SCXIchassisID, moduleSlot, calOp) Purpose Used to ground the amplifier inputs of an SCXI-1100, SCXI-1122, or SCXI-1141 so that you can determine the amplifier offset. You can also use this function to switch a shunt resistor across your bridge circuit to test the circuit. Shunt calibration is supported for the SCXI-1122 or SCXI-1121 modules with the SCXI-1321 terminal block.
Chapter 2 Function Reference — SCXI_Calibrate_Setup 4. Acquire data using the DAQ functions; you should acquire and average many samples. If you have enabled the filter on the module, wait for the amplifier to settle after calling SCXI_Calibrate_Setup before you acquire data. Refer to your SCXI-1100, SCXI-1122, or SCXI-1141 user manuals for settling times caused by filter settings. 5. SCXI_Calibrate_Setup—Disable calibration. 6. Continue with your application.
Chapter 2 Function Reference — SCXI_Change_Chan SCXI_Change_Chan Format status = SCXI_Change_Chan (SCXIchassisID, moduleSlot, moduleChan) Purpose Selects a new channel of a multiplexed module that you have previously set up for a single-channel analog input operation using the SCXI_Single_Chan_Setup function.
Chapter 2 Function Reference — SCXI_Configure_Filter SCXI_Configure_Filter Format status = SCXI_Configure_Filter (chassisID, moduleSlot, channel, filterMode, freq, cutoffDivDown, outClkDivDown, actualFreq) Purpose Configures the filter on any SCXI module that supports programmable filter settings. Currently, only the SCXI-1122, SCXI-1126, and SCXI-1141 have programmable filter settings; the other analog input modules have hardware-selectable filters.
Chapter 2 Function Reference — SCXI_Configure_Filter 2: 3: Configure the filter to use an external signal. The module divides the external signal by cutoffDivDown to determine the filter cutoff frequency. The module also divides the external signal by outClkDivDown and sends it to the module front connector OUTCLK pin. You can use this filter mode to configure a tracking filter. You can use this mode only with the SCXI-1141. Enable the filter (the reverse of filterMode 0).
Chapter 2 Function Reference — SCXI_Configure_Filter The SCXI-1126 has eight filter settings, one for each channel. These settings only work with filterMode = 1. The default frequency setting for the SCXI-1126 is 1 Hz. The SCXI-1141 also has one filter setting applied to all channels, so you must use channel = –1 when you select a cutoff frequency for that module.
Chapter 2 Function Reference — SCXI_Get_Chassis_Info SCXI_Get_Chassis_Info Format status = SCXI_Get_Chassis_Info (SCXIchassisID, chassisType, chassisAddress, commMode, commPath, numSlots) Purpose Returns chassis configuration information.
Chapter 2 Function Reference — SCXI_Get_Chassis_Info commMode is the Communication mode that will be used when the driver communicates with the SCXI chassis and modules. 0: Communication mode is disabled. In effect, the chassis is disabled. 1: Serial communication is enabled through a digital port of a DAQ device that is cabled to a module in the chassis. 2: Serial communication is enabled over the PC parallel port that is cabled to the SCXI-1200 module.
Chapter 2 Function Reference — SCXI_Get_Module_Info SCXI_Get_Module_Info Format status = SCXI_Get_Module_Info (SCXIchassisID, moduleSlot, modulePresent, operatingMode, DAQdeviceNumber) Purpose Returns configuration information for the given chassis slot number.
Chapter 2 24: 28: 30: 32: 38: 40: 42: 44: 68: Function Reference — SCXI_Get_Module_Info SCXI-1162HV. SCXI-1163R. SCXI-1102. SCXI-1141. SCXI-1200. SCXI-2400. VXI-SC-1102 VXI-SC-1150 SCXI-1120D. Any other value returned in the modulePresent parameter indicates that an unfamiliar module is present in the given slot. operatingMode indicates whether the module present in the given slot is being operated in Multiplexed or Parallel mode.
Chapter 2 Function Reference — SCXI_Get_State SCXI_Get_State Format status = SCXI_Get_State (SCXIChassisID, moduleSlot, port, channel, data) Purpose Gets the state of a single channel or an entire port on a digital or relay SCXI module.
Chapter 2 Function Reference — SCXI_Get_State When channel = –1, data contains the pattern of an entire port. Bit 0 corresponds to the state of channel 0 in the port, and the states of the other channels are represented in ascending order in data so that bit n corresponds to channel n. If the port is less than 32 bits wide, the unused bits in data are set to zero. When channel = n, the least significant bit (LSB) (bit 0) of data contains the state of channel n on the specified port.
Chapter 2 Function Reference — SCXI_Get_Status SCXI_Get_Status Format status = SCXI_Get_Status (SCXIChassisID, moduleSlot, wait, data) Purpose Reads the data in the Status Register on the specified module. This function supports the SCXI-1160, VXI-SC-1102, SCXI-1102, SCXI-1122, SCXI-1124, and SCXI-1126 modules.
Chapter 2 Function Reference — SCXI_Get_Status Using This Function If wait = 1, the function will wait a maximum of 100 ms (or 3 seconds for the SCXI-1126) for the module status to be ready. If, while polling the Status Register, a timeout occurs, the output parameter data returns the current value of the Status Register. The SCXI-1160, SCXI-1102, VXI-SC-1102, SCXI-1122, SCXI-1126, and SCXI-1124 Status Registers contain only one bit, so only the least significant bit of the data parameter is meaningful.
Chapter 2 Function Reference — SCXI_Load_Config SCXI_Load_Config Format status = SCXI_Load_Config (SCXIchassisID) Purpose Loads the SCXI chassis configuration information that you established in the configuration utility. Sets the software states of the chassis and the modules present to their default states. This function makes no changes to the hardware state of the SCXI chassis or modules.
Chapter 2 Function Reference — SCXI_ModuleID_Read SCXI_ModuleID_Read Format status = SCXI_ModuleID_Read (SCXIchassisID, moduleSlot, ModuleID) Purpose Reads the Module ID register of the SCXI module in the given slot.
Chapter 2 Function Reference — SCXI_ModuleID_Read 30: 32: 38: 40: 42: 44: 68: SCXI-1102. SCXI-1141. SCXI-1200. SCXI-2400. VXI-SC-1102. VXI-SC-1150. SCXI-1120D. Using This Function The principal difference between this function and SCXI_Get_Module_Info is that this function does a hardware read of the module. In contrast, SCXI_Get_Module_Info returns the module type stored by the NI-DAQ Configuration Utility.
Chapter 2 Function Reference — SCXI_MuxCtr_Setup SCXI_MuxCtr_Setup Format status = SCXI_MuxCtr_Setup (deviceNumber, enable, scanDiv, ctrValue) Purpose Enables or disables a DAQ device counter to be used as a multiplexer counter during SCXI channel scanning to synchronize the DAQ device scan list with the module scan list that NI-DAQ has downloaded to Slot 0 of the SCXI chassis.
Chapter 2 Function Reference — SCXI_MuxCtr_Setup Using This Function You can use this function to synchronize the scan list that NI-DAQ has loaded into the mux-gain memory of the DAQ device and the SCXI module scan list that NI-DAQ has loaded into Slot 0 of the SCXI chassis. The total number of samples to be taken in one pass through each scan list should be the same. Am9513-based MIO devices use counter 1 as the mux counter. The Lab and 1200 Series and E Series devices have a dedicated mux counter.
Chapter 2 Function Reference — SCXI_Reset SCXI_Reset Format status = SCXI_Reset (SCXIchassisID, moduleSlot) Purpose Resets the specified module to its default state. You can also use SCXI_Reset to reset the Slot 0 scanning circuitry or to reset the entire chassis.
Chapter 2 Function Reference — SCXI_Reset • SCXI-1120, SCXI-1120D, SCXI-1121, and SCXI-1140: – If the module is operating in Multiplexed mode: Channel 0 is selected. Multiplexed channel scanning is disabled. Module output is enabled if the module is cabled to a DAQ device. Hold count is 1. – If the module is operating in Parallel mode: All channels are enabled. Track/hold signal is disabled. • SCXI-1124: Sets the voltage range for each channel to 0 to 10 V. Writes a binary 0 to each DAC.
Chapter 2 • Function Reference — SCXI_Reset SCXI-1163: Initializes all of the digital output lines on the module to a logical high state. • SCXI-1163R: Initializes all of the solid state relays to their open states. • SCXI-1200: Sets channel 0 to read from the front panel 50-pin connector and not the SCXIbus. Use Init_DA_Brds to completely initialize the hardware and software state of the SCXI-1200. • SCXI-2400: Reboots the module.
Chapter 2 Function Reference — SCXI_Scale SCXI_Scale Format status = SCXI_Scale (SCXIchassisID, moduleSlot, channel, SCXIgain, TBgain, DAQboard, DAQchannel, DAQgain, numPoints, binArray, scaledArray) Purpose Scales an array of binary data acquired from an SCXI channel to voltage or frequency. SCXI_Scale uses stored software calibration constants if applicable for the given module when it scales the data.
Chapter 2 Function Reference — SCXI_Scale Parameter Discussion channel is the number of the channel on the SCXI module. Range: 0 to n–1, where n is the number of channels available on the module. –1: Scale data acquired from the temperature sensor on the terminal block connected to the module if the temperature sensor is in the MTEMP configuration. SCXIgain is the SCXI module or channel gain or range setting.
Chapter 2 Function Reference — SCXI_Scale binArray is the array of binary data for the given channel. binArray should contain numPoints data samples from the SCXI channel. If you acquired data from more than one SCXI channel, you need to demultiplex the binary data that was returned from the SCAN call before you call SCXI_Scale. You can use the SCAN_Demux call to do this.
Chapter 2 Function Reference — SCXI_SCAN_Setup SCXI_SCAN_Setup Format status = SCXI_SCAN_Setup (SCXIchassisID, numModules, moduleList, numChans, startChans, DAQdeviceNumber, modeFlag) Purpose Sets up the SCXI chassis for a multiplexed scanning data acquisition to be performed by the given DAQ device. You can scan modules in any order; however, you must scan channels on each module in consecutive order.
Chapter 2 Function Reference — SCXI_SCAN_Setup Any value in the moduleList array that is greater than the number of slots available in the chassis (such as a value of 15 or 16) can act as a dummy entry in the module scan list. Dummy entries are very useful in multichassis scanning operations to indicate in the module scan list when the MIO or AI is scanning channels on another chassis.
Chapter 2 Function Reference — SCXI_Set_Config SCXI_Set_Config Format status = SCXI_Set_Config (SCXIchassisID, chassisType, chassisAddress, commMode, commPath, numSlots, modulesPresent, operatingModes, connectionMap) Purpose Changes the software configuration of the SCXI chassis that you established in the configuration utility. Sets the software states of the chassis and the modules specified to their default states. This function makes no changes to the hardware state of the SCXI chassis or modules.
Chapter 2 Function Reference — SCXI_Set_Config 3: 4: VXI-SC-1000 carrier module. PXI-1010 chassis. chassisAddress is the hardware jumpered address of an SCXI chassis. Range: 0 to 31. commMode is the communication mode that will be used when the driver communicates with the SCXI chassis and modules. 0: Communication mode is disabled. In effect, this disables the chassis. 1: Enables serial communication through a digital port of a DAQ device that is cabled to a module in the chassis.
Chapter 2 24: 28: 30: 32: 42: 44: 68: Function Reference — SCXI_Set_Config SCXI-1162HV. SCXI-1163R. SCXI-1102. SCXI-1141. VXI-SC-1102. VXI-SC-1150. SCXI-1120D. Any other value for an element of the modulesPresent array indicates that a module that is unfamiliar to NI-DAQ (such as a custom-built module) is present in the corresponding slot. operatingModes is an array of length numSlots that indicates the operating mode of each module in the modulesPresent array—multiplexed or parallel.
Chapter 2 Function Reference — SCXI_Set_Gain SCXI_Set_Gain Format status = SCXI_Set_Gain (SCXIchassisID, moduleSlot, channel, gain) Purpose Sets the specified channel to the given gain or range setting on any SCXI module that supports programmable gain settings. Currently, the SCXI-1100, SCXI-1102, VXI-SC-1102, SCXI-1122, SCXI-1126, and SCXI-1141 have programmable gains; the other analog input modules have hardware-selectable gains.
Chapter 2 Function Reference — SCXI_Set_Input_Mode SCXI_Set_Input_Mode Format status = SCXI_Set_Input_Mode (SCXIchassisID, moduleSlot, inputMode) Purpose Configures the SCXI-1122 channels for two-wire mode or four-wire mode. Parameters Input Name Type Description SCXIchassisID i16 chassis ID number moduleSlot i16 module slot number inputMode i16 channel input mode configuration Parameter Discussion inputMode is the channel configuration you want to use. 0: two-wire mode (module default).
Chapter 2 Function Reference — SCXI_Set_State SCXI_Set_State Format status = SCXI_Set_State (SCXIChassisID, module, port, channel, data) Purpose Sets the state of a single channel or an entire port on a digital output or relay module.
Chapter 2 Function Reference — SCXI_Set_State When channel = n, the LSB (bit 0) of data contains the state of channel n on the specified port. For relay modules, a 0 bit indicates that the relay is closed or in the normally closed position, and a 1 indicates that the module is open or in the normally open position. For SCXI digital modules, a 0 bit indicates that the line is low, and a 1 bit indicates that the line is high.
Chapter 2 Function Reference — SCXI_Set_Threshold SCXI_Set_Threshold Format status = SCXI_Set_Threshold (SCXIChassisID, moduleSlot, channel, level, hysteresis) Purpose Sets the high and low threshold values for the SCXI-1126 frequency-to-voltage module.
Chapter 2 Function Reference — SCXI_Set_Threshold triggers low. The SCXI-1126 module uses the square wave to produce a corresponding voltage that is proportional to the frequency of the original input signal. The threshold values determines which part of the input signal to count, and which part to ignore. For example, a large hysteresis setting will keep signal noise from adding to the frequency of a signal.
Chapter 2 Function Reference — SCXI_Single_Chan_Setup SCXI_Single_Chan_Setup Format status = SCXI_Single_Chan_Setup (SCXIchassisID, moduleSlot, moduleChan, DAQdeviceNumber) Purpose Sets up a multiplexed module for a single channel analog input operation to be performed by the given DAQ device. Sets the module channel, enables the module output, and routes the module output on the SCXIbus if necessary.
Chapter 2 Function Reference — SCXI_Track_Hold_Control SCXI_Track_Hold_Control Format status = SCXI_Track_Hold_Control (SCXIchassisID, moduleSlot, state, DAQdeviceNumber) Purpose Controls the track/hold state of an SCXI-1140 module that you have set up for a single-channel operation. Note This function is not supported for the E Series devices.
Chapter 2 Function Reference — SCXI_Track_Hold_Setup SCXI_Track_Hold_Setup Format status = SCXI_Track_Hold_Setup (SCXIchassisID, moduleSlot, inputMode, source, send, holdCount, DAQdeviceNumber) Purpose Establishes the track/hold behavior of an SCXI-1140 module and sets up the module for either a single-channel operation or an interval-scanning operation.
Chapter 2 Function Reference — SCXI_Track_Hold_Setup source indicates what signal controls the track/hold state of the module. If the inputMode is 0, NI-DAQ ignores this parameter. 0: A counter of the DAQ device that is cabled to the module will be the source (NI-DAQ will reserve and use Am9513-based device counter 2, an E Series dedicated DAQ-STC counter, Lab and 1200 Series devices counter B1, DAQCard-700 or LPM device counter 2 for this purpose).
Chapter 2 Function Reference — SCXI_Track_Hold_Setup DAQdeviceNumber is the device number of the DAQ device in the PC that will be used to acquire the data. If the DAQdeviceNumber specified is a Lab and 1200 Series devices, DAQCard-700, or LPM device, inputMode 2 is not supported. If you are using the SCXI-1200 to acquire the data, use the logical device number you assigned to the SCXI-1200 in the configuration utility.
Chapter 2 Function Reference — SCXI_Track_Hold_Setup receive the source signal from the SCXIbus and drive the scan interval timer of the DAQ device, if you want; or the module can use the DAQ device counter output and send the signal on the SCXIbus, even if that module is not in the module scan list. For example, you want to scan two SCXI-1140 modules; one of which is cabled to the DAQ device that is to perform the acquisition.
Chapter 2 Function Reference — Select_Signal Select_Signal Format status = Select_Signal (deviceNumber, signal, source, sourceSpec) Purpose Chooses the source and polarity of a signal that the device uses (E Series and DAQArb 5411 devices only).
Chapter 2 • ND_RTSI_CLOCK • ND_RTSI_0 through ND_RTSI_6 • ND_PLL_REF_SOURCE Function Reference — Select_Signal Note The ND_OUT_START_TRIGGER, ND_OUT_UPDATE, and ND_UPDATE_CLOCK_TIMEBASE values do not apply to the AI E Series devices.
Chapter 2 Function Reference — Select_Signal Table 2-35.
Chapter 2 Function Reference — Select_Signal Table 2-35.
Chapter 2 Function Reference — Select_Signal signal = ND_IN_STOP_TRIGGER source sourceSpec ND_PFI_0 through ND_PFI_9 ND_LOW_TO_HIGH and ND_HIGH_TO_LOW ND_RTSI_0 through ND_RTSI_6 ND_LOW_TO_HIGH and ND_HIGH_TO_LOW Use ND_IN_STOP_TRIGGER for data acquisition in the pretriggered mode. The selected transition on the signal line indicates to the device that it should acquire a specified number of scans after the trigger and stop.
Chapter 2 source Function Reference — Select_Signal sourceSpec ND_GPCTR0_OUTPUT ND_LOW_TO_HIGH and ND_HIGH_TO_LOW ND_INTERNAL_TIMER ND_LOW_TO_HIGH Use this signal for scan timing. You can use a DAQ-STC timer for timing the scans, or you can use an external signal. You can also use the output of the general-purpose counter 0 for scan timing. This can be useful for applications such as Equivalent Time Sampling (ETS).
Chapter 2 Function Reference — Select_Signal signal = ND_IN_SCAN_CLOCK_TIMEBASE source sourceSpec ND_PFI_0 through ND_PFI_9 ND_LOW_TO_HIGH and ND_HIGH_TO_LOW ND_RTSI_0 through ND_RTSI_6 ND_LOW_TO_HIGH and ND_HIGH_TO_LOW ND_INTERNAL_20_MHZ ND_LOW_TO_HIGH ND_INTERNAL_100_KHZ ND_LOW_TO_HIGH Use ND_IN_SCAN_CLOCK_TIMEBASE as an input into the DAQ-STC scan timer.
Chapter 2 source Function Reference — Select_Signal sourceSpec ND_AUTOMATIC ND_LOW_TO_HIGH ND_IO_CONNECTOR ND_LOW_TO_HIGH Use ND_OUT_START_TRIGGER to initiate a waveform generation sequence. You can use an external signal or the signal used as the ND_IN_START_TRIGGER, or NI-DAQ can generate it. Setting source to ND_IN_START_TRIGGER is useful for synchronizing waveform generation with data acquisition. By setting source to ND_IO_CONNECTOR, you can trigger using a signal on the I/O connector pin.
Chapter 2 Function Reference — Select_Signal Use this signal for gating the waveform generation. For example, if you call this function with signal = ND_OUT_EXTERNAL_GATE, source = ND_PFI_9, and sourceSpec = ND_PAUSE_ON_HIGH, the waveform generation will be paused whenever the PFI 9 is at the high level.
Chapter 2 signal source Function Reference — Select_Signal sourceSpec ND_PFI_4 ND_GPCTR1_GATE ND_POSITIVE ND_PFI_5 ND_OUT_UPDATE ND_HIGH_TO_LOW ND_PFI_6 ND_OUT_START_TRIGGER ND_LOW_TO_HIGH ND_PFI_7 ND_IN_SCAN_START ND_LOW_TO_HIGH ND_PFI_7 ND_IN_SCAN_IN_PROG ND_LOW_TO_HIGH ND_PFI_8 ND_GPCTR0_SOURCE ND_LOW_TO_HIGH ND_PFI_9 ND_GPCTR0_GATE ND_POSITIVE Use ND_NONE to disable output on the pin.
Chapter 2 Function Reference — Select_Signal I/O connector because the pin is used for device-to-SCXI communication. Currently, there are no SCXI modules that require this. signal = ND_FREQ_OUT source sourceSpec ND_NONE ND_DONT_CARE ND_INTERNAL_10_MHZ 1 through 16 ND_INTERNAL_100_KHZ 1 through 16 Use ND_NONE to disable the output on the pin; in other words, to place the pin in high impedance state.
Chapter 2 Disabling the output on the PFI7 line (by calling Select_Signal with signal = ND_PFI_7 and source = ND_NONE) and then calling Select_Signal with signal = ND_RTSI_i and source = ND_IN_SCAN_START will result in ND_IN_SCAN_START being driven on the specified RTSI line regardless of what source was used to drive the PFI7 line in any previous Select_Signal call.
Chapter 2 Function Reference — Select_Signal Use source = ND_NONE to stop the device from driving the RTSI clock line. When source = ND_BOARD_CLOCK, this device drives the signal on the RTSI clock line. For DAQArb 5411 devices, the board clock is a 20 MHz clock. signal = ND_BOARD_CLOCK source sourceSpec ND_BOARD_CLOCK ND_DONT_CARE ND_RTSI_CLOCK ND_DONT_CARE Use source = ND_BOARD_CLOCK to stop the device from receiving the clock signal from the RTSI clock line.
Chapter 2 Function Reference — Select_Signal Parameter Discussion for the 6602 Devices Legal ranges for the signal, source, and sourceSpec parameters are given in terms of constants that are defined in a header file. • BASIC programmers— NIDAQCNS.INC (Visual Basic for Windows programmers should refer to the Programming Language Considerations section in Chapter 1, Using the NI-DAQ Functions, for more information. • Pascal programmers—NIDAQCNS.
Chapter 2 Function Reference — Select_Signal source sourceSpec ND_PFI_0 through ND_PFI_39 ND_LOW_TO_HIGH or ND_HIGH_TO_LOW ND_RTSI_0 through ND_RTSI_6 and ND_RTSI_CLOCK ND_LOW_TO_HIGH or ND_HIGH_TO_LOW Example status = Select_Signal (1, ND_START_TRIGGER, ND_RTSI_5, ND_LOW_TO_HIGH); This example would route RTSI lines to be the start trigger for the counters on the TIO board. When RTSI lines have a rising edge, all counters configured for hardware triggering will begin counting.
Chapter 2 Function Reference — Select_Signal Signal Name Equivalencies For a variety of reasons, some timing signals are given different names in the hardware documentation and the software and its documentation. The following table lists the equivalencies between the two sets of signal names. Table 2-37.
Chapter 2 Function Reference — Select_Signal Table 2-38.
Chapter 2 Function Reference — Set_DAQ_Device_Info Set_DAQ_Device_Info Format status = Set_DAQ_Device_Info (deviceNumber, infoType, infoValue) Purpose This function can be used to change the data transfer mode (interrupts and DMA) for certain classes of data acquisition operations, some settings for an SC-2040 track-and-hold accessory and an SC-2043-SG strain-gauge accessory, as well as the source for the CLK1 signal on the DAQCard-700.
Chapter 2 Function Reference — Set_DAQ_Device_Info infoType can be one of the following: infoType Description ND_ACK_REQ_EXCHANGE_GR1 ND_ACK_REQ_EXCHANGE_GR2 Used to exchange the ACK and REQ pins on the DIO 6533 (DIO-32HS) connector ND_AI_FIFO_INTERRUPTS Used to select method of AI interrupt generation ND_CLOCK_REVERSE_MODE_GR1 ND_CLOCK_REVERSE_MODE_GR2 Used to reverse the PCLK clock direction on the DIO 6533 (DIO-32HS) in burst handshaking mode ND_COUNTER_1_SOURCE Used to select a source for cou
Chapter 2 infoType Function Reference — Set_DAQ_Device_Info Description ND_DATA_XFER_MODE_GPCTR7 Method NI-DAQ uses for data transfers for buffered GPCTR operations with the general-purpose counter 7 ND_DATA_XFER_MODE_DIO_GR1 ND_DATA_XFER_MODE_DIO_GR2 ND_DATA_XFER_MODE_DIO_GR3 ND_DATA_XFER_MODE_DIO_GR4 ND_DATA_XFER_MODE_DIO_GR5 ND_DATA_XFER_MODE_DIO_GR6 ND_DATA_XFER_MODE_DIO_GR7 ND_DATA_XFER_MODE_DIO_GR8 Method NI-DAQ uses for data transfers for the digital input and output operations with group N (1
Chapter 2 Function Reference — Set_DAQ_Device_Info infoValue Description ND_NO_TRACK_AND_HOLD Disables use of the track-and-hold circuitry on the SC-20401 ND_OFF Disables the ACK and REQ exchange or the reversal of the clock direction of the DIO 6533 (DIO-32HS) ND_ON Exchanges the ACK and REQ pins or reverses the clock direction on the DIO 6533 (DIO-32HS) ND_STRAIN_GAUGE Enables the SC-2043-SG accessory for strain-gauge measurements (no excitation on channel 0) ND_STRAIN_GAUGE_EX0 Enables the S
Chapter 2 Function Reference — Set_DAQ_Device_Info All possible data transfer methods for the devices supported by NI-DAQ are listed below. If your device is not listed, none of the data transfer modes are applicable. The table also shows default values for data transfer modes and other settings. An asterisk indicates default value.
Chapter 2 Function Reference — Set_DAQ_Device_Info Device Type DAQCard-6533 AT-MIO-16 AT-MIO-16D AT-MIO-16E-1 NI-DAQ FRM for PC Compatibles infoType infoValue ND_DATA_XFER_MODE_DIO_GR1 ND_INTERRUPTS* ND_DATA_XFER_MODE_DIO_GR2 ND_INTERRUPTS* ND_ACK_REQ_EXCHANGE_GR1 ND_ON ND_OFF* ND_ACK_REQ_EXCHANGE_GR2 ND_ON ND_OFF* ND_CLOCK_REVERSE_MODE_GR1 ND_ON ND_OFF* ND_CLOCK_REVERSE_MODE_GR2 ND_ON ND_OFF* ND_DATA_XFER_MODE_AI ND_INTERRUPTS ND_UP_TO_1_DMA_CHANNEL ND_UP_TO_2_DMA_CHANNELS* ND_DATA_XF
Chapter 2 Device Type AT-MIO-16E-2 NEC-MIO-16E-4 AT-MIO-64E-3 infoType Function Reference — Set_DAQ_Device_Info infoValue ND_DATA_XFER_MODE_AI ND_INTERRUPTS ND_UP_TO_1_DMA_CHANNEL* ND_DATA_XFER_MODE_AO_GR1 ND_INTERRUPTS ND_UP_TO_1_DMA_CHANNEL* ND_DATA_XFER_MODE_GPCTR0 ND_INTERRUPTS ND_UP_TO_1_DMA_CHANNEL ND_UP_TO_2_DMA_CHANNELS* ND_DATA_XFER_MODE_GPCTR1 ND_INTERRUPTS ND_UP_TO_1_DMA_CHANNEL ND_UP_TO_2_DMA_CHANNELS* AT-5411 ND_DATA_XFER_MODE_AO_GR1 ND_FOREGROUND* ND_AUTOMATIC PCI-5411 ND_DATA
Chapter 2 Function Reference — Set_DAQ_Device_Info Device Type AT-AI-16XE-10 NEC-AI-16E-4 NEC-AI-16XE-50 AT-MIO-16F-5 AT-MIO-16X AT-MIO-64F-5 AT-MIO-16E-10 AT-MIO-16DE-10 AT-MIO-16XE-10 AT-MIO-16XE-50 NEC-MIO-16XE-50 DAQCard-AI-16E-4 DAQCard-AI-16XE-50 NI-DAQ FRM for PC Compatibles infoType infoValue ND_DATA_XFER_MODE_AI ND_INTERRUPTS ND_UP_TO_1_DMA_CHANNEL* ND_DATA_XFER_MODE_GPCTR0 ND_INTERRUPTS ND_UP_TO_1_DMA_CHANNEL ND_UP_TO_2_DMA_CHANNELS* ND_DATA_XFER_MODE_GPCTR1 ND_INTERRUPTS ND_UP_TO_1_
Chapter 2 Device Type DAQPad-MIO-16XE-50 infoType Function Reference — Set_DAQ_Device_Info infoValue ND_DATA_XFER_MODE_AI ND_INTERRUPTS* ND_DATA_XFER_MODE_AO_GR1 ND_INTERRUPTS* ND_DATA_XFER_MODE_GPCTR0 ND_INTERRUPTS* ND_DATA_XFER_MODE_GPCTR1 ND_INTERRUPTS* ND_AI_FIFO_INTERRUPTS ND_INTERRUPT_EVERY _SAMPLE ND_INTERRUPT_HALF_FIFO ND_AUTOMATIC* 516 devices DAQCard-500/700 ND_DATA_XFER_MODE_AI ND_INTERRUPTS* DAQCard-700 ND_AI_FIFO_INTERRUPTS ND_INTERRUPT_EVERY _SAMPLE ND_INTERRUPT_HALF_FIFO N
Chapter 2 Function Reference — Set_DAQ_Device_Info Device Type Lab-PC-1200AI infoType infoValue ND-DATA_XFER_MODE_AI ND_INTERRUPTS ND_UP_TO_1_DMA_CHANNEL* ND_AI_FIFO_INTERRUPTS ND_INTERRUPT_EVERY_ SAMPLE ND_INTERRUPT_HALF_FIFO ND_AUTOMATIC* USB devices ND_SUSPEND_POWER_STATE ND_OFF ND_ON* VXI-MIO-64E-1 VXI-MIO-64XE-10 ND_DATA_XFER_MODE_AI ND_INTERRUPTS ND_UP_TO_1_DMA_CHANNEL* ND_DATA_XFER_MODE_AO_GR1 ND_INTERRUPTS ND_UP_TO_1_DMA_CHANNEL* ND_DATA_XFER_MODE_GPCTR0 ND_INTERRUPTS ND_UP_TO_1_DM
Chapter 2 Function Reference — Set_DAQ_Device_Info (AT-MIO-16F-5, AT-MIO-16X, AT-MIO-64F-5 only) If you want to use separate DMA channels for each of the analog output channels, you have to set ND_DATA_XFER_MODE_AO to ND_UP_TO_2_DMA_CHANNELS and ND_DATA_XFER_MODE_AI to ND_INTERRUPTS.
Chapter 2 Function Reference — Timeout_Config Timeout_Config Format status = Timeout_Config (deviceNumber, timeout) Purpose Establishes a timeout limit that is used by the synchronous functions to ensure that these functions eventually return control to your application. Examples of synchronous functions are DAQ_Op, DAQ_DB_Transfer and WFM_from_Disk.
Chapter 2 Function Reference — Timeout_Config Lab_ISCAN_to_Disk WFM_from_Disk DAQ_to_Disk SCAN_Op WFM_Op SCAN_to_Disk © National Instruments Corporation 2-401 NI-DAQ FRM for PC Compatibles
Chapter 2 Function Reference — WFM_Chan_Control WFM_Chan_Control Format status = WFM_Chan_Control (deviceNumber, chan, operation) Purpose Temporarily halts or restarts waveform generation for a single analog output channel. Parameters Input Name Type Description deviceNumber i16 assigned by configuration utility chan i16 analog output channel operation i16 pause or resume Parameter Discussion chan is the analog output channel to be paused or restarted. Range: 0 or 1 for most devices.
Chapter 2 Function Reference — WFM_Chan_Control AT-AO-6/10, AT-MIO-16X, and AT-MIO-64F-5 only–You can use the PAUSE and RESUME operations on group 1 output channels only if at least one of the following conditions is true: • Group 1 consists of a single output channel. • Group 1 is using interrupts instead of DMA. AT-AO-6/10, AT-MIO-16X, and AT-MIO-64F-5 only–You will see a FIFO lag effect when you pause or resume group 1 channels.
Chapter 2 Function Reference — WFM_Check WFM_Check Format status = WFM_Check (deviceNumber, chan, wfmStopped, itersDone, pointsDone) Purpose Returns status information concerning a waveform generation operation.
Chapter 2 Function Reference — WFM_Check pointsDone returns the number of points written to the analog output channels specified in chan for the current buffer iteration. For devices that have analog output FIFOs, pointsDone returns the number of points written to the FIFO if chan belongs to group 1. Refer to the following Using This Function section for more information. Range: 0 to count – 1, where count is the parameter used in the last WFM_Load call.
Chapter 2 Function Reference — WFM_ClockRate WFM_ClockRate Format status = WFM_ClockRate (deviceNumber, group, whichclock, timebase, interval, mode) Purpose Sets an update rate and a delay rate for a group of analog output channels.
Chapter 2 0: 1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: Function Reference — WFM_ClockRate If whichclock is equal to 0, the external clock is connected to OUT2 on the MIO-16 and AT-MIO-16D; to EXTDACUPDATE* on the AT-MIO-16F-5, AT-MIO-64F-5, and AT-MIO-16X; to EXTUPDATE on the AT-AO-6/10 and Lab and 1200 Series analog output devices, or to a pin chosen through the Select_Signal function on an E Series device (default is PFI5).
Chapter 2 Function Reference — WFM_ClockRate The only internal timebases available on the E Series devices are 20 MHz and 100 kHz. If you use a timebase other than –3 or 2 for these devices, NI-DAQ performs the appropriate translation, if possible. Note If you are using an SCXI-1200 with remote SCXI, the maximum rate depends on the baud rate setting and updateRate. Refer to the SCXI-1200 User Manual for more details. mode depends on the whichclock parameter. Range: 0, 1, or 2 for E Series devices.
Chapter 2 Function Reference — WFM_ClockRate (if it is not busy in a data acquisition or a counting operation) to produce a clock of 100 kHz, which is used by the counter producing the update interval. Also suppose that interval equals 25. This value indicates that counter 2 must count 25 rising edges of its input clock signal before issuing a request to produce a new voltage at the analog output channels. The actual update rate in seconds is then 25 * 10 µs = 250 µs.
Chapter 2 Function Reference — WFM_ClockRate • Delay interval prescalar 2 corresponds to the interval argument you use in this function when whichclock = 3. If you do not call this function with whichclock = 3, this interval is 2. When whichclock = 2, NI-DAQ ignores timebase and mode arguments. Legal range for delay interval prescalar 1 is 1 through 224. When whichclock = 3, NI-DAQ ignores timebase and mode arguments. Legal range for delay interval prescalar 2 is 2 through 224.
Chapter 2 Function Reference — WFM_DB_Config WFM_DB_Config Format status = WFM_DB_Config (deviceNumber, numChans, chanVect, dbMode, oldDataStop partialTransferStop) Purpose Enables and disables the double-buffered mode of waveform generation.
Chapter 2 Function Reference — WFM_DB_Config oldDataStop is a flag whose value enables or disables the mechanism whereby NI-DAQ stops the waveform generation when NI-DAQ it is about to generate old data (data that has already been generated) a second time. Setting oldDataStop to 1 ensures seamless double-buffered waveform generation. 0: Allow regeneration of data. 1: Disallow regeneration of data.
Chapter 2 Function Reference — WFM_DB_HalfReady WFM_DB_HalfReady Format status = WFM_DB_HalfReady (deviceNumber, numChans, chanVect, halfReady) Purpose Checks if the next half buffer for one or more channels is available for new data during a double-buffered waveform generation operation. You can use WFM_DB_HalfReady to avoid the waiting period that can occur with the double-buffered transfer functions.
Chapter 2 Function Reference — WFM_DB_HalfReady Using This Function Double-buffered waveform generation functions cyclically output data from the waveform buffer (specified in WFM_Load). The waveform buffer is divided into two equal halves so that NI-DAQ can write data from one half of the buffer to the output channels while filling the other half of the buffer with new data.
Chapter 2 Function Reference — WFM_DB_Transfer WFM_DB_Transfer Format status = WFM_DB_Transfer (deviceNumber, numChans, chanVect, buffer, count) Purpose Transfers new data into one or more waveform buffers (selected in WFM_Load) as waveform generation is in progress. WFM_DB_Transfer waits until NI-DAQ can transfer the data from the buffer to the waveform buffers.
Chapter 2 Function Reference — WFM_DB_Transfer buffer is the array of new data that is to be transferred into the waveform buffer(s). WFM_DB_Transfer can transfer new data to more than one waveform buffer, except on PCI E Series devices. For example, if two channels use separate waveform buffers (you called WFM_Load once for each channel), you can use a single call to WFM_DB_Transfer to transfer data to both waveform buffers.
Chapter 2 Function Reference — WFM_from_Disk WFM_from_Disk Format status = WFM_from_Disk (deviceNumber, numChans, chanVect, fileName, startPt, endPt, iterations, rate) Purpose Assigns a disk file to one or more analog output channels, selects the rate and the number of times the data in the file is to be generated, and starts the generation. WFM_from_Disk always waits for completion before returning, unless you call Timeout_Config.
Chapter 2 Function Reference — WFM_from_Disk fileName is the name of the data file containing the waveform data. For MIO devices (except AT-MIO-16X, PCI-MIO-16XE-10, and VXI-MIO-64XE-10), AT-AO-6/10, and Lab and 1200 Series analog output devices, the file must contain integer data ranging from 0 to 4,095 for unipolar mode and from –2,048 to 2,047 for bipolar mode.
Chapter 2 Function Reference — WFM_from_Disk If you have changed the analog output configuration from the defaults by changing the jumpers on the device, you must call AO_Configure to set the software copies of the settings prior to calling WFM_from_Disk. NI-DAQ ignores the group settings made by calling WFM_Group_Setup when you call WFM_from_Disk. WFM_from_Disk and the settings are not changed after you execute WFM_from_Disk.
Chapter 2 Function Reference — WFM_Group_Control WFM_Group_Control Format status = WFM_Group_Control (deviceNumber, group, operation) Purpose Controls waveform generation for a group of analog output channels. Parameters Input Name Type Description deviceNumber i16 assigned by configuration utility group i16 group of analog output channels operation i16 operation to be performed Parameter Discussion group is the group of analog output channels (see WFM_Group_Setup).
Chapter 2 Function Reference — WFM_Group_Control Note If you invoke this function to clear continuous waveform generation that was stopped previously because of an underflow error, WFM_Group_Control does not report the occurrence of the underflow error. If you want to check for this type of error, invoke function WFM_Check prior to invoking WFM_Group_Control to clear waveform generation. Note For the MIO-16/16D, counter 2 must be available in order to use waveform generation.
Chapter 2 Function Reference — WFM_Group_Control generated after NI-DAQ executes RESUME. RESUME restarts waveform generation if NI-DAQ has completed the number of iterations specified in WFM_Load. operation = 5 (STEP): This operation initiates a waveform generation at the analog output channels in the group when the trigger mode has been set up to STEPPED or BURST using AO_Change_Parameter call. To advance to the next stage defined in the sequence list, call WFM_Group_Control again with operation = STEP.
Chapter 2 Function Reference — WFM_Group_Setup WFM_Group_Setup Format status = WFM_Group_Setup (deviceNumber, numChans, chanVect, group) Purpose Assigns one or more analog output channels to a waveform generation group. A call to WFM_Group_Setup is only required for the AT-AO-6/10. By default, both analog output channels for the MIO devices and the Lab-PC+ are in group 1.
Chapter 2 Function Reference — WFM_Group_Setup Using This Function For the AT-AO-6/10, you can assign analog output channels to one of two waveform generation groups. Each group has a separate update clock source. You can assign different update rates to each group by calling WFM_ClockRate. Also you cannot split channel pairs between groups (channel pairs are 0 and 1, 2 and 3, 4 and 5, and so on) for the AT-AO-6/10.
Chapter 2 Function Reference — WFM_Load WFM_Load Format status = WFM_Load (deviceNumber, numChans, chanVect, buffer, count, iterations, mode) Purpose Assigns a waveform buffer to one or more analog output channels and indicates the number of waveform cycles to generate.
Chapter 2 Function Reference — WFM_Load buffer is an array of integer values that are converted to voltages by DACs. If your device has 12-bit DACs, the data ranges from 0 to 4,095 in unipolar mode and from –2,048 to 2,047 in bipolar mode. If your device has 16-bit DACs, the data ranges from 0 to 65,535 in unipolar mode and from –32,768 to +32,767 in bipolar mode. For all devices except the DAQArb devices, data points for the output channels need to be interleaved when you set up the buffer parameter.
Chapter 2 Function Reference — WFM_Load The following information applies to DAQArb 5411 devices only: Note Table 2-40. Mode Values for the Count Parameter for DAQArb 5411 Devices Mode Count 0 not supported 1 Minimum count is 256 samples. Must be a multiple of 8 samples. Maximum count = size of the memory; that is, if memory size = 2 MB, maximum number of samples = 2,000,000. 2 Must be equal to 16,384 samples.
Chapter 2 Function Reference — WFM_Load and the pattern of waveform followed by delay followed by waveform and so on, which goes on indefinitely (for devices other than DAQArb 5411 devices). The following information applies to DAQArb 5411 devices only. Note Table 2-41. Mode Values for the Iterations Parameter for DAQArb 5411 Devices Mode Iterations 0 not supported 1 0 for continuous cyclic waveform generation. 1 through 65,535 for programmed cyclic waveform generation.
Chapter 2 Function Reference — WFM_Load When mode is 0, NI-DAQ does not use FIFO mode waveform generation. When mode is 1 and all of the following conditions are satisfied, NI-DAQ uses FIFO mode waveform generation: • The waveform buffer is small enough to reside in the DAC FIFO. If you load more than one channel, the total number of points must be less than or equal to the FIFO size. • You have not enabled double-buffered waveform generation mode. • For the AT-AO-6/10, iterations must be 0.
Chapter 2 Function Reference — WFM_Load DAQ Hardware Overview Guide. You must use the entire 16,384 points of buffer to define one cycle of your waveform. For example, to generate different frequencies of a sinusoidal waveform, you must load only one cycle of a sine wave to fit the entire 16,384 points of the buffer. To generate different frequencies of the loaded waveform, you must then call WFM_Load again with mode = 4. Notice that only one buffer is allowed for a mode of 2.
Chapter 2 Function Reference — WFM_Load Assume the following conditions: Update rate of the waveform is = U Hz, Accumulator size is = n bits, Desired frequency is = f Hz Then, the DDS Frequency word [63:0] is= (f * 2n)/U. Note For the DAQArb 5411, accumulator size n is 32 bits.
Chapter 2 Function Reference — WFM_Load Table 2-43. Array Structures for ARB Mode (Continued) Iterations [31:16] ← Array element 4 (range 0 to 65,535) Iterations [15:0] ← Array element 5 (range 0 to 65,535) Marker Offset [31:16] ← Array element 6 (range 0 to 65,535) Marker Offset [15:0] ← Array element 7 (range 0 to 65,535) For each stage, Buffer ID [31:0] specifies the buffer number to be generated.
Chapter 2 Function Reference — WFM_Load changing the jumpers on the device, you must call AO_Configure to set the software copies of the settings prior to calling WFM_Group_Control (operation = START). You can make repeated calls to WFM_Load to change the shape of a waveform in progress, except on E Series devices and SCXI DAQ modules used with remote SCXI; if you make repeated calls using these devices, this function will return a transferInProgError.
Chapter 2 Function Reference — WFM_Op WFM_Op Format status = WFM_Op (deviceNumber, numChans, chanVect, buffer, count, iterations, rate) Purpose Assigns a waveform buffer to one or more analog output channels, selects the rate and the number of times the data in the buffer is to be generated, and starts the generation. If the number of buffer generations is finite, WFM_Op waits for completion before returning, unless you call Timeout_Config.
Chapter 2 Function Reference — WFM_Op The DSA devices have 18-bit DACs and operate in bipolar mode only. Data will range from –131,072 to +131,071. For DSA devices each buffer element is 32 bits wide. Each data point goes in the upper 18 bits of its buffer element. You should set the lower bits to zero. count is the number of points in your buffer. When NI-DAQ is using interleaved waveform generation, count should be a multiple of numChans and not less than 2 * numChans.
Chapter 2 Function Reference — WFM_Op If you have changed the analog output configuration from the defaults by changing the jumpers on the device, you must call AO_Configure to set the software copies of the settings prior to calling WFM_Op. NI-DAQ ignores the group settings made by calling WFM_Group_Setup when you call WFM_Op and the settings are not changed after NI-DAQ executes you execute WFM_Op. Note For the MIO-16/16D, counter 2 must be available in order to use waveform generation.
Chapter 2 Function Reference — WFM_Rate WFM_Rate Format status = WFM_Rate (rate, units, timebase, updateInterval) Purpose Converts a waveform generation update rate into the timebase and update-interval values needed to produce the rate you want.
Chapter 2 Function Reference — WFM_Rate 2: 3: 4: 5: 100 kHz clock used as timebase (10 µs resolution). 10 kHz clock used as timebase (100 µs resolution) (Am9513-based MIO devices only). 1 kHz clock used as timebase (1 ms resolution) (Am9513-based MIO devices only). 100 Hz clock used as timebase (10 ms resolution) (Am9513-based MIO devices only). updateInterval is the number of timebase units that elapse between consecutive writes (updates) to the D/A converters.
Chapter 2 Function Reference — WFM_Scale WFM_Scale Format status = WFM_Scale (deviceNumber, chan, count, gain, voltArray, binArray) Purpose Translates an array of floating-point values that represent voltages into an array of binary values that produce those voltages when NI-DAQ writes the binary array to one of the board DACs. This function uses the current analog output configuration settings to perform the conversions.
Chapter 2 Function Reference — WFM_Scale range, NI-DAQ sets the voltage to the maximum or minimum value and returns an error. NI-DAQ still completes the translation, however. Range: Any real number that produces a voltage within the analog output range. voltArray is the input array of double-precision values that represents the voltages NI-DAQ is to produce at one of the outputs. Range: Any real number that produces a voltage within the analog output range.
Chapter 2 Function Reference — WFM_Set_Clock WFM_Set_Clock Format WFM_Set_Clock (deviceNumber, group, whichClock, desiredRate, units, actualRate) Purpose Sets the update rate for a group of channels (DSA devices only).
Chapter 2 Function Reference — WFM_Set_Clock actualRate is the rate at which data points are sent to the DACs. The capabilities of your device will determine how closely actualRate matches desiredRate. The DSA devices use the same base clock for both DAQ/SCAN and WFM operations so the rates available for WFM will be restricted if a DAQ/SCAN operation is already in progress. Note C Programmers—actualRate is a pass-by-reference parameter.
Appendix A Status Codes This appendix lists the status codes returned by NI-DAQ, including the name and description. Each NI-DAQ function returns a status code that indicates whether the function was performed successfully. When an NI-DAQ function returns a code that is a negative number, it means that the function did not execute. When a positive status code is returned, it means that the function did execute, but with a potentially serious side effect.
Appendix A Status Codes Table A-1. Status Code Summary (Continued) Status Code Status Name Description –10007 badChanError A channel is out of range for the board type or input configuration; or the combination of channels is not allowed; or the scan order must be reversed (0 last). –10008 badGroupError The group is invalid. –10009 badCounterError The counter is invalid.
Appendix A Status Codes Table A-1. Status Code Summary (Continued) Status Code Status Name Description –10022 badWriteCountError Your data array contains an incomplete update, or you are trying to write past the end of the internal buffer, or your output operation is continuous and the length of your array is not a multiple of one half of the internal buffer size. –10023 badWriteModeError The write mode is out of range or is disallowed.
Appendix A Status Codes Table A-1. Status Code Summary (Continued) Status Code Status Name Description –10031 badChassisIDError The specified SCXI chassis does not correspond to a configured SCXI chassis. –10032 badModuleSlotError The SCXI module slot that was specified is invalid or corresponds to an empty slot. –10033 invalidWinHandleError The window handle passed to the function is invalid. –10034 noSuchMessageError No configured message matches the one you tried to delete.
Appendix A Status Codes Table A-1. Status Code Summary (Continued) Status Code Status Name Description –10089 badTotalCountError The total count is inconsistent with the buffer size and pretrigger scan count or with the board type. –10090 badRPGError The individual range, polarity, and gain settings are valid but the combination is not allowed. –10091 badIterationsError You have attempted to use an invalid setting for the iterations parameter. The iterations value must be 0 or greater.
Appendix A Status Codes Table A-1. Status Code Summary (Continued) Status Code Status Name Description –10124 gpctrBadEntityIDError Invalid entityID used. –10125 gpctrBadActionError Invalid action used. –10200 EEPROMreadError Unable to read data from EEPROM. –10201 EEPROMwriteError Unable to write data to EEPROM. –10202 EEPROMWriteProtection Error You cannot write into this location or area of your EEPROM because it is write-protected.
Appendix A Status Codes Table A-1. Status Code Summary (Continued) Status Code Status Name Description –10247 cmosConfigError The CMOS configuration-memory for the device is empty or invalid, or the configuration specified does not agree with the current configuration of the device, or the EISA system configuration is invalid. –10248 dupAddressError The base addresses for two or more devices are the same; consequently, the driver is unable to access the specified device.
Appendix A Status Codes Table A-1. Status Code Summary (Continued) Status Code Status Name Description –10256 comPortOpenError There was an error in opening the specified COM port. –10257 baseAddressError Bad base address specified in the configuration utility. –10258 dmaChannel1Error Bad DMA channel 1 specified in the configuration utility or by the operating system. –10259 dmaChannel2Error Bad DMA channel 2 specified in the configuration utility or by the operating system.
Appendix A Status Codes Table A-1. Status Code Summary (Continued) Status Code Status Name Description –10345 chassisMemAllocError The required amount of memory cannot be allocated on the remote SCXI unit for the specified operation. –10346 badPacketError The packet received by the remote SCXI unit is invalid. Check your serial port cable connections. –10347 chassisCommunicationError There was an error in sending a packet to the remote chassis. Check your serial port cable connections.
Appendix A Status Codes Table A-1. Status Code Summary (Continued) Status Code Status Name Description –10402 deviceNotFoundError No device is located in the specified slot or at the specified address. –10403 deviceSupportError The specified device does not support the requested action (the driver recognizes the device, but the action is inappropriate for the device). –10404 noLineAvailError No line is available. –10405 noChanAvailError No channel is available.
Appendix A Status Codes Table A-1. Status Code Summary (Continued) Status Code Status Name Description –10440 sysOwnedRsrcError The specified resource is owned by the driver and cannot be accessed or modified by the user. –10441 memConfigError No memory is configured to support the current data-transfer mode, or the configured memory does not support the current data-transfer mode. (If block transfers are in use, the memory must be capable of performing block transfers.
Appendix A Status Codes Table A-1. Status Code Summary (Continued) Status Code Status Name Description –10448 stackMemError The driver is unable to continue parsing a string input due to stack limitations. –10449 cacheMemError A cache-related error occurred, or caching is not supported in the current mode. –10450 physicalMemError A hardware error occurred in physical memory, or no memory is located at the specified address.
Appendix A Status Codes Table A-1. Status Code Summary (Continued) Status Code Status Name Description –10460 interfaceInteractionError You have mixed VIs from the DAQ library and the _DAQ compatibility library (LabVIEW 2.2 style VIs). You may switch between the two libraries only by running the DAQ VI Device Reset before calling _DAQ compatibility VIs or by running the compatibility VI Board Reset before calling DAQ VIs.
Appendix A Status Codes Table A-1. Status Code Summary (Continued) Status Code Status Name Description –10600 noSetupError No setup operation has been performed for the specified resources. Or, some resources require a specific ordering of calls for proper setup. –10601 multSetupError The specified resources have already been configured by a setup operation. –10602 noWriteError No output data has been written into the transfer buffer.
Appendix A Status Codes Table A-1. Status Code Summary (Continued) Status Code Status Name Description –10611 badDirOnSomeLinesError Some of the lines in the specified channel are not configured for the transfer direction specified. For a write transfer, some lines are configured for input. For a read transfer, some lines are configured for output. –10612 badLineDirError The specified line does not support the specified transfer direction.
Appendix A Status Codes Table A-1. Status Code Summary (Continued) Status Code Status Name Description –10624 delayTrigError The delayed trigger mode is not supported or is not available in the current configuration, or no delay source has been assigned. –10625 masterTrigError The trigger configuration for the trigger master is invalid. –10626 slaveTrigError The trigger configuration for the trigger slave is invalid. –10627 noTrigDrvError No signal has been assigned to the trigger resource.
Appendix A Status Codes Table A-1. Status Code Summary (Continued) Status Code Status Name Description –10634 noContTransferInProgressError No continuous (double-buffered) transfer is in progress for the specified resource. –10635 invalidSCXIOpModeError Either the SCXI operating mode specified in a configuration call is invalid, or a module is in the wrong operating mode to execute the function call.
Appendix A Status Codes Table A-1. Status Code Summary (Continued) Status Code Status Name Description –10688 noTrigEnabledError The number of total scans and pretrigger scans implies that a triggered start is intended, but triggering is not enabled. –10689 digitalTrigBError Digital trigger B is illegal for the number of total scans and pretrigger scans specified. –10690 digitalTrigAandBError This board does not allow digital triggers A and B to be enabled at the same time.
Appendix A Status Codes Table A-1. Status Code Summary (Continued) Status Code Status Name Description –10698 timebaseConflictError You cannot use this combination of scan and sample clock timebases for this board. –10699 polarityConflictError You cannot use this combination of scan and sample clock source polarities for this operation and board. –10700 signalConflictError You cannot use this combination of scan and convert clock signal sources for this operation and board.
Appendix A Status Codes Table A-1. Status Code Summary (Continued) Status Code Status Name Description –10783 calConstPolarityConflictError Calibration constants in the load area have a different polarity from the current configuration. Therefore, if you receive this error, you should load constants from factory. If you receive status +10783, be aware that NI-DAQ has automatically loaded constants from the factory. –10800 timeOutError The operation could not complete within the time limit.
Appendix A Status Codes Table A-1. Status Code Summary (Continued) Status Code Status Name Description –10809 gateSignalError Attempted to start a pulse width measurement with the pulse in the phase to be measured (for example, high phase for high-level gating). –10840 internalDriverError An unexpected error occurred inside the driver when performing this given operation.
Appendix A Status Codes Table A-1. Status Code Summary (Continued) Status Code Status Name Description –10848 noDMACountAvailError The driver could not obtain a valid reading from the transfer-count register in the DMA controller. –10849 OpenFileError The configuration file could not be opened. –10850 closeFileError Unable to close a file. –10851 fileSeekError Unable to seek within a file. –10852 readFileError Unable to read from a file.
Appendix A Status Codes Table A-1. Status Code Summary (Continued) Status Code Status Name Description –10883 wfmPollDataLossError New data could not be transferred to the waveform buffer of the remote SCXI unit to keep up with the waveform update rate. Try using a slower waveform update rate if possible. –10884 pretrigReorderError Could not rearrange data after a pretrigger acquisition completed.
Analog Input Channel, Gain Settings, and Voltage Calculation Appendix B This appendix lists the valid channel and gain settings for DAQ boards, describes how NI-DAQ calculates voltage, and describes the measurement of offset and gain adjustment. DAQ Device Analog Input Channel Settings Table B-1 lists the valid analog input (ADC) channel settings.
Appendix B Analog Input Channel, Gain Settings, and Voltage Calculation Table B-1.
Appendix B Analog Input Channel, Gain Settings, and Voltage Calculation Table B-2.
Appendix B Analog Input Channel, Gain Settings, and Voltage Calculation Table B-3.
Appendix B Analog Input Channel, Gain Settings, and Voltage Calculation DAQ Device Gain Settings Table B-4 lists the valid gain settings for DAQ devices. Table B-4. Valid Gain Settings Device Valid Gain Settings AT-MIO-16L, AT-MIO-16DL 1, 10, 100, 500 AT-MIO-16H, AT-MIO-16DH 1, 2, 4, 8 AT-MIO-16F-5, AT-MIO-64F-5, and most E Series devices –1 (for a gain of 0.
Appendix B Analog Input Channel, Gain Settings, and Voltage Calculation Table B-5 lists the values of maxReading and maxVolt for different boards. Table B-5.
Appendix B Analog Input Channel, Gain Settings, and Voltage Calculation Offset and Gain Adjustment Measurement of Offset To determine the offset parameter used in the AI_VScale and DAQ_VScale functions, follow this procedure: Note 1. Ground analog input channel i, where i can be any valid input channel. 2. Call the AI_Read function with gain set to the gain that will be used in your real acquisition (g). The reading given by the AI_Read function is the value of offset.
Appendix C NI-DAQ Function Support This appendix contains tables that show which DAQ hardware each NI-DAQ function call supports. The NI-DAQ functions are listed in alphabetical order. A check mark indicates the hardware that the function supports. If you attempt to call an NI-DAQ function using a device that the function does not support, NI-DAQ returns a deviceSupportError. Table C-1 lists the NI-DAQ functions for MIO and AI devices.
Appendix C NI-DAQ Function Support Table C-1.
Appendix C NI-DAQ Function Support Table C-1.
Appendix C NI-DAQ Function Support Table C-1.
Appendix C NI-DAQ Function Support Table C-1.
Appendix C NI-DAQ Function Support Table C-2.
Appendix C NI-DAQ Function Support Table C-2.
Appendix C NI-DAQ Function Support Table C-2.
Appendix C NI-DAQ Function Support Table C-3.
Appendix C NI-DAQ Function Support Table C-3.
Appendix C NI-DAQ Function Support Table C-4.
Appendix C NI-DAQ Function Support Table C-4. Analog Output Family Functions (Continued) VXI-AO-48XDC AT-AO-6/10 AO-2DC Series Function DAQArb 5411 Devices Device WFM_DB_Config ✓ WFM_DB_HalfReady ✓ WFM_DB_Transfer ✓ WFM_from_Disk ✓ WFM_Group_Control ✓ ✓ WFM_Group_Setup ✓ ✓ WFM_Load ✓ ✓ WFM_Op ✓ WFM_Rate ✓ WFM_Scale ✓ Table C-5.
Appendix C NI-DAQ Function Support Table C-5.
Appendix C NI-DAQ Function Support Table C-5. Digital I/O Family Functions (Continued) ✓ Set_DAQ_Device_Info ✓ ✓ Timeout_Config ✓ ✓ VXI-DIO-128 ✓ PC-OPDIO-16 DAQDIO 6533 (DIO-32HS) RTSI_DisConn Function DIO-24 and DIO-96 AT-DIO-32F Device ✓ Table C-6.
Appendix C NI-DAQ Function Support Table C-6.
Appendix C NI-DAQ Function Support Table C-7.
Function SCXI_Single_Chan_Setup © National Instruments Corporation ✓ ✓ ✓ ✓ ✓ SCXI_Track_Hold_Control SCXI_Track_Hold_Setup C-17 ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ LPM Devices MIO and AI Devices Lab and 1200 Devices (except DAQPad-1200 and SCXI-1200) Module DIO Devices DAQCard-700 AO-2DC SCXI-1200 VXI-SC-1150 SCXI-1163/1163R SCXI-1162/1162HV SCXI-1161 SCXI-1160 SCXI-1141 SCXI-1140 SCXI-1124 SCXI-1122 SCXI-1121 SCXI-1120, SCXI-1120D 1102 Series SCXI-1100 Appendix C NI-DAQ Function Support
Appendix Customer Communication D For your convenience, this appendix contains forms to help you gather the information necessary to help us solve your technical problems and a form you can use to comment on the product documentation. When you contact us, we need the information on the Technical Support Form and the configuration form, if your manual contains one, about your system configuration to answer your questions as quickly as possible.
Fax-on-Demand Support Fax-on-Demand is a 24-hour information retrieval system containing a library of documents on a wide range of technical information. You can access Fax-on-Demand from a touch-tone telephone at 512 418 1111. E-Mail Support (Currently USA Only) You can submit technical support questions to the applications engineering team through e-mail at the Internet address listed below. Remember to include your name, address, and phone number so we can contact you with solutions and suggestions.
Technical Support Form Photocopy this form and update it each time you make changes to your software or hardware, and use the completed copy of this form as a reference for your current configuration. Completing this form accurately before contacting National Instruments for technical support helps our applications engineers answer your questions more efficiently.
NI-DAQ for PC Compatibles Hardware and Software Configuration Form Record the settings and revisions of your hardware and software on the line to the right of each item. Complete a new copy of this form each time you revise your software or hardware configuration, and use this form as a reference for your current configuration. Completing this form accurately before contacting National Instruments for technical support helps our applications engineers answer your questions more efficiently.
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-DAQ ™ Function Reference Manual for PC Compatibles Edition Date: April 1998 Part Number: 321645C-01 Please comment on the completeness, clarity, and organization of the manual.
Glossary Prefix Meanings Value p- pico 10 –12 n- nano- 10 –9 µ- micro- 10 – 6 m- milli- 10 –3 k- kilo- 10 3 M- mega- 10 6 G- giga- 10 9 t- tera- 10 12 Numbers/Symbols ° degree < less than or equal to – minus % percent + plus ± plus or minus Ω ohm A AC alternating current ACK acknowledge © National Instruments Corporation G-1 NI-DAQ FRM for PC Compatibles
Glossary A/D analog-to-digital ADC A/D converter ADC resolution the resolution of the ADC, which is measured in bits. An ADC with 16 bits has a higher resolution, and thus a higher degree of accuracy, than a 12-bit ADC.
Glossary buffer temporary storage for acquired or generated data (software) burst-mode a high-speed data transfer in which the address of the data is sent followed by back-to-back data words while a physical signal is asserted bus the group of conductors that interconnect individual circuitry in a computer. Typically, a bus is the expansion vehicle to which I/O or other devices are connected. Examples of PC buses are the ISA and PCI bus.
Glossary DAQ data acquisition—(1) collecting and measuring electrical signals from sensors, transducers, and test probes or fixtures and inputting them to a computer for processing; (2) collecting and measuring the same kinds of electrical signals with A/D and/or DIO boards plugged into a computer, and possibly generating control signals with D/A and/or DIO boards in the same computer dB decibel—the unit for expressing a logarithmic measure of the ratio of two signal levels: dB=20log10 V1/V2, for signal
Glossary drivers software that controls a specific hardware device such as a DAQ board or a GPIB interface board DSP digital signal processing E EEPROM electronically erasable programmable read-only memory EISA Extended Industry Standard Architecture ETS Equivalent Time Sampling F fetch-and-deposit a data transfer in which the data bytes are transferred from the source to the controller, and then from the controller to the target FIFO first-in first-out memory buffer—the first data stored is t
Glossary handle pointer to a pointer to a block of memory; handles reference arrays and strings. An array of strings is a handle to a block of memory containing handles to strings. handshaked digital I/O a type of digital acquisition/generation where a device or module accepts or transfers data after a digital pulse has been received. Also called latched digital I/O.
Glossary K k kilo—the standard metric prefix for 1,000, or 103, used with units of measure such as volts, hertz, and meters K kilo—the prefix for 1,024, or 210, used with B in quantifying data or computer memory kbytes/s a unit for data transfer that means 1,000 or 103 bytes/s Kword 1,024 words of memory L LabVIEW laboratory virtual instrument engineering workbench latched digital I/O a type of digital acquisition/generation where a device or module accepts or transfers data after a digital puls
Glossary Mbytes/s a unit for data transfer that means 1 million or 106 bytes/s MC Micro Channel memory buffer See buffer. min minutes MIO multifunction I/O MITE MXI Interfaces to Everything—a custom ASIC designed by National Instruments that implements the PCI bus interface. The MITE supports bus mastering for high speed data transfers over the PCI bus.
Glossary nonreferenced signal sources signal sources with voltage signals that are not connected to an absolute reference or system ground. Also called floating signal sources. Some common example of nonreferenced signal sources are batteries, transformers, or thermocouples.
Glossary PCMCIA an expansion bus architecture that has found widespread acceptance as a de facto standard in notebook-size computers. It originated as a specification for add-on memory cards written by the Personal Computer Memory Card International Association.
Glossary S s seconds S samples sample counter the clock that counts the output of the channel clock, in other words, the number of samples taken. On boards with simultaneous sampling, this counter counts the output of the scan clock and hence the number of scans. scan one or more analog or digital input samples. Typically, the number of input samples in a scan is equal to the number of channels in the input group.
Glossary SS simultaneous sampling—a property of a system in which each input or output channel is digitized or updated at the same instant S/s samples per second STC system timing controller switchless device devices that do not require dip switches or jumpers to configure resources on the devices—also called Plug and Play devices synchronous (1) hardware—a property of an event that is synchronized to a reference clock (2) software—a property of a function that begins an operation and returns only
Glossary V V volts W waveform multiple voltage readings taken at a specific sampling rate WF waveform wire data path between nodes word the standard number of bits that a processor or memory manipulates at one time. Microprocessors typically use 8-bit, 16-bit, or 32-bit words.
Index Numbers analog input functions AI_Change_Parameter, 2-1 to 2-2 AI_Check, 2-3 to 2-4 AI_Clear, 2-5 AI_Configure, 2-6 to 2-9 AI_MUX_Config, 2-10 to 2-11 AI_Read, 2-12 to 2-13 AI_Setup, 2-15 to 2-16 AI_VRead, 2-17 to 2-18 AI_VScale, 2-20 to 2-21 Configure_HW_Analog_Trigger, 2-83 to 2-89 DAQ_Check function, 2-115 to 2-116 DAQ_Clear, 2-117 DAQ_Config, 2-118 to 2-120 DAQ_DB_Config, 2-121 DAQ_DB_HalfReady, 2-122 to 2-123 DAQ_DB_Transfer, 2-124 to 2-125 DAQ_Monitor, 2-126 to 2-128 DAQ_Rate, 2-132 to 2-133 D
Index memory transfer width, 2-37 output attenuation, 2-33 output enable, 2-32 output impedance, 2-32 PLL reference frequency, 2-35 reglitching, 2-28 SYNC duty cycle, 2-35 to 2-36 trigger mode, 2-34 to 2-35 using the function, 2-26 to 2-37 voltage or current output, 2-28 to 2-29 AO_Configure function, 2-38 to 2-41 AO_Update function, 2-42 AO_VScale function, 2-43 to 2-44 AO_VWrite function, 2-45 to 2-46 AO_Write function, 2-47 to 2-48 arrays, 1-3 SCAN_Sequence_Demux, 2-300 to 2-302 SCAN_Sequence_Retrieve,
Index channel settings. See analog input channel settings.
Index Am9513 counters (CTR) CTR_Config function, 2-90 to 2-91 CTR_EvCount function, 2-92 to 2-93 CTR_EvRead function, 2-94 to 2-95 CTR_FOUT_Config, 2-96 to 2-97 CTR_Period function, 2-98 to 2-99 CTR_Pulse function, 2-100 to 2-103 CTR_Rate, 2-104 to 2-105 CTR_Reset, 2-106 CTR_Restart, 2-107 CTR_Simul_Op, 2-108 to 2-109 CTR_Square, 2-110 to 2-112 CTR_State, 2-113 CTR_Stop function, 2-114 LabWindows function panel tree, 1-11 to 1-12 DAQ-STC counters (GPCTR) GPCTR_Change_Parameter, 2-198 to 2-208 GPCTR_Config_
Index DAQ_Config, 2-118 to 2-120 DAQ_DB_Config, 2-121 DAQ_DB_HalfReady, 2-122 to 2-123 DAQ_DB_Transfer, 2-124 to 2-125 DAQ_Monitor, 2-126 to 2-128 DAQ_Op, 2-129 to 2-131 DAQ_Rate, 2-132 to 2-133 DAQ_Set_Clock, 2-134 to 2-135 DAQ_Start, 2-136 to 2-139 DAQ_StopTrigger_Config, 2-140 to 2-141 DAQ_to_Disk, 2-142 to 2-144 DAQ_VScale, 2-145 to 2-146 Lab_ISCAN_Check, 2-263 to 2-265 Lab_ISCAN_Op, 2-266 to 2-269 Lab_ISCAN_Start, 2-270 to 2-273 Lab_ISCAN_to_Disk, 2-274 to 2-276 Line_Change Attribute, 2-277 to 2-278 N
Index digital scanning output group handshaking connections (figure), 2-191 DIG_Trigger_Config function, 2-192 to 2-194 dithering, 2-284 DMA buffer. See Align_DMA_Buffer function.
Index ND_OTHER_GPCTR_TC, definition of other counter for (table), 2-200 ND_OUTPUT_MODE, 2-208 ND_OUTPUT_POLARITY, 2-208 ND_PRESCALE_VALUE, 2-201 ND_RELOAD_ON_GATE, 2-204 ND_SECOND_GATE, 2-205 ND_SECOND_GATE_POLARITY, 2-205 ND_SOURCE, legal values for (table), 2-199 ND_SOURCE_POLARITY, 2-201 ND_START_TRIGGER, 2-201 ND_UP_DOWN, 2-206 to 2-207 hardware control, 2-207 software control, 2-207 ND_Z_INDEX_PULSE, 2-204 GPCTR_Config_Buffer function, 2-209 to 2-210 GPCTR_Control function, 2-211 to 2-212 GPCTR_Read_B
Index I ND_SIMPLE_EVENT_CNT application, 2-217 to 2-218 ND_SINGLE_PERIOD_MSR application, 2-218 to 2-220 ND_SINGLE_PULSE_GNR application, 2-227 to 2-229 ND_SINGLE_PULSE_WIDTH_MSR application, 2-220 to 2-223 ND_SINGLE_TRIG_PULSE_GRN application, 2-229 to 2-231 ND_TRIG_PULSE_WIDTH_MSR application, 2-223 to 2-225 ND_TWO_SIGNAL_EDGE_SEPARATI ON_MSR application, 2-225 to 2-227 GPCTR_Watch function, 2-245 to 2-247 grounding of DAC reference, 2-31 group digital I/O functions DIG_Block_Check, 2-147 DIG_Block_Clea
Index DAQ_Check function, 2-115 to 2-116 DAQ_Clear, 2-117 DAQ_Config, 2-118 to 2-120 DAQ_DB_Config, 2-121 DAQ_DB_HalfReady, 2-122 to 2-123 DAQ_DB_Transfer, 2-124 to 2-125 DAQ_Monitor, 2-126 to 2-128 DAQ_Op, 2-129 to 2-131 DAQ_Rate, 2-132 to 2-133 DAQ_Set_Clock, 2-134 to 2-135 DAQ_Start, 2-136 to 2-139 DAQ_StopTrigger_Config, 2-140 to 2-141 DAQ_to_Disk, 2-142 to 2-144 DAQ_VScale, 2-145 to 2-146 definition, 1-13 Lab_ISCAN_Check, 2-263 to 2-265 Lab_ISCAN_Op, 2-266 to 2-269 Lab_ISCAN_Start, 2-270 to 2-273 Lab_
Index N pulse timing for pulseWidth=0 (figure), 2-103 pulse train generation application, 2-232 to 2-234 pulse width measurement applications buffered pulse width, 2-240 to 2-241 signals on two separate gates, 2-225 to 2-227 single pulse width, 2-220 to 2-223 single triggered pulse width measurement, 2-223 to 2-225 NI-DAQ constants include file, Microsoft Visual Basic for Windows, 1-5 O offset and gain adjustment gain adjustment measurement, B-7 offset measurement, B-7 output attenuation, 2-33 output en
Index SCXI_Set_Gain function, 2-360 SCXI_Set_Input_Mode function, 2-361 SCXI_Set_State function, 2-362 to 2-363 SCXI_Set_Threshold function, 2-364 to 2-365 SCXI_Single_Chan_Setup function, 2-366 SCXI_Track_Hold_Control function, 2-367 SCXI_Track_Hold_Setup function, 2-368 to 2-371 Select_Signal function, 2-372 to 2-388 6602 device parameters, 2-385 to 2-386 E Series, DAQArb 5411, and DSA parameters, 2-372 to 2-384 E series signal name equivalencies (table), 2-387 ND_BOARD_CLOCK signal definition (table), 2
Index data transfer modes, for supported devices (table), 2-393 to 2-398 infoValue parameters (table), 2-391 to 2-392 intoType parameters (table), 2-390 to 2-391 using the function, 2-392 to 2-399 signal name equivalencies, E series (table), 2-387 single period measurement application, 2-218 to 2-220 single pulse generation application, 2-227 to 2-229 single pulse width measurement application, 2-220 to 2-223 single trigger mode, for DAQArb 5411 devices, 2-34 single triggered pulse generation application,
Index triggered pulse width measurement applications, 2-223 to 2-225 square wave generation timing considerations, 2-112 status codes, 1-1 to 1-2 format, 1-1 status values (table), 1-1 summary of codes, A-1 to A-23 stepped trigger mode, for DAQArb 5411 devices, 2-34 SYNC duty cycle, 2-35 to 2-36 V variable data types, 1-2 to 1-4 arrays, 1-3 multiple types, 1-3 to 1-4 primary type names (table), 1-3 to 1-4 Visual Basic for Windows, 1-4 to 1-5 voltage calculation, B-5 to B-6 voltage or current output param
Index iterations parameter (table), 2-428 using the function, 2-432 to 2-433 WFM_Op, 2-434 to 2-436 WFM_Rate function, 2-437 to 2-438 WFM_Scale function, 2-439 to 2-440 WFM_Set_Clock function, 2-441 to 2-442 ARB mode, 2-431 to 2-432 data ranges for buffer parameter, DAQArb 5411 devices (table), 2-426 DDS mode, 2-430 to 2-431 mode values for DAQArb 5411 devices count parameter (table), 2-427 NI-DAQ FRM for PC Compatibles I-14 © National Instruments Corporation