Tektronix DAS-1800AO Series LabVIEW 4.0 (LV) with ASO Driver Users Guide

DAS-1800AO Series LabVIEW
VI Driver
USER’S GUIDE
DAS-1800AO Series
®
LabVIEW VI Driver
User’s Guide
Revision A – October 1994
Part Number: 93180
New Contact Information
Keithley Instruments, Inc.
28775 Aurora Road
Cleveland, OH 44139
Technical Support: 1-888-KEITHLEY
Monday – Friday 8:00 a.m. to 5:00 p.m (EST)
Fax: (440) 248-6168
Visit our website at http://www.keithley.com
The information contained in this manual is believed to be accurate and reliable. However, Keithley Instruments, Inc., assumes no responsibility for its use or for any infringements of patents or other rights of third parties that may result from its use. No license is granted by implication or otherwise under any patent rights of Keithley Instruments, Inc.
KEITHLEY INSTRUMENTS, INC., SHALL NO T BE LIABLE FOR ANY SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES RELATED TO THE USE OF THIS PRODUCT. THIS PRODUCT IS NOT DESIGNED WITH COMPONENTS OF A LEVEL OF RELIABILITY SUITABLE FOR USE IN LIFE SUPPORT OR CRITICAL APPLICATIONS.
Refer to your Keithley Instruments license agreement for specific warranty and liability information.
MetraByte is a trademark of Keithley Instruments, Inc. All other brand and product names are trademarks or registered trademarks of their respective companies.
© Copyright Keithley Instruments, Inc., 1994.
All rights reserved. Reproduction or adaptation of any part of this documentation beyond that permitted by Section 117 of the 1976 United States Copyright Act without permission of the Copyright owner is unlawful.
Keithley MetraByte Division
Keithley Instruments, Inc.
440 Myles Standish Blvd. Taunton, MA 02780
FAX: (508) 880-0179
Telephone: (508) 880-3000
Preface
The DAS-1800AO Series LabVIEW how to write LabVIEW application programs for DAS-1800AO Series boards using the Keithley MetraByte DAS-1800 Series VI Driver.
This manual is intended for LabVIEW application programmers using a DAS-1800AO Series board in an IBM It is assumed that users have read the user’s guide for the board and are familiar with the board’s features, and that they have completed the appropriate hardware installation and configuration. It is further assumed that users are experienced in programming in LabVIEW and are familiar with Windows™ and with data acquisition principles.
Manual Organization
The manual is organized as follows:
Chapter 1 explains how to install the DAS-1800 Series VI Driver and how to get help, if necessary.
Chapter 2 contains the background information needed to use the VIs included in the DAS-1800 Series VI Driver.
VI Driver User’s Guide explains
PC AT
or compatible computer.
Chapter 3 provides guidelines for using the DAS-1800 Series VIs. Chapter 4 contains detailed descriptions of the DAS-1800 Series VIs,
arranged in alphabetical order. Appendix A describes the error codes returned by DAS-1800 Series
VIs. Appendix B provides instructions for converting raw counts to
voltage and for converting voltage to raw counts.
ix
An index completes the manual.
Conventions Used in this Manual
The following conventions are used throughout this manual:
References to DAS-1800A O Series boards apply to the D AS-1801AO board and the DAS-1802AO board.
All VIs supported by the DAS-1800 Series VI Driver are illustrated graphically, as shown in the example below. The name of the VI is shown beneath the D AS-1800 icon; the wires connecting the inputs to and the outputs from the DAS-1800 icon represent the data type of the parameters.
Input Parameters
Numeric Data
Array
String
Cluster
Wiring
Output Parameters
Numeric Data Array String
Cluster
K_ Example VI
Name of VI
x
The data types of the inputs and outputs are represented as follows:
Inputs
I16 I32 U8 U16 U32
[ ]
I16
[ ]
U16
[ ]
U32
a b c T F
Related Documents
For more information, refer to the following documents:
Outputs
I16 I32
U8 U16 U32
[ ]
I16
[ ]
U16
[ ]
U32
a b c T F
Data Type
Signed 16-bit integer Signed 32-bit integer Unsigned 8-bit integer Unsigned 16-bit integer
Unsigned 32-bit integer Array of signed 16-bit integers
Array of unsigned 16-bit integers Array of unsigned 32-bit integers
Cluster String
Boolean
DAS-1800AO Series User’s Guide
LabVIEW manuals
xi
Table of Contents
Preface
Manual Organization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .ix
Conventions Used in this Manual . . . . . . . . . . . . . . . . . . . . . . . . . x
Related Documents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .xi
Getting Started
1
Installing the VI Driver . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .1-1
Getting Help. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .1-2
2
Available Operations
System Operations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2-1
Initializing the Driver . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2-2
Initializing a Board . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2-2
Retrieving Revision Levels . . . . . . . . . . . . . . . . . . . . . . . . . . .2-3
Handling Errors. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2-3
Analog Input Operations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2-4
Operation Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2-4
Memory Allocation and Management. . . . . . . . . . . . . . . . . . .2-5
Gains and Ranges . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2-7
Channels . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2-8
Specifying Channels When Using EXP-1800
Expansion Boards. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2-8
Acquiring Samples from a Single Channel . . . . . . . . . . .2-10
Acquiring Samples from a Group of Consecutive
Channels. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2-11
Acquiring Samples Using a Channel-Gain Array . . . . . .2-12
Conversion Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2-13
Clock Source. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2-13
A/D Pacer Clock. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2-14
Burst Mode Conversion Clock. . . . . . . . . . . . . . . . . . . . .2-15
Buffering Mode. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2-16
Trigger. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2-16
Trigger Source . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2-17
Post-Trigger Acquisition . . . . . . . . . . . . . . . . . . . . . . . . .2-20
Pre-Trigger Acquisition . . . . . . . . . . . . . . . . . . . . . . . . . .2-21
About-Trigger Acquisition . . . . . . . . . . . . . . . . . . . . . . . .2-22
iii
Hardware Gate. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2-22
Analog Output Operations . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2-23
Operation Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2-23
Memory Allocation and Management. . . . . . . . . . . . . . . . . .2-25
Gains and Ranges . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2-26
Channels . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2-26
Writing Values to a Single Channel . . . . . . . . . . . . . . . . .2-26
Writing Values to Both Channels Using the
Same Gain Code. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2-27
Writing Values to Both Channels Using
Different Gain Codes . . . . . . . . . . . . . . . . . . . . . . . . . . .2-27
Clock Source. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2-28
D/A Pacer Clock. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2-28
External Pacer Clock . . . . . . . . . . . . . . . . . . . . . . . . . . . .2-29
A/D Pacer Clock. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2-29
Buffering Mode. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2-30
Trigger. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2-30
Trigger Source . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2-30
Retriggering . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2-32
Hardware Gate. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2-33
Digital I/O Operations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2-34
Operation Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2-34
Memory Allocation and Management. . . . . . . . . . . . . . . . . .2-36
Digital Input Channel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2-36
Digital Output Channel . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2-37
Clock Source. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2-38
Buffering Mode. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2-39
3
Programming with the VI Driver
How the Driver Works . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3-1
General Programming Tasks . . . . . . . . . . . . . . . . . . . . . . . . . . .3-10
Operation-Specific Programming Tasks. . . . . . . . . . . . . . . . . . .3-11
Analog Input Operations. . . . . . . . . . . . . . . . . . . . . . . . . . . .3-11
Single Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3-11
Interrupt Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3-11
DMA Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3-14
Analog Output Operations . . . . . . . . . . . . . . . . . . . . . . . . . .3-16
Single Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3-16
Interrupt Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3-16
DMA Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3-18
Recycle Mode. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3-20
iv
Digital I/O Operations. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3-22
Single Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3-22
Interrupt Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3-23
VI Reference
4
K_ADRead . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4-5
K_AllocChnGAry . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4-7
K_BufListAdd . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4-8
K_BufListReset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-9
K_ClearFrame . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4-10
K_CloseDriver . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4-11
K_ClrAboutTrig . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4-12
K_ClrADFreeRun . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4-13
K_ClrContRun . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4-14
K_DASDevInit. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-15
K_DAWriteGain . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4-16
K_DIRead . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4-17
K_DMAAlloc . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4-18
K_DMAFree . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4-19
K_DMAStart . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4-20
K_DMAStatus . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-21
K_DMAStop . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4-24
K_DOWrite . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4-25
K_FormatChnGAry . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4-26
K_FreeChnGAry . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4-27
K_FreeDevHandle . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4-28
K_FreeFrame . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4-29
K_GetADCommonMode . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4-30
K_GetADConfig . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4-31
K_GetADFrame . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4-32
K_GetADMode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4-33
K_GetClkRate . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-34
K_GetDAFrame . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4-35
K_GetDevHandle . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4-36
K_GetDIFrame . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4-37
K_GetDOFrame . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4-38
K_GetErrMsg . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4-39
K_GetShellVer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4-40
K_GetVer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4-41
K_IntAlloc . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4-43
K_IntFree . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4-44
K_IntStart . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4-45
v
K_IntStatus . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4-46
K_IntStop . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4-49
K_MoveArrayToBuf . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4-50
K_MoveBufToArray . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4-51
K_OpenDriver . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4-52
K_SetAboutTrig . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4-53
K_SetADCommonMode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4-54
K_SetADConfig . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4-55
K_SetADFreeRun . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4-56
K_SetADMode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4-57
K_SetADTrig . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4-58
K_SetBuf . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4-60
K_SetBurstTicks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4-61
K_SetChn . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4-62
K_SetChnGAry . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4-63
K_SetClk . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4-64
K_SetClkRate . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4-66
K_SetContRun . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4-68
K_SetDITrig . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4-69
K_SetDMABuf . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-71
K_SetExtClkEdge . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4-72
K_SetG . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4-73
K_SetGate . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4-74
K_SetSSH . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4-75
K_SetStartStopChn . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4-76
K_SetStartStopG . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4-78
K_SetSync . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4-80
K_SetTrig . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4-81
K_SetTrigHyst . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4-82
Error Codes
A
B
Converting Data Formats
Converting Raw Counts to Voltage . . . . . . . . . . . . . . . . . . . . . . B-1
Converting Voltage to Raw Counts . . . . . . . . . . . . . . . . . . . . . . B-3
Specifying an Analog Output Value . . . . . . . . . . . . . . . . . . . B-3
Specifying an Analog Trigger Level . . . . . . . . . . . . . . . . . . . B-3
Specifying a Hysteresis Value. . . . . . . . . . . . . . . . . . . . . . . . B-4
Index
vi
List of Figures
Figure 2-1. Example of Logical Channel Assignments . . . . .2-10
Figure 2-2. Trigger Events for Analog Triggers. . . . . . . . . . .2-18
Figure 2-3. Using a Hysteresis Value. . . . . . . . . . . . . . . . . . .2-19
Figure 2-4. Trigger Events For Digital Triggers . . . . . . . . . .2-20
Figure 2-5. Digital Input Bits . . . . . . . . . . . . . . . . . . . . . . . . .2-36
Figure 2-6. Digital Output Bits. . . . . . . . . . . . . . . . . . . . . . . .2-37
Figure 3-1. Single-Mode Operation . . . . . . . . . . . . . . . . . . . . .3-2
Figure 3-2. Using a Frame for an Interrupt-Mode Operation. .3-3
List of Tables
Table 2-1. Supported Operations . . . . . . . . . . . . . . . . . . . . . .2-1
Table 2-2. Analog Input Ranges and Gains . . . . . . . . . . . . . .2-7
Table 2-3. Analog Output Ranges. . . . . . . . . . . . . . . . . . . . .2-26
Table 3-1. A/D Frame Elements . . . . . . . . . . . . . . . . . . . . . . .3-4
Table 3-2. D/A Frame Elements . . . . . . . . . . . . . . . . . . . . . . .3-6
Table 3-3. DI Frame Elements . . . . . . . . . . . . . . . . . . . . . . . .3-8
Table 3-4. DO Frame Elements. . . . . . . . . . . . . . . . . . . . . . . .3-9
Table 3-5. Error Cluster Elements. . . . . . . . . . . . . . . . . . . . .3-10
Table 3-6. VIs Used for Interrupt-Mode
Analog Input Operations . . . . . . . . . . . . . . . . . . .3-12
Table 3-7. VIs Used for DMA-Mode
Analog Input Operations . . . . . . . . . . . . . . . . . . .3-14
Table 3-8. VIs Used for Interrupt-Mode
Analog Output Operations. . . . . . . . . . . . . . . . . .3-17
Table 3-9. VIs Used for DMA-Mode
Analog Output Operations. . . . . . . . . . . . . . . . . .3-19
Table 3-10. VIs Used for Recycle-Mode
Analog Output Operations. . . . . . . . . . . . . . . . . .3-21
Table 3-11. VIs Used for Interrupt-Mode
Digital Input and Digital Output Operations . . . .3-23
Table 4-1. VIs by Functional Group . . . . . . . . . . . . . . . . . . . .4-2
Table A-1. Error Codes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A-1
Table B-1. Span Values For Analog Input Data
Conversion Equations . . . . . . . . . . . . . . . . . . . . . B-2
vii
Table 2-1. Supported Operations . . . . . . . . . . . . . . . . . . . . . .2-1
Table 2-2. Analog Input Ranges and Gains . . . . . . . . . . . . . .2-7
Table 2-3. Analog Output Ranges. . . . . . . . . . . . . . . . . . . . .2-26
Table 3-1. A/D Frame Elements . . . . . . . . . . . . . . . . . . . . . . .3-4
Table 3-2. D/A Frame Elements . . . . . . . . . . . . . . . . . . . . . . .3-6
Table 3-3. DI Frame Elements . . . . . . . . . . . . . . . . . . . . . . . .3-8
Table 3-4. DO Frame Elements. . . . . . . . . . . . . . . . . . . . . . . .3-9
Table 3-5. Error Cluster Elements. . . . . . . . . . . . . . . . . . . . .3-10
Table 3-6. VIs Used for Interrupt-Mode Analog Input Operations3-12 Table 3-7. VIs Used for DMA-Mode Analog Input Operations3-14 Table 3-8. VIs Used for Interrupt-Mode Analog Output Operations3-17 Table 3-9. VIs Used for DMA-Mode Analog Output Operations3-18 Table 3-10. VIs Used for Recycle-Mode Analog Output Operations3-20 Table 3-11. VIs Used for Interrupt-Mode Digital Input and Digital Output Operations3-23
Table 4-1. VIs by Functional Group . . . . . . . . . . . . . . . . . . . .4-2
Table A-1. Error Codes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A-1
Table B-1. Span Values For Analog Input Data Conversion Equations B-2
Figure 2-1. Example of Logical Channel Assignments . . . . .2-10
Figure 2-2. Trigger Events for Analog Triggers. . . . . . . . . . .2-18
Figure 2-3. Using a Hysteresis Value. . . . . . . . . . . . . . . . . . .2-19
Figure 2-4. Trigger Events For Digital Triggers . . . . . . . . . .2-20
Figure 2-5. Digital Input Bits . . . . . . . . . . . . . . . . . . . . . . . . .2-35
Figure 2-6. Digital Output Bits. . . . . . . . . . . . . . . . . . . . . . . .2-36
Figure 3-1. Single-Mode Operation . . . . . . . . . . . . . . . . . . . . .3-2
Figure 3-2. Using a Frame for an Interrupt-Mode Operation. .3-3
1
Getting Started
The DAS-1800 Series VI Driver is a library of data acquisition and control VIs (Virtual Instruments) used to write application programs for DAS-1800AO Series data acquisition boards.
This chapter describes how to install the DAS-1800 Series VI Driver and how to get help, if required.
Installing the VI Driver
To install the DAS-1800 Series VI Driver, perform the following procedure:
1. Insert the VI Driver disk into the appropriate disk drive of your computer.
2. Enter Windo ws.
3. From the Program Manager File menu, select Run.
4. Assuming you are using drive A, type the following command line in the Run dialog box:
A:SETUP
5. Select OK.
6. Respond to the installation prompts as appropriate.
The program creates a Program Manager setup group called KEITHLEY DAS-1800 VI Driver. This group contains files for the VI driver, utilities, and example programs using the DAS-1800 Series VIs.
1-1
Once you have installed the DAS-1800 Series VI Driver, install your DAS-1800AO Series board and its software, run the Keithley Memory Manager utility, and run the configuration program. Refer to the user’s guide for your board for the information required to perform these steps.
The above steps must be completed in order to open the VI Driver example programs. You can open LabVIEW from the Program Manager group by opening a VI Driver example program.
After installation, you may want to review the following files:
Readme.Txt - An ASCII file containing information available after
the publication of this manual. Files.Txt - An ASCII file that describes all of the files available.
Getting Help
If you need help installing or using the DAS-1800 Series VI Driver, call your local sales office or the Keithley Metrabyte Applications Engineering Department at:
(508) 880-3000 Monday - Friday, 8:00
A.M.
- 6:00
, Eastern Time
P.M.
An applications engineer will help you diagnose and resolve your problem over the telephone.
1-2 Getting Started
Please make sure that you have the follo wing information av ailable before you call:
Board Configuration Model
Serial # Revision code Base address setting Interrupt level setting Number of channels Input (S.E. or Diff.) Mode (uni. or bip.) DMA chan(s) Number of SSH-8s Number of EXPs
Computer
Operating System
LabVIEW Package
Manufacturer CPU type Clock speed (MHz) KB of RAM Video system BIOS type
Windows version Windows mode
Version ____________________
___________________ ___________________ ___________________ ___________________ ___________________ ___________________ ___________________ ___________________ ___________________ ___________________ ___________________ ___________
___________________ ___________________ ___________________ ___________________ ___________________ ___________________ ______
___________________ ___________________ __
Accessories
Type Type Type Type Type Type Type Type
___________________ ___________________ ___________________ ___________________ ___________________ ___________________ ___________________ ___________________ ________
1-3
2
Available Operations
This chapter contains the background information you need to use the VIs to perform operations on DAS-1800AO Series boards. The supported operations are listed in Table 2-1.
Table 2-1. Supported Operations
Operation Page Reference
System page 2-1 Analog input page 2-4 Analog output page 2-23 Digital input and output (I/O) page 2-34
System Operations
This section describes the miscellaneous operations and general maintenance operations that apply to DAS-1800AO Series boards and to the DAS-1800 Series VI Driver. It includes information on initializing a driver, initializing a board, retrieving revision levels, and handling errors.
2-1
Initializing the Driver
You must initialize the DAS-1800 Series VI Driv er and any other Keithle y DAS VI Drivers you are using in your application program. To initialize the drivers, use K_OpenDriver . You specify the configuration file that defines this particular use of the driver. The driver returns a unique identifier for the particular use of the driver; this identifier is called the driver handle. A maximum of 30 driver handles can be specified for all the Keithley MetraByte boards accessed from your application program.
If a particular use of a driver is no longer required and you want to free some memory or if all 30 driver handles have been used, you can use
K_CloseDriver to free a driver handle and close the associated use of the
driver. If the driver handle you free is the last driver handle specified for a VI Driver, the driver is shut down.
Initializing a Board
The DAS-1800 Series VI Driver supports up to three boards. You must use K_GetDevHandle to specify the boards you want to use. The driver returns a unique identifier for each board; this identifier is called the board handle. Board handles allow you to communicate with more than one board. In subsequent VIs related to the board, you use the board handle returned by K_GetDevHandle . A maximum of 30 board handles can be specified for all the Keithley DAS boards accessed from your application program.
If a board is no longer being used and you want to free some memory or if all 30 board handles have been used, you can use K_FreeDevHandle to free a board handle.
To reinitialize a board during an operation, use K_DASDevInit , which performs the following tasks:
Aborts all operations currently in progress that are associated with the
board identified by the board handle.
Verifies that the board identified by the board handle is the board specified in the configuration file.
2-2 Available Operations
Retrieving Revision Levels
If you are having problems with your application program, you may want to verify which versions of the VI Driver, Keithley DAS Driver Specification, and Keithley DAS Shell are installed on your board.
K_GetVer allows you to get both the revision number of the DAS-1800
Series VI Driver and the revision number of the Keithley DAS Driver Specification to which the driver conforms. K_GetShellVer allows you to get the revision number of the Keithley DAS Shell (the Keithley DAS Shell is a group of VIs that are shared by all DAS boards).
Handling Errors
Error information is passed from one VI to the next in your application program. You must first create an error cluster, which consists of three variables:
A Boolean error status (True/False: True = error)
A numeric error code for the number of the error, if an error occurred
(0 = no error, nonzero = error occurred)
A string for the name of the VI (error source) that returned the error, if an error occurred
You then wire the cluster to each VI in your program, normally starting with K_OpenDriver. When the program begins, the first VI checks the error status; if the status is False (no error), the VI runs. When it has finished, the VI sets the error status. If an error occurred during the execution of the VI, the error status is set to True, the error code is set to a nonzero value identifying the error , and the error source is set to the name of the VI that caused the error. The next VI in the program reads the error status; if it finds that the error status is True, the VI does not execute. All VIs remaining in the program do likewise.
You can read the error information by placing an Unbundle by Name function after a VI (normally the last VI in your program,
K_CloseDriver ). You create a variable for each element in the error
cluster; once the variables are wired to the Unbundle by Name cluster , the error information is displayed there.
Appendix A contains a complete list of error codes and their descriptions.
2-3
Analog Input Operations
This section describes the following:
Analog input operation modes available. How to allocate and manage memory for analog input operations.
How to specify the following for an analog input operation: channels and gains, conversion mode, clock source, buffering mode, trigger source, and hardware gate.
Operation Mode
The operation mode determines which attributes you can specify for an analog input operation and how data is transferred from the board to the computer. You can perform analog input operations in one of the following modes:
Single mode - In single mode, the board acquires a single sample
from an analog input channel. The driver initiates conversions; you cannot perform any other operation until the single-mode operation is complete.
Use K_ADRead to start an analog input operation in single mode. You specify the board you want to use, the analog input channel, and the gain code for the gain at which you want to read the signal.
Interrupt mode - In interrupt mode, the board acquires a single
sample or multiple samples from one or more analog input channels. A hardware clock initiates conversions. Once the analog input operation begins, control returns to your application program. The hardware temporarily stores the acquired data in the onboard A/D FIFO (first-in, first-out data buffer) and then transfers the data to a user-defined buf fer in the computer using an interrupt service routine. Use K_IntStart to start an analog input operation in interrupt mode.
You can specify either single-cycle or continuous buffering mode for interrupt-mode operations. Refer to page 2-16 for more information on buffering modes. Use K_IntStop to stop an interrupt-mode operation. Use K_IntStatus to determine the current status of an interrupt operation.
2-4 Available Operations
DMA mode - In DMA mode, the board acquires a single sample or
multiple samples from one or more analog input channels. A hardware clock initiates conv ersions. Once the analog input operation begins, control returns to your application program. The hardware temporarily stores the acquired data in the onboard A/D FIFO and then transfers the data to a user-defined DMA buffer in the computer.
Note:
You can perform an analog input operation in single-DMA mode or dual-DMA mode, depending on whether you specified one or two DMA channels in your configuration file. Refer to your
DAS-1800AO Series User’s Guide for more information.
Use K_DMAStart to start an analog input operation in DMA mode. You can specify either single-cycle or continuous buffering mode for
DMA-mode operations. Refer to page 2-16 for more information on buffering modes. Use K_DMAStop to stop a continuous-mode DMA operation. Use K_DMAStatus to determine the current status of a DMA operation.
The converted data is stored as ra w counts. For information on converting raw counts to voltage, refer to Appendix B.
Memory Allocation and Management
Interrupt-mode and DMA-mode analog input operations require memory buffers in which to store the acquired data. You can reserve a single buffer, or you can reserve multiple buffers (up to a maximum of 150) to increase the number of samples you can acquire. Buffers must be dynamically allocated outside of your application program’s memory area.
Use K_IntAlloc to allocate memory dynamically for interrupt-mode operations; use K_DMAAlloc to allocate memory dynamically for DMA-mode operations. You specify the operation requiring the buffer and the number of samples to store in the buffer (up to 65,536). The driv er returns the starting address of the buffer and a unique identifier for the buffer; this identifier is called the buffer handle.
2-5
T o assign the starting address of a b uffer and the number of samples in the buffer, use K_SetBuf for interrupt operations or K_SetDMABuf for DMA operations. If you are using multiple buffers, use K_BufListAdd to add each buffer to the list of multiple buffers associated with each operation. To move the contents of an allocated buffer to a LabVIEW array, use K_MoveBufToArray .
The following example shows how to allocate multiple buffers using
K_DMAAlloc and K_BufListAdd . For each K_DMAAlloc VI used, you
use the K_BufListAdd VI to add the allocated b uffer to the list of b uf fers. The example is illustrated in DMA mode; interrupt mode is identical except that you use the appropriate interrupt-mode VIs. Refer to the examples on disk for more information.
Frame Handle
Error In
Number of Samples
U32
Buffer Address
K_DMAAlloc
U32
Note:
U16
K_BufListAdd
Buffer Handle
K_DMAAlloc
If you are using multiple buffers, it is recommended that you use
U16
K_BufListAdd
To K_DMAFree
Buffer Handle
To K_DMAFree
the Keithley Memory Manager before you begin programming to ensure that you can allocate enough buffers and large enough buffers. Refer to your DAS-1800 Series board user’s guide for more information about the Keithley Memory Manager.
When a buffer is no longer required, you can free its memory for another use by specifying the buffer handle in K_IntFree for interrupt-mode operations or in K_DMAFree for DMA-mode operations.
2-6 Available Operations
Gains and Ranges
Each analog input channel on a DAS-1800AO Series board can measure signals in one of four software-selectable unipolar or bipolar analog input ranges. The input range type (unipolar or bipolar) is initially set according to your configuration file; use K_SetADMode to reset the input range type. Refer to your DAS-1800AO Series User’s Guide for more information about analog input ranges.
Table 2-2 lists the analog input ranges supported by DAS-1800AO Series boards and the gain and gain code associated with each range. (The gain code is used by the VIs to represent the gain.)
Table 2-2. Analog Input Ranges and Gains
Analog Input Range
Boards
Bipolar Unipolar
DAS-1801AO ±5 V 0 to 5 V 1 0
±1 V 0 to 1 V 5 1 ±100 mV 0 to 100 mV 50 2 ±20 mV 0 to 20 mV 250 3
DAS-1802AO ±10 V 0 to 10 V 1 0
±5 V 0 to 5 V 2 1 ±2.5 V 0 to 2.5 V 4 2 ±1.25 V 0 to 1.25 V 8 3
DAS-1801AO with EXP-1800 attached
±100 mV 0 to 100 mV 50 4 ±20 mV 0 to 20 mV 250 5 ±2 mV 0 to 2 mV 2500 6 ±0.4 mV 0 to 0.4 mV 12.5k 7
Gain
Gain Code
2-7
Table 2-2. Analog Input Ranges and Gains (cont.)
N
Boards
DAS-1802AO with EXP-1800 attached
Channels
Analog Input Range
Gain
Bipolar Unipolar
±200 mV 0 to 200 mV 50 4 ±100 mV 0 to 100 mV 100 5 ±50 mV 0 to 50 mV 200 6 ±25 mV 0 to 25 mV 400 7
Gain Code
DAS-1800AO Series boards are configured with either 16 onboard single-ended or eight onboard differential analog input channels. You can increase the number of channels to 256 single-ended channels using EXP-1800 expansion boards, described in the next section.
The input channel configuration (differential or single-ended) is initially set according to the configuration file; use K_SetADConfig to reset the input channel configuration. Use K_SetADCommonMode to set the common-mode ground reference for boards configured for single-ended input.
You can perform an analog input operation on a single channel or on a group of multiple channels. The following subsections describe how to specify the channels you are using.
Specifying Channels When Using EXP-1800 Expansion Boards
To increase the number of analog input channels, you can attach up to 16 EXP-1800 expansion boards to the DAS-1800AO Series board. Each EXP-1800 board has 16 analog input channels. If you are using
EXP-1800 boards, you must attach them to DAS-1800AO channels 0 to
N-1 . Refer to the user’s guide for information on connecting EXP-1800
boards to DAS-1800AO Series boards.
2-8 Available Operations
The analog input channel connections on a DAS-1800AO Series board or EXP-1800 board are designated with numbers from 0 to 15. These numbers are the physical channel numbers . If a system includes a DAS-1800AO Series board and one or more EXP-1800s, then that system contains duplicate physical channel numbers. To uniquely identify a physical channel, the VI Driver uses a scheme of logical channel
numbers. The channel# argument for any VI must be specified as a logical
channel number.
The logical channel number corresponding to a particular physical channel number is given by one of the following equations:
If the physical channel is on a DAS-1800AO Series board:
LogicalChan# PhysicalChan#15NumEXPs×()+=
If the physical channel is on an EXP-1800:
LogicalChan# PhysicalChan#16EXP#×()+=
where
NumEXPs is an integer from 0 to 16 that identifies the number of
EXP-1800s connected to the DAS-1800AO Series board, and
EXP# is an integer from 0 to 15 that indicates on which EXP-1800
the physical channel is located (0 indicates the first EXP-1800).
2-9
For example, consider the system illustrated in Figure 2-1, in which three EXP-1800s are connected to a DAS-1801AO.
0 1 2 ... 15
EXP #0
0 1 2 ... 15
EXP #1
0 1 2 ... 15
EXP #2
Logical Channel 48
Logical Channel 60
DAS-1801AO
0 1 2 3
15
Figure 2-1. Example of Logical Channel Assignments
The logical channel that identifies channel 3 on the DAS-1801A O is gi ven by:
LogicalChan# 3 15 3×()+ 3 45 48=+==
The logical channel that identifies channel 15 on the third EXP-1800 is given by:
Logical Channels 0 to 15
Logical Channels 16 to 31
Logical Channels 32 to 47
LogicalChan#15 162×()15 32+47==+=
Acquiring Samples from a Single Channel
You can acquire a single sample or multiple samples from a single analog input channel.
For single-mode analog input operations, you can acquire a single sample from a single analog input channel. Use K_ADRead to specify the channel and the gain code.
2-10 Available Operations
For interrupt-mode and DMA-mode analog input operations, you can acquire a single sample or multiple samples from a single analog input channel. Use K_SetChn to specify the channel and K_SetG to specify the gain code.
Acquiring Samples from a Group of Consecutive Channels
For interrupt-mode and DMA-mode analog input operations, you can acquire samples from a group of consecutive channels. Use K_SetStartStopChn to specify the first and last channels in the group. The channels are sampled in order from first to last; the channels are then sampled again until the required number of samples are read.
For example, assume that the start channel is 14, the stop channel is 17, and you want to acquire five samples. Your program reads data first from channel 14, then from channels 15, 16, and 17, and finally from channel 14 again.
You can specify a start channel that is higher than the stop channel. For example, assume that you are using a single-ended input configuration with no expansion boards, the start channel is 15, the stop channel is 2, and you want to acquire five samples. Your program reads data first from channel 15, then from channels 0, 1, and 2, and finally from channel 15 again.
Use K_SetG to specify the gain code for all channels in the group. (All channels must use the same gain code.) Use K_SetStartStopG to specify the gain code, the start channel, and the stop channel in a single VI.
Refer to Table 2-2 on page 2-7 for a list of the analog input ranges supported by DAS-1800 Series boards and the gain code associated with each range.
2-11
Acquiring Samples Using a Channel-Gain Array
For interrupt-mode and DMA-mode analog input operations, you can acquire samples from channels in a hardware channel-gain queue. You create an array and specify the channels you want to sample, the order in which you want to sample them, and a gain code for each channel. You can set the channels in the channel-gain array in consecutive order or in nonconsecutive order. You can also specify the same channel more than once. The channel gain array can contain up to 256 entries.
The channels are sampled in order from the first channel specified in the array to the last channel specified in the array; the channels in the array are then sampled again until the specified number of samples is read.
For example, assume you want to sample channels 0, 5, and 3. Channel 0 uses a gain code of 1, channel 5 uses a gain code of 2 and channel 3 uses a gain code of 3. Your array would look like this:
# of Entries Chan
3 015233
Gain Code Chan
Gain Code Chan
Gain Code
where the first element is the number of entries and the remaining pairs of elements represent the channel to read and its associated gain code.
After you create the channel-gain array, you allocate space for the channel-gain array in your program using K_AllocChnGAry; you initialize the channel-gain array using K_FormatChnGAry; you set the frame element for the channel-gain array using K_SetChnGAry. When the operation is finished with the channel-gain array, you can free its space using K_FreeChnGAry.
Refer to Table 2-2 on page 2-7 for a list of the analog input ranges supported by DAS-1800AO Series boards and the gain code associated with each range.
2-12 Available Operations
Conversion Mode
The conversion mode determines how the board regulates the timing of conversions when you are acquiring multiple samples from a single channel or from a group of multiple channels (known as a scan). For interrupt-mode and DMA-mode analog input operations, you can specify one of the following conversion modes:
Paced mode - Use paced mode if you want to accurately control the
period between conversions of individual channels in a scan. Paced mode is the default conversion mode.
Burst mode - Use burst mode if you want to accurately control both
the period between conversions of individual channels in a scan and the period between conversions of the entire scan. Use K_SetADFreeRun to specify burst mode.
Use burst mode with SSH (sample-and-hold) if you want to simultaneously sample all channels in a scan using the SSH-8 accessory board. Use K_SetSSH to specify burst mode with SSH.
Note: If you use an SSH-8 accessory board, you must use burst mode
with SSH. One extra tick of the burst mode conversion clock is required to allow the SSH-8 board to sample and hold the values. Refer to the SSH-8 board documentation for more information.
Clock Source
Refer to your DAS-1800AO Series User’s Guide for more information about conversion modes.
DAS-1800AO Series boards provide two clock sources for analog input operations: an A/D pacer clock and a burst mode conversion clock. Each clock has a dedicated use. When performing interrupt-mode and DMA-mode analog input operations in paced mode, you use only the A/D pacer clock; when performing interrupt-mode and DMA-mode analog input operations in burst mode and burst mode with SSH, you use both the A/D pacer clock and the burst mode conversion clock. These clock sources are described in the following subsections.
2-13
+ 154 hidden pages