National Instruments 321645c-01 User Manual

NI-DAQ™ Function
Reference Manual
for PC Compatibles
Version 6.1
Data Acquisition Software for the PC
NI-DAQ FRM for PC Compatibles
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.com

Bulletin Board Support

BBS United States: 512 794 5422 BBS United Kingdom : 01635 551422 BBS France: 01 48 65 15 59

Fax-on-Demand Support

512 418 1111

Telephone Support (USA)

Tel: 512 795 8248 Fax: 512 794 5678

International Offices

Australia 03 9879 5166, Austria 0662 45 79 90 0, Belgium 02 757 00 20, Brazi l 011 288 3336, Canada (Ontario) 905 785 0085, Canada (Québec) 514 694 8521, Denmark45 76 26 00, Finland 09 725 7 25 11, France 01 48 14 24 24, Germany 089 741 31 30, Hong Kong 2645 3186, Israel 03 6120092, Italy 02 413091, Japan 03 5472 2970, Korea 02 596 7456, Mexico 5 520 2635, Netherlands 0348 433466, Norway 32 84 84 00, Singapore 2265886, Spain 91 640 0085, Sweden 08 730 49 70, Switzerland 056 200 51 51, Taiwan 02 377 1200, United Kingdom 01635 523545

National Instruments Corporate Headquarters

6504 Bridge Point Parkway Austin, Texas 78730-5039 USA Tel: 512 794 0100

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. National Instruments does not warrant that the operation of the software shall be uninterrupted or error free.
A Return Material Autho rization (RMA) number must be obtained from the factory a nd clearly marked on the ou ts ide of the package before any equipment will be accepted for warranty work. National Instruments will pay the shipping costs of returning to the owner parts which are covered by warranty.
National Instruments believes that the informatio n in this manual is accurate. The docume nt has been ca refully review ed for technical accurac y. In th e even t that te ch nical o r typograp hic al errors exis t, Nation al Inst ruments rese rves th e right to make changes to subsequent editions of this document without prior notice to holders of this edition. The reader should consult National Instruments if errors are suspected. In no event shall National Instruments be liable for any damages arising out of or related to this document or the information contained in it.
E
XCEPT AS SPECIFIED HEREIN SPECIFICALLY DISCLAIMS ANY WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE RIGHT TO RECOVER DAMAGES CAUSED BY FAULT OR NEGLIGENCE ON THE PART OF NATIONAL INSTRUMENTS SHALL BE LIMITED TO THE AMOUNT THERETOFORE PAID BY THE CUSTOMER DAMAGES RESULTING FROM LOSS OF DATA, PROFITS, USE OF PRODUCTS, OR INCIDENTAL OR CONSEQUENTIAL DAMAGES EVEN IF ADVISED OF THE POSSIBILITY THEREOF
regardless of the form of action, wheth er in contrac t or tort, inc luding neglig ence. Any ac tion against N ational Inst ruments must be brought within one year after the cause of action accrues. National Instruments shall not be liable for any delay in performance due to causes beyond its reasonable control. The warranty provided herein does not cover damages, defects, malfunctions, or service failures caused by owner’s failure to follow the National Instruments installation, operation, or maintenance instructions; owner’s modification of the product; owner’s abuse, misuse, or negligent acts; and power failure or surges, fire, flood, accident, actions of third parties, or other events outside reasonable control.
, N
ATIONAL INSTRUMENTS MAKES NO WARRANTIES, EXPRESS OR IMPLIED, AND
. This limitation of the liability of National Instruments will apply
. C
USTOMER’S
. N
ATIONAL INSTRUMENTS WILL NOT BE LIABLE FOR
,

Copyright

Under the copyright laws, this publication may not be reproduced or transmitted in any form, electronic or mechanical, including photocopyi ng, recordi ng, st oring in an info rmation ret riev al syste m, or translating , in whole or in part, wit hout the prior written consent of National Instruments Corporation.

Trademarks

CVI™, DAQArb™, DAQCard™, DAQ Designer™, DAQPad™, DAQ-PnP™, DAQ-STC™, DAQWare™, LabVIEW™, NI-DAQ™, NI-DSP™, NI-PGIA™, RTSI™, and SCXI™ are trademarks of National Instruments Corporation.
Product and company names referenced in this document are trademarks or trade names of their respective companies.
WARNING REGARDING MEDICAL AND CLINICAL USE OF NATIONAL INSTRUMENTS PRODUCTS
National Instruments products are not designed with components and testing intended to ensure a level of reliability suitable for use in treatment and diagnosis of humans. Applications of National Instruments products involving medical or clinical treatment can create a potential for accidental injury caused by product failure, or by errors on the part of the user or application des igner. Any us e or ap plica tion of Na tiona l Instrum ents pr oducts for or inv olving m edi cal or clin ica l treatment must be performed by properly trai ned and qualifi ed medic al pe rsonne l, and al l tra ditiona l medic al safegu ards, equipment, and procedu res that are appropriate in the particula r situation to prevent serious injury or dea th should al ways continue to be used when Natio nal Instrume nts products are being use d. National In struments prod ucts are N OT intended to be a substitute for any form of establis hed process, procedure, or e quipment us ed to monit or or safeguard human heal th and safety in medical or clinical treatment.
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.....................................................................xvii
About the National Instruments Documentation Set.......................................................xix
Related Documentation....................................................................................................xx
Customer Communication............................................................................................ ...xx
Chapter 1 Using the NI-DAQ Functions
Status Codes, Device Numbers, and SCXI Chassis IDs..................................................1-1
Variable Data Types ........................................................................................................1-2
Primary Types ...................................................................................................1-2
Arrays................................................................................................................1-3
Multiple Types............................ ...... ..... ............................................................1-3
Programming Language Considerations..........................................................................1-4
Borland Delphi..................................................................................................1-4
Visual Basic for Windows.................................................................................1-4
NI-DAQ Constants Include File .........................................................1-5
NI-DAQ for LabWindows/CVI.......................................................................................1-5

Contents

Chapter 2 Function Reference
AI_Change_Parameter..................................................................................................... 2-1
AI_Check.........................................................................................................................2-3
AI_Clear...........................................................................................................................2-5
AI_Configure...................................................................................................................2-6
AI_Mux_Config...............................................................................................................2-10
AI_Read...........................................................................................................................2-12
AI_Read_Scan ................................................................................................................. 2-14
AI_Setup..........................................................................................................................2-15
AI_VRead........................................................................................................................2-17
AI_VRead_Scan ..............................................................................................................2-19
©
National Instruments Corporation v NI-DAQ FRM for PC Compatibles
Contents
AI_VScale .......................................................................................................................2-20
Align_DMA_Buffer........................................................................................................2-22
AO_Calibrate...................................................................................................................2-25
AO_Change_Parameter ...................................................................................................2-27
AO_Configure.................................................................................................................2-38
AO_Update......................................................................................................................2-42
AO_VScale......................................................................................................................2-43
AO_VWrite .....................................................................................................................2-45
AO_Write........................................................................................................................2-47
Calibrate_1200 ................................................................................................................2-49
Calibrate_DSA ................................................................................................................2-55
Calibrate_E_Series..........................................................................................................2-58
Config_Alarm_Deadband................................................................................................2-63
Config_ATrig_Event_Message.......................................................................................2-67
Config_DAQ_Event_Message........................................................................................2-71
Configure_HW_Analog_Trigger....................................................................................2-83
CTR_Config....................................................................................................................2-90
CTR_EvCount.................................................................................................................2-92
CTR_EvRead...................................................................................................................2-94
CTR_FOUT_Config........................................................................................................2-96
CTR_Period.....................................................................................................................2-98
CTR_Pulse.......................................................................................................................2-100
CTR_Rate........................................................................................................................2-104
CTR_Reset ...................................................................................................................... 2-106
CTR_Restart....................................................................................................................2-107
CTR_Simul_Op...............................................................................................................2-108
CTR_Square....................................................................................................................2-110
CTR_State .......................................................................................................................2-113
CTR_Stop........................................................................................................................2-114
DAQ_Check....................................................................................................................2-115
DAQ_Clear......................................................................................................................2-117
DAQ_Config ...................................................................................................................2-118
DAQ_DB_Config............................................................................................................2-121
DAQ_DB_HalfReady......................................................................................................2-122
DAQ_DB_Transfer .........................................................................................................2-124
DAQ_Monitor .................................................................................................................2-126
DAQ_Op..........................................................................................................................2-129
DAQ_Rate.......................................................................................................................2-132
DAQ_Set_Clock..............................................................................................................2-134
DAQ_Start.......................................................................................................................2-136
DAQ_StopTrigger_Config..............................................................................................2-140
DAQ_to_Disk..................................................................................................................2-142
DAQ_VScale...................................................................................................................2-145
NI-DAQ FRM for PC Compatibles vi
©
National Instruments Corporation
Contents
DIG_Block_Check........................................................................................................... 2-147
DIG_Block_Clear............................................................................................................2-148
DIG_Block_In .................................................................................................................2-149
DIG_Block_Out...............................................................................................................2-152
DIG_Block_PG_Config...................................................................................................2-154
DIG_DB_Config..............................................................................................................2-158
DIG_DB_HalfReady ....................................................................................................... 2-160
DIG_DB_Transfer...........................................................................................................2-162
DIG_Grp_Config.............................................................................................................2-164
DIG_Grp_Mode...............................................................................................................2-166
DIG_Grp_Status ..............................................................................................................2-169
DIG_In_Grp .....................................................................................................................2-171
DIG_In_Line....................................................................................................................2-173
DIG_In_Port .................................................................................................................... 2-175
DIG_Line_Config............................................................................................................ 2-177
DIG_Out_Grp..................................................................................................................2-178
DIG_Out_Line.................................................................................................................2-179
DIG_Out_Port..................................................................................................................2-181
DIG_Prt_Config...............................................................................................................2-183
DIG_Prt_Status................................................................................................................ 2-186
DIG_SCAN_Setup...........................................................................................................2-188
DIG_Trigger_Config.......................................................................................................2-192
Get_DAQ_Device_Info...................................................................................................2-195
Get_NI_DAQ_Version....................................................................................................2-197
GPCTR_Change_Parameter............................................................................................ 2-198
GPCTR_Config_Buffer...................................................................................................2-209
GPCTR_Control ..............................................................................................................2-211
GPCTR_Read_Buffer......................................................................................................2-213
GPCTR_Set_Application.................................................................................................2-215
GPCTR_Watch................................................................................................................2-245
ICTR_Read......................................................................................................................2-248
ICTR_Reset .....................................................................................................................2-250
ICTR_Setup.....................................................................................................................2-251
Init_DA_Brds...................................................................................................................2-255
Lab_ISCAN_Check.........................................................................................................2-263
Lab_ISCAN_Op ..............................................................................................................2-266
Lab_ISCAN_Start............................................................................................................2-270
Lab_ISCAN_to_Disk.......................................................................................................2-274
Line_Change_Attribute ...................................................................................................2-277
LPM16_Calibrate............................................................................................................. 2-279
MIO_Calibrate.................................................................................................................2-280
MIO_Config.....................................................................................................................2-284
RTSI_Clear......................................................................................................................2-286
©
National Instruments Corporation vii NI-DAQ FRM for PC Compatibles
Contents
RTSI_Clock .....................................................................................................................2-287
RTSI_Conn......................................................................................................................2-289
RTSI_DisConn................................................................................................................2-291
SC_2040_Config.............................................................................................................2-292
SCAN_Demux................................................................................................................. 2-294
SCAN_Op........................................................................................................................2-296
SCAN_Sequence_Demux...............................................................................................2-300
SCAN_Sequence_Retrieve.............................................................................................. 2-303
SCAN_Sequence_Setup..................................................................................................2-304
SCAN_Setup ...................................................................................................................2-307
SCAN_Start .....................................................................................................................2-309
SCAN_to_Disk................................................................................................................2-315
SCXI_AO_Write.............................................................................................................2-319
SCXI_Cal_Constants....................................................................................................... 2-322
SCXI_Calibrate_Setup....................................................................................................2-330
SCXI_Change_Chan.......................................................................................................2-332
SCXI_Configure_Filter...................................................................................................2-333
SCXI_Get_Chassis_Info.................................................................................................2-336
SCXI_Get_Module_Info.................................................................................................2-338
SCXI_Get_State..............................................................................................................2-340
SCXI_Get_Status ............................................................................................................2-342
SCXI_Load_Config.........................................................................................................2-344
SCXI_ModuleID_Read...................................................................................................2-345
SCXI_MuxCtr_Setup......................................................................................................2-347
SCXI_Reset.....................................................................................................................2-349
SCXI_Scale .....................................................................................................................2-352
SCXI_SCAN_Setup........................................................................................................2-355
SCXI_Set_Config............................................................................................................2-357
SCXI_Set_Gain...............................................................................................................2-360
SCXI_Set_Input_Mode...................................................................................................2-361
SCXI_Set_State ...............................................................................................................2-362
SCXI_Set_Threshold.......................................................................................................2-364
SCXI_Single_Chan_Setup..............................................................................................2-366
SCXI_Track_Hold_Control ............................................................................................2-367
SCXI_Track_Hold_Setup................................................................................................2-368
Select_Signal...................................................................................................................2-372
Set_DAQ_Device_Info ...................................................................................................2-389
Timeout_Config ..............................................................................................................2-400
WFM_Chan_Control.......................................................................................................2-402
WFM_Check ...................................................................................................................2-404
WFM_ClockRate.............................................................................................................2-406
WFM_DB_Config...........................................................................................................2-411
WFM_DB_HalfReady.....................................................................................................2-413
NI-DAQ FRM for PC Compatibles viii
©
National Instruments Corporation
WFM_DB_Transfer.........................................................................................................2-415
WFM_from_Disk............................................................................................................. 2-417
WFM_Group_Control .....................................................................................................2-420
WFM_Group_Setup......................................................................................................... 2-423
WFM_Load......................................................................................................................2-425
WFM_Op.........................................................................................................................2-434
WFM_Rate.......................................................................................................................2-437
WFM_Scale .....................................................................................................................2-439
WFM_Set_Clock............................................................................................................. 2-441
Appendix A Status Codes
Appendix B Analog Input Channel, Gain Settings, and Voltage Calculation
DAQ Device Analog Input Channel Settings..................................................................B-1
Valid Internal Analog Input Channels......................................................... ..... ...... .........B-2
DAQ Device Gain Settings..............................................................................................B-5
Voltage Calculation .........................................................................................................B-5
Offset and Gain Adjustment............................................................................................B-7
Measurement of Offset......................................................................................B-7
Measurement of Gain Adjustment.....................................................................B-7
Contents
Appendix C NI-DAQ Function Support
Appendix D Customer Communication
Glossary
Index

Figures

Figure 2-1. High Alarm Deadband.............................................................................2-65
Figure 2-2. Low Alarm Deadband.............................................................................2-66
Figure 2-3. Analog Trigger Event..............................................................................2-70
Figure 2-4. ND_BELOW_LOW_LEVEL.................................................................2-85
Figure 2-5. ND_ABOVE_HIGH_LEVEL.................................................................2-85
©
National Instruments Corporation ix NI-DAQ FRM for PC Compatibles
Contents
Figure 2-6. ND_INSIDE_REGION........................................................................... 2-85
Figure 2-7. ND_HIGH_HYSTERESIS.....................................................................2-86
Figure 2-8. ND_LOW_HYSTERESIS......................................................................2-86
Figure 2-9. Pulse Generation Timing ........................................................................2-102
Figure 2-10. Pulse Timing for pulseWidth = 0............................................................2-103
Figure 2-11. Square Wave Timing ..............................................................................2-112
Figure 2-12. Digital Scanning Input Group Handshaking Connections ...................... 2-190
Figure 2-13. Digital Scanning Output Group Handshaking Connections...................2-191
Figure 2-14. Simple Event Counting...........................................................................2-217
Figure 2-15. Single Period Measurement....................................................................2-219
Figure 2-16. Single Pulse Width Measurement...........................................................2-221
Figure 2-17. Single Triggered Pulse Width Generation Measurement ....................... 2-224
Figure 2-18. Start-Stop Measurement..........................................................................2-226
Figure 2-19. Single Pulse Generation..........................................................................2-228
Figure 2-20. Single Triggered Pulse Generation......................................................... 2-230
Figure 2-21. Retriggerable Pulse Generation ..............................................................2-232
Figure 2-22. Pulse Train Generation ...........................................................................2-233
Figure 2-23. Frequency Shift Keying..........................................................................2-235
Figure 2-24. Buffered Event Counting........................................................................2-236
Figure 2-25. Buffered Period Measurement................................................................2-238
Figure 2-26. Buffered Period Measurement when No Source Edges Are
Present between Gate Edges...................................................................2-239
Figure 2-27. Buffered Semi-Period Measurement when No Source Edges Are
Present between Gate Edges...................................................................2-239
Figure 2-28. Buffered Semi-Period Measurement when No Source Edges Are
Present between Gate Edges...................................................................2-240
Figure 2-29. Buffered Pulse Width Measurement.......................................................2-241
Figure 2-30. Buffered Pulse Width when Gate Is High during Arming...................... 2-241
Figure 2-31. Buffered Two-Signal Edge Separation Measurement............................2-243
Figure 2-32. Mode 0 Timing Diagram ........................................................................2-252
Figure 2-33. Mode 1 Timing Diagram ........................................................................2-252
Figure 2-34. Mode 2 Timing Diagram ........................................................................2-252
Figure 2-35. Mode 3 Timing Diagram ........................................................................2-253
Figure 2-36. Mode 4 Timing Diagram ........................................................................2-253
Figure 2-37. Mode 5 Timing Diagram ........................................................................2-253

