Tektronix Technical Forums are maintained by community involvement. Feel free to post questions or respond to questions by other members. Should you require a time-sensitive answer, please contact your local Tektronix support center here.

Fixed time step for 3706

Post Reply
robojames
Posts: 16
Joined: January 5th, 2011, 9:17 am
Country: United States

Fixed time step for 3706

Post by robojames » April 14th, 2011, 8:41 am

Hello,

Is there anyway to set the 3706 to take a measurement at fixed intervals (DCV)? Currently the time step varies fairly wildly.

Nathan S
Keithley Applications
Keithley Applications
Posts: 254
Joined: February 28th, 2011, 6:17 am
Country: United States
Contact:

Re: Fixed time step for 3706

Post by Nathan S » April 15th, 2011, 7:29 am

What is your current script or command list you're using for your measurements? Also, are you running this from TSB on a computer or loading it into the 3706 itself?

robojames
Posts: 16
Joined: January 5th, 2011, 9:17 am
Country: United States

Re: Fixed time step for 3706

Post by robojames » April 17th, 2011, 11:40 am

I currently utilize C++ to push commands through to the Keithley. My setup is as follows:

int controlSys(char fileName[256])
{
int i;
int srqFlag = {0};
double setAmp;
char data1[6000];
char data2[6000];
char time[6000];
double data1w[6000];
double data2w[6000];
double timew[6000];
double temp[6000];
double microVolts[6000];

ViSession defaultRM;
ViSession PS1;
ViSession dac;

ofstream dataWrite;

dataWrite.open(fileName);

viOpenDefaultRM(&defaultRM);
viOpen(defaultRM, "GPIB0::16::INSTR", VI_NULL, VI_NULL, &dac);
viOpen(defaultRM, "GPIB0::5::INSTR", VI_NULL, VI_NULL, &PS1);
viPrintf(PS1, "VSET 24\n");

if (dataWrite.is_open()){

viPrintf(dac, "display.clear()\n");
viPrintf(dac, "reset()\n");
viPrintf(dac, "dmm.configure.set('dcmeas')\n");
viPrintf(dac, "dmm.func = 'dcvolts'\n");
viPrintf(dac, "dmm.autozero = 1\n");
viPrintf(dac, "dmm.nplc = 1.0\n");
viPrintf(dac, "dmm.range =0\n");
viPrintf(dac, "dmm.configure.set('dcmeas')\n");
viPrintf(dac, "dmm.setconfig('6006:6007','dcmeas')\n");

viPrintf(dac, "reading_buffer = dmm.makebuffer(6000)\n");
viPrintf(dac, "scan.create('6006:6007')\n");
viPrintf(dac, "scan.scancount = 1\n");

viPrintf(dac, "print(timer.reset())\n");

cout << "Set current to (A): ";
cin >> setAmp;

dataWrite << "Time (s)" << "," << "Bridge (mV)" << "," << "Ice Bath (mV)" << "," << "Delta (Micro Volts)" << "," << "Temperature" << "," << "Amps" << endl;

viPrintf(dac, "print(timer.reset())\n");

for (i = 1; i <=100; i++) {


viPrintf(dac, "scan.background(reading_buffer)\n");
viPrintf(dac, "printbuffer(1,1,reading_buffer)\n");
viScanf(dac, "%s\n", &data1);

viPrintf(dac, "printbuffer(2,2,reading_buffer)\n");
viScanf(dac, "%s\n", &data2);

viPrintf(dac, "print(timer.measure.t())\n");
viScanf(dac, "%s\n", &time);

data1w = atof(data1); // Bridge measurement (channel 6006) conversion
data2w = atof(data2); // Ice Bath measurement (channel 6007) conversion
timew = atof(time);


microVolts = (data1w + 0.00127469) * pow(10,6); // Difference of the two voltages + conversion factor from mV to uV

if(microVolts >= 0) {
temp = c0 + c1*microVolts + c2*pow(microVolts,2) + c3*pow(microVolts,3) + c4*pow(microVolts[i],4) + c5*pow(microVolts[i],5) + c6*pow(microVolts[i],6) + c7*pow(microVolts[i],7) + c8*pow(microVolts[i],8) + c9*pow(microVolts[i],9);
}
else {
temp[i] = c01 + c11*microVolts[i] + c21*pow(microVolts[i],2) + c31*pow(microVolts[i],3) + c41*pow(microVolts[i],4) + c51*pow(microVolts[i],5) + c61*pow(microVolts[i],6) + c71*pow(microVolts[i],7) + c81*pow(microVolts[i],8) + c91*pow(microVolts[i],9);
}

dataWrite << timew[i] << "," << data1w[i] << "," << data2w[i] << "," << microVolts[i] << "," << temp[i] << endl;

cout << "Temperature: " << temp[i] << " " << "MicroVolts: " << microVolts[i] << endl;

} // END FOR 1


I didn't want to post the entire routine due to length, but I hope this includes what you are looking for. (dac is the Keithley)

robojames
Posts: 16
Joined: January 5th, 2011, 9:17 am
Country: United States

Re: Fixed time step for 3706

Post by robojames » April 21st, 2011, 4:00 pm

From reading other posts around the forums I'm guessing there is no setting to make this happen.

Andrea C
Keithley Applications
Keithley Applications
Posts: 1331
Joined: October 15th, 2010, 10:35 am
Country: United States
Contact:

Re: Fixed time step for 3706

Post by Andrea C » April 23rd, 2011, 10:22 am

You could make use of one of the four timers to generate an event at requested intervals and then use that event to feed the measure stimulus input.
TSP code would look something like below:

-- Use internal timer to
-- give me a time tic at requested intervals
PERIOD = trigger.timer[1]
PERIOD.delay = 1
PERIOD.stimulus = scan.trigger.EVENT_SCAN_START --which event causes timer to start
PERIOD.count = numOfChannelsinScan -- how many times should the timer tic
PERIOD.passthrough = false

-- feed the timer tic EVENT to the measure stimulus
scan.trigger.measure.stimulus = PERIOD.EVENT_ID


Refer to Figure 8-2 in the Reference Manual for a diagram of trigger model and where in the scan each of these events occur.

Andrea C

robojames
Posts: 16
Joined: January 5th, 2011, 9:17 am
Country: United States

Re: Fixed time step for 3706

Post by robojames » May 2nd, 2011, 10:06 am

I'm having a little bit of difficulty implementing this. Would this script be used in conjunction with an if/then statement to determine when the measurement should be taken?

Andrea C
Keithley Applications
Keithley Applications
Posts: 1331
Joined: October 15th, 2010, 10:35 am
Country: United States
Contact:

Re: Fixed time step for 3706

Post by Andrea C » May 3rd, 2011, 12:19 pm

Hello,

The TSP snippet I had previously provided was intended to be used together with your existing commands for the 3706.
The snippet I wrote merely configures an internal timer and modifies the scan to use the timer as the stimulus for when to measure.

Here is a script (borrowed heavily from your 3706 commands) that runs within the Test Script Builder to scan at a fixed time based upon an internal timer of the 3706:

display.clear()
reset()

dmm.configure.set('dcmeas')
dmm.func = 'dcvolts'
dmm.autozero = 1
dmm.nplc = 1.0
dmm.range =0
dmm.configure.set('dcmeas')

--dmm.setconfig('6006:6007','dcmeas')
dmm.setconfig('1001:1002','dcmeas')

reading_buffer = dmm.makebuffer(6000)

--scan.create('6006:6007')
scan.create('1001:1002')
scan.scancount = 1

-- Use internal timer to
-- give me a time tic at requested intervals
PERIOD = trigger.timer[1]
PERIOD.delay = 10 -- in units of seconds, so this is 10 seconds
PERIOD.stimulus = scan.trigger.EVENT_SCAN_START --which event causes timer to start
PERIOD.count = 2 -- how many times should the timer tic = number of channels in the scan
PERIOD.passthrough = false

-- feed the timer tic EVENT to the measure stimulus of the scan
scan.trigger.measure.stimulus = PERIOD.EVENT_ID

scan.background(reading_buffer)

printbuffer(1,1,reading_buffer)

printbuffer(2,2,reading_buffer)

Hope it helps.

Andrea C

robojames
Posts: 16
Joined: January 5th, 2011, 9:17 am
Country: United States

Re: Fixed time step for 3706

Post by robojames » July 25th, 2011, 9:36 am

Andrea,

Thanks for your assistance! This worked perfectly for my needs. Thanks again!

robojames
Posts: 16
Joined: January 5th, 2011, 9:17 am
Country: United States

Re: Fixed time step for 3706

Post by robojames » September 13th, 2011, 8:52 am

It there a way to do this with the ke37xx object in C#? I've perused through the object library but I can't find any of the commands.

Post Reply

Return to “Series 3700 Switch System/Multimeter and Plug-In Cards”

Who is online

Users browsing this forum: No registered users and 2 guests