Programming The Digital I/O Circuitry; Input - National Instruments 6527 Series Programmer's Manual

Register-level
Hide thumbs Also See for 6527 Series:
Table of Contents

Advertisement

ExpMgrConfigReadLong(deviceNode,
((LogicalAddress) 0x00000014L),
&cardBaseAddress);
//activate the standard i/o window.
*((unsigned long *) (miteBaseAddress +
0x000000C0L)) =
EndianSwap32Bit(((cardBaseAddress &
0xFFFFFF00L) | 0x00000080L));
//return the base address of the device.
return ((void *) cardBaseAddress);
}

Programming the Digital I/O Circuitry

Programming examples are presented in this section for three basic 6527 functions: Input,
Output, and Change Notification. Each example provides you with pseudocode.
All the ports on a 6527 device are preconfigured for input or output, so there is no need to
configure individual ports prior to reading from or writing to them. For input and output
specifications, refer to Appendix A, Specifications, of your 6527 User Manual. Handshaking
is also not required; simply write to or read from a specified port.

Input

You can read your 6527 device to get all data on a port. You can also set filter enable bits and
a filter period before performing input. Filtering can help eliminate glitches on input data. At
power-up, filtering is disabled.
To use an input port of a 6527 device, read the Port Register for the port to detect the logical
states of the optically isolated digital lines associated with that port. Reading a digital 1 at the
Port Register indicates a logic high on the input line (that is, greater than 2 V difference
between DIG+ and DIG–).
Use the following pseudocode example:
Read (Port 0)
For example, if you read 0x01, or binary 00000001, this indicates a logic high on Port 0,
line 0, and a logic low on lines 1 through 7 of Port 0.
© National Instruments Corporation
//Read eight bits from Port 0
3-5
6527 Register-Level Programmer Manual
Chapter 3
Programming

Advertisement

Table of Contents
loading

This manual is also suitable for:

Pci-6527Pxi-6527

Table of Contents