Tables

Table 1. MIO and AI Devices...............................................................................xvii
Table 1-1. Status Values...........................................................................................1-1
Table 1-2. Primary Type Names ..............................................................................1-2
Table 1-3. The LabWindows/CVI Function Tree for Data Acquisition .................. 1-6
NI-DAQ FRM for PC Compatibles x
©
National Instruments Corporation
Contents
Table 2-1. Parameter Settings for AI_Configure......................................................2-7
Table 2-2. Port 0 Digital I/O Lines Reserved...........................................................2-11
Table 2-3. Reglitching Parameters for Permissible Devices....................................2-28
Table 2-4. Voltage or Current Output Parameters....................................................2-29
Table 2-5. Parameter Values for FIFO Transfer Conditions....................................2-29
Table 2-6. Default Values for FIFO Transfer Condition..........................................2-30
Table 2-7. Parameter Setting Information for the Analog Filter .............................. 2-31
Table 2-8. Parameter Setting Information for the Digital Filter...............................2-31
Table 2-9. Parameter Setting Information for Output Enable..................................2-32
Table 2-10. Parameter Setting Information for Output Impedance............................2-32
Table 2-11. Parameter Setting Information for Output Attenuation...........................2-33
Table 2-12. Parameter Setting Information for Frequency Correction for
the Analog Filter......................................................................................2-34
Table 2-13. Parameter Setting Information for the Trigger Mode .............................2-35
Table 2-14. Parameter Setting Information for PLL Reference Frequency ...............2-35
Table 2-15. Parameter Setting Information for the SYNC Duty Cycle......................2-36
Table 2-16. Possible Calibrate_1200 Parameter Values.............................................2-51
Table 2-17. DAQEvent Messages ..............................................................................2-74
Table 2-18. Valid Counters and External Timing Signals for DAQEvent = 9...........2-78
Table 2-19. Usable Parameters for Different DAQ Events Codes............................. 2-79
Table 2-20. Legal Values for gpctrNum Parameter....................................................2-199
Table 2-21. Legal Values for paramValue when paramID = ND_SOURCE.............2-199
Table 2-22. Definition of Other Co unter for paramValue Set to
ND_OTHER_GPCTR_TC......................................................................2-200
Table 2-23. Default Source Selection for ND_SIMPLE_EVENT_CNT or
ND_BUFFERED_EVENT_CNT............................................................2-200
Table 2-24. Legal Values for paramValue when paramID = ND_GATE..................2-203
Table 2-25. Default Gate Selection............................................. ................................2-204
Table 2-26. Default Second Gate Selection...................................... ...... ....................2-205
Table 2-27. Legal Values for paramValue when
paramID = ND_INITIAL_COUNT........................................................2-206
Table 2-28. Legal Values for paramValue when paramID =
ND_COUNT_2, ND_COUNT_3, and ND_COUNT_4 .....................................2-206
ND_COUNT_1,
Table 2-29. Default Up/Down Selection ....................................................................2-207
Table 2-30. Legal Values for the action Parameter....................................................2-211
Table 2-31. Descriptions for application....................................................................2-216
Table 2-32. Terminal Count........................................................................................2-218
Table 2-33. SCXI Module Scan List ..........................................................................2-348
Table 2-34. MIO or AI Scan List................................................................................ 2-348
Table 2-35. Possible Values for signal....................................................................... 2-374
Table 2-36. Legal Parameters for the 6602 Devices...................................................2-385
Table 2-37. E Series Signal Name Equivalencies.......................................................2-387
Table 2-38. RTSI Bus Line and VXIbus Trigger Mapping........................................2-387
©
National Instruments Corporation xi NI-DAQ FRM for PC Compatibles
Contents
Table 2-39. Data Ranges for the Buffer Parameter for DAQArb 5411 Devices........ 2-426
Table 2-40. Mode Values for the Count Parameter for DAQArb 5411 Devices.......2-427
Table 2-41. Mode Values for the Iterations Parameter for
DAQArb 5411 Devices.................................... .................................. .....2-428
Table 2-42. Array Structures for DDS Mode.............................................................2-430
Table 2-43. Array Structures for ARB Mode.............................................................2-431
Table A-1. Status Code Summary.............................................................................A-1
Table B-1. Valid Analog Input Channel Settings .....................................................B-1
Table B-2. Valid Internal Analog Input Channels....................................................B-2
Table B-3. Internal Channel Purposes for Analog Input Devices.............................B-4
Table B-4. Valid Gain Settings.................................................................................B-5
Table B-5. The Values of maxReading and maxVolt............................................... B-6
Table C-1. MIO and AI Device Functions................................................................C-1
Table C-2. Lab/516/DAQCard-500/700 Functions ..................................................C-6
Table C-3. DSA Device Functions ...........................................................................C-9
Table C-4. Analog Output Family Functions............................................................C-11
Table C-5. Digital I/O Family Functions..................................................................C-12
Table C-6. Timing Device Functions........................................................................C-14
Table C-7. SCXI Functions.......................................................................................C-16
NI-DAQ FRM for PC Compatibles xii
©
National Instruments Corporation
The NI-DAQ Functi on Refe re nce M anu al f or PC Co mpat i ble s is f or users of the NI-DA Q s oftware for PC com patibles version 6.1 . NI-D A Q 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 bu s computers.
How to Use the NI-DAQ Manual Set
You should begin by reading the NI-DAQ User Manual for PC Compatibles. Chapter 1, Introduction to NI-DAQ, contains a f low chart that
illustrates the sequence of steps you sh ould take to learn about and get started with NI-DAQ software.
When you are familiar with the material in the NI-DAQ User Manual for
PC Compatibles, you can use the NI-DAQ Function Refer ence M anual for PC Compatibles, which contains detailed descriptions of the NI-DAQ
functions. You also can use the Windows help file contains all of the function reference material. Other documentation includes the DAQ Hardware Overview Guide ( Configuration Utility help file ( Wizard help file (
CHANWIZ.HLP).
NIDAQCFG.HLP
About
This
Manual
NIDAQPC.HLP, which
HWOG.PDF), the NI-DAQ
and the DAQ Channel
,
)

Organization of This Manual

The NI-DAQ Function Reference Manual for PC Compatibles is organized as follows:
Chapter 1, Using the NI-DAQ Functions, contains important information about how to apply the function descriptions in this manual to your programming language and environment.
Chapter2, Function Reference, contains a detailed explanation o f each NI-DAQ function. The functions are arranged alphabetically.
•AppendixA, Status Codes, lists the status codes returned by NI-DA Q, including the name and description.
©
National Instruments Corporation xiii NI-DAQ FRM for PC Compatibles
About This Manual
•AppendixB, Analog Input Channel, Gain Settings, and
Voltage Calculation, lists the valid channel and gain settings for DA Q
boards, describes how NI-DAQ calculates voltage, and describes the measurement of offset and gain adjustment.
•AppendixC, NI-DAQ Function Support, contains tables that show which DAQ hardware each NI-DAQ function call supports.
•AppendixD, Customer Communication, contains forms you can use to request help from Nati onal Instruments o r to comment on our products and manuals.
•The Glossary contains an alphabetical list and description of terms used in this manual, including abbreviations, acronyms, metric prefixes, mnemonics, and symbols.
•The Index contains an alphabetical list of key terms and topics in this manual, including the page where you can find each one.

Conventions Used in This Manual

The following conventions are used in this manual. This icon to the left of bold italicized text denotes a note, which alerts you
to important information.
!
1102/B/C modules Refers to the SCXI-1102, SCXI-1102B, and SCXI-1102C modules and
12-bit device These MIO and AI d evice s are listed in T able 1. 16-bit device These MIO and AI d evice s are listed in T able 1. 445X device Refers to the PCI-4 451 a nd PCI-44 52. 455X device Refers to the PCI-4 551 a nd PCI-45 52. 516 device Refers to the DAQCard-516 and PC-516. 611X device Refers to the PCI-6110E and PCI-6111E. 6602 device Refers to the PCI-6 602 a nd PXI- 6602 . AI device These analog input devices are listed in Table 1.
NI-DAQ FRM for PC Compatibles xiv
This icon to the left of bold italicized text denotes a caution, which advises you of precautions to take to avoid injury, data loss, or a system crash.
the VXI-SC-1102, VX I-S C-1 102B, an d V XI- SC-1 102C su bm odules .
©
National Instruments Corporation
About This Manual
Am9513-based de vice These dev ice s a re the A T-MI O-16 , AT -MIO - 16F-5, A T-MI O -16X,
AT-MIO-16D, and AT-MIO-64F-5.
bold Bold text denotes the names of menus, menu items, paramete rs, 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. DAQMeter 4350 Refers to the PC-4350, DAQCard-4350, and DAQPad-4350. DIO 6533 Refers to the AT-DIO- 32HS, PCI-D IO-3 2HS, D AQCa rd-6 533, a nd
PXI-6533. DIO-24 Refers to the PC -D IO -24, P C- DIO -24 PnP, a nd DAQC ard -D IO- 24. DIO-32F Refers to the AT-DIO-32F. DIO-96 Refers to the PC -D IO-9 6, PC -DI O -96 PnP, P CI -DIO -9 6,
DAQPad-6507, DA QP ad-6 508 , an d PXI -65 08. DIO device Refers to any DIO-24, DIO-32, DIO-6533, or DIO-96. DSA device Refers to the PC I-4451 , PCI- 445 2, PCI -45 51, a nd PCI-45 52. E Series device These are MIO and AI devices. Refer to Table 1 for a complete list of
these devices. italic Italic text denotes emphasis, a cross reference, or an introduction to
a key concept. This font a lso denotes text fo r which you supply the
appropriate word or value, such as in NI-DAQ 5.x. Lab and 1200 analog Refers to the DAQCard-1200, DAQPad-1 200, La b-PC+, Lab-PC-1200,
output device PCI-1200, and SCXI-1200. Lab and 1200 device Refers to the DAQCard-1200, DAQPad-1200, Lab-PC+, Lab-PC-1200,
Lab-PC-1200AI, PCI-1200, a nd SCXI-1200 . LPM device Refers to the PC-L P M-16 an d PC -LP M-16P n P. MIO device Refe rs to multifunction I/O devices. See Table 1 for a list of these
devices.
©
National Instruments Corporation xv NI-DAQ FRM for PC Compatibles
About This Manual
MIO-F-5/16X d ev ice Refers to the A T-M IO - 16F- 5, AT- MI O-16 X, a nd the AT -M IO -64F -5 . MIO-16/16D d ev ice Refers to the A T -MIO - 16 an d AT -M IO- 16D . MIO-16XE-50 d evi ce Refers to the A T-M IO -16X E -50, DA QP ad-M IO- 16X E-50 , an d
NEC-MIO-16XE-5 0, a nd PCI- MIO -16 XE-5 0.
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-M IO-64X E-10.
monospace Text in this font denotes text or characters that you should literally enter
from the keyboard, sections of co de, pro gramming ex ample s, and syntax examples. This fo nt a lso is used for the pro per n am es of d isk drives, paths, directories, programs, subprogram s, subroutines, device names, functions, operations, variables, filenames, and extensions, and for statements and c omm en ts take n from p rogra m code .
monospace italic
Italic text in this font denotes th at you mu st su pply the appr opriate words or values in the place of these items.
NI-DAQ Refers to the NI-DA Q softwa re for PC co mpat ible s, unless other wi se
noted. PC Refers to the IBM PC/XT, IBM PC AT, and compatible computers. PCI Series Refers to the National Instrum ents p rod ucts that use the
high-performance expan sion bus architec ture origin ally develope d
by Intel to replace ISA and EISA. Remote SCXI Refers to an SCXI configuration where either an SCXI-2000 chassis or
an SCXI-2400 remote commu nications module is connected to the PC
serial port. SCXI-1102/B/C SCXI-1102/B/C refers to the SCX I-11 02, SCX I-11 02B , an d
SCXI-1102C devices. SCXI-1120/D SCXI-1120/D refers to the SCXI-112 0 and SCXI-11 20D. SCXI analog i np ut Refers to t he S C XI -1 100, SC X I-1102 , S CXI-1 120 , S CXI-1 120 D,
module SCXI-1121, SCXI-1122, SCXI- 1140, and SCX I-1141 . SCXI chassis Refers to the SCXI-1000, SCXI-1000DC, SCXI-1001, and SCXI-2000. SCXI digital modul e Refers to the SCXI -1160 , SCXI-1 161, S CXI-1 162, SCX I-1162 HV,
SCXI-1163, and SCXI-1163 R.
NI-DAQ FRM for PC Compatibles xvi
©
National Instruments Corporation
About This Manual
Simultaneous sampling Refers to the PCI-6110E, PCI-6111E, PCI-4451, PCI-4452, PCI-4551, device 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- 110 2B, a nd V XI-SC -11 02C.

MIO and AI Device Terminology

This manual uses generic terms to describe groups of devices whenever possible. The generic terms for the MIO and AI devices are based on the number of bits, the platform, the functionality, and the series name of the devices. Table 1 lists each MIO and AI device and the possible classifications for each.
Table 1.
Number
of SE
Device
AT-AI-16XE-10 16 16-bit AT AI E Series AT-MIO-16 16 12-bit AT MIO Am9513-based AT-MIO-16D 16 12-bit AT MIO Am9513-based AT-MIO-16DE-10 16 12-bit AT MIO E Series AT-MIO-16E-1 16 12-bit AT MIO E Series AT-MIO-16E-2 16 12-bit AT MIO E Series AT-MIO-16E-10 16 12-bit AT MIO E Series AT-MIO-16F-5 16 12-bit AT MIO Am9513-based AT-MIO-16X 16 16-bit AT MIO Am9513-based AT-MIO-16XE-10 16 16-bit AT MIO E Series AT-MIO-16XE-50 16 16-bit AT MIO E Series AT-MIO-64E-3 64 12-bit AT MIO E Series AT-MIO-64F-5 64 12-bit AT MIO Am9513-based DAQCard-AI-16E-4 16 12-bit PCMCIA AI E Series
Channels
MIO and AI Devices
Bit Type Functionality Series
DAQCard-AI-16XE-50 16 16-bit PCMCIA AI E Series DAQPad-MIO-16XE-50 16 16-bit Parallel Port MIO E Series DAQPad-6020E 16 12-bit USB MIO E Series NEC-AI-16E-4 16 12-bit NEC AI E Series
©
National Instruments Corporation xvii NI-DAQ FRM for PC Compatibles
About This Manual
Table 1. MIO and AI Devices (Continued)
Number
Device
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-1 0) 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
of SE
Channels
Bit Type Functionality Series
PCI-6110E 4 diff.
only
PCI-6111E 2 diff.
only PCI-MIO-16E-1 16 12-bit PCI MIO E Series PCI-MIO-16E-4 16 12-bit PCI MIO E Series PCI-MIO-16XE-10 16 16-bit PCI MIO E Series PCI-MIO-16XE-50 16 16-bit PCI MIO E Series PXI-6011E 16 16-bit PXI MIO E Series PXI-6030E 16 16-bit PXI MIO E Series PXI-6040E 16 12-bit PXI MIO E Series PXI-6070E 16 12-bit PXI MIO E Series VXI-MIO-64E-1 64 12-bit VXI MIO E Series VXI-MIO-64XE-10 64 16-bit VXI MIO E Series
12-bit AI 16-bit AO
12-bit AI 16-bit AO
PCI MIO E Series
PCI MIO E Series
NI-DAQ FRM for PC Compatibles xviii
©
National Instruments Corporation
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 y ou are using SCXI, read these manuals next for detailed information about signal connections and module configuration. They also explain in greater detail how the module works and contain application hints.
Your DAQ hardware user manuals—These manuals have detailed information about the DAQ hardware that plugs into or is connected to your computer. Use these manuals for hardware installation and configuratio n i ns truct i on s, speci fication informati o n abo ut you r DAQ hardware, and application hint s .
Software documentation—Examples of software documentation you might have are the ComponentWorks, LabVIEW and LabWindows/CVI, VirtualBench, and NI-DAQ documentation. After you have set up your hardware system, use either the application software or the NI-D AQ do cuments to help you write your application. If you have a large and complicated system, it is worthwhile to look through the software manuals before you configure your hardware.
Accessory installation guides or manuals—If you are using accessory products, read the terminal block and cable assembly installation guides or accessory board user manuals. They explain how to physically connect the relevant pieces of the system. Consult these guides when you are making your connections.
SCXI Ch assis User Ma nual—If you are us ing SCXI, read this manual for maintenance information on the chassis an d installation instructions.
©
National Instruments Corporation xix NI-DAQ FRM for PC Compatibles
About This Manual

Related Documentation

The following documen ts contai n i nfo rmati on yo u may find useful as you read this manual:
For detailed hardware information, refer to the user manual included with each board. The following manuals are available from National Instruments:
Microsoft Visual C++ User Guide to Programming
Ome ga Temperature Handbook
NIST Monograph 125, Thermocouple Reference Tables

Customer Communication

National Instruments wants to receive your comments on our products and manuals. We are interested in the applications you develop with our products, and we want to help if you have problems with them. To make it easy for you to contact us, this manual contains comment and configuration forms for you to complete. These forms are in Appendix D, Custome r Communication, at the end of this manual.
NI-DAQ FRM for PC Compatibles xx
©
National Instruments Corporation
Chapter
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.
1
Status Codes, Device Numbers, and SCXI Chassis IDs
Every NI-DAQ function is of the following form:
status
=
Function_Name (parameter 1, parameter 2, … parameter n)
where n 0. Each function returns a value in the indicates the success or failure of the function, as shown in Table 1-1.
Table 1-1.
Status Result
Status Values
status
variable that
Negative Function did not execute because of an error Zero Function completed successfully Positive Fu nction executed but with a potentially serious
side effect
Note
©
National Instruments Corporation 1-1 NI-DAQ FRM for PC Compatibles
In all applications, contains a list of
In the parameter tables that follow the status codes, the first parameter to almost ev ery NI-DA Q functi on is the device n umber of the D AQ d evice you want NI-DAQ to use for the given operation. After you have followed the installation and configuration instructions in the NI-D A Q release notes and Chapter 1, Introduction to NI-DAQ, of the NI-DAQ User Manual for PC Compatibles, you can use the NI-DAQ Configuration Utility to determine the device number for each de vice you ha ve installed in the system.You can
status
status
is always a 16-bit integer. Appendix A,
codes.
Status Codes
,
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. The slots in the SCXI chassis are numbered from left to rig ht, beginning wi th slot 1. The controlle r on the left side of the chassis is referred to as Slot 0. Y ou can use the configuration utility to verify your chassis IDs and your module slot numbers.

Variable Data Types

The NI-DAQ API is identical in Windows 95 and Windows NT. Every function description has a parameter table that lists the data types in each of the environments. LabWindows/CVI uses the same types as Windows. The following sections describe the notation used in those parameter tables and throughout the manual for variable data types.

Primary Types

Table 1 -2 shows the primary type names and their ranges.
Type
Name
u8 8-bit ASCII
i16 16-bit signed
Description Range
0 to 255
character
–32,768 to 32,767
integer
Table 1-2.
Primary Type Names
C/C++ Visual BA SIC
char
short Integer
Not supported by BASIC. For functions that require ch arac ter arrays, use string types instead. See the STR description.
(for example:
deviceNum%
Type
Pascal (Borland
Delphi)
Byte
SmallInt
)
NI-DAQ FRM for PC Compatibles 1-2
©
National Instruments Corporation
Chapter 1 Using the NI-DAQ Functions
Type
Name
u16 16-bit uns igned
i32 32-bit signed
u32 32-bit uns igned
f32 32-bit
f64 64-bit
STR BASIC or
Description Range
integer
integer
integer
single-precision floating point
double-precisio n floating point
Pascal characte r string
Table 1-2.
0 to 65,535
–2,147,483,648 to 2,147,483,647
0 to 4,294,967,295
–3.402823 x 1038 to
3.402823 x 10
–1.797683134 862 31 5
30
8
×
10
to
1.797683134862315
308
×
10
Primary Type Names (Continued)
38
C/C++ Visual BASIC
unsigned short for 32-bit compilers
long Long
unsigned long
float Single
double Double
Use character array terminat ed by the null character
\0
Not supported by BASIC. For functions that require unsigned integers, use the signed integer type instead. See the i16 description.
(for example:
count&
Not supported by BASIC. For functions that require unsigned long integers, us e the signed long integer type instead. See th e i32 description.
example:
example:
voltage#
String
example:
filename$
Type
)
(for
num!
(for
(for
Pascal (Borland
Delphi)
Word
LongInt
Cardinal
32-bit operating systems). Refer to the i32 description.
Single
)
Double
)
String
)
(in

Arrays

When a primary type is inside square brackets (for example, [i16]) an array of the type named is required for that parameter.

Multiple Types

Some parameters can be in multiple types. Combinations of the primary types separated by commas denote parameters with th is ability, as in the following example:
[i16], [f32]
©
National Instruments Corporation 1-3 NI-DAQ FRM for PC Compatibles
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.
Note
Be sure to include the NI-DAQ function prototype files by including the appropriate NI-DAQ header file in your source code.

Borland Delphi

When you pass arrays to NI-DAQ functions using Borland Delphi in Windows, you need to pass a pointer to the array. You can either declare an array and pass the array address to the NI-DAQ function, or you can declare a pointer, dynamically allocate memory for the pointer, and pass the pointer directly to the NI-DAQ function. For example,
var
buffer : array [1..1000] of Integer; bufPtr : ^Integer;
status := DAQ_Start (device, chan, gain, @buffer, count, timebase, sampInterval);
or
(* allocate memory for bufPtr first using AllocMem or New *)
status := DAQ_Start (device, chan, gain, bufPtr, count, timebase, sampInterval);

Visual Basic for Windows

When you pass arrays to NI-DAQ functions using Visual Basic for Windows, you need to pass the first element of the array by referen ce. For example, you would call the syntax:
status% = DAQ_Start (device%, chan%, gain%, buffer%(0), count&, timebase%, sampInterval%)
DAQ_Start
function using the following
NI-DAQ FRM for PC Compatibles 1-4
©
National Instruments Corporation
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 constan ts def i ned in this file in any module in your program.
T o add the
NIDAQCNS.INC file for your pr oject in V isual Ba sic 3.0 and 4.0,
go to the File menu and select the Add File... option. Select
NIDAQCNS.INC, which is the Include subdirectory of NI-DAQ
subdirectory. Then, select Open to add the file to the project. To add the
NIDAQCNS.INC file to your project in Visual Basic 5.0, go to
the Project menu and select Add Module. Click on the Existing tab page.
NIDAQCNS.INC, which is the Include subdirectory of your
Select NI-DAQ directory. Then, select Open to add the file to the project.
This procedure is identical to the procedure you would follow wh en loading the Visual Basic f ile
CONSTANT.TXT. Search on the word CONSTANT for
more information from the V isual Basic on-line help. Alternatively , you can cut and paste individual lines from this file and place them in the module where you need them. Ho wever , if you do so, yo u shoul d remo v e the w or d Global from the CONSTANTS definition.
For example,
GLOBAL CONST ND_DATA_XFER_MODE_AI& = 14000
would become:
CONST ND_DATA_XFER_MODE_AI& = 14000
NI-DAQ for LabWindows/CVI
Inside the LabWindows/CVI environment, the NI-DAQ functions appear in the Data Acquisition function panels under the Libraries menu. Each function panel represents an NI-DAQ function, which is displayed at the bottom of the panel. The function panels have help text for each function and each parameter; however, if you n eed ad ditional inf ormatio n, y ou can look up the appropriate NI-DAQ function alphabetically in Chapter 2,
Function Reference of this manual.
©
National Instruments Corporation 1-5 NI-DAQ FRM for PC Compatibles
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.
LabWindows/CVI Function Panel NI-DAQ Function
Data Acquisition
Initialization/Utilities
Initialize Board Configure Timeout Get Device Information Set Device Information Align DMA Buffer Get DAQ Library Version Select E-Series Signals Config Analog Trigger Change Line Attribute
Board Config & Calibrate
Configure MIO Boards Configure AMUX Boards
The LabWindows/CVI Function Tree for Data Acquisition
Init_DA_Brds
Timeout_Config
Get_DAQ_Device_Info
Set_DAQ_Device_Info
Align_DMA_Buffer
Get_NI_DAQ_Version
Select_Signal
Configure_HW_Analog_Trigger
Line_Change_Attribute
MIO_Config
AI_Mux_Config
Configure SC-2040 Calibrate MIO Boards Calibrate E Series Calibrate LPM-16 Calibrate Analog Output Calibrate 1200 Devices Calibrate DSA Devices
NI-DAQ FRM for PC Compatibles 1-6
SC_2040_Config
MIO_Calibrate
Calibrate_E_Series
LPM16_Calibrate
AO_Calibrate
Calibrate_1200
Calibrate_DSA
©
National Instruments Corporation
Chapter 1 Using the NI-DAQ Functions
LabWindows/CVI Function Panel NI-DAQ Function
Analog Input
Single Point
Change Analog Input Parameter Measure Voltage Clear Analog Input Read Analog Binary Scale Binary to Voltage Setup Analog Input Check Analog Input Configure Analog Input
Multiple Point
Acquire Single Channel Scan Multiple Channels Scan Lab Channels
Table 1-3.
The LabWindows/CVI Function Tree for Data Acquisition (Continued)
AI_Change_Parameter
AI_VRead
AI_Clear
AI_Read
AI_VScale
AI_Setup
AI_Check
AI_Configure
DAQ_Op
SCAN_Op
Lab_ISCAN_Op
Single Scan Binary Single Scan Voltage Single Channel to Disk Multiple Chan to Disk Scan Lab Chan to Disk
AI_Read_Scan
AI_VRead_Scan
DAQ_to_Disk
SCAN_to_Disk
Lab_ISCAN_to_Disk
Low-Level Functions
Convert DAQ Rate Start DAQ Setup Scan Setup Sequence of Scans Retrieve Scan Sequence
©
National Instruments Corporation 1-7 NI-DAQ FRM for PC Compatibles
DAQ_Rate
DAQ_Start
SCAN_Setup
SCAN_Sequence_Setup
SCAN_Sequence_Retrieve
Chapter 1 Using the NI-DAQ Functions
Table 1-3.
The LabWindows/CVI Function Tree for Data Acquisition (Continued)
LabWindows/CVI Function Panel NI-DAQ Function
Start Scan Check DAQ or Scan Assign Rate to DAQ Group Monitor DAQ or Scan Start Lab Scan Check Lab Scan Clear DAQ or Scan Scale DAQ or Scan Reorder Scan Data Reorder Scan Seq Data Configure DAQ Config DAQ Pretrigger Config Double Buffering Is Half Buffer Read y?
SCAN_Start
DAQ_Check
DAQ_Set_Clock
DAQ_Monitor
Lab_ISCAN_Start
Lab_ISCAN_Check
DAQ_Clear
DAQ_VScale
SCAN_Demux
SCAN_Sequence_Demux
DAQ_Config
DAQ_StopTrigger_Config
DAQ_DB_Config
DAQ_DB_HalfReady
Half Buffer to Array
Analog Output
Single Point
Generate Voltage Scale Voltage to Binary Write Analog Binary Update Analog DACs Configure Analog Output Change Analog Output Parameter
NI-DAQ FRM for PC Compatibles 1-8
DAQ_DB_Transfer
AO_VWrite
AO_VScale
AO_Write
AO_Update
AO_Configure
AO_Change_Parameter
©
National Instruments Corporation
Chapter 1 Using the NI-DAQ Functions
Table 1-3.
The LabWindows/CVI Function Tree for Data Acquisition (Continued)
LabWindows/CVI Function Panel NI-DAQ Function
Waveform Generation
Generate WFM from Array Generate WFM from Disk
WFM_Op
WFM_from_Disk
Low-Level Functions
Scale Waveform Buffer Convert Waveform Rate Assign Waveform Group Load Waveform Buffer Assign Rate to WFM Group Control Waveform Group Pause/Resume WF M Cha nnel Check Waveform Channel Enable Double Buffering Is Half Buffer Read y?
WFM_Scale
WFM_Rate
WFM_Group_Setup
WFM_Load
WFM_ClockRate, WFM_Set_Clock
WFM_Group_Control
WFM_Chan_Control
WFM_Check
WFM_DB_Config
WFM_DB_HalfReady
Copy Array to WFM Buffer
WFM_DB_Transfer
Digital Input/Output
Configure Port Configure Line Read Port Read Line Write Port Write Line Get Port Status Configure Trigger
©
National Instruments Corporation 1-9 NI-DAQ FRM for PC Compatibles
DIG_Prt_Config
DIG_Line_Config
DIG_In_Port
DIG_In_Line
DIG_Out_Port
DIG_Out_Line
DIG_Prt_Status
DIG_Trigger_Config
Chapter 1 Using the NI-DAQ Functions
Table 1-3.
The LabWindows/CVI Function Tree for Data Acquisition (Continued)
LabWindows/CVI Function Panel NI-DAQ Function
Group Mode
Configure Group Read Group Write Group Get Group Status Set Group Mode
DIG_Grp_Config
DIG_In_Grp
DIG_Out_Grp
DIG_Grp_Status
DIG_Grp_Mode
Block Transfer
Read Block Write Block Check Block Clear Block Set Up Pattern Generation Set Up Digital Scanning Enable Double Buffering
DIG_Block_In
DIG_Block_Out
DIG_Block_Check
DIG_Block_Clear
DIG_Block_PG_Config
DIG_SCAN_Setup
DIG_DB_Config
Is Half Buffer Read y? Transfer To/From Array
SCXI
Load SCXI Configuration Change Configuration Get Chassis Config Info Get Module Config Info Read Module ID Register Reset SCXI Set Up Single AI Channel Set Up Muxed Scanning
NI-DAQ FRM for PC Compatibles 1-10
DIG_DB_HalfReady
DIG_DB_Transfer
SCXI_Load_Config
SCXI_Set_Config
SCXI_Get_Chassis_Info
SCXI_Get_Module_Info
SCXI_ModuleID_Read
SCXI_Reset
SCXI_Single_Chan_Setup
SCXI_SCAN_Setup
©
National Instruments Corporation
Chapter 1 Using the NI-DAQ Functions
Table 1-3.
The LabWindows/CVI Function Tree for Data Acquisition (Continued)
LabWindows/CVI Function Panel NI-DAQ Function
Set Up Mux Counter Set Up Track/Hold Control Track/Hold State Select Gain Configure Filter Select Scanning Mode Change AI Channel Scale SCXI Data Write to AO Channel Set Digital or Relay State Get Digital or Relay State Get Status Register Set Up Calibration Mode Change Cal Constants
SCXI_MuxCtr_Setup
SCXI_Track_Hold_Setup
SCXI_Track_Hold_Control
SCXI_Set_Gain
SCXI_Configure_Filter
SCXI_Set_Input_Mode
SCXI_Change_Chan
SCXI_Scale
SCXI_AO_Write
SCXI_Set_State
SCXI_Get_State
SCXI_Get_Status
SCXI_Calibrate_Setup
SCXI_Cal_Constants
Set Threshold Values
SCXI_Set_Threshold
Counter/Timer
DAQ-STC Counters (GPCTR)
Select Ctr Application Change Ctr Parameter Configure Ctr Buffer Control Ctr Operation Monitor Ctr Properties
GPCTR_Set_Application
GPCTR_Change_Parameter
GPCTR_Config_Buffer
GPCTR_Control
GPCTR_Watch
Am9513 Counters (CTR)
Configure Counter Count Events
©
National Instruments Corporation 1-11 NI-DAQ FRM for PC Compatibles
CTR_Config
CTR_EvCount
Chapter 1 Using the NI-DAQ Functions
Table 1-3.
The LabWindows/CVI Function Tree for Data Acquisition (Continued)
LabWindows/CVI Function Panel NI-DAQ Function
Count Periods Read Counter Stop Counter Restart Counter Reset Counter Get Counter Output State Convert CTR Rate Generate Pulse Generate Square Wave Generate Freq OUT Signal Operate Multi Counters
CTR_Period
CTR_EvRead
CTR_Stop
CTR_Restart
CTR_Reset
CTR_State
CTR_Rate
CTR_Pulse
CTR_Square
CTR_FOUT_Config
CTR_Simul_Op
8253 Counters (ICTR)
Setup Interval Counter Read Interval Counter
ICTR_Setup
ICTR_Read
Reset Interval Counter
RTSI Bus
Connect RTSI Disconnect RTSI Clear RTSI Clock RTSI
Event Messagi n g
Config Alarm Deadband Config Analog Trigger Event Config Event Message
NI-DAQ FRM for PC Compatibles 1-12
ICTR_Reset
RTSI_Conn
RTSI_DisConn
RTSI_Clear
RTSI_Clock
Config_Alarm_Deadband
Config_ATrig_Event_Message
Config_DAQ_Event_Message
©
National Instruments Corporation
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-DA Q 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.
Single Point is a class of Analog Input functions that perform A/D conversions of a single sample.
Multiple Point is a class of functions that perform clocked, buffered multiple A/D conversions typically used to capture waveforms. This class includes high-level functions and a Low-Level Functions subclass. The high-level functions are synchronous; that is, your application is blocked while these functions are performing the requested number of A/D conversions. The low-level functions are asynchronous; that is, your application continues to run while the board performs A/D conversions in the background. The low-level functions al so in cl ude th e doubl e- buffered functions.
The Analog Output class contains all the classes of functions that perform D/A conversions.
Single Point is a class of Analog Output functions that perfo rm single D/A conversions.
Waveform Generation is a class of functions that perform buffered analog output. The W avefo rm Generation functions generate wav eforms from data contained in an array or a disk file. The Low-Level Functions subclass provides a finer level of control in generating multiple D/A conversions.
Digital Input/Output is a class of functions that perform digital input and output operations. It also contains two subclasses. Group Mode is a subclass of the Digital Input/Output class that contains functions for handshaked digital input and output operations. Block Transfer is a subclass of the Group Mode class that contains functions for handshaked or clocked, buffered or double-buffered digital input and output operations.
SCXI is a class of functions used to configure the SCXI line of signal conditioning products.
©
National Instruments Corporation 1-13 NI-DAQ FRM for PC Compatibles
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 t he Am9513-bas ed devi ces, and the PC-TIO-10. 8253 Counters (ICTR) is a subclass of Counter/Timer that contains functions that perform counting and timing operations for the DAQCard-500/700 and 516, Lab and 1200 series, and LPM devices.
RTSI Bus is a class of function panels that connect control signals to the RTSI bus and to other boards.
The DAQ Event Messages class contains functions that set up conditions for sending messages to your application when certain events occur.
NI-DAQ FRM for PC Compatibles 1-14
©
National Instruments Corporation
Chapter
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.
Input
Name Type Description
deviceNumber
i16 assigned by configuration utility
2
channel
paramID paramVal ue
i16 number of channel you want to config ure; use –1
to indicate all channels u32 identification of the parameter you want to change u32 new value for the parameter specified by
paramID
Parameter Discussion
Legal ranges for header file. The header file you should use depends on the language you are using:
C programmers—
BASIC programmers—
Note
©
National Instruments Corporation 2-1 NI-DAQ FRM for PC Compatibles
Visual Basic for Windows programmers should refer to the Visual Basic f or Windows topic for more information.
paramID
NIDAQCNS.H (DATAACQ.H for LabWindows/CVI)
paramValue
and
NIDAQCNS.INC
are given in terms of constants defined in a
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
the PFI_0 line for the analog trigger.
Legal values for paramValue depend on par am ID . The following paragraph list features you can configure al ong with le gal v alues for paramID with explanat ions and corresp onding legal values for paramValue.
Channel Coupling
Some analog input devices have programmable AC/DC coupling for the analog input channels. To change the coupling parameter, set paramID to
Coupling Parameters
Device Type
PCI-6110E Yes ND_AC and ND_DC PCI-6111E Yes ND_AC and ND_DC PCI-445X Yes ND_AC and ND_DC PCI-455X Yes ND_AC and
Using This Function
You can customize the behavior of the analog input section of your device by using this function. Call this function before calling NI-DAQ functions that cause input on the analog input channels. You can call this function as often as needed.
Per Channel
Selection
Possible
ND_PFI_0
Legal Range for
paramValue
for channel when setting coupling of
ND_AI_COUPLING.
Default Setting
ND_DC
ND_DC
ND_AC
ND_DC
ND_AC
NI-DAQ FRM for PC Compatibles 2-2
©
National Instruments Corporation
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 read ing if one is av ailable.
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
Select_Signal function; see DAQ_Config for information on enabling external
the conversions.
Parameters
Input
Name Type Description
deviceNumber i16 assigned by configuration utility
Output
Name Type Description readingAvailable i16 whether a reading is available reading i16 integer result
Parameter Discussion
readingAvailable represents the status of the analog input circuitry.
1: NI-DAQ returns an A/D conversion result in reading. 0: No A/D conversion result is available.
reading is the integer in which NI-DAQ returns the 12-bit result of an A/D conversion. If the device is configured for unipolar operation, reading ranges from 0 to 4,095. If the device is configured for bipolar operation, reading ranges from –2,048 to +2,047. For devices with 16-bit ADCs, reading ranges from 0 to 65,535 i n unipol ar operatio n, and –32,76 8 to +32,767 in bipolar operation.
Note
©
National Instruments Corporation 2-3 NI-DAQ FRM for PC Compatibles
C Programmers—r eadingAvailable and reading are pass-by-reference parameters.
Chapter 2 Function Reference — AI_Check
Using This Function
AI_Check checks the status of the analog inpu t circuitry. If the device has performed an A/D
conversion, Otherwise,
AI_Setup, in conjunction with AI_Check and AI_Clear, is useful for externally timed A/D
conversions. Before you call of any previous conversion results. The device then performs a conversion each time the device receiv es a pulse at the appropriate p in. You can call available conversion results.
AI_Check returns read ing Av ailabl e = 1 and the A/D conversion result.
AI_Check returns readingAvailable = 0.
AI_Setup, you can call AI_Clear to clear out the A/D FIFO
AI_Check to check for and return
Note
You cannot use this function if you have an SC-2040 connected to your DAQ device.
NI-DAQ FRM for PC Compatibles 2-4
©
National Instruments Corporation

AI_Clear

Format
status = AI_Clear (deviceNumber)
Purpose
Clears the analog input circuitry and empties the FIFO memory.
Parameters
Input
Name Type Description deviceNumber i16 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. Call AI_Clear before AI_Setup to
clear out the A/D FIFO memory before any series of externally triggered con ver sions be gins.
Chapter 2 Function Reference — AI_Clear
©
National Instruments Corporation 2-5 NI-DAQ FRM for PC Compatibles
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. For devices that have no jumpers for analog input configuration, this function programs the device for the settings you want.
Parameters
Input
Name Type Description deviceNumber i16 assigned by configuration utility chan i16 channel to be configured inputMode i16 indicates whether channels are configured for
single-ended or differential operation
inputRange i16 voltage range of the analog input channels polarity i16 indicates whether the ADC is configured for
driveAIS i16 indicates whether to drive AISENSE to onboard
Parameter Discussion
chan is the analog input channel to be configured. Except for the E Series devices, the AT-MIO-64F-5, and the A T-MI O-16X, you must se t chan to –1 because the same analog input configuration applies to all of the channels. For the E Series devices, AT-MIO-64F-5, and A T-M IO-16X, chan specifies the channel to be con figured. If you want all of the channels to be configured identically, set chan to –1.
Range: See Table B-1 in Appendix B, Analog Input Channel, Gain Settings, and
Voltage Calculation.
inputMode indicates whether the analog input channels are configured for single-ended or differential operation:
0: Differential (DIFF) configuration (default).
NI-DAQ FRM for PC Compatibles 2-6
unipolar or bipolar operation
ground
©
National Instruments Corporation
Chapter 2 Function Reference — AI_Configure
1: 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).
2: Nonreferenced Single-Ended (NRSE) configuration (used when the input signal
has its own ground reference. The ground reference for the input signal is connected to AISENSE, which is tied to the negative input of the instrumentation amplifier).
inputRange is the voltage range of the analog input channels. polarity indicates whether the ADC is configured for unipolar or bipolar operation:
0: Bipolar operation (default value). 1: Unipolar operation.
T able 2-1 shows all possible settings for inputMode, inputRange, a nd pola rity. inputMode is independent of inputRange and polarity. In this table, italic text denotes default settings.
Table 2-1.
Parameter Settings for
AI_Configure
Analog Input Range
Resulting
Device
AT-MIO-64F-5, AT-MIO-16F-5, 12-bit E Series
AT-MIO-16X, 16-bit E Series, PCI-6110E,
Possible
Values for
inputMode
inputRange polarity
0, 1, 2 ignored unipolar 0 to +10 V Yes
ignored bipolar –5 to +5 V
0, 1, 2 ignored unipolar 0 to +10 V Yes
ignored bipolar –10 to +10 V
Analog
Input
Range
Software
Configurable
PCI-6111E MIO-16 and
AT-MIO-16D
0, 1, 2 10 unipolar 0 to +10 V No
10 bipolar –5 to +5 V 20 bipolar –10 to +10 V
Lab-PC+ 0, 1, 2 ignored unipolar 0 to +10 V No
ignored bipolar –5 to +5 V
1200 and 1200AI Devices
0, 1, 2 ignored unipolar 0 to +10 V Yes
ignored bipolar –5 to +5 V
©
National Instruments Corporation 2-7 NI-DAQ FRM for PC Compatibles
Chapter 2 Function Reference — AI_Configure
Table 2-1.
Parameter Settings for
AI_Configure
(Continued)
Analog Input Range
Resulting
Device
LPM Devices (RSE inputMode only)
Possible
Values for
inputMode
inputRange polarity
ignored 5 unipolar 0 to +5 V No
5 bipolar –2.5 to +2.5
Analog
Input
Range
V 10 unipolar 0 to +10 V 10 bipolar –5 to +5 V
516 Devices,
1 10 bipolar –5 to 5 V N/A
DAQCard-500 DAQCard-700 0, 1 5 bipolar –2.5 to +2.5
V 10 bipolar –5 to +5 V 20 bipolar –10 to +10 V
Software
Configurable
(PC-LPM-16)
Yes
(PC-LPM-16PnP)
Yes
Note If a device is software configurable, the inputMode, inputRange, and polarity
parameters are used to program the device for the configuration you want. If a device is not software configurable, this function uses these parameters to inform NI-DA Q of the device configuration, which you must set using hardware jumpers. If your device is software configurable and you have changed the analog input settings through the NI-DAQ Configuration Utility, you do not have to use
AI_Configure, although it is good practice to do so in case you inad vertently
change the configuration file maintained by the NI-DAQ Configuration Utility.
driveAIS, for the A T-MIO-64 F-5 and AT-MIO-16X, indicates whether to driv e AISENSE to onboard ground or not. This parameter is ignored for all other devices.
0: Do not drive AISENSE to ground. 1: Drive AISENSE to ground.
Notice that if you have configured any of the input channels in nonreferenced single-ended (NRSE) mode, this function returns a warning, inputModeConflict (18), if you se t driveAIS to 1. When NI-D A Q reads a ch annel in NRSE mode, the d evice uses AISENSE as an input to the negative input of the amplifier, regardless of the driveAIS setting. When NI-DAQ reads a channel in differen tial or referenced single-ended (RSE) mode, the de vice dri v es AISENSE to onboard ground if driveAIS is 1.
©
NI-DAQ FRM for PC Compatibles 2-8
National Instruments Corporation
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. On the AT-MIO-16X, 16-bit E Series, AT-MIO-16F-5, and AT-MIO-64F-5 devices, the calibration constants used for analog input change depending on the polarity of the analog input channels. NI-DAQ always ensures that the calibration constants in use match the current polarity of the channels.
Chapter 2 Function Reference — AI_Configure
See the
Calibrate_E_Series function description for information about calibration
constant loading on the E Series devices. If you change the polarity on AT-MIO-16X, AT-MIO-64F, and AT-MIO-16F-5 by calling
AI_Configure, NI-DAQ uses the following guidelin e s to en sure that appropriate co ns tan t s
are loaded automatically:
AT-MIO-16X—NI-DA Q checks if the load area con tains the appropriate constants. If so, NI-DAQ will load the constants from the load area. Otherwise, NI-DAQ will load the constants from the factory area for the current polarity and return status code calConstPolarityConflictError.
AT-MIO-64F-5—This device has separate caldacs for unipolar and bipolar input. Therefore, NI-DAQ does not need to reload calibration constants.
AT-MIO-16F-5—The load area on this device contains constants for both unipolar and bipolar input. Therefore, NI-DAQ will load the appropriate constants from the load area for the current polarity.
Note
The actual loading of calibration constants will take place when you call an AI,
DAQ, or SCAN function. On the AT-MIO-16X, the need for reloading the constants
will depend on the polarity of the channel on which you are doing analog input.
Note
The PCI-6110E and PCI-6111E support differential bipolar operation only.
©
National Instruments Corporation 2-9 NI-DAQ FRM for PC Compatibles
Chapter 2 Function Reference — AI_Mux_Config

AI_Mux_Config

Format
status = AI_Mux_C onfig (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).
Parameters
Input
Name Type Description deviceNumber i16 assigned by configuration utility numMuxBrds i16 number of external multiplexer devices
Parameter Discussion
numMuxBrds is the number of external multiplexer devices connected.
0: No external AMUX-64T devices are connected (default).
1, 2, 4: Number of AMUX-64T devices connected.
Using This Function
You can use an external multiplexer device (AMUX-64T) to expand the number of analog input signals that you can measure with the MIO and AI device. The AMUX-64T has 16 separate four-to-one analog multiplexer circuits. One AMUX-64T reads 64 single-ended (32 differential) analog input signals. You can cascade four AMUX-64T devices to permit up to 256 single-ended (128 dif ferential) analog input sign als to be read through one MIO or AI device. Refer to Chapter 1, Introduction to NI-DAQ, of the NI-DAQ User Manual for PC
Compatibles. See Chapter 10, AMUX-64T External Multiplexer Device, in the DAQ Hardware Overview Guide for more information on using the AMUX-64T.
AI_Mux_Config configures the number of multiplexer devices connected to the MIO or AI
device. Input channels are then referenced in subsequent analog input calls (
AI_Setup, and DAQ_Start, for example) with respect to the external AMUX-64T analog
input channels, instead of the MIO and AI device onboard channel numbers. You need to execute the call to
NI-DAQ FRM for PC Compatibles 2-10
AI_Mux_Config only once in an application program.
AI_VRead,
©
National Instruments Corporation
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 to use AMUX-64T channels. Refer to the
Note Some of the digital lines of port 0 on the MIO or AI device with AMUX-64T
MIO_Config function for further details.
MIO_Config if you plan
devices are reserved for AMUX device control. Any attempt to change the port or line direction or the digital values of the reserved line causes an error. Ta ble 2-2 shows the relationship between the number of AMUX-64T devices assigned to the MIO or AI device and the number of digital I/O lines reserved. You can use the remaining lines of port 0. On non-E Series devices, the remaining lines are available for output only.
Table 2-2.
Port 0 Digital I/O Lines Reserved
Number of AMUX-64T Devices
Assigned to an MIO or AI Device
0 none 1 lines 0 and 1 2 lines 0, 1, and 2 4 lines 0, 1, 2, and 3
Port 0 Digital Lines
Reserved
©
National Instruments Corporation 2-11 NI-DAQ FRM for PC Compatibles
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.
Parameters
Input
Name Type Description deviceNumber i16 assigned by configuration utility chan i16 analog input channel number gain i16 gain setting for the channel
Output
Name Type Description reading i16 the integer result of the A/D conversion
Parameter Discussion
chan is the analog input channel number . If you are using SCXI, you must use the appropriate analog input channel on the DAQ device that corresponds to th e SCXI channe l you want. To select the SCXI channel, use to Chapter 12, SCXI Hardware, in the DAQ Hardware Overview Guide and the NI-DAQ User Manual for PC Compatibles for more information on SCXI channel assignments.
Range: See Table B-1 in Appendix B, Analog Input Channel, Gain Settings, and
Voltage Calculation.
gain is the gain setting you use for the specified channel. This gain setting applies only to the DAQ device; if you are using SCXI, establish any gain you want on the SCXI module either by setting jumpers on the module or by calling
Analog Input Channel, Gain Settings, and Voltage Calculation, for valid gain settings. If you
use an inv alid gain, NI-DAQ returns an error . If you call or 516 and LPM devices, NI-DAQ ignores the gain.
NI-DAQ FRM for PC Compatibles 2-12
SCXI_Single_Chan_Setup before calling this function. Refer
SCXI_Set_Gain. Refer to Appendix B,
AI_Read for the D A QCar d-500/700
©
National Instruments Corporation
Chapter 2 Function Reference — AI_Read
Note NI-DAQ does not distinguish between the low-gain and high-gain versions of the
If
AT-MIO-16.
you enter a gain of 10 an d you h ave a device with g ai ns 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). –32,768 to 32,767 (16-bit devices, bipolar mode).
Note C Programmers—reading is a pass-by-reference parameter.
Using This Function
AI_Read addresses the specified analog inp ut channel, changes the input g ain to the specified
gain setting, and initiates an A/D conversion. and returns the result. If the conversion does not complete within a reasonable time, the call
AI_Read is said to have timed out and the timeOutError code is returned.
to
AI_Read waits for the con v er sion to comp lete
©
National Instruments Corporation 2-13 NI-DAQ FRM for PC Compatibles
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).
Parameters
Input
Name Type Description deviceNumber i16 assigned by configuration utility
Output
Name Type Description reading [i16] readings from each sampled analog input channel
Parameter Discussion
reading is an array of readings from each sampled analog input channel. The length of the reading array is equal to the number of channels selected in the
parameter. Range of elements in reading depends on your device A/D converter resolution and the unipolar/bipolar selection you made make for a given channel.
Using This Function
AI_Read_Scan samples the analog input channels selected by SCAN_Setup, at half the
maximum rate permitted by your data acquisition hardware.
SCAN_Setup numChans
NI-DAQ FRM for PC Compatibles 2-14
©
National Instruments Corporation

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 . If you are using SCXI, you must use the appropriate analog input channel on the DAQ device that corresponds to th e SCXI channe l you want. To select the SCXI channel, use to Chapter 12, SCXI Hardware, in the DAQ Hardwa re Overview Guide and the NI-DAQ User Manual for PC Compatibles for more information on SCXI channel assignments.
Range: See Table B-1 in Appendix B, Analog Input Channel, Gain Settings, and
Voltage Calculation.
SCXI_Single_Chan_Setup before calling this function. Refer
Chapter 2 Function Reference — AI_Setup
gain is the gain setting to be used for the specified channel. gain applies only to the DAQ device; if you are using SCXI, establish any gain you want on the SCXI module by settin g jumpers on the module (if any) or by calling
Input Channel , Gai n Settings, and Voltage Calculation, for valid gain settings. If you use an
invalid gain, NI-D AQ returns an error. If you call DAQCard-500/700, NI-DAQ ignores the gain.
Note
©
National Instruments Corporation 2-15 NI-DAQ FRM for PC Compatibles
NI-DA Q does not distinguish between the low-gain and high-gain versions of the AT- M IO-1 6. I f yo u en te r a ga in o f 10 and you have a device w ith ga i ns of 1 , 2, 4, and 8, NI-DAQ uses a gain of 2 and returns no error.
SCXI_Set_Gain. Refer to Appendix B, Analog
AI_Setup for the 516 and LPM de vices or
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. externally timed A/D conversions. If your application calls parameters different from those used in the last again for
AI_Check to return data from the channel you want at the selected gain.
AI_Setup, in conjunction with AI_Check and AI_Clear, is used for
AI_Read with channel and gain
AI_Setup call, you must call AI_Setup
Note
This function cannot be used if you have an SC-2040 connected to your DAQ device.
NI-DAQ FRM for PC Compatibles 2-16
©
National Instruments Corporation

