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.
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 U8U16U32
[ ]
I16
[ ]
U16
[ ]
U32
a b cT F
Related Documents
For more information, refer to the following documents:
Outputs
I16 I32
U8U16U32
[ ]
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
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
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-2Getting 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
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
OperationPage Reference
Systempage 2-1
Analog inputpage 2-4
Analog outputpage 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-2Available 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-4Available 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-6Available 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
BipolarUnipolar
DAS-1801AO±5 V0 to 5 V10
±1 V0 to 1 V51
±100 mV0 to 100 mV502
±20 mV0 to 20 mV2503
DAS-1802AO±10 V0 to 10 V10
±5 V0 to 5 V21
±2.5 V0 to 2.5 V42
±1.25 V0 to 1.25 V83
DAS-1801AO with
EXP-1800 attached
±100 mV0 to 100 mV504
±20 mV0 to 20 mV2505
±2 mV0 to 2 mV25006
±0.4 mV0 to 0.4 mV12.5k7
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
BipolarUnipolar
±200 mV0 to 200 mV504
±100 mV0 to 100 mV1005
±50 mV0 to 50 mV2006
±25 mV0 to 25 mV4007
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-8Available 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#3153×()+34548=+==
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×()1532+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-10Available 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
CodeChan
Gain
CodeChan
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-12Available 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
Loading...
+ 154 hidden pages
You need points to download manuals.
1 point = 1 manual.
You can buy points or you can get point for every manual you upload.