Digital I/O; Example 1; Example 2 - National Instruments PCI E Series Programmer's Manual

Register-level programmer manual, multifunction i/o boards for pci bus computers, register-level
Hide thumbs Also See for PCI E Series:
Table of Contents

Advertisement

Digital I/O

Example 1

Example 2

© National Instruments Corporation
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.
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 PCI board resources. Use the function
provided on the Companion Disk.
2.
Configure all the digital lines as outputs.
DIO_Control_Register = 0xFF;
3.
Output the digital patterns.
for (i=0;i<=255;i++)
{
DIO_Output_Register = i;
}
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 output 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.
1.
Set up the PCI board resources. Use the function
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-7
Chapter 4
Programming
Setup_Mite
Setup_Mite
PCI E Series RLPM

Advertisement

Table of Contents
loading

Table of Contents