ICP DAS USA PCI-P16R16 Series Software Manual page 26

Classic driver dll
Hide thumbs Also See for PCI-P16R16 Series:
Table of Contents

Advertisement

PCI-P16R16 Series Classic Driver
DLL Software Manual
/* getting the Driver version */
wRetVal=PCI_GetDriverVersion(&wVal);
printf("Driver Version=%x\n",wVal);
/* call a function to test if exact calling LIB */
nVal=PCI_ShortSub2(1,2);
printf("PCI_ShortSub2(1,2) = %d\n",nVal);
/* call another function to test if exact calling LIB */
fVal=PCI_FloatSub2(1.0,2.0);
printf("PCI_FloatSub2(1.0,2.0) = %f\n",fVal);
if( wP16R16No<1 )
{
putch(0x07);
printf("Please plug one PCI-P16R16 in PC !!!\n");
exit(0);
}
/***************************************************/
/************
/***************************************************/
printf("The PCI-P16R16 DO/DI testing !!!\n");
P16R16_DO(P16R16_BaseAddress,0x0000);
delay(500);
wInData=P16R16_DI(P16R16_BaseAddress);
printf("Digital Output -> 0000H | Digital Input -> %04xH\n",wInData);
P16R16_DO(P16R16_BaseAddress,0xFFFF);
delay(500);
wInData=P16R16_DI(P16R16_BaseAddress);
printf("Digital Output -> FFFFH | Digital Input -> %04xH\n",wInData);
P16R16_DO(P16R16_BaseAddress,0x5555);
delay(500);
wInData=P16R16_DI(P16R16_BaseAddress);
printf("Digital Output -> 5555H | Digital Input -> %04xH\n",wInData);
PCI-P16R16 DI/DO demo
/* Delay a little time 500ms */
/* Delay a little time 500ms */
/* Delay a little time 500ms */
************/
/* Digital output */
/* Digital input */
/* Digital output */
/* Digital input */
/* Digital output */
/* Digital input */
User Manual, Ver. 1.3, Oct. 2015, Page: 25

Advertisement

Table of Contents
loading

Table of Contents