AI_VRead

Format
status = AI_VR ead (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.
Parameters
Input
Name Type Description
deviceNumber i16 assigned by configuration utility chan i16 analog input channel number gain i16 gain setting to be used for the specified channel
Chapter 2 Function Reference — AI_VRead
Output
Name Type Description
voltage f64 the measured voltage returned, scaled to units
Parameter Discussion
chan is the analog input channel number.
Range: See Table B-1 in Appendix B, Analog Input Channel, Gain Settings, and
Voltage Calculation.
gain is the gain setting to be used for the specified channel. Refer to Appendix B, Analog
Input Channel , GainSettings, and Voltag e Calculation, for valid gain settings. If you use an
invalid gain, NI-D AQ returns an error. If you call DAQCard-500/700, NI-DAQ ignores the gain.
Note
NI-DA Q does not distinguish between the low-gain and high-gain versions of the AT- M IO-1 6. I f yo u en te r a ga in o f 10 and you have a device w ith ga i ns of 1 , 2, 4, and 8, NI-DAQ uses a gain of 2 and returns no error.
of volts
AI_VRead for the 516 and LPM de vices or
©
National Instruments Corporation 2-17 NI-DAQ FRM for PC Compatibles
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 conver sion. complete and then scales and returns the result. I f the conversion does not complete within a reasonable time, the call to timeOutError code.
When you use SCXI as a front end for analog input to an MIO or AI device, Lab-PC+, Lab-PC-1200, Lab-PC-1200AI, P CI-1200, LPM de vice, or D A QC ard-700, it is no t advisable to use the
AI_VRead function because that function does not take into account the gain of the
SCXI module when scaling the data. Use the call the
SCXI_Scale function.
When you have an SC-2040 accessory connected to an E Series device, this function takes both the onboard gains and the gains on SC-2040 into account while scaling the data. When you have an SC-2043 -SG accessory connected to your DAQ device, this function takes both the onboard gains and the SC-2043-SG fixed gain of 10 into account while scaling the data.
AI_VRead is said to have timed out and NI-DAQ returns the
AI_Read function to get unscaled data, and then
AI_VRead waits for the conversion to
When you have any SCC accessories connected to an E Series device, this function takes both the onboard gains and the SCC gains into account while scaling the data.
NI-DAQ FRM for PC Compatibles 2-18
©
National Instruments Corporation

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).
Parameters
Input
Name Type Description
deviceNumber i16 assigned by configuration utility
Chapter 2 Function Reference — AI_VRead_Scan
Output
Name Type Description
reading [f64] voltage readings from each sampled analog
Parameter Discussion
reading is an array of readings from each sampled analog input channel. The length of the reading array is equal to the number of channels selected in the
parameter. NI-DAQ uses values you have specified in parameter for computing voltages. If you have attached an SC-2040 or SC-2043-SG to your DAQ device, NI-DAQ also uses values you have specified in the sc2040gain parameter) or voltages.
If you have SCC modules conn ected, NI-D AQ also uses the SCC module gain for computing voltages.
Using This Function
AI_VRead_Scan samples the analog input channels selected by SCAN_Setup, at half
the maximum rate your D AQ hardware permits.Y ou mus t use the to invoking this function.
You cannot use external signals to control A/D conversion timing and use this function at the same time.
input channel
SCAN_Setup numChans
SCAN_Setup through the gains
SC_2040_Config (through
Set_DAQ_Device_Info (a fixed gain of 10) for computing
SCAN_Setup function prior
©
National Instruments Corporation 2-19 NI-DAQ FRM for PC Compatibles
Chapter 2 Function Reference — AI_VScale

AI_VScale

Format
status = AI_VScale (deviceNumber, chan, gain, g ainAdjust, offset, reading, voltage)
Purpose
Converts the binary result from an AI_Read call to the actual input voltage.
Parameters
Input
Name Type Description deviceNumber i16 assigned by configuration utility chan i16 chan nel on which bina ry reading was taken gain i16 gain setting used to take the reading gainAdjust f64 multiplying factor to adjust gain offset f64 binary offset present in reading reading i16 result of the A/D conversion
Output
Name Type Description voltage f64 computed floating-point voltage
Parameter Discussion
chan is the onboard channel or AMUX channel on which NI-DAQ took the binary reading
AI_Read. For devices other than the AT-MIO-16X, AT-MIO-64F-5, and E Series
using devices, this parameter is ignored because the scaling calculation is the same for all of the channels. However, you are encouraged to pass the correct channel number.
gain is the gain setting that you used to take the analog input reading. If you us ed SCXI to take the reading, this gain parameter should be the product of the gain on the SCXI module channel and the gain that the D AQ device used. Refer to Appendix B, Analog Input C hannel,
Gain Settings, and Voltage Calculation, for valid gain settings. Use of invalid gain settings
causes NI-DAQ to return an error unless you are using SCXI. If you call 516 and LPM devices or DAQCard-500/700, NI-DAQ ignores the gain unless you are using SCXI.
NI-DAQ FRM for PC Compatibles 2-20
AI_VScale for the
©
National Instruments Corporation
Chapter 2 Function Reference — AI_VScale
gainAdjust is the mult iplying 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. Refer to Appendix B,
Analog Input Channel, Gain Settings, and Voltage Calculation, for the procedure for
determining offset. If you do not want to do any offset compensation, set offset to 0. reading is the result of the A/D conversion returned by voltage is the variable in which NI-DAQ returns the input voltage converted from reading.
Note C Programmers—voltage is a pass-by-reference parameter.
Using This Function
Refer to Appendix B, Analog Input Channel, Gai n Settings, and Voltage Calculation, for the formula
If your device polarity and range settings differ from the default settings shown in the
Init_DA_Brds function, be sure to call AI_Configure to inform the driver of the correct
polarity and range before using this function.
AI_VScale uses to calculate voltage from reading.
AI_Read.
©
National Instruments Corporation 2-21 NI-DAQ FRM for PC Compatibles
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 buf fer to a void cr ossing a phy sical page boundary. This function is for use with DMA waveform generation and digital I/O pattern gen eration (AT-MIO-16F- 5 and AT-DIO-32F only).
Parameters
Input
Name Type Description deviceNumber i16 assigned by configuration utility resource i16 represents the DAC channel or the digital input
or output group
buffer [i16] integer array of samples to be used count u32 number of data samples bufferSize u32 actual size of buffer
Output
Name Type Description alignIndex u32 offset into the array of the first data sample
Parameter Discussion
resource represents the DAC channel (for waveform generation) or the digital input or output group (for patter n generation) for which NI-DAQ uses the buffer.
0: DAC channel 0. 1: DAC channel 1.
2: DAC channels 0 and 1. 11: DIG group 1 (group size of 2). 12: DIG group 2 (group size of 2). 13: DIG group 1 (group size of 4).
NI-DAQ FRM for PC Compatibles 2-22
©
National Instruments Corporation
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.
count is the number of data samples contained in buffer.
32
Range: 3 through 2
– 1.
bufferSize is the actual size of buffer.
32
Range: count through 2
–1.
alignIndex is the variable in which NI-DAQ returns the offset into the array of the first data sample. If NI-DAQ d id not have to align the buffer, NI-DAQ returns alignIndex as 0, indicating that the data is still located at the beginning of the buffer. If NI-DAQ aligned the buffer to av oi d a page boun dary, alignIndex is a value other than 0, and the first data sample is located at buffer[ alignIndex] (if your array is zer o based ). I f you u se digi tal inpu t with an aligned buffer, NI-DAQ stores the data in the buffer beginning at alignIndex.
Note C Programmers—alignIndex is a pass-by-reference parameter.
Using This Function
Use Align_DMA_Buffer to avoi d the negative effects of page boundari es in the data buffer on AT bus machines for the following cases:
DMA waveform generation at close to maximum speed
Digital I/O pattern generation at close to maximum speed
Interleaved DMA waveform generation at any speed
32-bit digital I/O pattern generation at any speed The possibility of a page boundary occurring in the data buffer increases with the size of the
buffer. When a page boundary occurs in the data buffer, NI-DAQ must reprogram the DMA controller before NI-DA Q can transfer the next data sample. The extra time needed to do the reprogramming increases the minimum update interv al (thus decreasing the maximum update rate).
A page boundary in an interleaved DMA waveform buffer or a buffer that is to be used for 32-bit digital pattern gener ation can cause unpred ictable res ults, regar dless of yo ur oper ating speed. To avoid this problem, you should always use
Align_DMA_Buffer with interleaved
DMA waveform generation (indicated by resource = 2) and 32-bit digital pattern generation (indicated by resource = 13). In these two cases,
Align_DMA_Buffer first attempts to align
the buffer so that the data completely avoids a page boundary. If bufferSize is not big enough for complete alignment, the function attempts to partially align the data to ensure that a page boundary does not cause unpredictable results. Partial alignment is possible if
©
National Instruments Corporation 2-23 NI-DAQ FRM for PC Compatibles
Chapter 2 Function Reference — Align_DMA_Buffer
bufferSize count + 1. If neither form of alignment is possible, the function returns an error.
Align_DMA_Buffer partially aligned the data, the function returns a memPageError
If warning indicating that a page boundary is still in the data.
Note Physical DMA page boundaries do not exist on EISA bus computers. However,
page boundaries can be introduced on these computers as a side effect of W indo ws 386 Enhanced mode and the Windows NT virtual memory management system. This happens when a buffer is locked into physical memory in preparati on for a DAQ operation. If the memory manager cannot find a contiguous space large enough, it fragments the buffer, placing pieces of it here and there in physical memory. This type of page boundary only affects the performance on an AT bus computer . NI-D AQ uses the DMA chaining feature available on EISA computers to chain across page boundaries, thus avoiding the delay involved in DMA programming.
Align_DMA_Buffer after your application has loaded buffer with the data samples
Call (for waveform generation or digital output) and before calling
DIG_Block_In, or DIG_Block_Out. You should pass the aligned buffer to the waveform
WFM_Op, WFM_Load,
generation and pattern generation functions the same way you would an unaligned b uffer . The count parameter in the waveform generation or pattern generation function call should be the same as the count parameter passed to
Align_DMA_Buffer, not bufferSize.
If you want to access the data in buffer after calling
Align_DMA_Buffer, access the data
starting at buffer[alignIndex] (if your array is zero based). After using an aligned buffer for waveform generation or pattern generation, NI-DAQ
unaligns the data. After the buffer has been unaligned, the first data sample is at offset zero of the buffer again. If you want to use the buffer for waveform generation or pattern generation again after it has been unaligned, you must make another call to
Align_DMA_Buffer before calling WFM_Op, WFM_Load, DIG_Block_In, or DIG_Block_Out.
See Waveform Generation A pplication Hints and Digital I/O Application Hints in Chapter 3, Software Overview, of the NI-DAQ User Manual for PC Compatibles for more information
on the use of
Align_DMA_Buffer. See Chapter 4, DMA and Progra mmed I/O Performance
Limitations, of the NI-DAQ User Manual for PC Compatibles for a discussion of DMA page
boundaries and special run-time considerations.
NI-DAQ FRM for PC Compatibles 2-24
©
National Instruments Corporation
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 EEPR OM areas to EEPR OM area 1. You can load an existing set of calibration constants into the calibration D A Cs fr om a storage area in the onboard EEPROM. You can copy EEPROM storage areas 2 through 5 (EEPROM area 5 contains the factory calibration constants) to storage area 1. NI-D A Q automatically loads the calibration constants stored in EEPROM area 1 the first time a function pertaining to the AT-AO-6/10 is called.
Note
Use the calibration utility provided with the AT-AO-6/10 to perform a calibration procedure. Refer to the calibration chapter in the AT-AO-6/10 User Manual for more information regarding the calibration procedure.
Parameters
Input
Name Type Description deviceNumber i16 assigned by configuration utility operation i16 operation to be performed EEPROMloc i16 storage location in the onboard EEPROM
Parameter Discussion
operation determines the operation to be performed.
1: Load calibration constants from EEPROMloc. 2: Copy calibration cons tants from EEPROMloc to EEPROM user calibration
area 1.
EEPROMloc selects the storage location in the onboard EEPROM to be used. You can use different sets of calibration constants to compensate for configuration or environmental changes.
1: User calibration area 1. 2: User calibration area 2. 3: User calibration area 3. 4: User calibration area 4. 5: Factory calibration area.
©
National Instruments Corporation 2-25 NI-DAQ FRM for PC Compatibles
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,
AO_Calibrate with operation set to 1 and EEPROMloc set to 1. When the AT-AO-6/10
leaves the factory, EEPROMloc 1 contains a copy of the calibration constants stored in EEPROMloc 5, the factory area.
A calibration procedure performed in bipolar mode is n ot valid for unipolar and vice versa. See the calibration chapter of the AT-AO-6/10 User Manual for more infor mation r e g a rdin g calibrating the device.
Init_DA_Brds performs the equivalent of calling
NI-DAQ FRM for PC Compatibles 2-26
©
National Instruments Corporation
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.
Parameters
Input
Name Type Description deviceNumber i16 assigned by configuration utility channel i16 number of channel you w ant to configure; you can
use –1 to indicate all channels
paramID u32 identification of the parameter y ou want to change paramVal ue u32 new value for the parameter specified by
paramID
Parameter Discussion
Legal ranges for paramID and paramValue are given in terms of constants defined in a header file. The header file you should use depends on the language you are using:
C programmers—
B ASIC programmers— refer to the Programming Language Considerations in Chapter 1, Using the NI-DAQ Functions, for more information.)
Pascal programmers—
Legal values fo r channel depend on the type of devi ce you are using ; analog outp ut channel s are labeled 0 through n–1, where n is the number of analog output channels on your device. You can set channel to –1 to indicate that you want the same parameter selection for all channels. You must set channel to –1 to change a parameter you cannot change on per channel basis.
©
National Instruments Corporation 2-27 NI-DAQ FRM for PC Compatibles
NIDAQCNS.H (DATAACQ.H for LabWindows/CVI)
NIDAQCNS.INC (V isual Basic for Windo ws programmers should
NIDAQCNS.PAS
Chapter 2 Function Reference — AO_Change_Parameter
Legal values for paramValue depend on paramID. The following paragraphs list features you can configure al ong with le gal v alues for paramID with expl anations and corr esponding 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. When reglitching is turned off, glitch size de pends on the binary patterns that are written into the DA C; the glitch is largest when the most significant bit in the pattern changes (when the wav efor m crosses the midrange of the DAC); it is smaller in other cases. When reglitching is turned on, the glitch size is much less dependent on the bit pattern.
To change the reglitching parameter, set paramID to
ND_REGLITCH.
If you are not concerned about this, you are li kely to be satisf ied by the def ault values NI- DA Q selects for you if y ou do not call th is functi on. The fo llo wing ta ble list s de vices on whi ch you can change this parameter.
Table 2-3.
Device Type
Reglitching Parameters for Permissible Devices
Per Channel
Selection Possible
Legal Range for
paramValue
AT-MIO-16X No ND_OFF and
ND_ON
AT-MIO-16E-1 AT-MIO-16E-2
Yes ND_OFF and
ND_ON
AT-MIO-64E-3 NEC-MIO-16E-4 PCI-MIO-16E-1 VXI-MIO-64E-1 VXI-MIO-64XE-10
Caution:
If you turn off reglitching on the AT -MIO-16X, timing problem s tha t NI-DAQ cannot detect might occur.
Voltage or Current Output
Some devices require separate calibration constants for voltage and current outputs. Setting the output type to voltage or current for these devices causes the driver to use the correct calibration constants and to interpret the input data correctly in output type, set paramID to
ND_OUTPUT_TYPE.
Default Setting for
paramV alue
ND_ON
ND_OFF
AO_VWrite. To change the
NI-DAQ FRM for PC Compatibles 2-28
©
National Instruments Corporation
Chapter 2 Function Reference — AO_Change_Parameter
Device Type
PC-AO-2DC DAQCard-AO-2DC VXI-AO-48XDC
For the VXI-AO-48XDC device the with the channel value to select the analog output channel to be affected. To select a voltage channel, set the
paramValue
paramValue
to
ND_CURRENT
FIFO Transfer Condition
You can specify the condition that causes more data to be transferred from the waveform buffer into the analog output FIFO. NI-DAQ selects a default setting for you, in order to achieve maximum performance. However, by changing this setting, you can force the FIFO to remain as full as possible, or effectively disable, or reduce the size of the FIFO.
For example, to reduce the FIFO lag effect (the amount of time it takes data to come out of the FIFO after being transferred into the FIFO), you can change the FIFO transfer condition to FIFO empty. Notice that reducing the effective FIFO size can also reduce the maximum sustainable update rate.
Table 2-4.
Voltage or Current Output Parameters
Per Channel
Selectio n Po ssib le
Yes
to
ND_VOLTAGE
.
Legal Range for
paramValue
ND_CURRENT_OUTPUT
and
ND_VOLTAGE_OUTPUT
of
paramID
ND_OUTPUT_TYPE
. To select a current channel, set the
Default Setting for
paramValue
ND_VOLTAGE_OUTPUT
is used in conjunction
To change the FIFO transfer condition, set and set
paramValue
to one of the values shown in Table 2-5:
Table 2-5.
Parameter Values for FIFO Transfer Conditions
paramID
to
ND_DATA_TRANSFER_CONDITION
Transfer Condition NI-DAQ Constant
FIFO not full FIFO half-full or less FIFO empty FIFO half-full or less until full
ND_FIFO_NOT_FULL
ND_FIFO_HALF_FULL_OR_LESS
ND_FIFO_EMPTY
ND_FIFO_HALF_FULL_OR_LESS_UNTIL_FULL
(DMA only)
Set
channel
configured group 1 to contain channels 0 and 1, you can set
Note
©
National Instruments Corporation 2-29 NI-DAQ FRM for PC Compatibles
to one of the channel numbers i n your wav eform group. F or example, if yo u have
channel
to 0 or 1.
This option is valid only for PCI E Series devices.
,
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 fro m the waveform buffer into the analog output FIFO when FIFO requests are generated. This option is for use in conjunction with the FIFO transfer condition, as described above.
AO_Change_Parameter should be called once to set the FIFO transfer condition, and can
optionally be called again to specify the FIFO transfer count. If you d o not specify th e FIFO transfer count, NI-DAQ chooses an appropriate value for you.
The value of FI FO tr ans fer count i s used dur ing interrupt-driven waveform generation but is ignored duri ng DMA-driven waveform ge neration. When you use DMA, DM A requests a re generated as long as the transfer condition is true.
Table 2-6 contains the def ault values that are used if you do n ot specify FIFO transfer coun t, in addition to the valid values that can be set.
Table 2-6.
Default Values for FIFO Transfer Condition
Transfer Condition Default Transfer Count Valid Input Valu es
FIFO not full 1 1 FIFO half-full or less half-FIFO size 1—half-FI F O size FIFO empty 1 1—FIFO size FIFO half-full or less until
full (DMA only)
FIFO transfer count cannot be specified for this transfer
N/A
condition
For example, if you choose the FIFO empty transfer condition and set the transfer count to 10, each time the board is interrupted with a FIFO empty interrupt, NI-DAQ transfers 10 samples from the user buffer into the analog output FIFO. Although this does not improve the maximum sustainable update rate, it redu ces the nu mber of interrupts, and reduces the FIFO lag effect to a maximum of 10 samples.
If you choose the FIFO half full or less transfer condition and set the transfer count to 100 on a board with a 2048-sample FIFO, the FIFO fills with a maximum of 1124 samples (half the FIFO plus 100 samples). Each time the number of samples in th e FIFO falls to less than 1024, another interrupt is generated, at which time 100 samples are transferred from the waveform buffer to the FIFO.
NI-DAQ FRM for PC Compatibles 2-30
©
National Instruments Corporation
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 in teger.
Set channel to one of th e channel numbers in yo ur wav eform group. F or example, if you ha ve 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.
Ground DAC Reference
You can ground the reference that the analog output channels use, which causes the output voltage to remain at 0 V, regardless of the value you write to the channel.
To change the grounding of the DAC Reference, set paramID to
ND_GROUND_DAC_REFERENCE, and set paramValue to either ND_YES, or ND_NO. The effect
is immediate. Also, groundi ng the D A C r eference on one channel has the ef fect of gro unding it for both channels, so you can specify either 0 or 1 for channel number.
Note This option is valid only for PCI E Series devices.
Analog Filter
Some devices have a lowpass analog filter after the DAC. You can switch this filter ON or OFF . By switching this filter OFF, the analog lowpass filter stage is bypassed. T o change the digital filter setting, set paramID to
ND_ANALOG_FILTER.
Table 2-7.
Device Type
DAQA rb AT-5411 DAQArb PCI- 5411
Parameter Setting Information for the Analog Filter
Per Channel
Selection Possible
Legal Range
for paramValue
Yes ND_ON and
ND_OFF
Default Setting
for paramValue
ND_ON
Digital Filter
Some devices have a lowpass digital filter before the DAC. You can switch this filter ON or OFF. By switching this filter OFF, the digital lowpass filter stage is bypassed.
To change the digital filter setting, set paramID to
Table 2-8.
Parameter Setting Information for the Digital Filter
Per Channel
Device Type
DAQA rb AT-5411
Selection Possible
Yes ND_ON and
DAQArb PCI- 5411
©
National Instruments Corporation 2-31 NI-DAQ FRM for PC Compatibles
ND_DIGITAL_FILTER.
Legal Range
for paramValue
ND_OFF
Default Setting
for paramValue
ND_ON
Chapter 2 Function Reference — AO_Change_Parameter
Output Enable
On some of the devices, you can di sable t he output e v en when th e wa v eform generation is in progress. You can use this feature to bring the output to a known level at any time.
On DAQArb 5411 devices, th ere 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. You can enable or disable the output at any time.
To change the output enable setting, set paramID to
Device Type
DAQA rb AT-5411 DAQArb PCI- 5411 4451 devices 4551 devices
Output Impedance
On some of the devices, you can select the output impedance to match the impedance of the load.
Output impedance of 50 is good for testing most of the devices. You can use output impedance of 75 for video testing. If you select an output impedance of 0 , you shoul d be driving an unterminated load (that is, a load with a very high input impedance).
To change the output impedance setting, set paramID to
Note
The values are set up in milliOhms (m).
Table 2-9.
Table 2-10.
ND_OUTPUT_ENABLE.
Parameter Setting Information for Output Enable
Per Channel
Selection Possible
Legal Range
for paramValue
Yes ND_YES and
ND_NO
ND_IMPEDANCE.
Parameter Setting Information for Output Impedance
Default Setting
for paramValue
ND_NO
Per Channel
Device Type
DAQA rb AT-5411
Selection Possible
Yes 0, 50,000, and
DAQArb PCI- 5411
NI-DAQ FRM for PC Compatibles 2-32
Legal Range
for paramValue
75,000
©
Default Setting
for paramValue
50,000
National Instruments Corporation
Output Attentuation
Some devices hav e attenuators after the f inal amplifier stage. By attenuating the output signa l, 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.
Chapter 2 Function Reference — AO_Change_Parameter
Attenuation (in mdB) = - [20 log
= The voltage level that you want for the output signa l .
V
o
= The input voltage level.
V
i
For DAQArb5411 devices, V
(Vo/Vi)]*1000
10
= -5 to +5 V for terminated load and -10 to +10 V for
i
unterminated load. For example, to change the output levels to –2.5 to +2.5 V into a terminated load, then:
Attenuation = –[20*log
2.5/5)]*1000 = 6020 mdB
(
10
The 4451 and 4551 devices have three levels of attenuation providing voltage ranges of –10 to + 10 V, –1 to +1 V, and –100 to +100 mV.
T o change the output attenuation setting set paramID to
ND_ATTENUATION. You can change
the attenuation at any time.
Note
The values are set up in millidecibels.
Table 2-11.
Parameter Setting Information for Output Attenuation
Legal Range
Device Type
DAQA rb AT-5411 DAQArb PCI- 5411
Per Channel
Selection Possible
Yes 0 through
for
paramValue
74,000
Default Setting
for paramValue
0
4451 and 4551 devices Yes 0, 20,000,
0
40,000
Frequency Correction for the Analog Filter
Some devices have an analog lowpass filter in their output stage. To correct for the abnormalities of this filter at a particular frequency, set paramID to
ND_FILTER_CORRECTION_FREQ. You can set the paramValue to 0 to disable the
frequency correction for the analog filter. If you have disabled the analog filter, you also must disable the frequency correction.
©
National Instruments Corporation 2-33 NI-DAQ FRM for PC Compatibles
Chapter 2 Function Reference — AO_Change_Parameter
Table 2-12.
Device Type
DAQA rb AT-5411 DAQArb PCI- 5411
Trigger Mode
Some devices can generate the waveforms stored in the memory on board in different ways by setting the trigger mode parameter.
The following trigger modes are possible on the DAQArb 5411 devices:
Single The waveform described by the user in the sequence list
Continuous The waveform described by the user in the sequence list is
Stepped After the start trigger, the waveform described by the first
Burst After the start trigger has been implemented, the waveform
Parameter Setting Information for Frequency Correction for the Analog Filter
Legal Range
Per Channel
Selection Possible
for
paramValue
Default Setting
for paramValue
Yes 0 through
16,000,000
generated once by going through all the sequence list. Only a start trigger is required.
generated infinitely by recycling through all of the sequence list. Only the start trigger is required.
sequence entry is generated. It then waits for another trigger. At the time of triggering, the waveform described by the second sequence entry is generated, and so on. When all of the sequence list is exhausted, it returns to the first sequence entry.
described by the first sequence entry is generated until another trigger is implemented. At the time of triggering, the earlier waveform is completed before the waveform described by the second sequence entry is generated and so on. When all of the sequence list is exhausted, it returns to the first sequence entry.
0
1
is
To change the trigger mode setting, set paramID to
1
A sequence list is used in staging-based waveform generation for linking, loop ing, and generating multiple waveforms stored on the onboard memory. The sequence list has a list of entries. Each entry is called a stage. Each stage specifies which waveform to generate and the other associated settings for that waveform (for example, the number of loops). For more details on staging-based waveform generation, refer to details on triggering and trigger sources, refer to your DAQArb 5411 User Manual.
NI-DAQ FRM for PC Compatibles 2-34
ND_TRIGGER_MODE.
WFM_Load in this manual. For more
©
National Instruments Corporation
Chapter 2 Function Reference — AO_Change_Parameter
Table 2-13.
Device Type
DAQA rb AT-5411 DAQArb PCI- 5411
PLL Reference Frequency
On some of the devices, you can phase-lock the internal timebase to an external reference clock. The internal timebase can be an integral multiple of the external reference clock. This feature is useful because you can synchronize the timebases of multiple devices so that they are all locked to each other.
On DAQArb 5411 devices, you can phase-lock the internal timebase to a non-National Instruments device using the I/O connector or to a National Instruments devi ce using the R TSI connector. You can select the reference clock source by using the call. If the PLL reference clock source is the R TSI clock, set the refer ence clock frequenc y to 20 MHz.
To change the PLL reference frequency, set paramID to
Note
The values are set up in Hertz (Hz).
Parameter Setting Information for the Trigger Mode
Per Channel
Selection Possible
Yes
Legal Range
for paramValue
ND_SINGLE ND_CONTINUOUS ND_BURST ND_STEPPED
ND_PLL_REF_FREQ.
Default Setting
for paramValue
ND_CONTINUOUS
Select_Signal function
Table 2-14.
Parameter Setting Information for PLL Reference Frequency
Legal Range
Device Type
DAQA rb AT-5411 DAQArb PCI- 5411
Per Channel
Selection Possible
Yes 1,000,000,
for
paramValue
10,000,000,
Default Setting
for paramValue
1,000,000
20,000,000
SYNC Duty Cycle
The SYNC output is a TTL version of the sine waveform being generated at the output. It is obtained by using a zero-crossing detector on the sine output. It is generated on a separate output connector instead of the main analog output connector. The SYNC output might not carry any meaning for any other types of waveforms being generated.
You can vary the duty cycle of TTL output on the fly. To change the SYNC duty cycle as
.
the percentage of the time high, set paramID to
ND_SYNC_DUTY_CYCLE_HIGH
paramValue parameters imply p e rcentag e (% ). To disable the SYNC output, set the
©
National Instruments Corporation 2-35 NI-DAQ FRM for PC Compatibles
The
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.
Device Type
DAQA rb AT-5411 DAQArb PCI- 5411
Using This Function
Use this function to cust o mize t he behavior of the analog ou t put s ect ion of your devi ce. Call this function before calling NI-DAQ functions that cause output on the analog output channels. You can call this function as often as needed.
End of Buffer Interrupts
On PCI E Series boards that use the PCI-MITE for DMA transfers, NI-DAQ causes the PCI-MITE to generate an interrupt after a full buffer has been transferred from host memory to the DAQ device. With one-shot operations, where the buffer is only output once, or even during continuous operations where the buffer is very large, these interrupts place very little burden on the system. However, wh en outputting a large number of iterations with small buffers or at high speeds, these interrupts can affect overall system performance.
These interrupts are generated so that NI-DAQ will read the state of the DMA controller and track the number of itera tions and t he number o f points tr ansferred si nce the be ginnin g of the operation. The PCI-MITE has a 32-bit counter that counts bytes transferred. The only drawback in turning off these interrupts is that NI-D AQ might not have a chance to detect an overflow of the counter. For example, when generating a waveform on one channel at 1 M samples/s, the count er will ov erflo w in 36 minutes. If you disable end- of-buf fer interr upts and do not query NI-DAQ for status information before the counter overflows, NI-DAQ will not be able to take the overflow into account, and the status information returned could be incorrect.
Parameter Setting Information for the SYNC Duty Cycle
Legal Range
Per Channel
Selection Possible
for
paramValue
Yes 20 to 80 50
Default Setting
for paramValue
To enable/disable end of buffer interrupts, set paramID to
ND_LINK_COMPLETE_INTERRUPTS and set paramValue to either ND_ON or ND_OFF. You
may specify any channel in the waveform group, and the setting will apply to all channels in the group.
Note
NI-DAQ FRM for PC Compatibles 2-36
This option is valid only for PCI/CPCI/PXI E Series devices.
©
National Instruments Corporation
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 DA Q de vice 16 bits at a time. This allows for the finest le vel of contro l and is necessary to properly support features lik e old data stop and partial transfer stop (see the NI-DAQ function
It is also possible to transfer data from host memory to the DAQ de vice 32 bits at a time, which requires fewer PCI b us cycles so that the D A Q de vice functions more effecti vely with the PCI bus. The only drawback is that when using old data stop and partial transfer stop, the waveform may stop one sample earlier than you would otherwise expect.
WFM_DB_Config).
To set the memory transfer width, set paramID to
ND_MEMORY_TRANSFER_WIDTH and set
paramValue to either 16 or 32. You may specify any channel in the w aveform group, an d the setting will apply to all channels in the group.
Note
This option is valid only for PCI/CPCI/PXI E Series devices. For 61XX devices, only even-sized buffers are allowed, and the memory transfer width is always 32 bits.
©
National Instruments Corporation 2-37 NI-DAQ FRM for PC Compatibles
Chapter 2 Function Reference — AO_Configure

AO_Configure

Format
status = AO_Configure (deviceNumber, chan, outputPolarity, intOrExtRef, refVoltage,
updateMode)
Purpose
Informs NI-D AQ of the output range and polarity selected for each analog output chan nel on the device and indic ates the update mode of the D ACs. If you have recorded an analog outp ut configuration that is not a default through the NI-DAQ Configuration Utility, you do not need
AO_Configure because NI-DAQ uses the settings recorded by the NI-DAQ
to use Configuration Utility. If you have a software-configurable device, you can use
AO_Configure to change the analog output configuration on the fly.
Caution
!
For the AT-AO-6/10, NI-DAQ records the configuration information for output polarity and update mode in chan nel pairs. A call to same output polarity and update mode selections for both channels in a pair.
Parameters
Input
Name Type Description deviceNumber i16 assigned by configuration utility chan i16 analog output channel number outputPolarity i16 unipolar or bipolar intOrExtRef i16 reference source refVoltage f64 voltage reference value updateMode i16 when to update the DACs
Parameter Discussion
chan is the analog output channel number.
Range: 0 or 1 for the AO-2DC, Lab and 1200 Series analog output devices, and MIO
devices. 0 through 5 for the AT-AO-6. 0 through 9 for the AT-AO-10. 0 through 47 for the VXI-AO-48XDC. 0 for DAQArb 5411 devices.
AO_Configure records the
NI-DAQ FRM for PC Compatibles 2-38
©
National Instruments Corporation
Chapter 2 Function Reference — AO_Configure
outputPolarit y 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 settin g, o ut put 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 settin g, o ut put range is from –5 to +5 V).
1: Unipolar operation (output range is from 0 to +10 V).
For the MIO-16XE-50 devices:
0: B i polar operation (output range is from 0 from –10 to +10 V).
For the AO-2DC devices:
0: Bi polar operation (out put range is from –5 to +5 V).
1: Unipolar operation (default setting, output range is from 0 to +10 V or
0to20mA).
For the VXI-AO-48XDC:
0: Bipolar operation (voltage only; output range is from –10.24 to +10.24 V).
1: Unipolar operation (current only; output range is from 0 to 20.47 mA).
For the DAQArb 5411 devices:
0: Bipolar operation (output range is –5 to +5 V for a 50 Ω te rminated load and –10
to +10 V for an unterminated load—that is, a load with a very high im pedance).
intOrExtRef indicates the source of voltage reference.
0: Internal reference.
1: External reference.
The MIO devices, except the 16-bit E Series devices, and AT-AO-6/10 devices support external analog output voltage references.
For DAQArb 5411 devices, only internal reference is supported. refVoltage is the analog output channel voltage reference value. You can configure each
channel to use an internal reference of +10 V (the default) or an external referen ce. Although each pair of channels is served by a single external reference connection, the conf iguration of the external reference operates on a per channel basis. Therefore, it is possible to have one channel in a pair internally referenced and the other channel in the same pair externally referenced.
Range: –10 to +10 V.
©
National Instruments Corporation 2-39 NI-DAQ FRM for PC Compatibles
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 . F or devices that ha ve no external re ference 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 sett ing). 1: Not updated when written to, but up dated later aft er a call to
(later internal update mode).
2: Not updated when written to, but updated later upon application of an active low
pulse. You should apply this pulse to the following:
OUT2 pin for an MIO-16/16D devi ce
EXTDACUPDATE pin for an MI O-F/16 devic e
EXTUPDATE pin for the AT -AO-6 /10 and La b and 1200 Seri es analo g output devices (late r exte rn al upda te mode )
PFI5 pin for the E S eries devices. To alter the pin and pol a rity selection s you make with this function, for an E Series device , you can ca ll
Select_Signal with signal = ND_OUT_UPDATE after you call AO_Configure.
Note This mode is not valid for the VXI-AO-48XDC.
AO_Update
Using This Function
AO_Configure stores information about the analog output channel on the specified device
in the configuration table for the analog channel. For the AT-AO-6/10, the outputPolarity and updateMode information is stored for channel pairs. For example, analog output channels 0 and 1 are grouped in a channel pair, and a call to record the outputPolarity and updateMode for both channels 0 and 1. Likewise, a call to
AO_Configure for channel 1 records the outputPolarity and updateMode for both
channels 0 and 1. The AT-AO-6/10 channel pairs are as follows: AT-AO-6/10 channel pairs:
Channels 0 and 1.
Channels 2 and 3.
Channels 4 and 5.
Channels 6 and 7 (AT-AO-10 only).
Channels 8 and 9 (AT-AO-10 only).
NI-DAQ FRM for PC Compatibles 2-40
AO_Configure for channel 0
©
National Instruments Corporation
Chapter 2 Function Reference — AO_Configure
AO_Configure stores information abou t the analog output channe l on the specified bo ard in
the configuration table for the analog channel. The analog output channel conf iguration 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). updateMode = 0: Updated when written to.
VXI-AO-48XDC:
outputPolarity = 0; Bipolar (–10.24 to +10.24 V). updateMode = 0: Updated when written to.
If you configure an output channel for later internal update mode (updateMode = 1), you can configure no other output channels for later external update mode (updateMode = 2). Likewise, if you configure an output channel for later external update mode, you can configure no other output channels for later internal update mode.
If the physical configuration (the jumpered settings) of the analog output channels on your device differs from the default setting, you must call
AO_Configure with the true
configuration information for the remaining analog output functions to operate properly.
Note The AT-AO-6/10 allows you to physically configure each analog output channel
(the jumper setting) f or bipolar or unipolar op eration. T o ens ure proper operation, configure both channels in a channel pair the same way.
On the AT-MIO-16X, A T-MIO-64F-5, and E Ser ies dev ices (except MIO-16XE-50 de vices), the calibration constants used for analog output change depending on the polarity of the analog output channels. NI-DAQ always ensures that the calibration constants in use match the current polarity of the channels.
If you change the polarity on the AT-MIO-16X or the AT-MIO-64F-5 by calling
AO_Configure, NI-DAQ checks if the load area contains the appropriate constants. If so,
NI-DA Q loads the constants from the load ar ea. Otherwise, NI-D A Q loads the co nstants from the factory area for the current polarity and return status code calConstPolarityConflictError. The actual loading of calibration constants takes place when you call an
AO or WFM function. See the Calibrate_E_Series function description
for information about calibration constant loading on the E Series devices. To load constants from some other EEPROM area, you must call the
function after calling
©
National Instruments Corporation 2-41 NI-DAQ FRM for PC Compatibles
AO_Configure.
MIO_Calibrate
Chapter 2 Function Reference — AO_Update

