beautypg.com

Measurement Computing Personal488 rev.3.0 For DOS & Windows 3.Xi User Manual

Page 244

background image

II. SOFTWARE GUIDES - 10. Driver488/W31

10E. C Languages

Personal488 User’s Manual, Rev. 3.0

II-229

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”))<0) {

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);

/* Setup event handling for trapping the SRQ

*/

OnEvent(ieee, hWndDlg, (OpaqueP)0L);
Arm(ieee, acSRQ);

/* Clear the ADC488

*/

Clear(adc);

/* Setup the ADC488 to SRQ on acquisition complete

*/

Output(adc, “M128X”);
/* Setup the ADC488:

100 uSec scan interval (I3)
No pre-trigger scans, 100 post-trigger scans (N100)
Continuous trigger on GET (T1)
*/
Output(adc, “I3N100T1X”);

/* Wait for the ready bit of the ADC488 to be asserted

*/

while ((SPoll(adc) & 32) == 0);

/* Trigger the ADC488

*/

Trigger(adc);
strcpy(textstr,"Waiting for SRQ event\r\n");
SetDlgItemText(hWndDlg, 201, (LPSTR)textstr);
break; /* End of WM_INITDIALOG

*/

case WM_CLOSE:

/* Closing the Dialog behaves the same as Cancel

*/

PostMessage(hWndDlg, WM_COMMAND, IDCANCEL, 0L);

break; /* End of WM_CLOSE

*/

case WM_COMMAND:
switch(wParam) {
case 201: /* Edit Control

*/

break;

case IDOK:

Close(ieee);
Close(adc);
EndDialog(hWndDlg,

TRUE);

break;

case IDCANCEL:

/* Ignore data values entered into the controls

*/

/* and dismiss the dialog window returning FALSE

*/

EndDialog(hWndDlg,

FALSE);

break;