Chapter 4
Programming
©
National Instruments Corporation
4-5
Before beginning register-level programming of the analog input and
analog output modules, you should test the Windowed addressing scheme.
To test the Windowed addressing scheme, use a simple example to operate
on the DIO lines. When this example works, try to write code for the other
modules.
As mentioned in Chapter 2 of the DAQ-STC Technical Reference Manual,
several write-only registers on the DAQ-STC contain bitfields that control
a number of functionally independent parts of the chip. To update bitfields,
you must set or clear bits without changing the status of the remaining bits
in the register. Since you cannot read these registers to determine which bits
are set, you should maintain a software copy of the write-only registers.
Note
For simplicity, these examples do not include software copies of the registers. If
you wish to write your own examples, or modify these examples, we strongly
recommend adding software copies of the write-only registers. Please refer to
Chapter 2, Register and Bitfield Programming Considerations, in the DAQ-STC
Technical Reference Manual for further information.
Digital I/O
Chapter 7 of the DAQ-STC Technical Reference Manual describes the DIO
module of the DAQ-STC and illustrates an example (C language) in
Windowed mode to toggle the DIO lines. Example 1 verifies that the
Windowed addressing scheme works. Example 2 illustrates digital I/O.
Example 1
This example illustrates the use of Windowed registers by toggling the
digital lines.
First configure all the digital lines as outputs. Write 0x0 through 0xFF to
the DIO output register and make sure the digital lines toggle. (This
example is also presented in Chapter 7 of the DAQ-STC Technical
Reference Manual.)
1.
Set up the Plug and Play resources. Use the function
Setup_PNP_Board
provided on the Companion Disk.
2.
Configure all the digital lines as outputs.
DIO_Control_Register = 0xFF;
Summary of Contents for AT-AI-16XE-10
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...