AO_Update

Format
status = AO_Update (deviceNumber)
Purpose
Updates analog output channels on the specified device to ne w vo ltage v alues when the later internal update mode is enabled by a previous call to
Parameters
Input
Name Type Description
deviceNumber i16 slo t or device ID numbe r
Using This Function
AO_Update issues an update pulse to all analog output chan nels on the sp ecif ied device. All
analog output channel voltages then simultaneously change to the last value written.
AO_Configure.
NI-DAQ FRM for PC Compatibles 2-42
©
National Instruments Corporation

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.
Parameters
Input
Name Type Description deviceNumber i16 assigned by configuration utility chan i16 analog output channel number voltage f64 voltage, in volts, to be converted to a binary value
Chapter 2 Function Reference — AO_VScale
Output
Name Type Description binVal i16 converted binary value returned
Parameter Discussion
chan is the analog output channel number.
Range: 0 or 1 for the Lab and 1200 Series analog output devices, and MIO devices.
0 through 5 for AT-AO-6. 0 through 10 for AT-AO-10. 0 through 47 for the VXI-AO-48XDC.
Note
C Programmers—binVal is a pass-by-reference parameter.
Using This Function
Using the following formula, AO_VScale calculates the binary value to be written to the specified analog output channel to generate an output voltage corresponding to voltage.
binVal = (voltage/refVoltage) * maxBinVal
where values of refVoltage and maxBinVal are appropriate for your device and current configuration.
©
National Instruments Corporation 2-43 NI-DAQ FRM for PC Compatibles
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.
Note Some inaccuracy results in the
the VXI-AO-48XDC, because this device works with a larger analog output resolution than can be represented by the 16-bit binary output value for
.
AO_VScale
The binary output value is designated as the most significant 16 bits of the scaling operation to minimize this inaccuracy. Use the to prevent this kind of inaccuracy.
parameter when you use this function on
binVal
AO_VWrite function
NI-DAQ FRM for PC Compatibles 2-44
©
National Instruments Corporation

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.
Parameters
Input
Name Type Description deviceNumber i16 assigned by configuration utility chan i16 analog output channel number voltage f64 floating-point value to be scaled and written
Parameter Discussion
chan is the analog output channel number.
Range: 0 or 1 for the AO-2DC, Lab and 1200 Series analog output, and MIO devices.
0 through 5 for AT-AO-6. 0 through 9 for AT-AO-10. 0 through 49 for the VXI-AO-48XDC.
Chapter 2 Function Reference — AO_VWrite
voltage is the floating-point value to be scaled and written to the analog output channel. The range of voltages depends on the type of device, on the jumpered output polarity, and on whether you apply an external voltage reference.
Default ranges (bipolar, internal voltage reference): MIO device: –10 to +10 V AT-AO-6/10: –10 to +10 V Lab and 1200 Serie s
analog output devi ces: –5 to +5 V
VXI-AO-48XDC: –10.24 to +10.24 V
Default ranges (unipolar, internal voltage reference): AO-2DC device: 0 to +10 V
©
National Instruments Corporation 2-45 NI-DAQ FRM for PC Compatibles
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. If the analog output channel is configured for immediate update, the output voltage or current changes immediately. Otherwise, the output voltage or current changes on a call to
If you have chan ged the output polarit y for the analog output ch annel from the factory setting of bipolar to uni polar , yo u must call correctly scale the floating-point value to the binary value.
You also can use th is function to calibrate the VXI-AO-48XDC. On this device, writes to channel number 48 affect the voltage or current offset calibration, depending on the output type of this channel as set by the channel number 49 affect the voltage or current gain calibration, which also depends on the output type of the channel as set by the
AO_Update or the application if an external pulse.
AO_Configure with this information for AO_VWrite to
AO_Change_Parameter function. In addition, writes to
AO_Change_Parameter function.
NI-DAQ FRM for PC Compatibles 2-46
©
National Instruments Corporation

AO_Write

Format
status = AO_Write (deviceNumber, chan, value)
Purpose
Writes a binary value to one o f the analog output channels, chan ging the v o ltage produ ced 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.
Range: 0 or 1 for Lab and 1200 Series analog output and MIO devices.
0 through 5 for AT-AO-6. 0 through 9 for AT-AO-10. 0 through 47 for the VXI-AO-48XDC.
Chapter 2 Function Reference — AO_Write
value is the digital value to be written to the analog output channel. value has several r anges, depending on whether the analog output channel is configured for unipolar or bipolar operations and on the analog output resolution o f the device as shown in the following table.
Device Bipolar Unipolar
Most devices –2,048 to +2,047 0 to +4,095 AT-MIO-16X, 16-bit E Series devices –32,768 to +32,767 0 to +65,535
Using This Function
AO_Write
output channel for immediate update, which is the default setting, the output voltage or current changes immediately. Otherwise, the output voltage or current changes on a call to
AO_Update or the application of an external pulse.
©
National Instruments Corporation 2-47 NI-DAQ FRM for PC Compatibles
writes value to the DAC in the analog outp ut channel. If you configu re the analog
Chapter 2 Function Reference — AO_Write
Note 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 repr esents the most significant 16 bits of the DAC, in order to minimize this inaccuracy. Use the function to prevent this type of inaccuracy.
AO_VWrite
NI-DAQ FRM for PC Compatibles 2-48
©
National Instruments Corporation
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. Howe ve r , if you feel that the device is not performing eith er analog input or outpu t accurately and suspect the device calibration to be in error , you can use obtain a user-defined set of new calibration constants.
A complete set of calibration constants consists of ADC constants for all gains at one polarity plus DAC constants for both DACs, again at the same polarity setting. It is important to understand the polarity rules. The polarity your device was in when a set of calibration constants was created must match the polarity your device is in when those calibration constants are used. For example, calibration constants created when your ADC is in unipolar must be used only for data acquisition when your ADC is also in unipolar.
You can store up to six sets of user-defined calibration constants. These are stored in the EEPROM on yo ur de v ice in plac es called user calibration ar eas. Refer to your h ardw are user manual for more information on these calibration areas. You also can use the calibration constants created at the factory at any time. These are stored in write protected places in the EEPROM called factory calibration areas. There are two of these. One holds constants for bipolar operation and the other for unipolar. One additional area in the EEPROM important to calibration is called the default load table. This table contains four pointers to sets of calibration constants; one pointer each for ADC unipolar constants, ADC bipolar constants, DAC unipolar and DAC bipolar. This tab le is u sed by NI-DAQ for calibration constant loading.
Calibrate_1200 to
It is also important to understand the calibration constan t loading rules. The first time a function requiring use of the ADC or DAC is called in an application, NI-DAQ automatically loads a set of calibration constants. At that ti me, th e polarities of your ADC and DACs are examined and the appropriate pointers in the default load table are used. The calibration constant loading is done after the DLL is loaded. If your DLL is ever unloaded and then reloaded again, the calibration constant loading is also done again.
Note
©
National Instruments Corporation 2-49 NI-DAQ FRM for PC Compatibles
Calling this function on an SCXI-1200 with remote SCXI might take an extremely long time. We strongly recommend that you switch your SCXI-1200 to use a parallel port connection before performing the calibration and store the calibration constants in one of the EEPROM storage locations.
Chapter 2 Function Reference — Calibrate_1200
Caution Read the calibration chapter in your device user manual before using
!
Calibrate_1200.
Parameters
Input
Name Type Description device i16 device number calOP i16 operation to be performed saveNewCal i16 save new calibration constants EEPROMloc i16 storage location on EEPROM calRefChan i16 AI channel connected to the calibration voltage grndRefChan i16 AI channel that is grounded DAC0chan i16 AI channel connected to DAC0 DAC1chan i16 AI channel connected to DAC1 calRefVolts f64 DC calibration voltage gain f64 gain at which ADC is operating
Parameter Discussion
calOP determines the operation to be performed.
1: Load calibration constants from EEPROMloc. If EEPROMloc is 0, the default
load table is used and NI-DAQ ensures that the constants loaded are appropriate for the current polarity settings. If EEPROMloc is any other value you must ensure that the polarity of your device matches those of the calibration constants.
2: Calibrate the ADC using DC reference voltage calRefVolts connected to
calRefChan. To calibrate the ADC, you must ground one input channel (grndRefChan) and connect a voltage reference between any other channel and AGND (pin 11). After calibration, the calibration constants that were obtained during the process remain in use by the ADC until the device is initialized again.
Note The ADC must be in referenced single-ended mode for successful calibration of
the ADC.
3: Calibrate the DACs. DAC0chan and DAC1chan are the analog input channels
to which DAC0 and DAC1 are connected, respectively. To calibrate the DACs, you must wrap-back the DAC0 out (pin 10) and DAC1 out (pin 12) to any two analog input channels. After calibration, the calibration constants that were
©
NI-DAQ FRM for PC Compatibles 2-50
National Instruments Corporation
Chapter 2 Function Reference — Calibrate_1200
obtained during the process remain in use by the DACs until the device is initialized again.
Note The ADC must be in referenced single-ended and bipolar mode and fully
calibrated (using calOP = 2) for successful calibration of the DACs.
4: Reserved. 5: 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. NI-DAQ changes either the unipolar or bipolar pointer in the default load table depending on the polarity those constants are intended for. The factory default for the ADC unipolar pointer is EE PROMloc = 9. The factory default for the ADC bipolar poin te r is EE PR OMloc = 10. You can specify any user area in EEPROMloc after you have run a calibration on the ADC and saved the calibration constants to that user area. Or, you can specify EEPROMloc = 9 or 10 to reset the default load table to the factory calibration for unipolar and bipolar mode respectively.
6: Edit the default load table so that the set of constan ts in the area identified by
EEPROMloc (1–6, 9 or 10) become the default calibration constants for the DACs. NI-DAQ’s behavior for calOP = 6 is identical to that for calOP = 5. Just substitute DAC everywhere you see ADC.
The following table summarizes the possible values of other parameters depending on the value of calOP.
Table 2-16.
calOP
1 ignored 0–10 ignored ignored ignored ignored ignored ignored 2 0 or 1 1–6 AI chan
3 0 or 1 1–6 ignored ignored AI chan
saveNewCal
EEPROMloc
connected to voltage source (0–7)
Possible Calibrate_1200 Parameter Values
calRefChan
grndRefChan
AI chan connected to ground (0–7)
DAC0chan
ignored ignored the voltage
connected to DAC0Out (0–7)
DAC1chan
AI chan connected to DAC1Out (0–7)
calRefVolts
of the voltage source
ignored 1, 2, 5, 10,
1, 2, 5, 10, 50, or 100
50, or 100
gain
©
National Instruments Corporation 2-51 NI-DAQ FRM for PC Compatibles
Chapter 2 Function Reference — Calibrate_1200
Possible Calibrate_1200 Parameter Values (Continued)
calRefChan
ignored ignored ignored ignored ignored ignored
ignored ignored ignored ignored ignored ignored
grndRefChan
DAC0chan
DAC1chan
calRefVolts
calOP
5 ignored 1–6,
6 ignored 1–6,
saveNewCal
9–10
9–10
Table 2-16.
EEPROMloc
saveNewCal is valid only when calOP is 2 or 3.
0: Do not save new calibration constants. Even though they are not permanently
saved in the EEPROM, calibration constants created after a successful calibration remains in use by your device until your device is initialized again.
1: Save ne w calibration constants in EEPROMloc (1–6).
EEPROMloc selects the storage location in the onboard EEPROM to be used. Dif ferent sets of calibration constants can be used to compensate for configuration or environmental changes.
0: Use the default load table (valid only if calOP = 1). 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: Invalid. 8: Invalid. 9: Factory calibration area for unipolar (write protected).
10: Factory calibration area for bipolar (write protected).
gain
Notice that the user cannot write into EEPROMloc 9 and 10. calRefChan is the analog input channel connected to the calibration voltage of calRefVolt s
when calOP is 2.
Range: 0 through 7.
grndRefChan is the analog input channel connected to ground when calOP is 2.
Range: 0 through 7.
DAC0chan is the analog input channel connected to DAC0 when calOP is 3.
Range: 0 through 7.
NI-DAQ FRM for PC Compatibles 2-52
©
National Instruments Corporation
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
calRefV olts * 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. When you perform an analog input operation, a calibration constant for that gain must be available. When you run the
Calibrate_1200 function at a particular gain, the de vice only can be used
to collect data accurately at that gain. If you are creating a set of calibration constants that you intend to use, you must be sure to calibrate at all gains at which you in tend to sample.
Range: 1, 2, 5, 10, 50, or 100.
Using This Function
A calibration performed in bipolar mode is not valid for unipolar and vice versa.
Calibrate_1200 performs a bipol ar or unipolar calibration, or loads the bi polar or unipo lar
constants (calOP=1, EEPROMloc=0), depending on the value of the polarity parameter in the last call to with the wrong set of calibration constants loaded, you might produce erroneous data.
AI_Configure and AO_Configure. If analog input measurements are taken
Calibrate for a particular gain if you plan to acquire at that gain. If you calibrate the device yourself make sure you calibrate at a gain that you are likely to use. Each gain has a different calibration constant. When you switch gains, NI-DAQ automatically loads the calibration constant for that part icular gain. If y ou have n ot calibrated for th at gain and sa ved the cons tant earlier, an incorrect value is used.
To set up your own calibration constants in the user area for both unipolar and bipolar configurations, you need to complete the following steps. The basic steps are to create and store both unipolar and bipolar ADC cal ibration constants, and modi fy the defau lt load table so that NI-DAQ automatically loads your constants instead of the factory constants.
Step 1. Unipolar calibration—Change the po l ari ty o f yo ur device to unipol ar (by using the
AI_Configure call or use the NI-DAQ Configuration Utility in Windows). Call Calibrate_1200 to perform an ADC calibration, as in the following example:
status = Calibrate_1200 (device, 2, 1, EEPROMloc, calRefChan, grndRefChan, 0, 0, calRefVolts, gain)
where you specify device, EEPROMloc (say 1, for example), ca lRefChan, grndRefChan, calRefVolts, and gain.
©
National Instruments Corporation 2-53 NI-DAQ FRM for PC Compatibles
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-DA Q 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. Call
Calibrate_1200 to perform another ADC calibration (calOP = 2) with saveNewCal = 1
(save) and EEPROMloc set to a different user area (say, 2) as shown above. Next, call the function with calOP = 5 and EEPROMloc = 2 as shown above. NI-DAQ automatically modifies the ADC bipolar pointer in the default load table to point to user area 2. At this point, you have set up user area 1 to be your default load area when you operate the device in unipolar mode and user area 2 to be your default load area when you operate the device in bipolar mode. NI-DAQ automatically handles the loading of the appropriate constants.
Failed calibrations leave your device in an incorrectly calibrated state. If you run this function with calOp = 2 or 3 and receiv e an err or, you must reload a valid set of calibration constants. If you have a valid set of user defined constants in one of the user areas, you can load them. Otherwise, reload the factory constants.
Note If you are u sing remote SCXI, the time this function might take depends on the
baud rate settings, where slower baud rates causes this function to take longer. You also might want to call
Timeout_Config to set the timeout limit for your device
to a longer value, if you do obtain a timeoutError from this function.
NI-DAQ FRM for PC Compatibles 2-54
©
National Instruments Corporation
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 calib ration voltage
Parameter Discussion
The legal range for operation is gi ven in terms of constants de fined in a header f ile. The header file you should use depends on the language you are using:
C programmers—
BASIC programmers— should refer to the Programming Language Considerations s ection in Chapter 1, Using the NI-DAQ Functions, for more information.
Pascal programmers—
NIDAQCNS.H (DATAACQ.H) for LabWindows/CVI)
NIDAQCNS.INC Visual Basic for Windows programmers
NIDAQCNS.PAS
operation determines the operation to be performed. Range:
ND_SELF_CALIBRATE ND_EXTERNAL_CALIBRATE ND_RESTORE_FACTORY_CALIBRATION
Self-calibrates the device.
Externally calibrates the device.
Calibrates the device using internal factory
reference.
refVoltage is the value of the DC calibration voltage connected to analog input channel 0 when operation is
ND_EXTERNAL_CALIBRATE or ND_RESTORE_FACTORY_CALIBRATION.
set to
ND_EXTERNAL_CALIBRATE. This parameter i s ig no red wh en operation is
Range:+1.0 to +9.99 V. To achieve the highest accuracy, use a reference voltage between +5.0 and +9.99 V.
©
National Instruments Corporation 2-55 NI-DAQ FRM for PC Compatibles
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. To achieve specification accur acy, you should perform an internal calibration of your device just before a measurement session but after your computer and the device have been powered on and allo wed to warm up for at least 15 minutes . Frequent calibration pro duces the most stable and repeatable measurement performance.
Before the device is shipped from the factory, an external calibration is performed and the EEPROM contains calibration constants that NI-DAQ automatically loads into the calDACs as needed. The value of the onboard reference voltage is also stored in the EEPR OM, and th is value is used when you subsequen tly perform a self-calibration. The calibration con stants are recalculated and stored in the EEPROM when a self-calibration is performed. When you perform an external calibration, NI-DAQ recalculates the value of the onboard reference voltage and then performs a self-calibratio n. This new o nboard reference v alue is used for all subsequent self-calibration operations. If a mistake is made when performing an external calibration, you can restore the board’s factory calibration so that the board is not unusable.
Performing Self-Calibration of the Board
Set operation to ND_SELF_CALIBRATE to perform self-calibration of your device.
Example:
You want to perform self-calibration of your device and you want to store the new set of calibration constants in the EEPROM. You should make the following call:
Calibrate_DSA (deviceNumber, ND_SELF_CALIBRATE, 0.0)
Performing External Calibration of the Board
Set operation to ND_EXTERNAL_CALIBRATE to e xternally calibrate your device. The value of the internal reference voltage will be recalculated and the board will be self-calibrated using the new reference value.
Before calling the
Calibrate_DSA function, connect the output of your reference voltage to
analog input channel 0.
Example:
You want to externally calibrate your de vice us i ng an external reference volt age s our ce with a precise 7.0500 V ref erence, and yo u want to store t he ne w set of cal ibration c onstants in the EEPROM. You should make the following call:
Calibrate_DSA (deviceNumber, ND_EXTERNAL_CALIBRATE, 7.0500)
NI-DAQ FRM for PC Compatibles 2-56
©
National Instruments Corporation
Restoring Factory Calibration
To restore the factory value o f the intern al refere nce voltage after an external calibration, set operation to a mistake while performing the external calibration, or if you did not want to perform the external calibration at all.
ND_RESTORE_FACTORY_CALIBRATION. You might want to do so if you made
Chapter 2 Function Reference — Calibrate_DSA
©
National Instruments Corporation 2-57 NI-DAQ FRM for PC Compatibles
Chapter 2 Function Reference — Calibrate_E_Series

