ICP DAS USA PCI-P16C16 User Manual

Page 44

Advertising
background image

printf("P180X_FloatSub2(1.0,2.0) = %f\n",fVal);

if( wP16R16No<1 )

{

putch(0x07);

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

exit(0);

}

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

/***** PCI-P16R16 DO/DO demo *****/

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

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

P16R16_DO(P16R16_BaseAddress,0x0000); /* Digital output */

delay(500); /* Delay a little time 500ms */

wInData=P16R16_DI(P16R16_BaseAddress); /* Digital input */

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

P16R16_DO(P16R16_BaseAddress,0xFFFF); /* Digital output */

delay(500); /* Delay a little time 500ms */

wInData=P16R16_DI(P16R16_BaseAddress); /* Digital input */

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

P16R16_DO(P16R16_BaseAddress,0x5555); /* Digital output */

delay(500); /* Delay a little time 500ms */

wInData=P16R16_DI(P16R16_BaseAddress); /* Digital input */

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

P16R16_DO(P16R16_BaseAddress,0xAAAA); /* Digital output */

delay(500); /* Delay a little time 500ms */

wInData=P16R16_DI(P16R16_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) …

44

Advertising
This manual is related to the following products: