Computer Operations
Computer Interface Commands and Operation
4
4-63
asiputs( COM2, "ECHO 0", -2); /* Turn off command echo on Hydra */
checkResponse(); /* Get prompt */
/* Open data file TESTDATA.PRN */
if((testdata = fopen("testdata.prn","w")) == NULL)
{
perror("Cannot open testdata.prn");
exit(1);
}
/* Find out the number of channels the user wants to configure
NOTE: Channel 0 will not be used */
numChannels = 0;
while((numChannels < 1) || (numChannels > 20))
{
fprintf(stdout,"Enter the number of channels to be scanned (1-20):");
gets(response);
numChannels = atoi(response); /* convert ascii response to numeric */
}
/* Turn off unused channels */
fprintf(stdout,"\nWait....\n");
for(index = numCh 1; index < 21; ++index)
{
sprintf(sendbuff,"FUNC %d, OFF",index);
asiputs(COM2,sendbuff,-2);
checkResponse(); /* get prompt */
}
/* Print Header and Hydra identification header */
fprintf(stdout,"\n\nSample Program for Hydra\n");
asiputs(COM2,"*IDN?",-2); /* Ask for Hydra identification info */
checkResponse(); /* Get prompt */
asigets_timed(COM2,recvbuff,256,-2,TICKS_PER_SECOND*2); /* Receive Hydra
identification
header */
fprintf(stdout,"%s\n\n",recvbuff);
/*
* Configure channels and scan until user chooses to Quit
*/
while(1)
{
int func; /* Configuration setting */
char configStr[14]; /* channel function string */
/*
* Configure Hydra Channels
*/
op53_2f.eps
Figure 4-7. Sample Program (QuickC) (2 of 5)
Summary of Contents for 2635A
Page 8: ...2635A Users Manual vi...
Page 26: ...2635A Users Manual xxiv...
Page 29: ...Preparation for Use Introduction 1 1 3...
Page 50: ...2635A Users Manual 1 24...
Page 53: ...Front Panel Operations Summary of Front Panel Operations 2 2 3...
Page 88: ...2635A Users Manual 2 38...
Page 180: ...2635A Users Manual 5 10...
Page 212: ......
Page 234: ...2635A Users Manual B 4...
Page 250: ...2635A Users Manual D 8...
Page 251: ...E 1 Appendix E 8 Bit Binary Coded Decimal Table...
Page 264: ...Hydra Memory Card Record DATA FILES SET UP FILES DATxx Application Note SETxx Application Note...
Page 268: ...2635A Users Manual 4...