Keysight Technologies 8163A/B Programming Manual page 252

Table of Contents

Advertisement

6
VISA Programming Examples
252
{
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\"")))
||
8163A/B, 8164A/B & 8166A/B Mainframes Programming Guide

Advertisement

Table of Contents
loading

This manual is also suitable for:

8164a/b8166a/b

Table of Contents