User manual

DELIB API reference |Seite 61
DapiDOSet1(handle, 0, 1);
IsError();
printf("Output channel 0 has been switched on\n");
printf("Press any key to continue\n");
getch();
DapiDOSet1(handle, 0, 0);
IsError();
printf("Output channel 0 has been switched off\n");
printf("Press any key to continue\n");
getch();
DapiDOSet1(handle, 1, 1);
IsError();
printf("Output channel 1 has been switched on\n");
printf("Press any key to continue\n");
getch();
DapiDOSet1(handle, 1, 0);
IsError();
printf("Output channel 1 has been switched off\n");
printf("Press any key to continue\n");
getch();
DapiDOSet8(handle, 0, 0xff); //hexadecimal
IsError();
printf("Output channel 0-7 have been switched on\n");
printf("Press any key to continue\n");
getch();
DapiDOSet8(handle, 0, 0);
IsError();
printf("Output channel 0-7 have been switched off\n");
printf("Press any key to continue\n");
getch();
// ----------------------------------------------------------
// Write and readback output channels
DapiDOSet8(handle, 0, 31);
IsError();
printf("Output channel 0-7 have been switched on\n");
printf("Press any key to continue\n");
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();
DapiDOSet8(handle, 0, 0);
IsError();
printf("Output channel 0-7 have been switched off\n");
printf("Press any key to continue\n");