Agilent Technologies 8163A Work Light User Manual


 
How to Log Results VISA Programming Examples
Agilent 8163A/B, 8164A/B & 8166A/B Mainframes, Fifth Edition 209
break;
}
/* find the substring "COMPLETE" in the reply of the instrument
*/
replySubStr = replyBuf;
while(*replySubStr)
{
if(!strncmp(replySubStr,"COMPLETE",strlen("COMPLETE")))
break;
replySubStr ++;
}
}while (!*replySubStr); /*substring "COMPLETE" not found */
/*continue polling */
/* The instrument returns the logging result in the following format:
#xyyyffff...; the first digits after the hash denotes the number of ascii
digits following (y) ; y specifies the number of binary data following;
"ffff" represent the 32Bit floats as log result. */
/* get the result */
errStatus =
viPrintf(vi,"SENS%1d:CHAN%1d:FUNC:RES?\n",slot,chan);
/* only query an error, if there is one, else the query will be
interrupted ! */
if(errStatus < VI_SUCCESS)checkError(vi,errStatus);
/* read the binary data */
errStatus = viRead(vi, logBuffer, MAX_LOG_VALUES *
sizeof(ViReal32) + HEADER_SIZE, &retCnt);
checkError(vi,errStatus);
if(logBuffer[0] != '#')
{
printf("invalid format returned from logging\n");
exit(1);
}
else
{
noOfDigits = logBuffer[1] -'0';
memcpy( logResults, &logBuffer[2 + noOfDigits ],
MAX_LOG_VALUES * sizeof(ViReal32));
}
/* stop logging */
viPrintf(vi,"SENS%1d:CHAN%1d:FUNC:STAT
LOGG,STOP\n",slot,chan);
checkError(vi,errStatus);