DNx-AI-208 Analog Input Layer
Chapter 3
9
Programming with the Low-Level API
Tel: 508-921-4600
www.ueidaq.com
Vers:
4.6
Date: November 2013
File:
AI208 Chap3.fm
© Copyright 2009
United Electronic Industries, Inc.
Chapter 3
Programming with the Low-Level API
This section describes how to program the PowerDNA cube using the Low-level
API The low-level API offers direct access to PowerDNA DAQBios protocol and
also allows you to access device registers directly.
We recommend that, when possible, you use the UeiDaq Framework High-Level
API (see Chapter 2), because it is easier to use.
You should need to use the low-level API only if you are using an operating sys-
tem other than Windows.
3.1
Configuration
Settings
Configuration settings are passed through the
DqCmdSetCfg()
and
DqAc-
bInitOps()
functions.
Not all configuration bits apply to the AI-208 layer.
The following bits are used:
#define DQ_LN_IRQEN (1L<<10) // enable layer irqs
#define DQ_LN_PTRIGEDGE1 (1L<<9) // stop trigger edge MSB
#define DQ_LN_PTRIGEDGE0 (1L<<8) // stop trigger edge: 00 -
software,
// 01 - rising, 02 - falling
#define DQ_LN_STRIGEDGE1 (1L<<7) // start trigger edge MSB
#define DQ_LN_STRIGEDGE0 (1L<<6) // start trigger edge: 00 -
software, 01 - rising,
// 02 - falling
#define DQ_LN_CLCKSRC1 (1L<<3) // CL clock source MSB
#define DQ_LN_CLCKSRC0 (1L<<2) // CL clock source 01 - SW, 10 -
HW, 11 -EXT
#define DQ_LN_ACTIVE (1L<<1) // "STS" LED status
#define DQ_LN_ENABLED (1L<<0) // enable operations
For streaming operations with hardware clocking, the user has to select the fol-
lowing flags:
DQ_LN_ENABLE | DQ_LN_CLCKSRC0 | DQ_LN_STREAMING | DQ_LN_IRQEN |
DQ_LN_ACTIVE
DQ_LN_ENABLE
enables all layer operations.
DQ_LN_CLCKSRC0
selects the internal channel list clock (CL) source as a time
base. The AI-208 layer supports the CL clock only where the time between con-
secutive channel readings is calculated by the rule of maximizing setup time per
channel. If you’d like to select the CL clock from an external clock source such
as the SYNCx line, set DQ_LN_CLCKSRC1
as well.
Aggregate rate = Per-channel rate * Number of channels