D – Example Programs
170
360 !
370 OUTPUT @Ps;"FETCH:CURR:MAX?" ! Get more data from previous
measurement.
380 ENTER @Ps;Curr_max
390 PRINT "MAX CURRENT",Curr_max
400 !
410 OUTPUT @Ps;"FETCH:CURR:MIN?"
420 ENTER @Ps;Curr_min
430 PRINT "MIN CURRENT",Curr_min
440 !
450 OUTPUT @Ps;"FETCH:CURR:HIGH?"
460 ENTER @Ps;Curr_hi
470 PRINT "HIGH CURRENT",Curr_hi
480 !
490 OUTPUT @Ps;"FETCH:CURR:LOW?"
500 ENTER @Ps;Curr_low
510 PRINT "LOW CURRENT",Curr_low
520 !
530 END
When this program runs, it returns 100 measurement data points as well as the MIN, MAX, HIGH, andLOW data in the following format:
.030585 .031869 .0344369 .031655 .0320829 .0325109 .0333669 .0340089
.0320825 .031449 .031227 .031441 .0337949 .0327249 .031869 .031655
.0327249 .031013 .0325109 .0333669 3.09751 3.1814 3.14266 3.13667
3.13817 3.13624 .977283 .0667496 .0245932 .0280171 .031013 .031655
.0331529 .0350788 .0348648 .0327249 .031227 .0327249 .031227 .030799
.031869 .0329389 .030371 .031655 .031869 .0329389 .031869 .0322869
.0320829 .0325109 .0333669 .0340089 .0348648 .0327249 .031227 .0327249
.0320829 .030371 .031449 .031227 .031441 .0337949 .031449 .0333669
.031441 .0337949 .030371 .031655 .031869 .0329389 .031869 .0293011
.031441 .0337949 .0327249 .031869 .031655 .031655 .0320829 .031227
.0322969 .031655 .0327249 .0340089 2.97661 3.18632 3.14523 3.13496
3.13453 3.13731 1.32438 .0836549 .0258772 .0284451 .0275891 .0329389
.0329389 .0333669 .0322969 .0333669
MAX CURRENT 3.18632
MIN CURRENT .0245932
HIGH CURRENT 3.1371
LOW CURRENT .0314077
Example 4. Voltage Pulse Measurement Using VISA Library Calls
#include <visa.h>
#include <stdio.h> /* for printf */
#include <stdlib.h>
ViStatus main(void)
{
ViSession defRM, instrumentHandle;
ViStatus err;
ViReal64 measvoltage, meascurrent;
ViReal64 resultDC, resultRMS, resultMIN, resultMAX, resultHIGH, resultLOW;
ViReal64 voltArray[10];
ViInt32 i, numReadings ;
/* initialize the VISA session */
err = viOpenDefaultRM(&defRM);
if (err)