Tektronix Keithley KUSB-3116 User's Manual User manual

KUSB-3116
User’s Manual
KUSB3116-900-01 Rev. A / January 2005
www.keithley.com
A GR
EATER MEASURE OF CONFIDENCE
WARRANTY
Keithley Instruments, Inc. warrants this product to be free from defects in material and workmanship for a period of 3 years from date of shipment.
Keithley Instruments, Inc. warrants the following items for 90 days from the date of shipment: probes, cables, rechargeable batteries, diskettes, and documentation.
During the warranty period, we will, at our option, either repair or replace any product that proves to be defective.
To exercise this warranty, write or call your local Keithley representative, or contact Keithley headquarters in Cleveland, Ohio. You will be given prompt assistance and return instructions. Send the product, transportation prepaid, to the indicated service facil­ity. Repairs will be made and the product returned, transportation prepaid. Repaired or replaced products are warranted for the bal­ance of the original warranty period, or at least 90 days.
LIMITATION OF WARRANTY
This warranty does not apply to defects resulting from product modification without Keithley’s express written consent, or misuse of any product or part. This warranty also does not apply to fuses, software, non-rechargeable batteries, damage from battery leak­age, or problems arising from normal wear or failure to follow instructions.
THIS WARRANTY IS IN LIEU OF ALL OTHER WARRANTIES, EXPRESSED OR IMPLIED, INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR USE. THE REMEDIES PROVIDED HEREIN ARE BUYER’S SOLE AND EXCLUSIVE REMEDIES.
NEITHER KEITHLEY INSTRUMENTS, INC. NOR ANY OF ITS EMPLOYEES SHALL BE LIABLE FOR ANY DIRECT, INDIRECT, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OF ITS INSTRU­MENTS AND SOFTWARE EVEN IF KEITHLEY INSTRUMENTS, INC., HAS BEEN ADVISED IN ADVANCE OF THE POSSIBILITY OF SUCH DAMAGES. SUCH EXCLUDED DAMAGES SHALL INCLUDE, BUT ARE NOT LIMITED TO: COSTS OF REMOVAL AND INSTALLATION, LOSSES SUSTAINED AS THE RESULT OF INJURY TO ANY PERSON, OR DAMAGE TO PROPERTY.
A G R E A T E R M E A S U R E O F C O N F I D E N C E
Keithley Instruments, Inc.
Corporate Headquarters • 28775 Aurora Road • Cleveland, Ohio 44139
440-248-0400 • Fax: 440-248-6168 • 1-888-KEITHLEY (534-8453) • www.keithley.com
12/04
KUSB-3116
User’s Manual
©2005, Keithley Instruments, Inc.
All rights reserved.
First Printing, January 2005
Cleveland, Ohio, U.S.A.
Document Number: KUSB3116-900-01A Rev. A

Manual Print History

The print history shown below lists the printing dates of all Revisions and Addenda created for this manual. The Revi­sion Level letter increases alphabetically as the manual undergoes subsequent updates. Addenda, which are released between Revisions, contain important change information that the user should incorporate immediately into the manual. Addenda are numbered sequentially. When a new Revision is created, all Addenda associated with the previous Revision of the manual are incorporated into the new Revision of the manual. Each new Revision includes a revised copy of this print history page.
Revision A (Document Number KUSB3116-900-01A) ...................................................................... January 2005
All Keithley product names are trademarks or registered trademarks of Keithley Instruments, Inc. Other brand and product names are trademarks or registered trademarks of their respective holders.

Safety Precautions

The following safety precautions should be observed before using this product and any associated instrumentation. Although some in­struments and accessories would normally be used with non-haz­ardous voltages, there are situations where hazardous conditions may be present.
This product is intended for use by qualified personnel who recog­nize shock hazards and are familiar with the safety precautions re­quired to avoid possible injury. Read and follow all installation, operation, and maintenance information carefully before using the product. Refer to the manual for complete product specifications.
If the product is used in a manner not specified, the protection pro­vided by the product may be impaired.
The types of product users are:
Responsible body is the individual or group responsible for the use and maintenance of equipment, for ensuring that the equipment is operated within its specifications and operating limits, and for en­suring that operators are adequately trained.
Operators use the product for its intended function. They must be trained in electrical safety procedures and proper use of the instru­ment. They must be protected from electric shock and contact with hazardous live circuits.
Maintenance personnel perform routine procedures on the prod­uct to keep it operating properly, for example, setting the line volt­age or replacing consumable materials. Maintenance procedures are described in the manual. The procedures explicitly state if the operator may perform them. Otherwise, they should be performed only by service personnel.
Service personnel are trained to work on live circuits, and perform safe installations and repairs of products. Only properly trained ser­vice personnel may perform installation and service procedures.
Keithley products are designed for use with electrical signals that are rated Measurement Category I and Measurement Category II, as described in the International Electrotechnical Commission (IEC) Standard IEC 60664. Most measurement, control, and data I/O sig­nals are Measurement Category I and must not be directly connect­ed to mains voltage or to voltage sources with high transient over­voltages. Measurement Category II connections require protection for high transient over-voltages often associated with local AC mains connections. Assume all measurement, control, and data I/O connections are for connection to Category I sources unless other­wise marked or described in the Manual.
Exercise extreme caution when a shock hazard is present. Lethal voltage may be present on cable connector jacks or test fixtures. The American National Standards Institute (ANSI) states that a shock hazard exists when voltage levels greater than 30V RMS,
42.4V peak, or 60VDC are present. A good safety practice is to ex-
pect that hazardous voltage is present in any unknown circuit before measuring.
Operators of this product must be protected from electric shock at all times. The responsible body must ensure that operators are pre­vented access and/or insulated from every connection point. In some cases, connections must be exposed to potential human con­tact. Product operators in these circumstances must be trained to protect themselves from the risk of electric shock. If the circuit is capable of operating at or above 1000 volts, no conductive part of
the circuit may be exposed.
Do not connect switching cards directly to unlimited power circuits. They are intended to be used with impedance limited sources. NEVER connect switching cards directly to AC mains. When con­necting sources to switching cards, install protective devices to limit fault current and voltage to the card.
Before operating an instrument, make sure the line cord is connect­ed to a properly grounded power receptacle. Inspect the connecting cables, test leads, and jumpers for possible wear, cracks, or breaks before each use.
When installing equipment where access to the main power cord is restricted, such as rack mounting, a separate main input power dis­connect device must be provided, in close proximity to the equip­ment and within easy reach of the operator.
For maximum safety, do not touch the product, test cables, or any other instruments while power is applied to the circuit under test. ALWAYS remove power from the entire test system and discharge any capacitors before: connecting or disconnecting cables or jump­ers, installing or removing switching cards, or making internal changes, such as installing or removing jumpers.
Do not touch any object that could provide a current path to the com­mon side of the circuit under test or power line (earth) ground. Always make measurements with dry hands while standing on a dry, insulated surface capable of withstanding the voltage being measured.
The instrument and accessories must be used in accordance with its specifications and operating instructions or the safety of the equip­ment may be impaired.
Do not exceed the maximum signal levels of the instruments and ac­cessories, as defined in the specifications and operating informa­tion, and as shown on the instrument or test fixture panels, or switching card.
When fuses are used in a product, replace with same type and rating for continued protection against fire hazard.
Chassis connections must only be used as shield connections for measuring circuits, NOT as safety earth ground connections.
If you are using a test fixture, keep the lid closed while power is ap­plied to the device under test. Safe operation requires the use of a lid interlock.
5/03
If a screw is present, connect it to safety earth ground using the wire recommended in the user documentation.
!
The symbol on an instrument indicates that the user should re­fer to the operating instructions located in the manual.
The symbol on an instrument shows that it can source or mea­sure 1000 volts or more, including the combined effect of normal and common mode voltages. Use standard safety precautions to avoid personal contact with these voltages.
The symbol indicates a connection terminal to the equipment frame.
The WARNING heading in a manual explains dangers that might result in personal injury or death. Always read the associated infor­mation very carefully before performing the indicated procedure.
The CAUTION heading in a manual explains hazards that could damage the instrument. Such damage may invalidate the warranty.
Instrumentation and accessories shall not be connected to humans.
Before performing any maintenance, disconnect the line cord and all test cables.
To maintain protection from electric shock and fire, replacement components in mains circuits, including the power transformer, test leads, and input jacks, must be purchased from Keithley Instru­ments. Standard fuses, with applicable national safety approvals, may be used if the rating and type are the same. Other components that are not safety related may be purchased from other suppliers as long as they are equivalent to the original component. (Note that se­lected parts should be purchased only through Keithley Instruments to maintain accuracy and functionality of the product.) If you are unsure about the applicability of a replacement component, call a Keithley Instruments office for information.
To clean an instrument, use a damp cloth or mild, water based cleaner. Clean the exterior of the instrument only. Do not apply cleaner directly to the instrument or allow liquids to enter or spill on the instrument. Products that consist of a circuit board with no case or chassis (e.g., data acquisition board for installation into a com­puter) should never require cleaning if handled according to instruc­tions. If the board becomes contaminated and operation is affected, the board should be returned to the factory for proper cleaning/ser­vicing.

Table of Contents

About this Manual . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xi
Intended Audience. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xi
How this Manual is Organized . . . . . . . . . . . . . . . . . . . . . . . . . . . xi
Conventions Used in this Manual . . . . . . . . . . . . . . . . . . . . . . . . . xii
Related Information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xii
Where To Get Help. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xiii
Chapter 1: Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
Hardware Features. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
Supported Software . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
Chapter 2: Principles of Operation . . . . . . . . . . . . . . . . . . . . 5
Analog Input Features. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
Input Resolution . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
Analog Input Channels . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
Specifying a Single Analog Input Channel . . . . . . . . . . . 9
Specifying One or More Analog Input Channels . . . . . . 9
Specifying the Digital Input Port in the Analog
Input Channel-Gain List . . . . . . . . . . . . . . . . . . . . . . . . 10
Specifying Counter/Timers in the Analog
Input Channel-Gain List . . . . . . . . . . . . . . . . . . . . . . . . 11
Performing Dynamic Digital Output Operations . . . . 13
Input Ranges and Gains. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
Specifying the Gain for a Single Channel . . . . . . . . . . . 15
Specifying the Gain for One or More Channels . . . . . . 15
Input Sample Clock Sources . . . . . . . . . . . . . . . . . . . . . . . . . . 16
vii
Contents
Analog Input Conversion Modes . . . . . . . . . . . . . . . . . . . . . . 17
Continuous Scan Mode . . . . . . . . . . . . . . . . . . . . . . . . . . 18
Triggered Scan Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
Internally Retriggered Scan Mode . . . . . . . . . . . . . . 20
Externally Retriggered Scan Mode. . . . . . . . . . . . . . 21
Input Triggers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
Data Format and Transfer . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
Error Conditions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
Analog Output Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
Output Resolution. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
Analog Output Channels . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
Specifying a Single Analog Output Channel . . . . . . . . 27
Specifying Multiple Analog Output Channels
and/or the Digital Output Port . . . . . . . . . . . . . . . . . . 27
Output Ranges and Gains . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
Output Triggers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
Output Clocks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
Output Conversion Modes . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
Continuously Paced Analog Output . . . . . . . . . . . . . . . 31
Waveform Generation . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
Data Format and Transfer . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
Error Conditions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
Digital I/O Features. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
Digital I/O Lines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
Operation Modes. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
Counter/Timer Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
C/T Channels . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
C/T Clock Sources . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
Gate Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
Pulse Output Types and Duty Cycles . . . . . . . . . . . . . . . . . . 41
viii
Counter/Timer Operation Modes . . . . . . . . . . . . . . . . . . . . . 42
Event Counting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
Up/Down Counting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
Frequency Measurement . . . . . . . . . . . . . . . . . . . . . . . . . 44
Edge-to-Edge Measurement . . . . . . . . . . . . . . . . . . . . . . 45
Rate Generation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46
One-Shot . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
Repetitive One-Shot . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48
Chapter 3: Supported Device Driver Capabilities. . . . . . . . 51
Chapter 4: Programming Flowcharts. . . . . . . . . . . . . . . . . . 63
Single-Value Operations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65
Continuous A/D Operations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67
Continuous D/A Operations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69
Continuous Digital Input Operations . . . . . . . . . . . . . . . . . . . . . . 71
Continuous Digital Output Operations . . . . . . . . . . . . . . . . . . . . 72
Event Counting Operations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73
Up/Down Counting Operations . . . . . . . . . . . . . . . . . . . . . . . . . 75
Frequency Measurement Operations . . . . . . . . . . . . . . . . . . . . . . 77
Edge-to-Edge Measurement Operations . . . . . . . . . . . . . . . . . . . 79
Pulse Output Operations. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81
Simultaneous Operations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83
Contents
Chapter 5: Troubleshooting . . . . . . . . . . . . . . . . . . . . . . . . . 97
General Checklist . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98
Service and Support. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101
Appendix A: Specifications . . . . . . . . . . . . . . . . . . . . . . . . 103
ix
Contents
Appendix B: Connector Pin Assignments . . . . . . . . . . . . 113
Analog Input Connector . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 114
Digital I/O Connector . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 116
Analog Output, Counter/Timer, Clock, and Trigger
Connector . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 118
Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 121
x
About this Manual
This manual describes the features of the KUSB-3116 module, the capabilities of the device driver, and how to program the KUSB-3116 module using DT-Open Layers software. Troubleshooting information is also provided.

