Hi Andrea, thank you for the answer. Currently im trying to make a script on TSB but I'm not a programmer myself so I'm having a little bit of trouble. I managed to write a code that can measure a voltage value on 1mA and another voltage value on 10mA. These voltage values are stored on 2 different buffers. Is there any way I can make a mathematical expression using values from 2 different buffers?
This is my code as of now:
-- Reset the instrument, which also clears the buffer.
reset()
--PRIMER VALOR DE VOLTAJE (1mA)
miliampx = buffer.make(10, buffer.STYLE_FULL)
-- Set up the source function.
smu.source.func = smu.FUNC_DC_CURRENT
smu.source.vlimit.level = 1100
smu.source.level = 1e-3
-- Set up measure function.
smu.measure.func = smu.FUNC_DC_VOLTAGE
smu.measure.terminals = smu.TERMINALS_FRONT
smu.measure.autorange = smu.ON
smu.measure.nplc = 1
-- Turn on the output and initiate readings.
trigger.model.load("DurationLoop", 1, 1, miliampx )
trigger.model.initiate()
-- Wait for the trigger model to complete.
waitcomplete()
smu.source.output = smu.OFF
-- Math?.
buffer.math(miliampx, buffer.UNIT_NONE, buffer.EXPR_LOG10)
for x = 1,1 do
print("Reading: ", smu.measure.read(miliampx))
end
--SEGUNDO VALOR DE VOLTAJE (10mA)
miliampy = buffer.make(10, buffer.STYLE_FULL)
-- Set up the source function.
smu.source.func = smu.FUNC_DC_CURRENT
smu.source.vlimit.level = 1100
smu.source.level = 10e-3
-- Set up measure function.
smu.measure.func = smu.FUNC_DC_VOLTAGE
smu.measure.terminals = smu.TERMINALS_FRONT
smu.measure.autorange = smu.ON
smu.measure.nplc = 1
-- Turn on the output and initiate readings.
trigger.model.load("DurationLoop", 1, 1, miliampy)
trigger.model.initiate()
-- Wait for the trigger model to complete.
waitcomplete()
smu.source.output = smu.OFF
-- Math?.
buffer.math(miliampy, buffer.UNIT_NONE, buffer.EXPR_LOG10)
for y = 1,1 do
print("Reading: ", smu.measure.read(miliampy))
end
alpha = (1/(miliampy[1]/miliampx[1]))
print(alpha)