![background image](http://html1.mh-extra.com/html/icp-das-usa/piso-p8r8u/piso-p8r8u_user-manual_3551649033.webp)
return
0;
}
int DIO1(WORD wCardAddress, WORD wValue)
{
WORD wDI, Lo, Hi;
/***********
Digital
Output with wValue ***************/
Lo = wValue & 0xFF;
Hi = (wValue >> 8) & 0xFF;
outpb( wCardA 0xC0, Lo ); /* low-byte is at 0xC0 */
outpb( wCardA 0xC4, Hi ); /* High-byte is at 0xC4 */
/****** delay a while until DO is ready ******/
delay(100);
/****** Digital Input *********/
Lo = inpb( wCardA 0xC0 ); /* Low-byte is at 0xC0 */
Hi = inpb( wCardA 0xC4 ); /* High-byte is at 0xC4 */
wDI = (Hi << 8) | Lo;
delay(300);
+;
/* Compare the DO and DI values */
printf("DO=0x%04X,
DI=0x%04X, ", wValue, wDI);
if ( wDI != wValue )
{
printf("FAILED!
(%04X)\n", wDI ^ wValue);
+;
return
1;
}
printf("OK!
\n");
return
0;
}
PISO-P8R8U/P16R16U/PEX-P8R8i/P16R16i User Manual (Ver.1.6,Mar/2010, PMH-021-16) -
33
-