Chapter 4
Programming
4-6
©
National Instruments Corporation
3.
Output the digital patterns.
for (i=0;i<=255;i++)
{
DIO_Output_Register = i;
}
Example 2
This example shows how to perform digital I/O.
Configure digital lines 0, 2, 4, and 6 as outputs and the remaining lines as
inputs. Wrap back the ouput lines to the input lines. Write patterns 0b0000
and 0b1111 to the output lines. Read back the input pins to verify the data.
Also check some intermediate patterns as well.
1.
Set up the Plug and Play resources. Use the function
Setup_PNP_Board
provided on the Companion Disk.
2.
Configure lines 0, 2, 4, and 6 as outputs and 1, 3, 5, and 7 as inputs.
DIO_Control_Register = 0x55;
3.
Write the digital pattern.
DIO_Output_Register = 0x00;
4.
Read the digital pattern.
Pattern = DIO_Parallel_Input Register;
5.
Repeat Steps 3 and 4 for subsequent patterns.
Analog Input
See Chapter 2 in the DAQ-STC Technical Reference Manual for
information on programming analog input and the relevant registers. This
section also describes the programming sequences for the various functions
and organizes these functions for a particular operation. Individual bitfield
descriptions are also given.
Programming the AT E Series boards for analog input can be divided into
writing to and reading from two main register groups: discrete board
registers, and DAQ-STC registers. The following functions configure the
board by calling the
Board_Read
and
Board_Write
functions:
Setup_PNP_Board;
Configure_Board;
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...