Chapter 4
Programming
4-4
©
National Instruments Corporation
rebooted or powered off. The hardware stores the assigned base I/O address
in an onboard register, but not in any form of nonvolatile memory. The
E Series board will “forget” what its base I/O address is after a reboot.
Windowing Registers
Since the DAQ-STC contains a large number of registers (180),
eight address lines would be required to decode the addresses in direct
address mode. In addition to the DAQ-STC registers, the AT-MIO E Series
boards have other discrete registers. This enormous I/O address space
makes it impossible to use other peripheral cards with their own registers.
The windowing scheme allows a smaller address space requirement for the
DAQ-STC at the expense of requiring more accesses to perform the same
task. To write to a register in Windowed mode, write the address offset to
the Window_Address_Register. Write the bit pattern (data) to the
Window_Data_Write_Register. Similarly, to read from a register in
Windowed mode, write the address offset to the Window_Address_
Register; read from the Window_Data_Read_Register.
Programming Examples
The programs presented in this chapter are broken into five sections:
Digital I/O, Analog Input, Analog Output, General Purpose Counters, and
Analog Trigger. Each example provides the pseudo-code for the main
program. The examples follow the procedure presented in detail in the
DAQ-STC Technical Reference Manual, and further explanation of the
functions can be found in this manual. Each program is also provided in its
entirety on the AT E Series Register Level Programmer Manual
Companion Disk.
The Companion Disk also contains the support files necessary to run the
examples. The support files include
PNPINIT.c
,
ESERRLP.h
, and
ESERFNCT.c
which should all be included with the project for each
example.
PNPINIT.c
includes the
Setup_PNP_Board
function which
assigns the base I/O address as discussed in the Plug and Play Initialization
section of this manual;
ESERRLP.h
declares the external function
prototypes and the register addresses;
ESERFNCT.c
contains functions
which write to and read from Windowed and board discrete registers:
DAQ_STC_Windowed_Mode_Write
,
DAQ_STC_Windowed_Mode_Read
,
Board_Write
, and
Board_Read
.
Summary of Contents for AT-MIO E Series
Page 131: ...Appendix A OKI MSM82C55A Data Sheet AT MIO E Series RLPM A 2 National Instruments Corporation...
Page 132: ...Appendix A OKI MSM82C55A Data Sheet National Instruments Corporation A 3 AT MIO E Series RLPM...
Page 133: ...Appendix A OKI MSM82C55A Data Sheet AT MIO E Series RLPM A 4 National Instruments Corporation...
Page 134: ...Appendix A OKI MSM82C55A Data Sheet National Instruments Corporation A 5 AT MIO E Series RLPM...
Page 135: ...Appendix A OKI MSM82C55A Data Sheet AT MIO E Series RLPM A 6 National Instruments Corporation...
Page 136: ...Appendix A OKI MSM82C55A Data Sheet National Instruments Corporation A 7 AT MIO E Series RLPM...
Page 137: ...Appendix A OKI MSM82C55A Data Sheet AT MIO E Series RLPM A 8 National Instruments Corporation...
Page 138: ...Appendix A OKI MSM82C55A Data Sheet National Instruments Corporation A 9 AT MIO E Series RLPM...
Page 139: ...Appendix A OKI MSM82C55A Data Sheet AT MIO E Series RLPM A 10 National Instruments Corporation...
Page 140: ...Appendix A OKI MSM82C55A Data Sheet National Instruments Corporation A 11 AT MIO E Series RLPM...
Page 141: ...Appendix A OKI MSM82C55A Data Sheet AT MIO E Series RLPM A 12 National Instruments Corporation...
Page 142: ...Appendix A OKI MSM82C55A Data Sheet National Instruments Corporation A 13 AT MIO E Series RLPM...
Page 143: ...Appendix A OKI MSM82C55A Data Sheet AT MIO E Series RLPM A 14 National Instruments Corporation...
Page 144: ...Appendix A OKI MSM82C55A Data Sheet National Instruments Corporation A 15 AT MIO E Series RLPM...
Page 145: ...Appendix A OKI MSM82C55A Data Sheet AT MIO E Series RLPM A 16 National Instruments Corporation...
Page 146: ...Appendix A OKI MSM82C55A Data Sheet National Instruments Corporation A 17 AT MIO E Series RLPM...