Calibrate_E_Series

Format
status = Calibrate_E_Series (deviceNumber, cal OP, 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
!
Note
Read the calibration chapter in your device user manual before using
Calibrate_E_Series.
Analog output channels and the AO and WFM functions do not apply to the AI E Series devices.
Parameters
Input
Name Type Description deviceNumber i16 assigned by configuration utility calOP u32 operation to be performed setOfCalConst u32 set of calibration constants or the EEPROM
calRefVolts f64 DC calibration voltage
Parameter Discussion
The legal ranges for the calOp and setOfCalConst parameters are giv en in terms of constants that are defined in the header file. The header file you should use depends on which of the following languages you are using:
C programmers—
BASIC programmers—
Pascal programmers—NIDAQCNS.PAS
location to use
NIDAQCNS.H (DATAACQ.H for LabWindows/CVI)
NIDAQCNS.INC
calOP determines the operation to be performed.
Range:
ND_SET_DEFAULT_LOAD_AREA—Make setOfCalConst the default load area; do not
perform calibration.
ND_SELF_CALIBRATE—Self-calibrates the device. ND_EXTERNAL_CALIBRATE—Externally calibrates the device.
NI-DAQ FRM for PC Compatibles 2-58
©
National Instruments Corporation
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
ND_SET_DEFAULT_LOAD_AREA.
to
ND_NI_DAQ_SW_AREA: NI-DAQ maintains calibration constants internally; no
writing into the EEPROM occurs. You cannot us e this setting when calOP is set to
ND_SET_DEFAULT_LOAD_AREA. You can use this
setting to calibrate your device repeatedly during your program, and you do not want to store the calibration constants in the EEPROM.
ND_USER_EEPROM_AREA: For the user calibration area of the EEPROM. If calOP
is set to
ND_EXTERNAL_CALIBRATE, the new calibration
ND_SELF_CALIBRATE or
constants is written into this area, and this area becomes the new default load area. You can use this setting to run several NI-DAQ applications during one measurement session conducted at same temperature, and you do not want to recalibrate your device in each application.
calRefVolts is the value of the DC calibration voltage connected to analog input channel 0 when calOP is
ND_SET_DEFAULT_LOAD_AREA or ND_SELF_CALIBRATE.
ND_EXTERNAL_CALIBRATE. This parameter is ignored when calOP is
Range:
12-bit E Series devices: +6.0 to +10. 0 V 16-bit E Series devices: +6.0 to +9.999 V
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 constant s. Those cons tants are stor ed in non-v olati le memory (EE PR OM) on your device or are maintained by NI-DAQ. To achieve specification accuracy, you should perform an internal calibration of your device just before a measurement session but after your computer and the device have been powered on and allowed to warm up for at least 15 minutes. Frequent calibration produces the most stable and repeatable measurement performance. The device is not affected negatively if you recalibrate it as often as you want.
Two sets of calibration constants can reside in two load areas inside the EEPROM; one set is programmed at the factory , and the other is left for the user. One load area in the EEPROM corresponds to one set of constants. The load area NI-DAQ uses for loading calDACs with calibration constants is called the default load area. When you get the de vice from the factor y ,
©
National Instruments Corporation 2-59 NI-DAQ FRM for PC Compatibles
Chapter 2 Function Reference — Calibrate_E_Series
the default load area is the area that contains the calibration constants obtained b y calibrating the device in the factory . NI-D AQ automatically loads the relev ant 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. NI-DAQ also automatically reloads calibration constants whenever appropriate; see the Calibration Constant Loading by NI-DAQ section later in this function for details. When you call the
ND_NI_DAQ_SW_AREA, NI-DAQ uses a set of constants it maintains in a load area that does
Calibrate_E_Series function with setOfCalConst set to
not reside inside the EEPROM.
Note Calibration of your MIO or AI device takes some time. Do not be alarmed if the
Calibrate_E_Series function takes several seconds to execute.
Note After powering on your computer, you should wait for some time (typically 15
minutes) for the entire system to warm up before performing the calibration. You should allow the same warm-up time before any measurement session that will take advantage of the calibration constants de termined by using the
Calibrate_E_Series function.
Note 611 X d evices do not support external calibration. Caution When you call the Calibrate_E_Series function with calOP set to
!
ND_SELF_CALIBRATE or ND_EXTERNAL_CALIBRATE, NI-DAQ w ill abort any
ongoing operations the device is performing and set all configurations to defaults. Therefore, we recommend that you call
Calibrate_E_Series before calling
other NI-DAQ functions or when no other operations are going on.
Explanations about using this function for different purposes (with different values of calOP) are given in the following sections.
Changing the Default Load Area
Set calOP to ND_SET_DEFAU LT_LOAD_AREA to change the area used for calibration constant loading. The storage location selected by setOfCalCo nst becomes the ne w def aul t load area.
Example:
You want to make the factory area of the EEPROM default load area. You should make the following call:
Calibrate_E_Series(deviceNumber, ND_SET_DEFAULT_LOAD_AREA, ND_FACTORY_EEPROM_AREA, 0.0)
Performing Self-Calibration of the Board
Set calOP to ND_SELF_CALIBRATE to perform self-calibration of your device. The storage location selected by setOfCalConst becomes the new default load area.
NI-DAQ FRM for PC Compatibles 2-60
©
National Instruments Corporation
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 sh ould 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. The storage location selected by setOfCalConst becomes the new default load area.
Chapter 2 Function Reference — Calibrate_E_Series
Make the following connections before calling the
Calibrate_E_Series function:
12-bit E Series Devices 16-bit E Series
1. Connect the positiv e output o f your reference voltage source to the analog input channel 8.
2. Connect the negati ve output of your reference voltage source to the AISENSE line.
3. Connect the DAC0 line (analog output channel 0 ) to analog input channel 0.
4. If your reference volta ge source and your computer are floating with respect to each other, connect the AISENSE line to the AIGND line
1. Connect the positiv e output of your refe rence voltage source to analog input channel 0.
2. Connect the negati ve output of y our reference voltage source to analog input channel 8.
Note: By performing these first two
connections, you supply the reference voltage to analog input channel 0, which is configured for differential operation.
3. If your reference voltage source and your computer are floating with respect to each other, connect the negative output of your reference voltage source to the AIGND line as well as to analog input channel 8.
as well as to the negative output of your reference voltage source.
Example:
Y ou w ant to perform an exte rnal calibration of your de vice using an ex ternal reference volta ge source with a precise 7.0500 V reference, and you want NI-DAQ to maintain a new set of calibration constants without storing them in the EEPROM. You sho uld make the following call:
Calibrate_E_Series(deviceNumber, ND_EXTERNAL_CALIBRATE, ND_NI_DAQ_SW_AREA, 7.0500)
The internal NI-DA Q area will become the default load area, and the calibration constants will be lost when your application ends.
©
National Instruments Corporation 2-61 NI-DAQ FRM for PC Compatibles
Chapter 2 Function Reference — Calibrate_E_Series
Calibration Constant Loading by NI-DAQ
NI-DA Q automatically loads calibration constants in to calDA Cs whene ver you call functions that depend on them (
12-bit E Series Devices 16-bit E Series Devices
AI, AO, DAQ, SCAN, and WFM functions). The following conditions apply:
• 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 . When you change the polarity of an analog output channel, NI-DAQ reloads the calibration constants for that channel.
• Calibration constants required by th e 16-bit E Series devices for unipolar analog input channels are different from those for bipolar analog input channels. If you are acquiring data from one channel, or if all of the channels you are acquiring data from are conf igured for the same polarity, NI-DAQ selects the appropriate set of calibration constants for you. If you are scanning se veral channels, and you mix channels configur ed for unipolar and bipolar mode in your scan list, NI-D A Q loads the calibration constants appropriate for the polarity that analog input channel 0 is configured for.
• Analog output channels on the A T-MIO-16XE-50 can be configured only for bipolar operation. Therefore, NI-D A Q always uses the same constants for t he analog outpu t channels.
NI-DAQ FRM for PC Compatibles 2-62
©
National Instruments Corporation
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.
Parameters
Input
Name Type Description deviceNumber i16 assigned by configuration utility mode i16 add or remove high/low alarm events chanStr STR channel string trigLevel f64 trigger level in volts deadbandWidth f64 the width of the alarm deadband in volts handle i16 handle alarmOnMessage i16 user-defined alarm-on message alarmOffMessage i16 user-defined alarm-off message callbackAddr u32 user callback function address
Parameter Discussion
mode indicates whether to add a new alarm message or remove an old alarm message with the given device.
0: Add a high alarm deadband event. 1: Add a low alarm deadband event. 2: Remove a high alarm deadband event. 3: Remove a low alarm deadband event.
chanStr is a string description of the trigger analog channel or digital port.
©
National Instruments Corporation 2-63 NI-DAQ FRM for PC Compatibles
Chapter 2 Function Reference — Config_Alarm_Deadband
The channel string has one of the following formats:
xn SCn!MDn!CHn AMn!n
where
x: AI for analog input channel. n: Analog channel, digital port, SCXI chassis, SCXI module number, or
AMUX-64T device number.
SC: Keyword stands for SCXI chassis. MD: Keyword stands for SCXI module. CH: Keyword stands for SCXI channel. AM: Keyword stands for AMUX-64T device.
!: Delimiter.
For example, the following string specifies onboard analog input channel 5 as the trigger channel:
AI5
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 also can specify more than one channel as the trigger channel by listing all the channels when specifying the channel number. For example, the following string specifies onboard analog input channel 2, 4, 6, and 8 as the trigger channels:
AI2,AI4,AI6,AI8
Also, if your channel numbers ar e consecutive, you can use t he following shortcut to sp ecify onboard analog input channels 2 through 8 as trigger channels:
AI2:8
trigLevel is the alarm limit in volts. trigLevel and deadbandWidth determin e the trigger condition.
deadbandWidth specifies, in volts, the hysteresis window for triggering. handle is the handle to the window you want to receive a Windows message in when
DAQEvent happens.
NI-DAQ FRM for PC Compatibles 2-64
©
National Instruments Corporation
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-DA Q passes alarmOffMessage back to you. The messages can be any value.
In Windows, yo u can set the message to a value including any W indo ws predef ined messages such as from
WM_PAINT. However, to define your own message, you can use any value ranging
WM_USER (0x400) to 0x7fff. This range is reserved by Microsoft for messages you
define.
callbackAddr is the address of the user callback function. NI-DAQ calls this function when DAQEvent occurs. See
Using This Function
To meet the high alarm-on condition, the input signal must first go below (trigLevel - deadbandWidth/2) volts and then go above (trigLevel + deadbandWidth/2) volts. On the other hand, to meet the high alarm-off condition, the input signal must first go above (trigLevel + deadbandWidth/2) volts an d then go below (trigLevel – deadbandWidth/2) volts. See Figure 2-1 for an illustration of the high alarm condition.
Chapter 2 Function Reference — Config_Alarm_Deadband
Config_DAQ_Event_Message for restrictions on this parameter.
On: high alarm on Off: high alarm off
trigLevel +
deadbandWidth/2
trigLevel
trigLevel -
deadbandWidth/2
Figure 2-1.
on
off
Time
High Alarm Deadband
The low alarm deadband trigger condition is the opposite of the high alarm deadband trigger condition. To meet the low alarm-on condition, the input signal must first go above (trigLevel + deadba ndWidth/2) and then go below (trigLevel - deadbandWidth/2). On the other hand, to meet the low alarm-off condition, the input signal must first go below (trigLeveldeadbandWidth/2) and then go above (trigLevel + deadbandWidth/2 ). See Figure 2-2 for an illustration of the low alarm condition.
©
National Instruments Corporation 2-65 NI-DAQ FRM for PC Compatibles
Chapter 2 Function Reference — Config_Alarm_Deadband
On: low alarm on Off: low alarm off
trigLevel +
deadbandWidth/2
trigLevel
trigLevel -
deadbandWidth/2
Config_Alarm_Deadband
on
Figure 2-2.
Low Alarm Deadband
is a high-level function for NI-DAQ event messaging. Because
off
Time
this function uses the current inputRange and polarity settings to translate triglevel and deadbandWidth from volts to binary , you sho uld not call
settings after you have called event messaging, see the low-level function
Config_Alarm_Deadband. For more information on NI-DAQ
Config_DAQ_Event_Message. When you are
AI_Configure and change these
using this function, the analog input data acquisition must be run with in terrupts only (programmed I/O mode). You cannot use DMA. See
Set_DAQ_Device_Info for how to
change modes.
NI-DAQ FRM for PC Compatibles 2-66
©
National Instruments Corporation
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.
Parameters
Input
Name Type Description deviceNumber i16 assigned by configuration utility mode i16 add or remove a message chanStr STR channel string trigLevel f64 trigger level in volts windowSize f64 hysteresis window size in volts triggerSlope i16 trigger slope trigSkipCount u32 num ber of triggers preTrigScans u32 number of scans to skip before trigger event postTrigScans u32 number of scans after trigger event handle i16 handle message i16 user-defined message callbackAddr u32 user callback function address
Parameter Discussion
mode indicates whether to add a new alarm message or to remov e an old alarm message with the given device.
0: Remove an existing analog trigger event. 1: Add a new analog trigger event.
©
National Instruments Corporation 2-67 NI-DAQ FRM for PC Compatibles
Loading...