There is an example and code listing in the PDF I attached in earlier post.
This app note is good too:
App Note showing trigger model use - production test - fast throughput
Even for transfer curve, “sweeping” both gate and drain with trigger model task can give fast test speed.
If wanting a drain bias condition rather than a sweep, just make start equal to stop and number of steps same as the sweeping channel (gate). You’ll get an Ids at constant Vds for each Vgs value.
Sometimes you might want to do your own loop rather than use the trigger model sweep or list sweep. So what you have implemented is totally reasonable.
But if you judge it is taking too long to execute consider some revisions.
With the code you have now, each time your Python function is called, a lot of commands are sent to the SMUs. What’s in the Keithley_get()? Even more commands for the measurements?
All that is consuming time.
step 1: don’t execute setup commands needlessly. Same for reset. This costs time.
step 2: make a “apply configuration to SMU” function. Call it only when a setting is changing/prior to first run
step 3: make a run_it() function. Maybe clear buffers, output on, trigger.initiate(), <determine done>, printbuffers, output off - Next DUT
If you install these functions in the runtime memory of the SMUs, then the amount of characters across the bus between Python and the instrument can be vastly reduced and your speed further improved. You just need to VISA write the name of your functions to execute the code on the instrument. Big speed improvement!
I also encourage you to make use of tsp-link so that your Python code only needs connection to one instrument. Over tsp-link you will have node[2].smua and node[2].smub rather than a second VISA session to an instrument.
Last on buffer size: how many samples do you need? In the rare case that nvbuffers are not large enough, you can allocate runtime memory to be an even larger buffer. If you are getting past 100K samples to be transferred, take a look at binary xfer to reduce bus traffic for the data to PC xfer to again reduce time to do the task.