PEX/PIO/PISO-DA Series Card
Analog Output Boards
User Manual/ Ver. 3.1/ Oct. 2013/ PMH-0010-31/ Page: 56
6.1.3 PIO_GetConfigAdressSpace
PIO_GetConfigAddressSpace(wBoardNo,*wBase,*wIrq,
*wSubVendor,*wSubDevice,*wSubAux,*wSlotBus, *wSlotDevice)
wBoards=0 to N
The total number of boards using the PIO_DriverInit(...) function
wBase
The base address of the board control word
wIrq
The allocated IRQ channel number for this board
wSubVendor
The subVendor ID of this board
wSubDevice
The subDevice ID of this board
wSubAux
The subAux ID of this board
wSlotBus
The bus number of the slot used by this board
wSlotDevice
The device number of the slot used by this board
The function can be used to save the resource information for all PIO/PISO cards installed in
this system. The application program can then directly control all functions of the PIO/PISO
series card.
Detect the configuration address space for your PEX/PISO/PIO-DA series cards.
/* Step 1: Detect all PEX/PISO/PIO-DA series cards */
wSubVendor=0x80; wSubDevice=4; wSubAux=0x00;
/*For PIO_DA4/8/16 series cards */
wRetVal=PIO_DriverInit(&wBoards, wSubVendor,wSubDevice,wSubAux);
printf("There are %d PIO-DA16/8/4 Cards in this PC\n",wBoards);
/* Step 2: Save the resource information for all PEX/PISO/PIO-DA cards installed in this PC */
for (i=0; i<wBoards; i++)
{
PIO_GetConfigAddressSpace
(i,&wBase,&wIrq,&t1,&t2,&t3,&t4,&t5);
printf("\nCard_%d: wBase=%x, wIrq=%x", i,wBase,wIrq);
wConfigSpace[i][0]=wBaseAddress;
/*Save the resource information for this card*/
wConfigSpace[i][1]=wIrq;
/*Save the resource information for this card*/
}
/* Step 3: Control the PEX/PISO/PIO cards directly */
wBase=wConfigSpace[0][0]
;
/* get the base address for card_0 */
outport(wBase,1);
/* enable all D/I/O operations of card_0 */
wBase=wConfigSpace[1][0];
/* get the base address for card_1 */
outport(wBase,1);
/* enable all D/I/O operations of card_1 */
ГК
Атлант
Инжиниринг
–
официальный
представитель
в
РФ
и
СНГ
+7(495)109-02-08 [email protected] www.bbrc.ru