ICP DAS USA PCI-P16C16 User Manual

Page 48

Advertising
background image

if( wP8R8No<1 )

{

putch(0x07);

printf("Please plug one PCI-P8R8 in PC !!!\n");

exit(0);

}

/***********************************/

/***** PCI-P8R8 DO/DO demo *****/

/***********************************/

printf("The PCI-P8R8 DO/DI testing !!!\n");

P8R8_DO(P8R8_BaseAddress,0x0000);

/* Digital output */

delay(500);

/* Delay a little time */

wInData=P8R8_DI(P8R8_BaseAddress);

/* Digital input */

printf("Digital Output -> 0000H | Digital Input -> %04xH\n",wInData);

P8R8_DO(P8R8_BaseAddress,0xFFFF);

/* Digital output */

delay(500);

/* Delay a little time */

wInData=P8R8_DI(P8R8_BaseAddress);

/* Digital input */

printf("Digital Output -> FFFFH | Digital Input -> %04xH\n",wInData);

P8R8_DO(P8R8_BaseAddress,0x5555);

/* Digital output */

delay(500);

/* Delay a little time */

wInData=P8R8_DI(P8R8_BaseAddress);

/* Digital input */

printf("Digital Output -> 5555H | Digital Input -> %04xH\n",wInData);

P8R8_DO(P8R8_BaseAddress,0xAAAA);

/* Digital output */

delay(500);

/* Delay a little time */

wInData=P8R8_DI(P8R8_BaseAddress);

/* Digital input */

printf("Digital Output -> AAAAH | Digital Input -> %04xH\n",wInData);

PCI_DriverClose();

return 0;

}

PCI-P8R8/P16R16/P16C16/P16POR16 User’s Manual (Ver.2.2, 2005/5/5) …

48

Advertising
This manual is related to the following products: