Measurement-computing Personal488 rev.3.0 For DOS & Windows 3.Xi Manual de usuario Pagina 228

  • Descarga
  • Añadir a mis manuales
  • Imprimir
  • Pagina
    / 400
  • Tabla de contenidos
  • SOLUCIÓN DE PROBLEMAS
  • MARCADORES
  • Valorado. / 5. Basado en revisión del cliente
Vista de pagina 227
II. SOFTWARE GUIDES - 10. Driver488/W31 10E. C Languages
Personal488 Users Manual, Rev. 3.0 II-213
/* open Driver488/W31 */
if ((ieee=OpenName(IEEE))) {
MessageBox(hWndDlg, (LPSTR)"Cannot initialize IEEE system",
NULL, MB_OK);
EndDialog(hWndDlg, TRUE);
return TRUE;
}
/* open device named ADC */
Error(ieee, OFF);
switch (adc=OpenName(ADC)) {
case -2:
MessageBox(hWndDlg, (LPSTR)"ADC device already open", NULL,
MB_OK);
EndDialog(hWndDlg, TRUE);
return TRUE;
case -1:
/* Create the device ADC by copying the default device WAVE*/
switch (devhandle=OpenName(WAVE)) {
case -2:
MessageBox(hWndDlg, (LPSTR)"WAVE device already
open", NULL, MB_OK);
EndDialog(hWndDlg, TRUE);
return TRUE;
case -1:
MessageBox(hWndDlg, (LPSTR)"Cannot open WAVE
device",NULL, MB_OK);
EndDialog(hWndDlg, TRUE);
return TRUE;
default:
break;
}
if ((adc=MakeDevice(devhandle, ADC))) {
MessageBox(hWndDlg, (LPSTR)"Cannot create ADC device", NULL,
MB_OK);
EndDialog(hWndDlg, TRUE);
return TRUE;
}
Close(devhandle);
break;
default:
break;
}
GetError(ieee, response);
Error(ieee, ON);
BusAddress(adc, 14, -1);
When the IEEE 488 Event Message has been passed to the application, the following service routine is
executed. The particular subroutine is invoked when the ADC generates an
SRQ
on acquisition
complete.
default:
if (Message==WM_IEEE488EVENT) {
strcpy(textstr,"SRQ event detected\r\n");
SetDlgItemText(hWndDlg, 201, (LPSTR)textstr);
}
/* Clear the SRQ condition */
SPoll(adc);
/* Reset the buffer pointer of the ADC488 */
Output(adc, B0X);
/* Get 100 readings from the ADC488 */
for (i=0;id;i++) {
Enter(adc,response);
strcat(textstr, response);
strcat(textstr, \r\n);
}
SetDlgItemText(hWndDlg, 201, (LPSTR)textstr);
}
return FALSE;
Vista de pagina 227
1 2 ... 223 224 225 226 227 228 229 230 231 232 233 ... 399 400

Comentarios a estos manuales

Sin comentarios