ICP DAS USA PISO-P8R8U User Manual page 33

Table of Contents

Advertisement

return 0;
}
int DIO1(WORD wCardAddress, WORD wValue)
{
WORD wDI, Lo, Hi;
/*********** Digital Output with wValue ***************/
Lo = wValue & 0xFF;
Hi = (wValue >> 8) & 0xFF;
outpb( wCardAddress + 0xC0, Lo ); /* low-byte is at 0xC0 */
outpb( wCardAddress + 0xC4, Hi ); /* High-byte is at 0xC4 */
/****** delay a while until DO is ready ******/
delay(100);
/****** Digital Input *********/
Lo = inpb( wCardAddress + 0xC0 ); /* Low-byte is at 0xC0 */
Hi = inpb( wCardAddress + 0xC4 ); /* High-byte is at 0xC4 */
wDI = (Hi << 8) | Lo;
delay(300);
iCounts++;
/* Compare the DO and DI values */
printf("DO=0x%04X, DI=0x%04X, ", wValue, wDI);
if ( wDI != wValue )
{
printf("FAILED! (%04X)\n", wDI ^ wValue);
iErrors++;
return 1;
}
printf("OK! \n");
return 0;
}
PISO-P8R8U/P16R16U/PEX-P8R8i/P16R16i User Manual (Ver.1.6,Mar/2010, PMH-021-16) -
-
33

Advertisement

Table of Contents
loading

This manual is also suitable for:

Piso-p16r16uPex-p8r8iPex-p16r16i

Table of Contents