In TestFlow's instrument library, the Keithley 2602B takes 69 TSP commands, 14 of them queries, and the Keysight B2902B takes 62 SCPI commands, 15 of them queries. That is 7 more on the 2602B. Counting distinct command headers (the command path without its arguments), 0 are accepted by both, 52 exist only on the 2602B, and 58 only on the B2902B. The 2602B is programmed in TSP and the B2902B in SCPI, so a script written for one does not run on the other without translating each command.
Only the 2602B has smua, smub, errorqueue, localnode, beeper, and reset and 2 more. Only the B2902B has SOURce, SENSe, OUTPut, FETCh, MEASure, and READ and 6 more.
Only the 2602B library has an operation-complete command (waitcomplete()); the B2902B library has none. Only the 2602B library has an error-queue read (errorqueue.next()); the B2902B library has none.
TestFlow's library gives the 2604B, 2612B, 2614B, 2634B, and 2636B the same command set as the 2602B, so the 2602B column applies to them too. TestFlow's library gives the B2912B the same command set as the B2902B, so the B2902B column applies to it too.
Describe the test; TestFlow's agent uses these command sets to drive your Keithley 2602B or Keysight B2902B and writes the report from the measured results.
Counts come from TestFlow's instrument library, the command sets its AI agent uses to drive each instrument. A distinct command header is the command path without its arguments, so :OUTPut ON and :OUTPut OFF count once.
| Keithley 2602B | Keysight B2902B | |
|---|---|---|
| Commands in TestFlow's library | 69 | 62 |
| Queries (read a value or state) | 14 | 15 |
| Settings and actions | 55 | 47 |
| Subsystems | 10 | 16 |
| Distinct command headers | 52 | 58 |
| Headers the other lacks | 52 | 58 |
| Command language | TSP | SCPI |
| Operation complete | waitcomplete() | Not in library |
| Error queue | errorqueue.next() | Not in library |
| Models on this command set | 2602B, 2604B, 2612B, 2614B, 2634B, 2636B | B2902B, B2912B |
None. No command header in TestFlow's 2602B library matches one in its B2902B library: the 2602B speaks TSP and the B2902B speaks SCPI.
52 command headers in the 2602B library have no match in the B2902B library. Below are 12 of them from the 6 largest subsystems; the full list is in the Keithley 2602B command reference.
| Command | What it does |
|---|---|
| smua.source.output = smua.OUTPUT_ON | Turn On CHA. Enables the output of SMU channel A (TSP command). |
| smua.source.func = smua.OUTPUT_DCVOLTS | Set Source Function Voltage CHA. Sets the source function of channel A to DC voltage. |
| smua.source.levelv = <Voltage> | Set Voltage Source CHA. Sets the output voltage level in volts on channel A. |
| smua.source.leveli = <Amp> | Set Current Source CHA. Sets the output current level in amps on channel A. |
| Command | What it does |
|---|---|
| smub.source.output = smub.OUTPUT_ON | Turn On CHB. Enables the output of SMU channel A (TSP command). |
| smub.source.func = smub.OUTPUT_DCVOLTS | Set Source Function Voltage CHB. Sets the source function of channel A to DC voltage. |
| smub.source.levelv = <Voltage> | Set Voltage Source CHB. Sets the output voltage level in volts on channel A. |
| smub.source.leveli = <Amp> | Set Current Source CHB. Sets the output current level in amps on channel A. |
| Command | What it does |
|---|---|
| beeper.beep(<Duration>, <Frequency>) | Beep. Sounds the beeper for the given duration and frequency. |
| Command | What it does |
|---|---|
| print(errorqueue.next()) | Read Error. Reads the next message from the error queue. |
| Command | What it does |
|---|---|
| print(localnode.description) | Identify. Returns the instrument identification string. |
| Command | What it does |
|---|---|
| reset() | Reset. Resets the entire instrument to its default state. |
58 command headers in the B2902B library have no match in the 2602B library. Below are 23 of them from the 6 largest subsystems; the full list is in the Keysight B2902B command reference.
| Command | What it does |
|---|---|
| :SOURce<Channel>:FUNCtion:SHAPe <Function> | Set Source Function. Sets the source output shape (DC or Pulse) for the specified channel. |
| :SOURce<Channel>:FUNCtion:MODE <Mode> | Set Source Mode. Sets the source function mode (voltage or current sourcing) for the specified channel. |
| :SOURce<Channel>:VOLTage:LEVel:IMMediate:AMPLitude <Voltage> | Set Voltage. Sets the DC output voltage level in volts for the specified channel (range: -21 V to +21 V). |
| :SOURce<Channel>:CURRent:LEVel:IMMediate:AMPLitude <Current> | Set Current. Sets the DC output current level in amperes for the specified channel (range: -3 A to +3 A). |
| Command | What it does |
|---|---|
| :SENSe<Channel>:VOLTage:PROTection:LEVel <Voltage> | Set Voltage Compliance. Sets the voltage compliance (protection) limit in volts for the specified channel when sourcing current. |
| :SENSe<Channel>:CURRent:PROTection:LEVel <Current> | Set Current Compliance. Sets the current compliance (protection) limit in amperes for the specified channel when sourcing voltage. |
| :SENSe<Channel>:FUNCtion:ON "<Function>" | Set Sense Function. Selects the measurement (sense) function for the specified channel. |
| :SENSe<Channel>:VOLTage:RANGe:UPPer <Range> | Set Sense Voltage Range. Sets the voltage measurement range for the specified channel in volts. |
| Command | What it does |
|---|---|
| *SAV <Register> | Save State. Saves the current instrument settings (both channels) to non-volatile memory register (0 to 4). |
| *RCL <Register> | Recall State. Recalls and restores instrument settings (both channels) from the specified non-volatile memory register. |
| *IDN? | Identify. Queries and returns the instrument identification string (manufacturer model serial firmware). |
| *RST | Reset. Resets the instrument to factory default settings on all channels and aborts any pending operations. |
| Command | What it does |
|---|---|
| :OUTPut<Channel> ON | Turn On. Enables the output of the specified channel (1 or 2). |
| :OUTPut<Channel>:STATe? | Read Output State. Queries and returns the output state of the specified channel (0=OFF / 1=ON). |
| :OUTPut<Channel>:OFF:MODE <Mode> | Set Output Off Mode. Sets the terminal condition when the output of the specified channel is turned off. |
| :OUTPut<Channel>:LOW <State> | Set Output Low. Sets the output LO terminal to ground or floating for the specified channel when output is off. |
| Command | What it does |
|---|---|
| :FETCh:SCALar:VOLTage? (@<Channel>) | Fetch Voltage. Returns the last measured voltage of the specified channel from buffer without re-triggering. |
| :FETCh:SCALar:CURRent? (@<Channel>) | Fetch Current. Returns the last measured current of the specified channel from buffer without re-triggering. |
| :FETCh:SCALar? (@<Channel>) | Fetch All. Returns all last measured data (voltage current resistance status timestamp) for the specified channel. |
| :FETCh:ARRay:VOLTage? (@<Channel>) | Fetch Array Voltage. Returns the array of measured voltage data points from the last sweep for the specified channel. |
| Command | What it does |
|---|---|
| :MEASure:VOLTage? (@<Channel>) | Measure Voltage. Triggers a measurement and returns the measured voltage of the specified channel in volts. |
| :MEASure:CURRent? (@<Channel>) | Measure Current. Triggers a measurement and returns the measured current of the specified channel in amperes. |
| :MEASure:RESistance? (@<Channel>) | Measure Resistance. Triggers a measurement and returns the measured resistance of the specified channel in ohms. |
With PyVISA and any VISA backend, this opens both instruments, identifies them, sends one setting, and reads one value from each. For the setting, the two libraries have no common command with a worked example on both, so each instrument uses its own: smua.source.output = smua.OUTPUT_ON on the 2602B and :OUTPut1 ON on the B2902B. For the reading, the two libraries have no common command with a worked example on both, so each instrument uses its own: print(smua.measure.v()) on the 2602B and :MEASure:VOLTage? (@1) on the B2902B. For the basics, see the PyVISA tutorial.
import pyvisa
rm = pyvisa.ResourceManager()
print(rm.list_resources()) # find both VISA addresses
a = rm.open_resource("PASTE_2602B_ADDRESS") # Keithley 2602B
b = rm.open_resource("PASTE_B2902B_ADDRESS") # Keysight B2902B
for inst in (a, b):
inst.timeout = 5000 # ms
print(inst.query("*IDN?"))
# No shared setting with an example on both, so each uses its own command
a.write("smua.source.output = smua.OUTPUT_ON") # Turn On CHA
b.write(":OUTPut1 ON") # Turn On
# No shared reading with an example on both, so each uses its own command
print(a.query("print(smua.measure.v())")) # Measure Voltage CHA
print(b.query(":MEASure:VOLTage? (@1)")) # Measure Voltage
a.close()
b.close()Describe the test; TestFlow's agent uses these command sets to drive your Keithley 2602B or Keysight B2902B and writes the report from the measured results.
In TestFlow's library the 2602B has 69 TSP commands and the B2902B has 62 SCPI commands. 0 command headers are common to both, 52 are only on the 2602B (mostly smua and smub), and 58 are only on the B2902B (mostly SOURce and SENSe).
Not directly. The 2602B uses TSP and the B2902B uses SCPI, so each command has to be rewritten for the other instrument. PyVISA opens both the same way, and both answer *IDN?, but the commands that set and read values differ.
The 2602B: 69 commands for the 2602B against 62 for the B2902B in TestFlow's library. Of those, 14 on the 2602B and 15 on the B2902B are queries that read a value or state, and the library splits them into 10 and 16 subsystems.
Only the 2602B library has an operation-complete command (waitcomplete()); the B2902B library has none. Only the 2602B library has an error-queue read (errorqueue.next()); the B2902B library has none. Each command named here is listed in the tables on this page and on each instrument's command reference.
Describe the test. TestFlow builds the workflow, runs it on your instruments, and writes the report. See it on a bench like yours.