I will do this for a device (a fuel cell), then switch the leads to another fuel cell, take the same measurement, and repeat for many cells. I just want to be able to start the trigger model to characterize each device via the script, have all the data saved, and be able to move it to excel for processing. Do you recommend creating a new buffer for each fuel cell?
I've got the TSP commands for controlling the SMU more or less figured out, but am totally lost on saving the data. I think I want the "printbuffer" command, but I don't know what things like .n, i =, for, do, if, , ==, '\t', %g, string.format, etc. mean. I have been scouring the reference manual and forums but there seems to be no guide as to what this coding means, how to use it, and what their resultant output is. Where can I read in detail about how to use this code?
Also, please let me know if the code is okay for the measurement: 10 applied current steps from -1.5 to 0 mA with ~300 s steps. I think it's not quite right as-is.
Code: Select all
reset() fuelcell_1 = buffer.make(100000) --Measure Settings smu.measure.func = smu.FUNC_DC_VOLTAGE smu.measure.autorange = smu.ON smu.measure.nplc = 10 smu.measure.sense=smu.SENSE_4WIRE --Source Settings smu.source.func = smu.FUNC_DC_CURRENT smu.source.vlimit.level = 0.1 smu.source.delay = 0.01 smu.source.sweeplinear('LinearSweep', -0.0015, 0, 10) --Trigger Model configuration trigger.model.setblock(1, trigger.BLOCK_BUFFER_CLEAR) trigger.model.setblock(2, trigger.BLOCK_CONFIG_RECALL, "LinearSweep", 1) trigger.model.setblock(3, trigger.BLOCK_SOURCE_OUTPUT, smu.ON) trigger.model.setblock(4, trigger.BLOCK_BRANCH_ON_EVENT, trigger.EVENT_SOURCE_LIMIT, 15) trigger.model.setblock(5, trigger.BLOCK_DELAY_CONSTANT, 10) trigger.model.setblock(6, trigger.BLOCK_MEASURE) trigger.model.setblock(7, trigger.BLOCK_BRANCH_COUNTER, 1000, 6) trigger.model.setblock(8, trigger.BLOCK_CONFIG_NEXT, "LinearSweep") trigger.model.setblock(9, trigger.BLOCK_BRANCH_ON_EVENT, trigger.EVENT_SOURCE_LIMIT, 15) trigger.model.setblock(10, trigger.BLOCK_MEASURE) trigger.model.setblock(11, trigger.BLOCK_BRANCH_COUNTER, 1000, 10) trigger.model.setblock(12, trigger.BLOCK_BRANCH_COUNTER, 9, 8) trigger.model.setblock(13, trigger.BLOCK_SOURCE_OUTPUT, smu.OFF) trigger.model.setblock(14, trigger.BLOCK_BRANCH_ALWAYS, 0) trigger.model.setblock(15, trigger.BLOCK_SOURCE_OUTPUT, smu.OFF) trigger.model.setblock(16, trigger.BLOCK_LOG_EVENT, 2733, "source limit exceeded") trigger.model.initiate() waitcomplete() printbuffer(1, 1000, fuelcell_1.readings,fuelcell_1.sourcevalues,fuelcell_1.relativetimestamps) print("Rdg#","Times","Voltage (V)") for i=1,fuelcell_1.n do print(i,fuelcell_1.[i], fuelcell_1.sourcevalues[i], fuelcell_1.readings[i],fuelcell_1.relativetimestamps[i],fuelcell_1[i])) end