Справочник Пользователя для National Instruments PCI-DIO-96

Скачать
Страница из 93
Chapter 6
Programming
PCI-DIO-96 User Manual
6-6
©
 National Instruments Corporation
)
{
unsigned short
pciCommandRegister;
unsigned long
cardBaseAddress,
miteBaseAddress;
//
configure the i/o space of the board such
// that it is memory mapped.
ExpMgrConfigReadWord(deviceNode,
((LogicalAddress) 0x00000004L),
&pciCommandRegister);
ExpMgrConfigWriteWord(deviceNode,
((LogicalAddress) 0x00000004L),
(pciCommandRegister | 0x0002));
//
get the base addresses for the board.
ExpMgrConfigReadLong(deviceNode,
((LogicalAddress) 0x00000010L), 
&miteBaseAddress);
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 board.
return ((void *) cardBaseAddress);
}
Port Identification
This manual refers to each port as A, B, and C and each PPI (82C55A) 
as A, B, C, and D. NI-DAQ and LabVIEW documentation use numbers 
to identify each port and PPI. For example, this manual uses PPI A 
port A to refer to port A of the 82C55A identified as PPI A. NI-DAQ, 
LabWindows/CVI, LabVIEW, or other application software 
documentation, however, refer to this port as 0. Table 6-1 shows the 
correlation between the different port names.