User manual

DELIB API Referenz |Seite 62
getch();
value = DapiDOReadback32(handle, 0);
IsError();
printf("Readback output channel 0-3\n");
printf("value = %d\n", value);
printf("Press any key to continue\n");
getch();
// ----------------------------------------------------------
// Set timeout of output channels to 5 seconds
DapiSpecialCommand(handle, DAPI_SPECIAL_CMD_TIMEOUT,
DAPI_SPECIAL_TIMEOUT_SET_VALUE_SEC, 5, 0);
IsError();
printf("Timeout has been set to 5 seconds\n");
printf("Press any key to continue\n");
getch();
// ----------------------------------------------------------
// Activate timeout and switch on output channels 0-3
DapiSpecialCommand(handle, DAPI_SPECIAL_CMD_TIMEOUT,
DAPI_SPECIAL_TIMEOUT_ACTIVATE, 0, 0);
IsError();
DapiDOSet8(handle, 0, 15);
IsError();
printf("Timeout has been activated\n");
printf("Output channels 0-3 have been switched on and will be switched
off automatically after 5 seconds\n");
printf("Press any key to continue\n");
getch();
// ----------------------------------------------------------
// Deactivate timeout
DapiSpecialCommand(handle, DAPI_SPECIAL_CMD_TIMEOUT,
DAPI_SPECIAL_TIMEOUT_DEACTIVATE, 0, 0);
IsError();
printf("Timeout has been deactivated\n");
printf("Press any key to continue\n");
getch();
// ----------------------------------------------------------
// Close Module
DapiCloseModule(handle);
printf("Module closed\n");
printf("End of program!\n");
printf("Press any key to exit\n");
getch();
return ;
}