beautypg.com

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

Page 237

background image

10E. C Languages

II. SOFTWARE GUIDES - 10. Driver488/W31

II-222

Personal488 User’s Manual, Rev. 3.0

/* wait for the acquisition complete bit of ADC488 to be asserted */
while ((SPoll(adc) & 128) == 0);

/* Reset the buffer pointer of the ADC488 */
Output(adc, “B0X”);
/* Take 100 readings from the ADC488 */
noterm.EOI = 0;
noterm.nChar = 0;
EnterX(adc, (char *)hundred, 200, 1, ¬erm, 1, 0);

/* Display DRIVER488/W31 status

*/

Status(ieee, &substat);
showstat(&substat, textstr);

/* Wait for completion of input operation

*/

Wait(adc);

/* Display DRIVER488/W31 status

*/

Status(ieee, &substat);
showstat(&substat, textstr);

/* Print the received charcters

*/

for (i=0;i<100;i++) {
sprintf(response, “%6d ”, hundred[i]);
strcat(textstr, response);
if ((i%8)==7) {
strcat(textstr,"\r\n");
}
}
strcat(textstr,"\r\n");
SetDlgItemText(hWndDlg, 201, (LPSTR)textstr);

Close(ieee);
Close(adc);

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:
EndDialog(hWndDlg,

TRUE);

break;
case IDCANCEL:

/* Ignore data values entered into the controls

*/

/* and dismiss the dialog window returning FALSE

*/

EndDialog(hWndDlg,

FALSE);

break;
}
break; /* End of WM_COMMAND

*/

default:
return FALSE;
}
return TRUE;
} /* End of EX2DLGMsgProc

*/