
Using the I/O Address Map
36
DAI12-4(FIT)GY
for(i = 0; i < CH; i++) {
/* Set Initial Data */
do {
sts = (unsigned char)inp( ADR+0x16 );
} while( sts & 0x01 );
if ( i == 3 ) outp( ADR+0x12, 0x40+i );
/* Set Last Channel */
else outp( ADR+0x12, i );
/* Set Channel */
outp( ADR+0x10, LowerData[i] );
/* Set Lower Data */
outp( ADR+0x11, UpperData[i] );
/* Set Upper Data */
}
outp( ADR+0x18, 0x05 ); /* Timer Start */
for(i = 0; i < NUM; i++) {
do {
sts = (unsigned char)inp( ADR+0x16 );
} while( (sts & 0x02) != 0x02 );
printf("0 to 3ch %02x%02x %7.3f[V] ", UpperData[i],
LowerData[i], Volt[i]);
for(j = 0; j < CH; j++) {
/* Set Initial Data */
do {
sts = (unsigned char)inp( ADR+0x16 );
} while( sts & 0x01 );
if ( j == 3 ) outp( ADR+0x12, 0x40+j );
/* Set Last Channel */
else outp( ADR+0x12, j );
/* Set Channel */
outp( ADR+0x10, LowerData[i+1] );
/* Set Lower Data */
outp( ADR+0x11, UpperData[i+1] );
/* Set Upper Data */
}
sts = (unsigned char)inp( ADR+0x16 );
outp( ADR+0x16, sts & 0x12 );
/* Status reset */
if( sts & 0x20 ) {
i = NUM;
printf("Clock Error\n");
} else printf("\n");
}
outp( ADR+0x18, 0x06 );
/* Timer Stop */
}
/* ------------------------------------- End of file --- */
Содержание DAI12-4FITGY
Страница 1: ...F eIT Series Isolated Analog Output Module DAI12 4 FIT GY User s Manual CONTEC CO LTD...
Страница 47: ...Using the I O Address Map 42 DAI12 4 FIT GY...
Страница 64: ......