Chapter 2
Analog Input Timing/Control
©
National Instruments Corporation
2-25
DAQ-STC Technical Reference Manual
2.6.2 Windowing Registers
All of the write-only and read-only registers on the DAQ-STC can be addressed in two
modes—direct mode and windowed mode. A particular implementation on a board may use
either or both of these modes.
Direct mode allows direct access to all of the DAQ-STC registers. The register addresses are
calculated by adding the register offset to the base address assigned to the DAQ-STC on the
particular board. The
section of Appendix B,
, lists the
register offsets.
Windowed mode allows a smaller address space requirement for the DAQ-STC at the expense
of requiring more accesses to perform the same task. In this mode, all DAQ-STC register
accesses use the Window_Address_Register and Window_Data_Register. Refer to the
Windowed Mode Register Access Example
, for more
information on windowing mode and for an example program.
Caution
When using windowed-mode accesses from an interruptable process, your
application may not function properly if an interrupt occurs between the time that
the address is loaded into the Window_Address_Register and the time that an
access is made from the Window_Data_Register. Make sure that the interrupt does
not disturb the Window_Address_Register during this sensitive period; disable
interrupts during windowed-mode accesses or write the interrupt routines so that
they do not disturb the contents of the Window_Address_Register.
2.6.3 Programming for an Analog Input Operation
This section contains detailed programming information for bit-level programming of the
AITM for specialized applications. The programs are presented in a bottom-up fashion. This
section lists functions that can be used to configure the AITM for various operations. The
functions are then assembled into a complete program in section
.
Most of the programming sequences presented here must be executed exactly as shown.
Bitfield assignments are defined as pseudocode instructions of the form <bitfield name> =
<value>. Pseudocode sequences enclosed in braces that contain only bitfield assignments can
normally be executed in any order, or simultaneously, if possible. If the sequence must be
executed in exact order, the character
∑
marks the boundary between two groups of
assignments that have to be executed sequentially. For example, in the following pseudocode,
the first bitfield assignment must be performed first, the second and third assignments may
then be executed in any order, but the fourth bitfield assignment must be executed after the
second and third bitfield assignments. Other programming constructs, such as if-then, should
be executed in the order shown.
!