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.
I am running TSP scripts on 4 2602B instruments with TSP link. I call the scripts from a VBA macro. In the scripts I make measurements with overlappediv command
I then print the measurements with
printbuffer(1, MaxIterations, smu3.nvbuffer2) --V3
printbuffer(1, MaxIterations, smu3.nvbuffer1) --I3
printbuffer(1, MaxIterations, smu2.nvbuffer2) --V2
printbuffer(1, MaxIterations, smu2.nvbuffer1) --I2
printbuffer(1, MaxIterations, smu4.nvbuffer2) --V4
printbuffer(1, MaxIterations, smu4.nvbuffer1) --I4
To get the measurements into VBA I run a ReadNumber command.
For i = 0 To 4
instrout(i) = instrAny.ReadNumber()
However, when doing this, the data queue is not cleared. So when I run a second measurement, the first measurement is still in the beginning of the instrout array.
In the TSP scripts there are both smuX.reset and smuX.nvbufferY.clear() in the very beginning of the script.
- Keithley Applications
- Posts: 1427
- Joined: October 15th, 2010, 10:35 am
- Country: United States
After you clear the buffer, see if it indeed has cleared. Interrogate the value of smuX.nvbufferX.n
Code: Select all
numberOfReadings = smua.nvbuffer1.n print(numberOfReadings)
Code: Select all
function reset_buffers(smu) -- Prepare the Reading Buffers smu.nvbuffer1.clear() smu.nvbuffer1.appendmode = 1 smu.nvbuffer1.collecttimestamps = 1 smu.nvbuffer2.clear() smu.nvbuffer2.appendmode = 1 smu.nvbuffer2.collecttimestamps = 1 end -- function
It is a command from a visa communication library
Set instrAny = New VisaComLib.FormattedIO488
The first thing I do in the functions is to clear the buffer.
However, I found a solution with the instrAny.IO.clear in the VBA macro. That appears to fix the problem.
Who is online
Users browsing this forum: Google [Bot] and 2 guests