Intended Audience

This document is intended for engineers, scientists, technicians, or others responsible for using and/or programming the KUSB-3116 module for data acquisition operations in the Microsoft® Windows® 2000 or Windows XP operating system. It is assumed that you have some familiarity with data acquisition principles and that you understand your application.

How this Manual is Organized

This manual is organized as follows:
Chapter 1, “Overview,” describes the major features of the KUSB-3116 module, as well as the supported software and accessories for the modules.
Chapter 2, “Principles of Operation,” describes all of the features of the KUSB-3116 module and how to use them in your application.
Chapter 3, “Supported Device Driver Capabilities,” lists the data acquisition subsystems and the associated features accessible using the device driver.
Chapter 4, “Programming Flowcharts,” describes the processes you must follow to program the subsystems of the KUSB-3116 module using DT-Open Layers-compliant software.
xi
About this Manual

Conventions Used in this Manual

Chapter 5, “Troubleshooting,” provides information that you can use to resolve problems with the KUSB-3116 module and device driver, should they occur.
Appendix A, “Specifications,” lists the specifications of the KUSB-3116 module.
Appendix B, “Connector Pin Assignments,” shows the pin assignments for the connectors on the KUSB-3116 module.
• An index completes this manual.
The following conventions are used in this manual:
• Notes provide useful information or information that requires special emphasis, cautions provide information to help you avoid losing data or damaging your equipment, and warnings provide information to help you avoid catastrophic damage to yourself or your equipment.
xii
• Items that you select or type are shown in bold.

Related Information

Refer to the following documents for more information on using the KUSB-3116 module:
KUSB-3116 Getting Started Manual. This manual, included on the CD that is shipped with the module, describes the how to install the KUSB-3116 module and related software.
DataAcq SDK User’s Manual. For programmers who are developing their own application programs using the Microsoft C compiler, this manual describes how to use the DT-Open
TM
Layers access the capabilities of your module.
DataAcq SDKTM in Windows 2000 or Windows XP to
DTx-EZ Getting Started Manual. This manual describes how to use the ActiveX controls provided in DTx-EZ capabilities of your module in Microsoft Visual Basic® or Visual C++®.
DT-LV Link Getting Started Manual. This manual describes how to use DT-LV Link language to access the capabilities of your module.
• Microsoft Windows 2000 or Windows XP documentation.
• USB web site (http://www.usb.org).

Where To Get Help

Should you run into problems installing or using your KUSB-3116 module, please call the Keithley Technical Support Department.
About this Manual
TM
to access the
TM
with the LabVIEW® graphical programming
xiii
About this Manual
xiv
1

Overview

Hardware Features. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
Supported Software . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
1
Chapter 1

Hardware Features

The KUSB-3116 is a high-performance, multifunction data acquisition modules for the USB (Ver. 2.0 or Ver. 1.1) bus. The key hardware features of the KUSB-3116 module are as follows:
• Installed in a metal BNC box to provide easy connections.
• Simultaneous operation of analog input, analog output, digital I/O, and counter/timer subsystems.
• Analog input subsystem:
16-bit A/D converter.
Throughput rate up to 500 kSamples/s.
16 single-ended or 8 differential analog input channels.
Programmable gain of 1, 2, 4, or 8 provides input ranges of
±10, ±5, ±2.5, and ±1.25 V.
1024-location channel-gain list. You can cycle through the
channel-gain list using continuous scan mode or triggered scan mode. The maximum sampling rate when using the channel-gain list is 500 kSamples/s.
• Analog output subsystem:
Four 16-bit D/A converters.
Output rate up to 500 kSamples/s.
Output range of ±10 V.
The DACs are deglitched to prevent noise from interfering
with the output signal.
Output channel list. You can cycle through the output channel
list using continuous output mode or waveform mode. For waveform generation mode, you can simultaneously update all four DACs at 500 kS/s per channel; for continuous output mode, you can simultaneously update all four DACs at 250 kS/s per channel.
2
• Digital I/O subsystem:
Overview
One digital input port, consisting of 16 digital input lines. You
can program any of the first eight digital input lines to perform interrupt-on-change operations. You can read the value of the digital input port using the analog input channel-gain list.
One digital output port, consisting of 16 digital output lines.
You can output the value of the digital output port using the output channel list.
An additional dynamic digital output line that changes state
whenever an analog input channel is read.
• Five 32-bit counter/timer (C/T) channels that perform event counting, up/down counting, frequency measurement, edge-to-edge measurement, continuous pulse output, one-shot, and repetitive one-shot operations. You can read the value of one or more of the C/T channels using the analog input channel-gain list.
• External or internal clock source.
• Trigger operations using a software command, an analog threshold value, or an external digital input value as the trigger event.
1
1
1
1
1
1
• 500 V galvanic isolation barrier that prevents ground loops to maximize analog signal integrity and protect your computer.
1
1
1
3
Chapter 1

Supported Software

The following software is available for use with the KUSB-3116 module:
Device Driver This software is provided on the CD shipped with the module. The device driver allows you to use a KUSB-3116 module with any of the supported software packages or utilities. Refer to the KUSB-3116 Getting Started Manual for more information on loading and configuring the device driver.
Quick Data Acq application − This application provides a quick way to get a KUSB-3116 module up and running. Using the Quick Data Acq application, you can verify the features of the module, display data on the screen, and save data to disk.
DataAcq SDK − This DT-Open Layers Software Develop Kit (SDK) allows programmers to develop application programs for the KUSB-3116 using the Microsoft C compiler in Windows 2000 or Windows XP.
DTx-EZ − This software package contains ActiveX controls that allow Microsoft Visual Basic® or Visual C++® programmers to access the capabilities of the KUSB-3116 module.
DT-LV Link − This software package allows LabVIEW® programmers to access the capabilities of the KUSB-3116 module.
4
2

Principles of Operation

Analog Input Features. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
Analog Output Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
Digital I/O Features. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
Counter/Timer Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
5
Chapter 2
Analog
Input
Channels
Figure 1 shows a block diagram of the KUSB-3116 module.
Input MUX
Programmable
Gain (1, 2, 4, 8)
12-Bit or
16-Bit
ADC
Input FIFO
Analog
Threshold
Trigger
Dynamic
Digital
Output
4 Analog Output Channels
Channel­Gain List
(1024)
Digital I/O
16 In
16 Out
12/16-Bit
D/A
12/16-Bit
D/A
12/16-Bit
D/A
12/16-Bit
D/A
8
16
Interrupt
Logic
Output
FIFO
Input
Control
Output
Control
500 V Isolation
Barrier
USB 1.1 or 2.0 Interface
Ext. A/D
Tr ig
Ext. A/D
Clk
Ext. D/A
Tr i g
Ext. D/A
Clk
Clock
and
Trigger
Logic
5 32-Bit
Counter/
Timers
Ext. A/D Trig
Ext. A/D Clk
Ext. D/A Trig
Ext. D/A Clk
5 Clock In
5 Gate In
5 Signal Out
Figure 1: Block Diagram of the KUSB-3116 Module
6

Analog Input Features

This section describes the following features of analog input (A/D) operations on the KUSB-3116 module:
• Input resolution, described on this page;
• Analog input channels, described on page 7;
• Input ranges and gains, described on page 14;
Principles of Operation
2
2
• Input sample clock sources, described on page 16;
• Analog input conversion modes, described on page 17;
• Input triggers, described on page 22;
• Data format and transfer, described on page 23; and
• Error conditions, described on page 25.

Input Resolution

The resolution of the KUSB-3116 module is fixed at 16 bits. You cannot specify the resolution in software.

Analog Input Channels

You can use the analog input channels in one of the following configurations:
Single-ended − Single-ended channels are useful when you are measuring high-level signals, when noise is not significant, when the source of the input is close to the module, and when all the input signals are referred to the same common ground.
2
2
2
2
2
2
2
7
Chapter 2
Pseudo-Differential − Pseudo-differential channels are useful when noise or common-mode voltage (the difference between the ground potentials of the signal source and the ground of the screw terminal panel or between the grounds of other signals) exists and when the differential configuration is not suitable for your application. This option provides less noise rejection than the differential configuration; however, more analog input channels are available.
Differential − Differential channels are useful when you want to measure low-level signals, when noise is a significant part of the signal, or when common-mode voltage exists.
The BNC connectors on the KUSB-3116 module are configured in the single-ended channel configuration. To access the differential signals, you need to use the analog input connector.
Note: For pseudo-differential inputs, specify single-ended in software; in this case, how you wire these signals determines the configuration.
Using the Open Layers Control Panel applet, you can also select whether to use 10 kΩ termination resistance between the low side of each differential channel and isolated analog ground. This feature is particularly useful with floating signal sources. Refer to the KUSB-3116 Getting Started Manual for more information about wiring to inputs and configuring the driver to use bias return termination resistance.
The KUSB-3116 module can acquire data from a single analog input channel or from a group of analog input channels. Channels are numbered 0 to 31 for single-ended and pseudo-differential inputs, and 0 to 15 for differential inputs.
The following subsections describe how to specify the channels.
8
Specifying a Single Analog Input Channel
Principles of Operation
The simplest way to acquire data from a single analog input channel is to specify the channel for a single-value analog input operation using software; refer to page 17 for more information about single-value operations.
You can also specify a single channel using the analog input channel-gain list, described in the next section.
Specifying One or More Analog Input Channels
You can read data from one or more analog input channels using an analog input channel-gain list. You can group the channels in the list sequentially (starting either with 0 or with any other analog input channel) or randomly. You can also specify a single channel or the same channel more than once in the list.
Using software, specify the channels in the order you want to sample them. You can enter up to 1,024 entries in the channel-gain list. The channels are read in order (using continuously paced scan mode or triggered scan mode) from the first entry in the list to the last entry in the list. Refer to page 17 for more information about the supported conversion modes.
2
2
2
2
2
2
You can also use software to set up a channel-inhibit list. This feature is useful if you want to discard acquired values from specific entries in the channel-gain list. Using the channel-inhibit list, you can enable or disable inhibition for each entry in the channel-gain list. If enabled, the value is discarded after the channel is read; if disabled, the value is not discarded after the channel is read.
2
2
2
9
Chapter 2
Notes: If you select an analog input channel as the analog threshold trigger source, the channel used for this trigger source must be the first channel specified in the channel-gain list; refer to page 22 for more information about this trigger source.
The maximum rate at which the module can read the analog input channels depends on the total number of analog input channels and/or counter/timer channels (see page 11) in the list, and whether or not you are reading the digital input port (see the next section). For example, since the maximum throughput of the analog input subsystem is 500 kSamples/s, the module can read two analog input channels at a rate of 250 kSamples/s each or four analog input channels at a rate of 125 kSamples/s each.
Specifying the Digital Input Port in the Analog Input Channel-Gain List
The KUSB-3116 module allows you to read the digital input port (all 16 digital input lines) using the analog input channel-gain list. This feature is particularly useful when you want to correlate the timing of analog and digital events.
10
To read the digital input port, specify channel 16 or channel 32 in the analog input channel-gain list. Use channel 16 for modules with 16 single-ended channels or eight differential channels; use channel 32 for modules with 32 single-ended channels or 16 differential channels. You can enter channel 16 or 32 anywhere in the list, and you can enter it more than once, if desired.
The digital input port is treated like any other channel in the analog input channel-gain list; therefore, all the clocking, triggering, and conversion modes supported for analog input channels are supported for the digital input port, if you specify them this way.
Principles of Operation
Note: The maximum rate at which the module can read the digital input port depends on the total number of analog input channels (see page 9) and/or counter/timer channels (see the next section) in the channel-gain list. For example, since the maximum throughput of the analog input subsystem is 500 kSamples/s, the module can read one analog input channel and the digital input port (two channels/ports) at a rate of 250 kSamples/s each or three analog input channels and the digital input port (four channels/ports) at a rate of 125 kSamples/s each.
Specifying Counter/Timers in the Analog Input Channel-Gain List
The KUSB-3116 module allows you to read the value of one or more of the five counter/timer channels using the analog input channel-gain list. This feature is particularly useful when you want to correlate the timing of analog and counter/timer events.
To read a counter/timer channel, specify the appropriate channel number in the analog input channel-gain list (refer to Table 1 on page
12). You can enter a channel number anywhere in the list, and you
can enter it more than once, if desired.
2
2
2
2
2
2
You need two channel-gain list entries to read one 32-bit counter value. The first entry stores the lower 16-bit word, and the second entry stores the upper 16-bit word. If you need only the lower 16-bit word, you do not have to include the second entry. The entire 32-bit count value is latched when the lower 16-bit word is stored. This prevents the counter/timer from incrementing between samples.
Table 1 lists the channel number(s) to use for each counter/timer.
2
2
2
11
Chapter 2
Table 1: Using Counter/Timers in Analog Input Channel-Gain List
Counter/Timer
Channel
C/T_0_LOW Lower 16 bits (0 to 15) of C/T 0 Channel 17
C/T_0_HI Upper 16 bits (16 to 31) of C/T 0 Channel 18
C/T_1_LOW Lower 16 bits (0 to 15) of C/T 1 Channel 19
C/T_1_HI Upper 16 bits (16 to 31) of C/T 1 Channel 20
C/T_2_LOW Lower 16 bits (0 to 15) of C/T 2 Channel 21
C/T_2_HI Upper 16 bits (16 to 31) of C/T 2 Channel 22
C/T_3_LOW Lower 16 bits (0 to 15) of C/T 3 Channel 23
C/T_3_HI Upper 16 bits (16 to 31) of C/T 3 Channel 24
C/T_4_LOW Lower 16 bits (0 to 15) of C/T 4 Channel 25
C/T_4_HI Upper 16 bits (16 to 31) of C/T 4 Channel 26
Description
Channel to Specify
in Channel-Gain List
The counter/timer channel is treated like any other channel in the analog input channel-gain list; therefore, all the clocking, triggering, and conversion modes supported for analog input channels are supported for the counter/timers, if you specify them this way.
12
Principles of Operation
Note: The maximum rate at which the module can read the counter/timers depends on the total number of counter/timer channels and/or analog input channels (see page 9) in the list and whether or not you are reading the digital input port (see page 10). For example, since the maximum throughput of the analog input subsystem is 500 kSamples/s, the module can read one analog input channel and one counter/timer channel (two channels) at a rate of 250 kSamples/s each or three analog input channels and one counter/timer channel (four channels) at a rate of 125 kSamples/s each.
Performing Dynamic Digital Output Operations
Using software, you can enable a synchronous dynamic digital output operation for the analog input subsystem. This feature is particularly useful when you want to synchronize and control external equipment.
One dynamic digital output line is accessible through hardware. This line is set to a value of 0 on power up; a reset does not affect the value of the dynamic digital output line. Note that this line is provided in addition to the other 16 digital output lines; see page 35 for more information about the digital I/O features.
2
2
2
2
2
2
You specify the value (0 or 1) to write from the dynamic digital output line using the analog input channel-gain list. A value of 0 indicates a low-level signal; a value of 1 indicates a high-level signal.
As each entry in the channel-gain list is read, the corresponding value is output to the dynamic digital output line. For example, assume that dynamic digital output operations are enabled; that the channel-gain list contains analog input channels 0, 1, 2, and 3; and that the channel-gain list contains the dynamic digital output values 1, 0, 0, 1. Figure 2 shows this configuration.
2
2
2
13
Chapter 2
Analog Input Channel-Gain List
Analog Input Channels
0
1
2
3
Dynamic Digital Output Values
1
0
0
1
Figure 2: Example Using Dynamic Digital Outputs
As analog input channel 0 is read, a high-level signal is output to the dynamic digital output line. As analog input channels 1 and 2 are read, a low-level signal is output to the dynamic digital output line. As analog input channel 3 is read, a high-level signal is output to the dynamic digital output line.

Input Ranges and Gains

Values Output from Dynamic Digital Output Line
1
0
0
1
14
Table 2 lists the supported gains and effective bipolar input ranges for
each.
Table 2: Effective Input Range
Gain Input Range
1 ±10 V
2 ±5 V
4 ±2.5 V
8 ±1.25 V
Principles of Operation
Using software, specify a range of −10 V to +10 V. Note that this is the range for the entire analog input subsystem, not the range per channel.
For each channel, choose the gain that has the smallest effective range that includes the signal you want to measure. For example, if the range of your analog input signal is ±1.05 V, specify a range of −10 V to +10 V for the module and use a gain of 8 for the channel; the effective input range for this channel is then ±1.25 V, which provides the best sampling accuracy for that channel.
The way you specify gain depends on how you specified the channels, as described in the following subsections.
2
2
2
Specifying the Gain for a Single Channel
The simplest way to specify gain for a single channel is to specify the gain for a single-value analog input operation using software; refer to
page 17 for more information about single-value operations.
You can also specify the gain for a single channel using an analog input channel-gain list, described in the next section.
Specifying the Gain for One or More Channels
You can specify the gain for one or more analog input channels using an analog input channel-gain list. Using software, set up the channel-gain list by specifying the gain for each entry in the list.
For example, assume the analog input channel-gain list contains three entries: channels 5, 6, and 7 and gains 2, 4, and 1. A gain of 2 is applied to channel 5, a gain of 4 is applied to channel 6, and a gain of 1 is applied to channel 7.
2
2
2
2
2
2
15
Chapter 2
Note: For channel 16 or 32 (the digital input port) and channels 17 through 26 or channels 33 through 42 (the counter/timer channels), specify a gain of 1.

Input Sample Clock Sources

The KUSB-3116 module allows you to use one of the following clock sources to pace analog input operations:
Internal A/D clock – Using software, specify the clock source as internal and the clock frequency at which to pace the operation. The minimum frequency supported is 0.75 Samples/s; the maximum frequency supported is 500 kSamples/s.
According to sampling theory (Nyquist Theorem), specify a frequency that is at least twice as fast as the input’s highest frequency component. For example, to accurately sample a 20 kHz signal, specify a sampling frequency of at least 40 kHz. Doing so avoids an error condition called aliasing, in which high frequency input components erroneously appear as lower frequencies after sampling.
16
External A/D clock – An external A/D clock is useful when you want to pace acquisitions at rates not available with the internal A/D clock or when you want to pace at uneven intervals.
Connect an external A/D clock to the External ADC Clock input signal on the KUSB-3116 module. Conversions start on the falling edge of the external A/D clock input signal.
Using software, specify the clock source as external. The clock frequency is always equal to the frequency of the external A/D sample clock input signal that you connect to the module.
Principles of Operation
Note: If you specify channel 16 or 32 (the digital input port) and/or channels 17 through 26 or channels 33 through 42 (the counter/timer channels) in the channel-gain list, the input sample clock (internal or external) also paces the acquisition of the digital input port and/or counter/timer channels.

Analog Input Conversion Modes

The KUSB-3116 module supports the following conversion modes:
Single-value operations are the simplest to use. Using software, you specify the range, gain, and analog input channel. The module acquires the data from the specified channel and returns the data immediately. For a single-value operation, you cannot specify a clock source, trigger source, scan mode, or buffer.
Single-value operations stop automatically when finished; you cannot stop a single-value operation.
Scan mode takes full advantage of the capabilities of the KUSB-3116 module. For a scan, you can specify a channel-gain list, clock source, trigger source, scan mode, buffer, and buffer wrap mode using software. Two scan modes are supported: continuous scan mode and triggered scan mode (often called burst mode). These modes are described in the following subsections.
Using software, you can stop a scan by performing either an orderly stop or an abrupt stop. In an orderly stop, the module finishes acquiring the data, stops all subsequent acquisition, and transfers the acquired data to host memory; any subsequent triggers are ignored.
2
2
2
2
2
2
2
2
In an abrupt stop, the module stops acquiring samples immediately; the acquired data is not transferred to host memory, and any subsequent triggers are ignored.
2
17
Chapter 2
Continuous Scan Mode
Use continuous scan mode if you want to accurately control the period between conversions of individual channels in a scan.
When it detects an initial trigger, the module cycles through the channel-gain list, acquiring and converting the value for each entry in the list (this process is defined as the scan). The module then wraps to the start of the channel-gain list and repeats the process continuously until either the allocated buffers are filled or until you stop the operation. Refer to page 23 for more information about buffers.
The conversion rate is determined by the frequency of the input sample clock; refer to page 16 for more information about the input sample clock. The sample rate, which is the rate at which a single entry in the channel-gain list is sampled, is determined by the frequency of the input sample clock divided by the number of entries in the channel-gain list.
To select continuous scan mode, use software to specify the data flow as continuous and to specify the initial trigger (the trigger source that starts the operation). You can select a software trigger, an external TTL trigger, or an analog threshold trigger as the initial trigger. Refer to page 22 for more information about the supported trigger sources.
18
Figure 3 illustrates continuous scan mode using a channel-gain list
with three entries: channel 0, channel 1, and channel 2. In this example, analog input data is acquired on each clock pulse of the input sample clock. When it reaches the end of the channel-gain list, the module wraps to the beginning of the channel-gain list and repeats this process. Data is acquired continuously.
Principles of Operation
Chan 0
Input Sample Clock
Initial trigger event occurs
Triggered Scan Mode
Use triggered scan mode if you want to accurately control both the period between conversions of individual channels in a scan and the period between each scan. This mode is useful in emulating simultaneous sample-and-hold and trigger-per-buffer operations. You can acquire up to 262,144 samples per trigger (256 times per trigger x 1024-location channel-gain list).
The KUSB-3116 module supports two triggered scan modes: internally retriggered and externally retriggered. These modes are described in the following subsections.
Chan 2
Chan 1
Figure 3: Continuous Scan Mode
Chan 0
Chan 2
Chan 1
Data acquired continuously
Chan 0
Chan 2
Chan 1
Chan 0
Chan 1
Chan 2
2
2
2
2
2
2
2
2
2
19
Chapter 2
Internally Retriggered Scan Mode
In internally retriggered scan mode, the module waits for the initial trigger to occur. When it detects an initial trigger, the module scans the analog input channel-gain list a specified number of times (up to
256), then waits for an internal retrigger to occur. When it detects an internal retrigger, the module scans the channel-gain list the specified number of times, then waits for another internal retrigger to occur. The process repeats continuously until either the allocated buffers are filled or you stop the operation; refer to page 23 for more information about buffers.
The sample rate is determined by the frequency of the input sample clock divided by the number of entries in the channel-gain list; refer to page 16 for more information about the input sample clock. The conversion rate of each scan is determined by the frequency of the internal retrigger clock. The minimum frequency supported is 0.75 Samples/s; the maximum frequency supported is 500 kSamples/s.
Specify the retrigger frequency as follows:
20
Min. Retrigger = # of CGL entries x # of CGLs per trigger + 2 µs Period A/D sample clock frequency
Max. Retrigger = 1 Frequency Min. Retrigger Period
For example, if you are using 512 channels in the channel-gain list, scanning the channel-gain list 256 times every trigger or retrigger, and using an A/D sample clock with a frequency of 100 kHz, set the maximum retrigger frequency to 0.762 Hz, since
0.762 Hz = 1 ( 512 * 256) +2 µs
100 kHz
Principles of Operation
To select internally retriggered scan mode, use software to specify the following parameters:
• The dataflow as continuous,
• Triggered scan mode usage as enabled,
2
• The initial trigger (the trigger source that starts the acquisition),
• The retrigger mode as internal,
• The number of times to scan per trigger or retrigger (also called the multiscan count), and
• The frequency of the retrigger clock.
Externally Retriggered Scan Mode
In externally retriggered scan mode, the module waits for the initial trigger to occur. When it detects an initial trigger, the module scans the channel-gain list up to 256 times, then waits for an external retrigger to occur.
When the retrigger occurs, the module scans the channel-gain list the specified number of times, then waits for another external digital (TTL) trigger to occur. The process repeats continuously until either the allocated buffers are filled or you stop the operation; refer to page
23 for more information about buffers.
The conversion rate of each channel is determined by the frequency of the input sample clock; refer to page 16 for more information about the input sample clock. The conversion rate of each scan is determined by the period between external retriggers; therefore, it cannot be accurately controlled. The module ignores external triggers that occur while it is acquiring data. Only external retrigger events that occur when the module is waiting for a retrigger are detected and acted on.
2
2
2
2
2
2
2
2
21
Chapter 2
To select externally retriggered scan mode, use software to specify the following parameters:
• The dataflow as continuous,
• Triggered scan mode as enabled,
• The initial trigger (the trigger source that starts the operation) as any of the supported trigger sources,
• The retrigger mode as an external retrigger (retrigger extra),
• The number of times to scan per trigger or retrigger (also called the multiscan count), and
• The retrigger source as the external digital (TTL) trigger.
Note: If you want to use the external digital (TTL) trigger source as both the initial trigger and the retrigger source, specify the retrigger mode as scan-per-trigger. In this case, you do not have to specify the retrigger source.
22

Input Triggers

A trigger is an event that occurs based on a specified set of conditions. Acquisition starts when the module detects the initial trigger event and stops when the specified number of samples has been acquired (if the buffer wrap mode is none, described on page
24), or when you stop the operation. Note that when you stop the
operation, the module completes the reading of the channel-gain list.
If you are using triggered scan mode, the module continues to acquire data using the specified retrigger source to clock the operation. Refer to page 19 for more information about triggered scan mode.
Principles of Operation
The KUSB-3116 module supports the following trigger sources:
Software trigger − A software trigger event occurs when you start the analog input operation (the computer issues a write to the module to begin conversions). Using software, specify the trigger source as a software trigger.
External digital (TTL) trigger − An external digital (TTL) trigger event occurs when the KUSB-3116 module detects a transition (high-to-low or low-to-high) on the External ADC Trigger input signal connected to the module. Using software, specify the trigger source as a rising-edge external digital trigger (external) or a falling-edge external digital trigger (extra).
Analog threshold trigger – An analog threshold trigger event occurs when the signal on the first channel in the analog input channel-gain list rises above (low-to-high transition) a programmable threshold level. Using software, specify the trigger source as a positive threshold trigger (threshpos).
You can use any one of the 16 analog input channels as the analog trigger. The analog trigger channel must be the first entry in the analog input channel-gain list.
You specify the threshold level in the olDaPutSingleValue function, using D/A subsystem 1. Specify a value between 0 and 255, where 0 equals 0 V and 255 equals +10 V.
2
2
2
2
2
2
Note that you can also use the analog threshold trigger to trigger analog output and digital output operations.

Data Format and Transfer

The KUSB-3116 module uses offset binary data encoding: 0000 to represent negative full-scale and FFFFh to represent positive full-scale. Use software to specify the data encoding as binary.
The ADC outputs FFFFh for above-range signals and 0000 for below-range signals.
2
2
2
23
Chapter 2
Before you begin acquiring data, you must allocate buffers to hold the data. A Buffer Done message is returned whenever a buffer is filled. This allows you to move and/or process the data as needed.
Note: It is recommended that you allocate buffers of 1024 samples or more to optimize the performance of your KUSB-3116 module. If you allocate smaller buffers, the software automatically adjusts the buffer size to 256 samples/buffer, 512 samples/buffer, or 768 samples/buffer, whichever is closest. The rate at which Buffer Done messages are returned depends on the buffer size.
It is recommended that you allocate a minimum of three buffers for analog input operations, specifying one of the following buffer wrap modes in software:
None − Data is written to multiple allocated input buffers continuously; when no more empty buffers are available, the operation stops. If wrap mode is none, the module guarantees gap-free data; however, the data read may not be what you expect.
24
Multiple − Data is written to multiple allocated input buffers continuously; when no more empty buffers are available, the module overwrites the data in the filled buffers, starting with the first location of the first buffer. This process continues indefinitely until you stop it. If wrap mode is multiple, the module does not guarantee gap-free data.
Single − Data is written to a single input buffer continuously; when the buffer is filled, the module overwrites the data in the buffer starting with the first location of the buffer. This process continues indefinitely until you stop it. Typically, single wrap mode is not used for analog input operations.

Error Conditions

Principles of Operation
The KUSB-3116 module can report an error if one of the following conditions occurs:
A/D Over Sample – The A/D sample clock rate is too fast. This error is reported if a new A/D sample clock pulse occurs while the ADC is busy performing a conversion from the previous A/D sample clock pulse. The host computer can clear this error. To avoid this error, use a slower sampling rate.
Input FIFO Overflow – The analog input data is not being transferred fast enough to the host computer. The host computer can clear this error, but the error will continue to be generated if the Input FIFO is still full. To avoid this error, close other applications that may be running while you are acquiring data. If this has no effect, try using a computer with a faster processor or reduce the sampling rate.
If one of these error conditions occurs, the module stops acquiring and transferring data to the host computer.
2
2
2
2
2
2
2
2
2
25
Chapter 2

Analog Output Features

This section describes the following features of analog output operations:
• Output resolution, described on this page;
• Analog output channels, described on page 26;
• Output ranges and gains, described on page 28;
• Output triggers, described on page 28,
• Output clocks, described on page 29,
• Data format and transfer, described on page 33; and
• Error conditions, described on page 34.

Output Resolution

The KUSB-3116 module support a fixed resolution of 16-bits for analog output operations. You cannot specify the resolution in software.
26

Analog Output Channels

The KUSB-3116 module supports four DC-level analog output channels (DAC0, DAC1, DAC2, and DAC3). Refer to the KUSB-3116 Getting Started Manual for information about how to wire analog output signals to the module.
The DACs are deglitched to prevent noise from interfering with the output signal. They power up to a value of 0 V ±10 mV. Unplugging the module resets the DACs to 0 V.
The KUSB-3116 module can output data from a single DAC or sequentially from one or more DACs and/or the digital output port. The following subsections describe how to specify the channels.
Specifying a Single Analog Output Channel
Principles of Operation
The simplest way to output data from a single DAC is to specify the channel for a single-value analog output operation using software; refer to page 30 for more information about single-value operations.
You can also specify a single DAC using the output channel list, described in the next section.
Specifying Multiple Analog Output Channels and/or the Digital Output Port
You can output data from one or more DACs and/or the digital output port using the output channel list. This feature is particularly useful when you want to correlate the timing of analog and digital output events.
Using software, specify the data flow mode as continuous for the D/A subsystem (described on page 30) and specify the output channels you want to update, where 0 is DAC0, 1 is DAC1, 2 is DAC2, 3 is DAC3, and 4 is the digital output port. You can enter a maximum of 5 entries in the output channel list and the channels must be in order. Note that you can skip a channel in the list, however, if you do not want to update it. For example, if you want to update only DAC3 and the digital output port, specify channels 3 and 4 in the output channel list. If you want to update all the DACs and the digital output port, specify channels 0, 1, 2, 3, and 4 in the output channel list. The channels are output in order from the first entry in the list to the last entry in the list.
2
2
2
2
2
2
2
The amount of data that you can output for each channel depends on how many channels are in the output channel list. For example, if only one channel is entered in the output channel list, you can output up to 128K values; if all five channels are entered in the output channel list, you an output up to 24K values per channel.
2
2
27
Chapter 2
Notes: The maximum rate at which the module can update the output channels depends on the total number of channels in the output channel list. Since the maximum throughput for each output channel is 500 kSamples/s, the module can update two output channels at a rate of 1000 kSamples/s or all five output channels at a rate of 2.5 MSamples/s.
The digital output port is treated like any other channel in the output channel list; therefore, all the clocking, triggering, and conversion modes supported for analog output channels are supported for the digital output port, if you specify the digital output port in the output channel list.

Output Ranges and Gains

Each DAC on the KUSB-3116 module can output bipolar analog output signals in the range of ±10 V.
28
Through software, specify the range for the entire analog output subsystem as −10 V to +10 V, and the gain for each DAC as 1.

Output Triggers

A trigger is an event that occurs based on a specified set of conditions. The KUSB-3116 module supports the following output trigger sources:
Software trigger – A software trigger event occurs when you start the analog output operation. Using software, specify the trigger source as a software trigger.
Principles of Operation
External digital (TTL) trigger – An external digital (TTL) trigger event occurs when the KUSB-3116 module detects a transition (high-to-low or low-to-high) on the External DAC Trigger input signal connected to the module. Using software, specify the trigger source as external and the polarity as high-to-low transition or low-to-high transition.
Analog threshold trigger – An analog threshold trigger event occurs when the signal on the first channel in the analog input channel-gain list rises above (low-to-high transition) a programmable threshold level. Using software, specify the trigger source as a positive threshold trigger (threshpos).
You can use any one of the 16 analog input channels as the analog trigger. The analog trigger channel must be the first entry in the analog input channel-gain list.
You specify the threshold level in the olDaPutSingleValue function, using D/A subsystem 1. Specify a value between 0 and 255, where 0 equals 0 V and 255 equals +10 V.
Note that you can also use the analog threshold trigger to trigger analog input operations.
2
2
2
2
2

Output Clocks

The KUSB-3116 module allows you to use one of the following clock sources to pace analog output and digital output operations:
Internal DAC clock – Using software, specify the clock source as internal and the clock frequency at which to pace the operation. The minimum frequency supported is 0.75 Samples/s; the maximum frequency supported is 500 kSamples/s.
2
2
2
2
29
Chapter 2
External DAC clock – An external DAC clock is useful when you want to pace conversions at rates not available with the output sample clock or when you want to pace at uneven intervals.
Connect an external DAC clock to the External DAC Clock input signal on the KUSB-3116 module. Analog output and digital output operations start on the rising edge of the external DAC clock output signal.
Using software, specify the clock source as external. The clock frequency is always equal to the frequency of the external DAC clock output signal that you connect to the module.

Output Conversion Modes

The KUSB-3116 modules supports the following conversion modes:
Single-value operations are the simplest to use but offer the least flexibility and efficiency. Use software to specify the analog output channel, and the value to output from that channel. For a single-value operation, you cannot specify a clock source, trigger source, or buffer. Single-value operations stop automatically when finished; you cannot stop a single-value operation.
30
Continuous analog output operations take full advantage of the capabilities of the KUSB-3116 module. In this mode, you can specify an output channel list, clock source, trigger source, buffer, and buffer wrap mode. Two continuous analog output modes are supported: continuously paced and waveform generation mode. These modes are described in the following subsections.
Note that each channel in the output channel list must write the same number of values, use the same output clock (refer to page
29), and use the same output trigger (refer to page 28).
Continuously Paced Analog Output
Principles of Operation
Use continuously paced analog output mode if you want to accurately control the period between conversions of individual channels in the output channel list.
Use software to fill the output buffer with the values that you want to write to the DACs and to the digital output port, if applicable. For example, if your output channel list contains only DAC0 and the digital output port, specify the values in the output buffer as follows: the first output value for DAC0, the first output value for the digital output port, the second output value for DAC0, the second output value for the digital output port, and so on.
When it detects a trigger, the module starts writing output values to the DACs/ports, as determined by the output channel list. The operation repeats continuously until either all the data is output from the buffers (if buffer wrap mode is none) or you stop the operation (if buffer wrap mode is multiple). Refer to page 33 for more information about buffer modes.
Make sure that the host computer transfers data to the output channel list fast enough so that the list does not empty completely; otherwise, an underrun error results.
2
2
2
2
2
2
To select continuously paced analog output mode, use software to specify the data flow as continuous, the buffer wrap mode as multiple or none, and the trigger source as any of the supported trigger sources. Refer to page 28 for more information about the supported trigger sources.
To stop a continuously paced analog output operation, you can stop sending data to the module, letting the module stop when it runs out of data, or you can perform either an orderly stop or an abrupt stop using software. In an orderly stop, the module finishes outputting the specified number of samples, then stops; all subsequent triggers are ignored. In an abrupt stop, the module stops outputting samples immediately; all subsequent triggers are ignored.
2
2
2
31
Chapter 2
Waveform Generation
Use waveform generation mode if you want to output a waveform repetitively.
The waveform pattern can range from 2 to 120K (122,880) samples if you specify one output channel, 2 to 60K (61,440) samples for two output channels, 2 to 40K (40,960) samples for three output channels, 2 to 30K (30,720) samples for four output channels, or 2 to 24K (24,576) samples for five output channels.
Note: The waveform pattern size must be the same for all output channels, and the total number of samples must be a multiple of the total number of output channels.
Use software to fill the output buffer with the values that you want to write to the channels in the output channel list. For example, if your output channel list contains only DAC0 and the digital output port, specify the values in the output buffer as follows: the first output value for DAC0, the first output value for the digital output port, the second output value for DAC0, the second output value for the digital output port, and so on.
32
When it detects a trigger, the host computer transfers the entire waveform pattern to the module, and the module starts writing output values to the DACs/ports, as determined by the output channel list. Use software to allocate the memory and specify the waveform pattern.
To select waveform generation mode, use software to specify the data flow as continuous, the buffer wrap mode as single (refer to page 34), and the trigger source as any of the supported trigger sources (refer to page 28).

Data Format and Transfer

Principles of Operation
Data from the host computer must use offset binary data encoding for analog output signals: 0000 to represent −10 V and FFFFh to represent +10 V. Using software, specify the data encoding as binary.
Before you begin writing data to the DACs/digital output port, you must allocate and fill buffers with the appropriate data. A Buffer Done message is returned whenever a buffer is output. This allows you to output additional data as needed.
Note: It is recommended that you allocate buffers of 1024 samples or more to optimize the performance of your KUSB-3116 module. If you allocate smaller buffers, the software automatically adjusts the buffer size to 256 samples/buffer, 512 samples/buffer, or 768 samples/buffer, whichever is closest. The rate at which Buffer Done messages are returned depends on the buffer size.
Specify one of the following buffer wrap modes in software:
None − Data is written from multiple output buffers continuously; when no more buffers of data are available, the operation stops. If wrap mode is none, the module guarantees gap-free data; however, the data written may not be what you expect.
Multiple − Data is written from multiple output buffers continuously; when no more buffers of data are available, the module returns to the first location of the first buffer and continues writing data. This process continues indefinitely until you stop it. If wrap mode is multiple, the module does not guarantee gap-free data.
2
2
2
2
2
2
2
2
2
33
Chapter 2
Single − Data is written from a single output buffer continuously; when all the data in the buffer is written, the module returns to the first location of the buffer and continues writing data. This process continues indefinitely until you stop it.
If wrap mode is single and the data in the output channel list fits into the allocated output buffer, the data is written once to the module. The module recycles the data, allowing you to output the same pattern continuously without having to reload the data from the output channel list.

Error Conditions

The KUSB-3116 module can report an error if one of the following conditions occurs:
Output FIFO Underflow – The output channel list data is not being sent from the host fast enough. This error is reported if an output sample clock pulse occurs while the output channel list is empty. Note that if no new data is available to be output by either the DACs or the digital output port, the last value placed in the output channel list continues to be output by the DACs/port. You can ignore this error when performing a single-value operation.
34
DAC Over Sample error − The output sample clock rate is too fast. This error is reported if a new output sample clock occurs while the module is busy loading the next values from the output channel list into the DACs and/or digital output port. To avoid this error, try slowing down the D/A clock, using a different wrap mode, increasing the buffer sizes, or using more buffers.

Digital I/O Features

This section describes the following features of digital I/O operations:
• Digital I/O lines, described on this page; and
• Operation modes, described on page 36.

Digital I/O Lines

The KUSB-3116 module supports one digital input port, consisting of 16 digital input lines (lines 0 to 15) and one digital output port, consisting of 16 digital output lines (lines 0 to 15).
You can specify the digital I/O line that you want to read or write in a single-value digital I/O operation. Refer to page 36 for more information about single-value operations.
In addition, you can specify the entire digital input port in an analog input channel-gain list to perform a continuous digital input operation, or you can specify the entire digital output port in an output channel list to perform a continuous digital output operation. Refer to page 36 for more information about continuous digital I/O operations.
Principles of Operation
2
2
2
2
2
2
A digital line is high if its value is 1; a digital line is low if its value is
0. On power up or reset, a low value (0) is output from each of the digital output lines.
The KUSB-3116 module allows you to program the first eight digital input lines to perform interrupt-on-change operations. Refer to page
36 for more information.
The KUSB-3116 module provides a dynamic digital output line that you can update whenever an analog input channel is read. The dynamic digital output line is in addition to the 16 digital output lines. Refer to page 37 for more information.
2
2
2
35
Chapter 2

Operation Modes

The KUSB-3116 module supports the following digital I/O operation modes:
Single-value operations are the simplest to use but offer the least flexibility and efficiency. You use software to specify the digital I/O port and a gain of 1 (the gain is ignored). Data is then read from or written to all the digital I/O lines. For a single-value operation, you cannot specify a clock or trigger source.
Single-value operations stop automatically when finished; you cannot stop a single-value operation.
Continuous digital I/O takes full advantage of the capabilities of the KUSB-3116 module. You can specify a clock source, scan mode, trigger source, buffer, and buffer wrap mode for the operation.
Digital input – For digital input operations, enter the digital
input port (all 16 digital input lines) as channel 16 in the analog input channel-gain list; refer to page 10 for more information. The input sample clock (internal or external) paces the reading of the digital input port (as well as the acquisition of the analog input and counter/timer channels); refer to page 16 for more information.
36
Digital output – For digital output operations, enter the
digital output port (all 16 digital output lines) as channel 4 in the output channel list; refer to page 27 for more information. The output clock (internal or external) paces the update of the digital output port (as well as the update of the analog output channels); refer to page 29 for more information.
Interrupt-on-change operations – You can use the Open Layers Control Panel applet to select any of the first eight digital input lines to perform interrupt-on-change operations. When any one of the specified bits changes state, the module reads the entire 16-bit digital input value and generates an interrupt.
Principles of Operation
Dynamic digital output is useful for synchronizing and controlling external equipment and allows you to output data to the dynamic digital output line each time an analog input value is acquired. This mode is programmed through the analog input subsystem; refer to page 13 for more information.
2
2
2
2
2
2
2
2
2
37
Chapter 2

Counter/Timer Features

This section describes the following features of counter/timer (C/T) operations:
• C/T channels, described on this page;
• C/T clock sources, described on page 39;
• Gate types, described on page 40;
• Pulse types and duty cycles, described on page 41; and
• C/T operation modes, described on page 42.

C/T Channels

The KUSB-3116 module provides five 32-bit counter/timers. The counters are numbered 0, 1, 2, 3, and 4. Each counter accepts a clock input signal and gate input signal and outputs a pulse (pulse output signal), as shown in Figure 4.
38
Clock Input SIgnal (internal or external)
Counter
Gate Input Signal (software or external input)
Figure 4: Counter/Timer Channel
Pulse Output Signal
Principles of Operation
To specify the counter/timer to use in software, specify the appropriate C/T subsystem. For example, counter/timer 0 corresponds to C/T subsystem element 0; counter/timer 3 corresponds to C/T subsystem element 3.
2
Using software, you can also specify one or more of the counter/timers in the analog input channel-gain list. You need two channel-gain list entries to read a 32-bit counter value. The first entry stores the lower 16-bit word, and the second entry stores the upper 16-bit word. If you need only the lower 16-bit word, you do not have to include the second entry. The entire 32-bit count value is latched when the lower 16-bit word is stored. This prevents the counter/timer from incrementing between samples. Refer to page 11 for more information about using C/Ts in the channel-gain list.

C/T Clock Sources

The following clock sources are available for the counter/timers:
Internal C/T clock – The internal C/T clock always uses an 18 MHz time base. Through software, specify the clock source as internal, and specify the clock divider to use to determine the frequency at which to pace the operation (this is the frequency of the Counter n Out signal).
External C/T clock – An external C/T clock is useful when you want to pace counter/timer operations at rates not available with the internal C/T clock or if you want to pace at uneven intervals. The frequency of the external C/T clock can range from .004 Hz to 9 MHz.
2
2
2
2
2
2
Connect the external clock to the Counter n Clock input signal on the KUSB-3116 module. Counter/timer operations start on the rising edge of the clock input signal.
Using software, specify the clock source as external.
2
2
39
Chapter 2
Note: The external C/T clock (the clock connected to the Counter n Clock input signal) determines how often you want to count events, measure frequency, or measure the time interval between edges.
If you specify a counter/timer in the analog input channel-gain list, the external A/D clock (the clock connected to the External ADC Clock input signal) determines how often you want to read the counter value. Refer to page 16 for more information about the external A/D clock.

Gate Types

The edge or level of the Counter n Gate signal determines when a counter/timer operation is enabled. The KUSB-3116 module provides the following gate types:
None − A software command enables any counter/timer operation immediately after execution.
40
Logic-low level external gate input − Enables a counter/timer operation when the Counter n Gate signal is low, and disables the counter/timer operation when the Counter n Gate signal is high. Note that this gate type is used for event counting and rate generation modes; refer to page 42 for more information about these modes.
Logic-high level external gate input − Enables a counter/timer operation when the Counter n Gate signal is high, and disables a counter/timer operation when the Counter n Gate signal is low. Note that this gate type is used for event counting and rate generation modes; refer to page 42 for more information about these modes.
Principles of Operation
Falling-edge external gate input − Enables a counter/timer operation when a high-to-low transition is detected on the Counter n Gate signal. In software, this is called a low-edge gate type. Note that this gate type is used for edge-to-edge measurement, one-shot, and repetitive one-shot mode; refer to
page 42 for more information about these modes.
Rising-edge external gate input − Enables a counter/timer operation when a low-to-high transition is detected on the Counter n Gate signal. In software, this is called a high-edge gate type. Note that this gate type is used for edge-to-edge measurement, one-shot, and repetitive one-shot mode; refer to
page 42 for more information about these modes.
2
2
2
Specify the gate type in software.

Pulse Output Types and Duty Cycles

The KUSB-3116 module can output the following types of pulses from each counter/timer:
High-to-low transitions – The low portion of the total pulse output period is the active portion of the counter/timer clock output signal.
Low-to-high transitions – The high portion of the total pulse output period is the active portion of the counter/timer pulse output signal.
You specify the pulse output type in software.
The duty cycle (or pulse width) indicates the percentage of the total pulse output period that is active. For example, a duty cycle of 50 indicates that half of the total pulse output is low and half of the total pulse output is high. You specify the duty cycle in software.
Figure 5 illustrates a low-to-high pulse with a duty cycle of
approximately 30%.
2
2
2
2
2
2
41
Chapter 2
Active Pulse Width
high pulse
low pulse
Total Pulse Period
Figure 5: Example of a Low-to-High Pulse Output Type

Counter/Timer Operation Modes

The KUSB-3116 module supports the following counter/timer operation modes:
• Event counting,
42
• Up/down counting,
• Frequency measurement,
• Edge-to-edge measurement,
• Rate generation,
• One-shot, and
• Repetitive one-shot.
Note: The active polarity for each counter/timer operation mode is software-selectable.
The following subsections describe these modes in more detail.
Event Counting
Principles of Operation
Use event counting mode if you want to count the number of rising edges that occur on the Counter n Clock input when the Counter n Gate signal is active (low-level or high-level). Refer to page 40 for information about specifying the active gate type.
You can count a maximum of 4,294,967,296 events before the counter rolls over to 0 and starts counting again.
Using software, specify the counter/timer mode as event counting (count), the C/T clock source as external, and the active gate type as low-level or high-level.
Make sure that the signals are wired appropriately. Refer to the KUSB-3116 Getting Started Manual for an example of connecting an event counting application.
Up/Down Counting
Use up/down counting mode if you want to increment or decrement the number of rising edges that occur on the Counter n Clock input, depending on the level of the Counter n Gate signal.
2
2
2
2
2
2
If the Counter n Gate signal is high, the C/T increments; if the specified gate signal is low, the C/T decrements.
Using software, specify the counter/timer mode as up/down counting (up/down), and the C/T clock source as external. Note that you do not specify the gate type in software.
Make sure that the signals are wired appropriately. Refer to the KUSB-3116Getting Started Manual for an example of connecting an up/down counting application.
2
2
2
43
Chapter 2
Note: Initialize the counter/timer so that the C/T never increments above FFFFFFFFh or decrements below 0.
Frequency Measurement
Use frequency measurement mode if you want to measure the number of rising edges that occur on the Counter n Clock input over a specified duration.
Using software, specify the counter/timer mode as frequency measurement (count) or event counting (count), the clock source as external, and the time over which to measure the frequency.
You can use the Windows timer (which uses a resolution of 1 ms), or if you need more accuracy than the Windows timer provides, you can connect a pulse of a known duration (such as a one-shot output of another user counter) to the Counter n Gate input signal.
If you use a known pulse, use software to set up the counter/timers as follows:
44
1. Set up one of the counter/timers for one-shot mode, specifying the clock source as internal, the clock frequency, the gate type that enables the operation as rising edge or falling edge, the polarity of the output pulse as high-to-low transition or low-to-high transition, the pulse width, and the duty cycle of the output pulse.
2. Set up the counter/timer that will measure the frequency for event counting mode, specifying the type of clock pulses to count and the gate type (this should match the pulse output type of the counter/timer set up for one-shot mode).
3. Start both counters (pulses are not counted until the active period of the one-shot pulse is generated).
Principles of Operation
4. Read the number of pulses counted. (Allow enough time to ensure that the active period of the one-shot occurred and that events have been counted.)
5. Determine the measurement period using the following equation:
Measurement period = 1 Clock Frequency
6. Determine the frequency of the clock input signal using the following equation:
Frequency Measurement = Number of Events Measurement Period
Make sure that the signals are wired appropriately. One way to wire a frequency measurement operation is to use the same wiring as an event counting application, but not use an external gate signal. Refer to the KUSB-3116 Getting Started Manual for an example of connecting a frequency measurement application.
* Active Pulse Width
2
2
2
2
2
Edge-to-Edge Measurement
Use edge-to-edge measurement mode if you want to measure the time interval between a specified start edge and a specified stop edge.
The start edge and the stop edge can occur on the rising edge of the Counter n Gate input, the falling edge of the Counter n Gate input, the rising edge of the Counter n Clock input, or the falling edge of the Counter n Clock input. When the start edge is detected, the counter/timer starts incrementing, and continues incrementing until the stop edge is detected. The C/T then stops incrementing until it is enabled to start another measurement.
2
2
2
2
45
Chapter 2
You can use edge-to-edge measurement to measure the following:
•Pulse width of a signal pulse (the amount of time that a signal pulse is in a high or a low state, or the amount of time between a rising edge and a falling edge or between a falling edge and a rising edge). You can calculate the pulse width as follows:
Pulse width = Number of counts/18 MHz
• Period of a signal pulse (the time between two occurrences of the same edge - rising edge to rising edge or falling edge to falling edge). You can calculate the period as follows:
Period = 1/Frequency
Period = Number of counts/18 MHz
• Frequency of a signal pulse (the number of periods per second). You can calculate the frequency as follows:
Frequency = 18 MHz/Number of Counts
When the operation is complete, you can read the value of the counter.
46
Using software, specify the counter/timer mode as edge-to-edge measurement mode (measure), the C/T clock source as internal, the start edge type, and the stop edge type.
Make sure that the signals are wired appropriately. Refer to the KUSB-3116 Getting Started Manual for an example of connecting an edge-to-edge measurement application.
Rate Generation
Use rate generation mode to generate a continuous pulse output signal from the Counter n Out line; this mode is sometimes referred to as continuous pulse output or pulse train output. You can use this pulse output signal as an external clock to pace other operations, such as analog input, analog output, or other counter/timer operations.
Principles of Operation
The pulse output operation is enabled whenever the Counter n Gate signal is at the specified level. While the pulse output operation is enabled, the counter outputs a pulse of the specified type and frequency continuously. As soon as the operation is disabled, rate generation stops.
2
The period of the output pulse is determined by the C/T clock source (either internal using a clock divider, or external). You can output pulses using a maximum frequency of 9 MHz (this is the frequency of the Counter n Out signal). Refer to page 39 for more information about the C/T clock sources.
Using software, specify the counter/timer mode as rate generation (rate), the C/T clock source as either internal or external, the clock divider (for an internal clock), the polarity of the output pulses (high-to-low transition or low-to-high transition), the duty cycle of the output pulses, and the active gate type (low-level or high-level). Refer to page 41 for more information about pulse output signals and to page 40 for more information about gate types.
Make sure that the signals are wired appropriately. Refer to the KUSB-3116 Getting Started Manual for an example of connecting a rate generation application.
One-Shot
Use one-shot mode to generate a single pulse output signal from the Counter n Out line when the specified edge is detected on the Counter n Gate signal. You can use this pulse output signal as an external digital (TTL) trigger to start other operations, such as analog input or analog output operations.
2
2
2
2
2
2
2
After the single pulse is output, the one-shot operation stops. All subsequent clock input signals and gate input signals are ignored.
2
47
Chapter 2
The period of the output pulse is determined by the C/T clock source (either internal using a clock divider, or external). Note that in one-shot mode, the internal C/T clock is more useful than an external C/T clock; refer to page 39 for more information about the C/T clock sources.
Using software, specify the counter/timer mode as one-shot, the clock source as internal (recommended), the clock divider, the polarity of the output pulse (high-to-low transition or low-to-high transition), the duty cycle of the output pulse, and the active gate type (rising edge or falling edge). Refer to page 41 for more information about pulse output types and to page 40 for more information about gate types.
Note: In the case of a one-shot operation, use a duty cycle as close to 100% as possible to output a pulse immediately. Using a duty cycle closer to 0% acts as a pulse output delay.
48
Make sure that the signals are wired appropriately. Refer to the KUSB-3116 Getting Started Manual for an example of connecting a one-shot application.
Repetitive One-Shot
Use repetitive one-shot mode to generate a pulse output signal from the Counter n Out line whenever the specified edge is detected on the Counter n Gate signal. You can use this mode to clean up a poor clock input signal by changing its pulse width, then outputting it.
The module continues to output pulses until you stop the operation. Note that any Counter n Gate signals that occur while the pulse is being output are not detected by the module.
Principles of Operation
The period of the output pulse is determined by the C/T clock source (either internal using a clock divider, or external). Note that in repetitive one-shot mode, the internal C/T clock is more useful than an external clock; refer to page 39 for more information about the C/T clock sources.
2
Using software, specify the counter/timer mode as repetitive one-shot (oneshot-rpt), the polarity of the output pulses (high-to-low transition or low-to-high transition), the duty cycle of the output pulses, the C/T clock source as internal (recommended), the clock divider, and the active gate type (rising edge or falling edge). Refer to
page 41 for more information about pulse output types and to page 40 for more information about gates.
Note: In the case of a repetitive one-shot operation, use a duty cycle as close to 100% as possible to output a pulse immediately. Using a duty cycle closer to 0% acts as a pulse output delay.
Make sure that the signals are wired appropriately. Refer to the KUSB-3116 Getting Started Manual for an example of connecting a repetitive one-shot application.
2
2
2
2
2
2
2
2
49
Chapter 2
50
3
Supported Device Driver
Capabilities
51
Chapter 3
The KUSB-3116 Device Driver provides support for the analog input (A/D), analog output (D/A), digital input (DIN), digital output (DOUT), and counter/timer (C/T) subsystems. For information on how to configure the device driver, refer to the KUSB-3116 Getting
Started Manual.
Table 3 summarizes the features available for use with the DataAcq
SDK and the KUSB-3116 module. The DataAcq SDK provides functions that return support information for specified subsystem capabilities at run-time.
The first row in the table lists the subsystem types. The first column in the table lists all possible subsystem capabilities. A description of each capability is followed by the parameter used to describe that capability in the DataAcq SDK.
Note: Blank fields represent unsupported options.
52
The DataAcq SDK uses the functions olDaGetSSCaps (for those queries starting with OLSSC) and olDaGetSSCapsEx (for those queries starting with OLSSCE) to return the supported subsystem capabilities for a device.
For more information, refer to the description of these functions in the DataAcq SDK online help. See the DataAcq User’s Manual for information on launching this help file.
Supported Device Driver Capabilities
Table 3: KUSB-3116 Supported Options
KUSB-3116 A/D D/A DIN DOUT SRL C/T
3
Total Subsystems on Module 1 1 1
Single-Value Operation Support
OLSSC_SUP_SINGLEVALUE Yes Yes Yes Yes
Continuous Operation Support
OLSSC_SUP_CONTINUOUS Yes Yes Yes
Continuous Operation until Trigger Event
Support
OLSSC_SUP_CONTINUOUS_PRETRIG
Continuous Operation before and after
Trigger Event
OLSSC_SUP_CONTINUOUS_
ABOUTTRIG
Data Flow Mode
DT-Connect Support
OLSSC_SUP_DTCONNECT
Continuous DT-Connect Support
OLSSC_SUP_DTCONNECT_
CONTINUOUS
Burst DT-Connect Support
OLSSC_SUP_DTCONNECT_BURST
Simultaneous Start List Support
OLSSC_SUP_SIMULTANEOUS_START Yes Yes
Sim.
Oper.
Pause Operation Support
OLSSC_SUP_PAUSE
Oper.
Pause
Asynchronous Operation Support
OLSSC_SUP_POSTMESSAGE Yes Yes Yes
Wind.
Mess.
Buffer Support
OLSSC_SUP_BUFFERING Yes Yes Yes
Single Buffer Wrap Mode Support
Buffering
OLSSC_SUP_WRPSINGLE Yes Yes Yes Yes Yes
a
1b 0 5
c
Ye sd Ye se
f
Ye s
g
Ye sh Ye si
3
3
3
3
3
3
3
3
53
Chapter 3
Table 3: KUSB-3116 Supported Options (cont.)
KUSB-3116 A/D D/A DIN DOUT SRL C/T
Total Subsystems on Module 1 1 1
Multiple Buffer Wrap Mode Support
OLSSC_SUP_WRPMULTIPLE Yes Yes
Inprocess Buffer Flush Support
OLSSC_SUP_INPROCESSFLUSH Yes
Waveform Generation Mode Support
Buffering (cont.)
OLSSC_SUP_WAVEFORM_MODE Yes
Number of DMA Channels
OLSSC_NUMDMACHANS 0 0 0 0 0
Supports Gap Free Data with No DMA
OLSSC_SUP_GAPFREE_NODMA Yes Yes
DMA
Supports Gap Free Data with Single DMA
OLSSC_SUP_GAPFREE_SINGLEDMA
Supports Gap Free Data with Dual DMA
OLSSC_SUP_GAPFREE_DUALDMA
Triggered Scan Support
OLSSC_SUP_TRIGSCAN Yes
Maximum Number of CGL Scans per
Trigger
OLSSC_MAXMULTISCAN 256
Supports Scan per Trigger Event
Triggered Scan
OLSSC_SUP_RETRIGGER_SCAN_
PER_TRIGGER Yes
Supports Internal Retriggered Triggered
Triggered Scan Mode
Scan
OLSSC_SUP_RETRIGGER_INTERNAL Yes
Extra Retrigger Support
OLSSC_SUP_RETRIGGER_EXTRA Yes
j
k
000 0
a
1b 0 5
54
Supported Device Driver Capabilities
Table 3: KUSB-3116 Supported Options (cont.)
KUSB-3116 A/D D/A DIN DOUT SRL C/T
Total Subsystems on Module 1 1 1
Maximum Retrigger Frequency
OLSSCE_MAXRETRIGGER 250 kHz 250 kHz 0 0 0
Minimum Retrigger Frequency
Tr ig. Sc a n
OLSSCE_MINRETRIGGER 0.75 Hz 0.75 Hz 0 0 0
Mode (cont.)
Maximum Channel-Gain List Depth
OLSSC_CGLDEPTH 1024 5 1 1 0
Sequential Channel-Gain List Support
OLSSC_SUP_SEQUENTIAL_CGL Yes Yes
Zero Start Sequential Channel-Gain List
Support
OLSSC_SUP_ZEROSEQUENTIAL_CGL Yes Yes
Random Channel-Gain List Support
OLSSC_SUP_RANDOM_CGL Yes
Channel-Gain List
Simultaneous Sample-and-Hold Support
OLSSC_SUP_SIMULTANEOUS_SH
Channel List Inhibit Support
OLSSC_SUP_CHANNELLIST_
INHIBIT Yes
Programmable Gain Support
OLSSC_SUP_PROGRAMGAIN Yes
Number of Gains
OLSSC_NUMGAINS 4 1 1 1 0
Gain
AutoRanging Support
OLSSC_SINGLEVALUE_AUTORANGE
Synchronous Digital I/O Support
OLSSC_SUP_SYNCHRONOUS_
DIGITALIO Yes
Maximum Synchronous Digital I/O Value
Digital I/O
Synchronous
OLSSC_MAXDIGITALIOLIST_VALUE 1 65,535 0 0 0
a
1b 05
3
3
3
3
3
3
3
3
3
55
Chapter 3
Table 3: KUSB-3116 Supported Options (cont.)
KUSB-3116 A/D D/A DIN DOUT SRL C/T
Total Subsystems on Module 1 1 1
Number of Channels
OLSSC_NUMCHANNELS 27 or 42
I/O Channels
SE Support
OLSSC_SUP_SINGLEENDED Yes
SE Channels
OLSSC_MAXSECHANS 16 0 0 0 0
DI Support
OLSSC_SUP_DIFFERENTIAL Yes Yes Yes Yes
Channel Type
DI Channels
OLSSC_MAXDICHANS 8 4 1 1 0
Filter/Channel Support
OLSSC_SUP_FILTERPERCHAN
Number of Filters
Filters
OLSSC_NUMFILTERS 1 1 1 1 0
Number of Voltage Ranges
OLSSC_NUMRANGES 1 1 0 0 0
Range per Channel Support
Ranges
OLSSC_SUP_RANGEPERCHANNEL
Software Programmable Resolution
OLSSC_SUP_SWRESOLUTION
Number of Resolutions
Resolution
OLSSC_NUMRESOLUTIONS 1
Binary Encoding Support
OLSSC_SUP_BINARY Yes Yes Yes Yes Yes
Data
Twos Complement Support
Encoding
OLSSC_SUP_2SCOMP
l
4 1 1 0
m
1m 1 1 1
a
1b 05
56
Supported Device Driver Capabilities
Table 3: KUSB-3116 Supported Options (cont.)
KUSB-3116 A/D D/A DIN DOUT SRL C/T
Total Subsystems on Module 1 1 1
Software Trigger Support
OLSSC_SUP_SOFTTRIG Yes Yes Yes Yes Yes
External Trigger Support
OLSSC_SUP_EXTERNTRIG Yes
Positive Threshold Trigger Support
OLSSC_SUP_THRESHTRIGPOS Yes Yes
Negative Threshold Trigger Support
OLSSC_SUP_THRESHTRIGNEG
Analog Event Trigger Support
Triggers
OLSSC_SUP_ANALOGEVENTTRIG
Digital Event Trigger Support
OLSSC_SUP_DIGITALEVENTTRIG
Timer Event Trigger Support
OLSSC_SUP_TIMEREVENTTRIG
Number of Extra Triggers
OLSSC_NUMEXTRATRIGGERS 1 0 0 0 0
Internal Clock Support
OLSSC_SUP_INTCLOCK Yes Yes Yes Yes Yes
External Clock Support
OLSSC_SUP_EXTCLOCK Yes Yes Yes
Simultaneous Input/Output on a Single
Clock Signal
OLSSC_SUP_SIMULTANEOUS_
CLOCKING No Yes
Clocks
Number of Extra Clocks
OLSSC_NUMEXTRACLOCKS 0 0 0 0 0
Base Clock Frequency
OLSSCE_BASECLOCK 18 MHz 18 MHz 0 0 18 MHz
Maximum External Clock Divider
OLSSCE_MAXCLOCKDIVIDER 1 1 1 1
n
Ye s Ye s
a
1b 05
2,147,
483,647
3
3
3
3
3
3
3
3
3
57
Chapter 3
Table 3: KUSB-3116 Supported Options (cont.)
KUSB-3116 A/D D/A DIN DOUT SRL C/T
Total Subsystems on Module 1 1 1
Minimum External Clock Divider
OLSSCE_MINCLOCKDIVIDER 1 1 1 1 2
Maximum Throughput
OLSSCE_MAXTHROUGHPUT 500 kHz 500 kHz 0 0 9 MHz
Minimum Throughput
Clocks (cont.)
OLSSCE_MINTHROUGHPUT 0.75 Hz 0.75 Hz 0 0
Cascading Support
OLSSC_SUP_CASCADING
Event Count Mode Support
OLSSC_SUP_CTMODE_COUNT Yes
Generate Rate Mode Support
OLSSC_SUP_CTMODE_RATE Yes
One-Shot Mode Support
OLSSC_SUP_CTMODE_ONESHOT Yes
Repetitive One-Shot Mode Support
OLSSC_SUP_CTMODE_ONESHOT_
RPT Ye s
Up/Down Counting Mode Support
OLSSC_SUP_CTMODE_UP_DOWN Yes
Edge-to-Edge Measurement Mode
Counter/Timers
Support
OLSSC_SUP_CTMODE_MEASURE Yes
Continuous Edge-to-Edge Measurement
Mode Support
OLSSC_SUP_CTMODE_CONT_
MEASURE 15
High to Low Output Pulse Support
OLSSC_SUP_PLS_HIGH2LOW Yes
Low to High Output Pulse Support
OLSSC_SUP_PLS_LOW2HIGH Yes
a
1b 05
0.004
Hz
o
58
Supported Device Driver Capabilities
Table 3: KUSB-3116 Supported Options (cont.)
KUSB-3116 A/D D/A DIN DOUT SRL C/T
Total Subsystems on Module 1 1 1
None (internal) Gate Type Support
OLSSC_SUP_GATE_NONE Yes
High Level Gate Type Support
OLSSC_SUP_GATE_HIGH_LEVEL Yes
Low Level Gate Type Support
OLSSC_SUP_GATE_LOW_LEVEL Yes
High Edge Gate Type Support
OLSSC_SUP_GATE_HIGH_EDGE Yes
Low Edge Gate Type Support
OLSSC_SUP_GATE_LOW_EDGE Yes
Level Change Gate Type Suppor t
OLSSC_SUP_GATE_LEVEL
High Level Gate Type with Input
Debounce Support
OLSSC_SUP_GATE_HIGH_LEVEL_
DEBOUNCE
Low Level Gate Type with Input
Debounce Support
OLSSC_SUP_GATE_LOW_LEVEL_
Counter/Timers (cont.)
DEBOUNCE
High Edge Gate Type with Input
Debounce Support
OLSSC_SUP_GATE_HIGH_EDGE_
DEBOUNCE
Low Edge Gate Type with Input
Debounce Support
OLSSC_SUP_GATE_LOW_EDGE_
DEBOUNCE
Level Change Gate Type with Input
Debounce Support
OLSSC_SUP_GATE_LEVEL_
DEBOUNCE
a
1b 05
3
3
p
p
p
p
3
3
3
3
3
3
3
59
Chapter 3
Table 3: KUSB-3116 Supported Options (cont.)
KUSB-3116 A/D D/A DIN DOUT SRL C/T
Total Subsystems on Module 1 1 1
Interrupt Support
OLSSC_SUP_INTERRUPT Yes Yes
Interrupt
FIFO in Data Path Support
OLSSC_SUP_FIFO
Output FIFO Size
FIFOs
OLSSC_FIFO_SIZE_IN_K 128
Data Processing Capability
OLSSC_SUP_PROCESSOR Yes Yes Yes Yes Yes
Processor
Software Calibration Support
OLSSC_SUP_SWCAL Yes
Software
Calibration
a. The DIN subsystem contains 16 digital input lines. b. The DOUT subsystem contains 16 digital output lines. c. The DIN subsystem supports continuous mode by allowing you to read the digital input port
(all 16 digital input lines) using the analog input channel-gain list.
d. The DOUT subsystem supports continuous mode by allowing you to output data from the
digital output port (all 16 digital output lines) using the output channel list.
e. The C/T subsystem supports continuous mode by allowing you to read the value of one or
more of the five counter/timer channels using the analog input channel-gain list.
f. The DIN subsystem supports the posting of messages only if the digital input port is
configured for continuous mode and if you used the Open Layers Control Panel applet to select any of the first eight digital input lines to perform interrupt-on-change operations. The device driver posts the OLDA_WM_EVENTDONE_WITH_DATA message when a bit changes state. The 16-bit value of the digital input port is also returned.
g. The DIN subsystem supports buffering by allowing you to read the digital input port (all 16
digital input lines) using the analog input channel-gain list.
h. The DOUT subsystem supports buffering by allowing you to output data from the digital
output port (all 16 digital output lines) using the output channel list.
i. The C/T subsystem supports buffering by allowing you to read the value of one or more of the
five counter/timer channels using the analog input channel-gain list.
j. The data from the KUSB-3116 module is transferred to the host in 4,096-byte (2,048-sample)
segments. If the application calls olDaFlushFromBufferInprocess before the module has transferred 2,048 samples to the host, the buffer on the done queue will contain 0 samples. Your application program must deal with these situations when flushing an inprocess buffer.
r
Ye sr
q
a
1b 05
60
Supported Device Driver Capabilities
k. The channel-gain list depth of 1024 entries in conjunction with a multiscan of 256 provides an
effective channel-gain list depth of up to 256K entries.
l. Channels 0 to 15 read the analog input channels; channel 16 reads all 16 bits from the DIN
subsystem; channels 17 to 26 read the C/T channels. m. The resolution of the KUSB-3116 module is 16 bits. n. OL_TRG_EXTERN is the rising-edge external digital (TTL) trigger input; OL_TRG_EXTRA is
the falling-edge digital external (TTL) trigger input; OL_TRG_THRESHPOS is the
positive-edge analog threshold trigger from an analog input channel. o. Edge-to-edge measurement mode is supported on both the gate and clock signals; rising and
falling edges are both supported. p. High-edge and low-edge are supported for one-shot and repetitive one-shot modes. High-level
and low-level are supported for event counting, up/down counting, frequency measurement,
edge-to-edge measurement, and rate generation modes. q. At the present time, this query is supported for the KUSB-3116 module only. For this module,
the output FIFO size is always 128 K. r. The KUSB-3116 module is calibrated at the factory and should not require recalibration.
3
3
3
3
3
3
3
3
3
61
Chapter 3
62
4

Programming Flowcharts

Single-Value Operations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65
Continuous A/D Operations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67
Continuous D/A Operations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69
Continuous Digital Input Operations . . . . . . . . . . . . . . . . . . . . . . 71
Continuous Digital Output Operations . . . . . . . . . . . . . . . . . . . . 72
Event Counting Operations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73
Up/Down Counting Operations . . . . . . . . . . . . . . . . . . . . . . . . . 75
Frequency Measurement Operations . . . . . . . . . . . . . . . . . . . . . . 77
Edge-to-Edge Measurement Operations . . . . . . . . . . . . . . . . . . . 79
Pulse Output Operations. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81
Simultaneous Operations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83
63
Chapter 4
The following flowcharts show the steps required to perform data acquisition operations using DT-Open Layers. For illustration purposes, the DataAcq SDK functions are shown; however, the concepts apply to all DT-Open Layers software.
Note that many steps represent several substeps; if you are unfamiliar with the detailed operations involved with any one step, refer to the indicated page for detailed information. Optional steps appear in shaded boxes.
64

Single-Value Operations

Initialize the device driver and get the
device handle with olDaInitialize.
Specify A/D subsystem 0 for an analog input
Get a handle to the subsystem with
olDaGetDASS.
Set the data flow to
OL_DF_SINGLEVALUE using
olDaSetDataFlow.
operation, D/A subsystem 0 for an analog output operation, DIN subsystem 0 for a digital input operation, or DOUT subsystem 0 for a digital output operation.
Programming Flowcharts
4
4
4
For A/D subsystem 0 only,
set the range using olDaSetRange.
Configure the subsystem using
olDaConfig.
Go to the next page.
4
4
4
4
4
4
65
Chapter 4
Single-Value Operations (cont.)
Continued from previous page.
For the A/D subsystem, read a single analog input value from the specified channel (0 to 15 for single-ended or pseudo-differential mode or 0 to 7 for differential mode) using the specified gain (1, 2, 4, or 8). For the DIN subsystem, read the value of the 16-bit digital input port.
Acquiring
data?
No
Ye s
Acquire a single value using
olDaGetSingleValue.
Output a single value using
olDaPutSingleValue.
For the D/A subsystem, the value is output to the specified channel (DAC0, DAC1, DAC2, or DAC3) using a gain of 1. For the DOUT subsystem, the value is output to the 16-bit digital output port.
Acquire/
output
Ye s
another
value?
No
Release the subsystem using
olDaReleaseDASS.
Release the driver and terminate the
session using olDaTerminate.
66

Continuous A/D Operations

Initialize the device driver and get the
device handle with olDaInitialize.
Get a handle to the A/D subsystem
with olDaGetDASS.
Set the data flow using
olDaSetDataFlow.
Specify OL_DF_CONTINUOUS (the default value).
Programming Flowcharts
4
4
4
Set up the analog input
channel-gain list (see page 85).
Set up the clocks and triggers
(see page 86).
Go to the next page.
4
4
4
4
4
4
67
Chapter 4
Continuous A/D Operations (cont.)
Continued from previous page.
Set up triggered scan
(see page 87).
Set up buffering (see page 88).
After you configure the subsystem, you can use
Configure the subsystem using
olDaConfig.
Start the operation with olDaStart.
olDaGetClockFrequency to return the actual frequency of the internal clock; you can use olDaGetRetriggerFrequency to return the actual frequency of the internal retrigger clock.
68
Deal with messages and buffers
(see page 90).
Stop the operation (see page 95).
Clean up the operation (see page 96).

Continuous D/A Operations

Initialize the device driver and get the
device handle with olDaInitialize.
Get a handle to D/A subsystem 0
with olDaGetDASS.
Specify OL_DF_CONTINUOUS with
olDaSetDataFlow.
Continuous mode is the default setting.
Programming Flowcharts
4
4
4
Set up the output channel list
(see page 85).
Set up the clocks and triggers
(see page 86).
Go to the next page.
4
4
4
4
4
4
69
Chapter 4
Continuous D/A Operations (cont.)
Continued from previous page.
Set up buffering (see page 89).
Configure the subsystem using
olDaConfig.
Start the operation with olDaStart.
Deal with messages and buffers
(see page 90).
70
Stop the operation (see page 95).
Clean up the operation (see page 96).
Programming Flowcharts

Continuous Digital Input Operations

Initialize the device driver and get the
device handle with olDaInitialize.
Get a handle to A/D subsystem 0
with olDaGetDASS.
Set up the analog input
channel-gain list (see page 85).
Specify channel 16 as the digital input port; specify a gain of 1.
4
4
4
Set up the clocks and triggers
(see page 86).
Set up buffering (see page 88).
Configure the subsystem using
olDaConfig.
Start the operation with olDaStart.
Deal with messages and buffers
(see page 90).
Stop the operation (see page 95).
Clean up the operation (see page 96).
4
4
4
4
4
4
71
Chapter 4

Continuous Digital Output Operations

Initialize the device driver and get the
device handle with olDaInitialize.
Get a handle to the D/A subsystem with
olDaGetDASS.
Set up the output channel list
(see page 85).
Set up the clocks and triggers
(see page 86).
Set up buffering (see page 89).
Configure the subsystem using
olDaConfig.
Start the operation with olDaStart.
Stop the operation (see page 95).
Clean up the operation (see page 96).
Specify channel 4 as the digital output port; specify a gain of 1.
72

Event Counting Operations

Initialize the device driver and get the
device handle with olDaInitialize.
Get a handle to the C/T subsystem with
olDaGetDASS.
Specify the clock source as
OL_CLK_EXTERNAL using
olDaSetClockSource.
Specify the gate type as high-level
(OL_GATE_HIGH_LEVEL) or low-level
(OL_GATE_LOW_LEVEL) using
olDaSetGateType
Specify the appropriate C/T subsystem/element. The KUSB-3116 module supports five elements (0, 1, 2, 3,
4).
Programming Flowcharts
4
4
4
4
4
Specify the mode as OL_CTMODE_COUNT
using olDaSetCTMode.
Configure the subsystem using
olDaConfig.
Go to the next page.
4
4
4
4
73
Chapter 4
Event Counting Operations (cont.)
Continued from previous page.
Start the operation using olDaStart.
Read the events counted using
olDaReadEvents.
Get update
of events
total?
No
Stop the operation (see page 95).
Release each subsystem with
olDaReleaseDASS.
Release the device driver and terminate
the session with olDaTerminate.
Ye s
74

Up/Down Counting Operations

Initialize the device driver and get the
device handle with olDaInitialize.
Get a handle to the C/T subsystem with
olDaGetDASS.
Specify the clock source as
OL_CLK_EXTERNAL using
olDaSetClockSource.
Specify the mode as
OL_CTMODE_UP_DOWN
using olDaSetCTMode.
Configure the subsystem using
olDaConfig.
Specify the appropriate C/T subsystem/element. The KUSB-3116 module supports five elements (0, 1, 2, 3,
4).
Programming Flowcharts
4
4
4
4
4
Go to the next page.
4
4
4
4
75
Chapter 4
Up/Down Counting Operations (cont.)
Continued from previous page.
Start the operation using olDaStart.
Read the events counted using
olDaReadEvents.
Get update
of events
total?
No
Stop the operation (see page 95).
Release each subsystem with
olDaReleaseDASS.
Release the device driver and terminate
the session with olDaTerminate.
Ye s
76
Programming Flowcharts

Frequency Measurement Operations

The following flowchart shows the steps required to perform a frequency measurement operation using the Windows timer. If you need more accuracy the Windows timer provides, refer to page 44 of this manual or to your DataAcq SDK User’s Manual for more information.
4
4
Initialize the device driver and get the
device handle with olDaInitialize.
Get a handle to the C/T subsystem with
olDaGetDASS.
Specify the clock source as
OL_CLK_EXTERNAL using
olDaSetClockSource.
Specify the mode as OL_CTMODE_COUNT
using olDaSetCTMode.
Go to the next page.
Specify the appropriate C/T subsystem/element. The KUSB-3116 module supports five elements (0, 1, 2, 3,
4).
4
4
4
4
4
4
4
77
Chapter 4
Frequency Measurement Operations (cont.)
Continued from previous page.
Configure the subsystem using
olDaConfig.
Start the frequency measurement
operation using olDaMeasureFrequency.
Message is in the form
Measure
done
message
returned?
No
Ye s
OLDA_WM_MEASURE_DONE.
Use the LongtoFreq (IParam)
macro to get the measured
frequency value:
float = Freq;
Freq = LongtoFreq (IParam);
78
Release each subsystem with
olDaReleaseDASS.
Release the device driver and terminate
the session with olDaTerminate.
Programming Flowcharts

Edge-to-Edge Measurement Operations

Initialize the device driver and get the
device handle with olDaInitialize.
Get a handle to the C/T subsystem with
olDaGetDASS.
Specify the mode as
OL_CTMODE_MEASURE
using olDaSetCTMode.
Specify the clock source as
OL_CLK_INTERNAL using
olDaSetClockSource.
Specify the clock divider using
olDaSetExternalClockDivider.
Specify the start edge
using olDaSetMeasureStartEdge.
Specify the stop edge
using olDaSetMeasureStopEdge.
Specify the appropriate C/T subsystem/element. The KUSB-3116 module supports five elements (0, 1, 2, 3,
4).
Specify a clock divider between 2 (the default) and 2,147,483,647. The clock divider determines the frequency at which to pace the operation (this is the frequency of the Counter n Out signal).
Specify OL_GATE_RISING for a rising edge on the Counter n Gate input, OL_GATE_FALLING for a falling edge on the Counter n Gate input, OL_CLOCK_RISING for a rising edge on the Counter n Clock input, or OL_CLOCK_FALLING for a falling edge on the Counter n Clock input.
4
4
4
4
4
4
4
Configure the subsystem using
olDaConfig.
Go to the next page.
4
4
79
Chapter 4
Edge-to-Edge Measurement Operations (cont.)
Continued from previous page.
Start the operation using olDaStart.
Message is in the form OLDA_WM_EVENT_DONE. Note that if you want to perform another edge-to-edge measurement, you can call olDaStart again or use the OLDA_WM_EVENT_DONE
Event
done
message
returned?
handler to call olDaStart again.
Ye s
The LParam parameter of the
message contains the count.
80
No
Release each subsystem with
olDaReleaseDASS.
Release the device driver and terminate
the session with olDaTerminate.

Pulse Output Operations

Initialize the device driver and get the
device handle with olDaInitialize.
Get a handle to the C/T subsystem with
olDaGetDASS.
Specify the appropriate C/T subsystem/element. The KUSB-3116 module supports five elements (0, 1, 2, 3, 4).
Programming Flowcharts
4
4
4
Using an
internal clock?
No
Specify OL_CLK_EXTERNAL
using olDaSetClockSource.
Specify the gate type using
olDaSetGateType
Ye s
Specify OL_CLK_INTERNAL
using olDaSetClockSource.
Specify the clock divider using
olDaSetExternalClockDivider
Go to the next page.
Specify a clock divider between 2
(the default) and 2,147,483,647.
Specify OL_GATE_NONE for a software (internal) gate, OL_GATE_HIGH_LEVEL for a high-level gate, OL_GATE_LOW_LEVEL for a low-level gate, OL_GATE_HIGH_EDGE for a high-edge gate, or OL_GATE_LOW_EDGE for a low-edge gate.
4
4
4
4
4
4
81
Chapter 4
Pulse Output Operations (cont.)
Continued from previous page.
Specify the mode using
olDaSetCTMode.
Specify the output pulse type using
olDaSetPulseType.
Specify the duty cycle of the output
pulse using olDaSetPulseWidth.
Configure the subsystem using
olDaConfig.
Start the operation using olDaStart.
Stop the operation (see page 95).
Release each subsystem with
olDaReleaseDASS.
Specify OL_CTMODE_RATE for rate generation, OL_CTMODE_ONESHOT for one-shot, or OL_CTMODE_ONESHOT_RPT for repetitive one-shot.
This step is not required for one-shot mode.
82
Release the device driver and
terminate the session with
olDaTerminate.

Simultaneous Operations

Programming Flowcharts
4
Configure the A/D and D/A
subsystem that you want to run
simultaneously.
Allocate a simultaneous start list using
olDaGetSSList.
Put each subsystem to be
simultaneously started on the start list
using olDaPutDassToSSList.
Prestart the subsystems on the
simultaneous start list with
olDaSimultaneousPreStart.
Start the subsystems on the
simultaneous start list with
olDaSimultaneousStart.
Go to the next page.
See the previous flow diagrams in this chapter; note that you cannot perform single-value operations simultaneously.
4
4
4
4
4
4
4
4
83
Chapter 4
Simultaneous Operations (cont.)
Continued from previous page.
Deal with messages (see page 90 for analog input operations; see page 93
for analog output operations).
Stop the operation (see page 95).
Clean up the operation
(see page 96).
84
Set Up Channel List and Channel Parameters
Use to specify the size of the analog input or analog
olDaSetChannelListSize
olDaSetChannelListEntry
olDaSetGainListEntry
output channel list, gain list, synchronous digital I/O list, and channel-inhibit lists, if applicable (the default is 1).
Use to set up the analog input or analog output channel list.
For the A/D subsystem, channels 0 to 15 or channels 0 to 31 are available in single-ended or pseudo-differential mode; channels 0 to 7 or channels 0 to 15 are available in differential mode. You can enter the digital input port as channel 16 or 32 to achieve continuous digital input. You can also enter one or more C/T channels as channels 17 to 26 or channels 33 to
42. If you are using an analog input channel as the threshold trigger, specify the analog input channel used as entry 0 (the default).
For the D/A subsystem, channels 0 (DAC0), 1 (DAC1), 2 (DAC2), 3 (DAC3), and 4 (digital output port) are available.
For the A/D subsystem only, use to set up the gain list by specifying the gain for each channel in the channel list. Gains of 1, 2, 4, and 8 are supported.
Programming Flowcharts
4
4
4
4
4
olDaSetChannelListEntryInhibit
olDaSetSynchronousDigitalIOUsage
olDaSetDigitalIOListEntry
For D/A, DIN, DOUT, and C/T channels, use a gain of 1 (the default).
For the A/D subsystem only, use to enable or disable (the default) inhibition for the specified channel entries. If inhibited, the acquired values from the specified channels are discarded.
For the A/D subsystem only, use to enable or disable a dynamic digital output operation. Dynamic digital output operations are disabled by default.
For the A/D subsystem only, use to specify the digital value to output as each entry in the channel list is sampled. The value can be 0 or 1.
4
4
4
4
85
Chapter 4
Set Clocks and Triggers
Using an
Ye s
internal
clock?
No
olDaSetClockSource
olDaSetTrigger
Using analog
Ye s
input trigger?
Specify OL_CLK_INTERNAL (the
olDaSetClockSource
olDaSetClockFrequency
Specify OL_CLK_EXTERNAL to select the external clock.
Use to specify the initial trigger source (OL_TRG_SOFT (the default) for the software trigger, OL_TRG_EXTERN for the rising-edge external digital (TTL) trigger, OL_TRG_EXTRA for the falling-edge external digital (TTL) trigger, or OL_TRG_THRESHPOS for a positive threshold trigger from an analog input channel).
olDaPutSingleValue
default) to select the internal clock.
Use to specify the frequency of the internal clock. For the A/D and D/A subsystems, values range from 0.75 Hz to 500 kHz. The driver sets the actual frequency as closely as possible to the number specified.
Use to specify the threshold value for D/A subsystem 1.
86
Loading...