![background image](http://html1.mh-extra.com/html/icp-das-usa/piso-p8r8u/piso-p8r8u_user-manual_3551649030.webp)
4.4. Sample Program for DOS
#include "PIO.H"
WORD wCardAddress, wTotalBoardsFound;
int SelectBoard(WORD wBoardNo);
DWORD TestDIO(WORD wCardAddress);
DWORD iCounts, iErrors;
int main()
{
WORD wRtn, wIrqNo;
WORD
wSubVendor,wSubDevice,wSubAux,wSlotBus,wSlotDevice;
char
c;
WORD
i;
clrscr();
/*************** Initialize Driver for
PISO-P16R16U
**********************/
wRtn
=
PIO_DriverInit
(&wTotalBoardsFound,
0x1800,0x0,0xFF
);
if ( wTotalBoardsFound == 0 || wRtn != 0 )
{
printf("Driver initialization error! Error Code=%d\n", (int) wRtn);
return
1;
}
printf("\nThere are %d PISO-P16R16U Card(s) in this PC",wTotalBoardsFound);
/***********
Get
Card Information (I/O Address) *********/
printf("\n\n--------------
The
Configuration Space --------------");
for(i=0; i<wTotalBoardsFound; i++)
{
PIO_GetConfigAddressSpace
(i, &wCardAddress, &wIrqNo,
&wSubVendor, &wSubDevice, &wSubAux, &wSlotBus, &wSlotDevice);
printf("\nCard#%d: wBase=%x,wIrq=%x,subID=[%x,%x,%x],SlotID=[%x,%x]",
PISO-P8R8U/P16R16U/PEX-P8R8i/P16R16i User Manual (Ver.1.6,Mar/2010, PMH-021-16) -
30
-