3.1.1
PIO_DriverInit
PIO_DriverInit(&wBoards, wSubVendor,wSubDevice,wSubAux)
•
wBoards=0 to N
•
wSubVendor
•
wSubDevice
•
wSubAux
This function can be used to detect all PIO/PISO series cards within your
system. Implementation is based on the PCI Plug & Play mechanism. The
function locates all PIO/PISO series cards installed in this system and save the
relevant resource information in the library.
Sample program 1: Detect all PIO-DA4/8/16 series cards installed in this PC
/* Step 1: Detect all PIO-DA16/8/4 series cards installed in this PC */
wSubVendor=0x80; wSubDevice=4; wSubAux=0x00;
series cards*/
wRetVal=PIO_DriverInit(&wBoards, wSubVendor,wSubDevice,wSubAux);
printf("There are %d PIO-DA16 Cards in this PC\n",wBoards);
/* Step 2: Save the resource information for all PIO-DA4/8/16 series cards
installed in this PC */
for (i=0; i<wBoards; i++)
{
PIO_GetConfigAddressSpace(i,&wBase,&wIrq,&wID1,&wID2,&wID3,&wID4,
printf("\nCard_%d: wBase=%x, wIrq=%x", i,wBase,wIrq);
wConfigSpace[i][0]=wBaseAddress;
wConfigSpace[i][1]=wIrq;
}
PIO-DA/PISO-DA Series User Manual (Ver.2.9, Feb. 2011, PMH-009-29 )
The number of boards found in this PC
The subVendor ID of the board you are seeking
The subDevice ID of the board your are seeking
The subAux ID of the board you are seeking
&wID5);
/*Save the resource information for this card */
/*Save the resource information for this card */
/* For PIO-DA4/8/16
41