![background image](http://html1.mh-extra.com/html/national-instruments/daqcard-dio-24/daqcard-dio-24_user-manual_709163056.webp)
Appendix B
Register-Level Programming
©
National Instruments Corporation
B-15
DAQCard-DIO-24 User Manual
/* EXAMPLE 1–Port A input */
wrt(cnfg,0xB0);
/* Port A is an input in mode 1. */
while (!(rd(portc) & 0x20))
/* Wait until IBFA is set, indicating that */
rd(ireg1);
/* data has been loaded in port A. */
valread = rd(porta);
/* Read the data from port A. */
/* EXAMPLE 2–Port B input */
wrt(cnfg,0x86);
/* Port B is an input in mode 1. */
while (!(rd(portc) & 0x02))
/* Wait until IBFB is set, indicating that */
rd(ireg1);
/* data has been loaded in port B. */
valread = rd(portb);
}
Mode 1 Strobed Output
The control word written to the CNFG Register to configure port A for
output in mode 1 is shown as follows. Bits PC4 and PC5 of port C can
be used as extra input or output lines when port A uses mode 1 output.
The control word written to the CNFG Register to configure port B for
output in mode 1 is shown as follows.
During a mode 1 data write transfer, the status of the handshaking lines
and interrupt signals can be obtained by reading port C. Notice that the
bit definitions are different for a write and a read transfer.
X
X
X
1/0
0
1
0
1
Port C bits PC4 and PC5
1 = input
0 = output
7
6
5
4
3
2
1
0
X
1
X
X
X
X
1
7
6
5
4
3
2
1
0
0
Содержание DAQCard-DIO-24
Страница 68: ...Appendix C OKI 82C55A Data Sheet DAQCard DIO 24 User Manual C 2 National Instruments Corporation ...
Страница 69: ...Appendix C OKI 82C55A Data Sheet National Instruments Corporation C 3 DAQCard DIO 24 User Manual ...
Страница 70: ...Appendix C OKI 82C55A Data Sheet DAQCard DIO 24 User Manual C 4 National Instruments Corporation ...
Страница 71: ...Appendix C OKI 82C55A Data Sheet National Instruments Corporation C 5 DAQCard DIO 24 User Manual ...
Страница 72: ...Appendix C OKI 82C55A Data Sheet DAQCard DIO 24 User Manual C 6 National Instruments Corporation ...
Страница 73: ...Appendix C OKI 82C55A Data Sheet National Instruments Corporation C 7 DAQCard DIO 24 User Manual ...
Страница 74: ...Appendix C OKI 82C55A Data Sheet DAQCard DIO 24 User Manual C 8 National Instruments Corporation ...
Страница 75: ...Appendix C OKI 82C55A Data Sheet National Instruments Corporation C 9 DAQCard DIO 24 User Manual ...
Страница 76: ...Appendix C OKI 82C55A Data Sheet DAQCard DIO 24 User Manual C 10 National Instruments Corporation ...
Страница 77: ...Appendix C OKI 82C55A Data Sheet National Instruments Corporation C 11 DAQCard DIO 24 User Manual ...
Страница 78: ...Appendix C OKI 82C55A Data Sheet DAQCard DIO 24 User Manual C 12 National Instruments Corporation ...
Страница 79: ...Appendix C OKI 82C55A Data Sheet National Instruments Corporation C 13 DAQCard DIO 24 User Manual ...
Страница 80: ...Appendix C OKI 82C55A Data Sheet DAQCard DIO 24 User Manual C 14 National Instruments Corporation ...
Страница 81: ...Appendix C OKI 82C55A Data Sheet National Instruments Corporation C 15 DAQCard DIO 24 User Manual ...
Страница 82: ...Appendix C OKI 82C55A Data Sheet DAQCard DIO 24 User Manual C 16 National Instruments Corporation ...
Страница 83: ...Appendix C OKI 82C55A Data Sheet National Instruments Corporation C 17 DAQCard DIO 24 User Manual ...