Using scale & offset to measurement – BNC 1105 Universal Counter User Manual

Page 185

Advertising
background image

185

185

185

185

/*------------------------------- Total CH1 measure ----------------------------*/

// stat = viWrite(sesn, "CONF:TOT (@1),(@2)", 18, &ret);

/*----------------------------------- Gate Ext ------------------------------------*/

// stat = viWrite(sesn, "TOT:ARM:SOUR IMM", 16, &ret);

// stat = viWrite(sesn, "TOT:ARM:STOP:SOUR TIM", 21, &ret);

// stat = viWrite(sesn, "TOT:ARM:STOP:TIM 1", 18, &ret);

/*----------------------------------- Gate Time ----------------------------------*/

// stat = viWrite(sesn, "TOT:ARM:SOUR IMM", 16, &ret)

// stat = viWrite(sesn, "TOT:ARM:STOP:SOUR TIM", 21, &ret);

// stat = viWrite(sesn, "TOT:ARM:STOP:TIM 1", 18, &ret);

/*----------------------------------- ARM Auto -----------------------------------*/

// stat = viWrite(sesn, "TOT:ARM:SOUR IMM", 16, &ret)

// stat = viWrite(sesn, "TOT:ARM:STOP:SOUR IMM", 21, &ret);

/*----------------------------------------------------------------------------------*/

/*------------------------------ Read From Device ------------------------------*/

stat = viWrite(sesn, (unsigned char *)("FETC?"), 5, &ret);

// stat = viWrite(sesn, "READ?", 5, &ret);

// stat = viWrite(sesn, "MEAS:FREQ?", 10, &ret);

// stat = viWrite(sesn, "SENS:DATA?", 10, &ret);

/*----------------------------------------------------------------------------------*/

stat=viRead(sesn,(unsigned char *)readin,128,&ret);

printf ("Read : %s",readin);

stat = viSetAttribute(sesn, VI_ATTR_TMO_VALUE, tmo);

stat = viGpibControlREN(sesn, VI_GPIB_REN_ADDRESS_GTL);

viClose (flist);

viClose (defaultRM);

return 0;

}

Using Scale & Offset to Measurement

Example 5 Scale & Offset

// Scal_Offset.cpp : Defines the entry point for the console application.

#include "stdafx.h"

#include "visa.h"//include visa32.lib first to the probject.

#define MAX_COUNT 200

Advertising