EasyManua.ls Logo

Keysight Technologies 8163A/B - Page 252

Keysight Technologies 8163A/B
306 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
252 8163A/B, 8164A/B & 8166A/B Mainframes Programming Guide
6 VISA Programming Examples
{
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);
/* display the values using %g, a float format specifier,
you may also use %e or %f */
for ( i = 0; i < noOfValues; i++)
printf("\t%g\n",logResults[i]);
/* loop, until a key is pressed */
while(!scanf("%c",&c));
/* close the session */
viClose(vi);
}
void checkError(ViStatus session, ViStatus err_status )
{
ViStatus error;
ViChar errMsg[256];
error = viQueryf(session,"SYST:ERR?\n","%t",errMsg);
if (error == VI_ERROR_TMO)
{
printf("System Error!\n") ;
exit(1);
}
else
{
/* only errors should be displayed */
if(errMsg[0] != '+')
{
printf("error:%ld --> %s\n", err_status,errMsg) ;
if
((!strncmp(errMsg,
"-303,\"Module slot empty or slot / channel invalid\
"",
strlen("-303,\"Module slot empty or slot / channel
invalid\"")))
||

Table of Contents

Related product manuals