Keithley 2602B software bug

I am taking measurments from the KEITHLEY 2602B system source meter and displays it onto my own software that plots the readings. My issue is that I get every two readings the following errors.So the first run the software runs the measurment but only the 2nd time I get this error :Device (Channel a): Error: “could only read 0 of 11 bytes: Unknown error”

Details:

    Error code: 0 (The operation completed successfully).

    Source: keithley.cpp line 453.

Device (Channel b):

Error: "could not request errorqueue.count"

Details:

    Source: keithley.cpp line 408.

    Last command sent: smub.source.output=0.00000000000e+000 (sets output to zero).

    No additional data was transmitted/received (data size: 0)

.So its always the 2nd time I need to take a measurment for the error message to appear and so on. Chanel A is connected to a photodiode taking readings and channel B provide power to an LED. If I could get some help since this issue has been bugging me for the last few months, much appreciated!
QByteArray errorCountString = PORT_BLOCK_REQUEST_LINE( “print(errorqueue.count)” );
//qDebug() << “print(errorqueue.count)=“” << errorCountString << “””;
errorCountString.chop( 1 );//remove \n
bool ok;
const int errorCount = errorCountString.toDouble( &ok );
if ( !ok )
{
setErrorMessage( CREATE_DATA_ERROR_MESSAGE( QByteArray::fromRawData( dataOut, dataOutSize ),
QByteArray::fromRawData( dataIn, dataInSize ),
QCoreApplication::translate( “Keithley”, “could not request errorqueue.count” ) ) );
return true;
};

if ( errorCount != 0 )
{
QString errors;
for( int i = 0; i < errorCount; ++i )
{
const QByteArray ba = PORT_BLOCK_REQUEST_LINE( “print(errorqueue.next())” );
const QByteArrayList bal = ba.split( ‘\t’ );

  if ( bal.size() == EMI_IndexCount )
    errors += QLatin1ByteArray( bal[EMI_Message] ) + QLatin1Char( '\n' );
  else
    errors += QLatin1ByteArray( ba );
};

errors.chop( 1 );//remove \n

setErrorMessage( CREATE_DATA_ERROR_MESSAGE( QByteArray::fromRawData( dataOut, dataOutSize ),
                                            QByteArray::fromRawData( dataIn,  dataInSize  ),
                                            QCoreApplication::translate( "Keithley", "device error" ) + QConstLatin1String( ":\n" ) + errors ) );
return true;

};

//----
//done
//----
return false;
}
//-----------------------------------------------
bool request( const SharedPort::Pointer & port, SetErrorMessageFunction setErrorMessage, const char * dataOut, int dataOutSize, char * dataIn, int dataInSize, ReferencedTime * start, ReferencedTime * end )
{
TRACE_MTneu;

MUTEXLOCKER1( port → blockRequestMutex() );
//if ( qApp → applicationName() == QLatin1String( “fsoModularMeasurement” ) )
//if ( qApp → applicationName() == QLatin1String( “fsoDevicePool” ) )
// utils::threadOutput( “%s: %s”, port->name().toLocal8Bit().constData(), dataOut );

//request data
const qint64 bytes = port → blockRequest( dataOut, dataOutSize, dataIn, dataInSize, start, end );
if ( bytes != dataInSize )
{
setErrorMessage( CREATE_LAST_ERROR_MESSAGE( QCoreApplication::translate( “Keithley”, "could only read %1 of %2 bytes: " ).arg( bytes ).arg( dataInSize ) + port → blockErrorString() ) );

return false;

};

//check for error
return !hasRequestError( port, setErrorMessage, dataOut, dataOutSize, dataIn, dataInSize );
}
//-------------------------------- the code above is part of the code the error message is referring to, in case this helps in debugging the issue.

Hi mo7.abdo,

thanks for posting your issues. As this forum is about SweepMe! and using Python for instrument automation, I cannot go much into detail with my answer. Still, it might be also interesting for our community how to fix such issues.

First, I assume that it is probably related to the commands that you sent and not an issue of the instrument as many people have programmed a Keithley 2602B without such issues.

If the first run is ok but the second one fails, it is likely that your intrument remains in a state that is not the same as before the first run. To check this, restart the instrument before every run. If that solves the problem you need to make sure your instrument is reset before each new run. Typically you can send a reset command as we also do it in our SweepMe! driver for the Keithley 2600 series:
https://github.com/SweepMe/instrument-drivers/blob/b9158dd2c80c86d4778c57fb3864600d228dd4be/src/SMU-Keithley_26xx/main.py#L182

If you make measurements with two channels to control an LED and and readout a photodiode, you should also consider to change your setup to SweepMe!. Such a measurement can be easily created in minutes and probably faster than fixing your bug.

Here is a screenshot of our sequencer, showing how to combine two SMU modules to run an IV curves with SMU1 and use SMU to readout the photodiode:

And here is the SweepMe! configuration to reproduce this. Just download SweepMe! 1.5.7, copy the text snippet below and paste it into the sequencer via right-click menu.

{
  "child_items": [
    {
      "child_items": [
        {
          "child_items": [
            {
              "child_items": [],
              "is_checked": true,
              "is_expanded": true,
              "module_details": {
                "module_type": "SMU",
                "Label": "SMU2",
                "value": "",
                "Device": "SMU-Keithley_26xx",
                "Channel": "Ch B",
                "Port": "COM7",
                "SweepValue": "SweepEditor",
                "SweepMode": "Voltage in V",
                "RouteOut": "Rear",
                "4wire": false,
                "Compliance": "0.0001",
                "SkipCompliance": false,
                "Speed": "Fast",
                "Range": "Auto",
                "RangeVoltage": "Auto",
                "Average": 1,
                "Configuration": "",
                "PostProcessingResistance": false,
                "PostProcessingConductance": false,
                "PostProcessingPower": false,
                "ShowPulse": false,
                "CheckPulse": false,
                "PulseCount": "1",
                "PulseOffLevel": "0.0",
                "PulseOnTime": "0.0002",
                "PulseOffTime": "0.2",
                "PulsePeriod": "1e-3",
                "PulseDelay": "0.0",
                "PulseMeasStart": 50,
                "PulseMeasTime": 1,
                "PulseRiseTime": "100e-9",
                "PulseFallTime": "100e-9",
                "PulseImpedance": "200e-3",
                "SweepEditor": {
                  "sweeps": [
                    {
                      "loop": "1",
                      "start": "0.0",
                      "end": "0.0",
                      "step_points": "0.1",
                      "scaling": "Step width",
                      "hold": "0.0"
                    }
                  ]
                },
                "ListSweepCheck": false,
                "ListSweepType": "Sweep",
                "ListSweepStart": "0.0",
                "ListSweepEnd": "1.0",
                "ListSweepStepPointsType": "Step width:",
                "ListSweepStepPointsValue": "0.1",
                "ListSweepDual": false,
                "ListSweepCustomValues": "",
                "ListSweepHoldtime": "0.1",
                "ListSweepDelaytime": "0.0",
                "Comment": ""
              }
            }
          ],
          "is_checked": true,
          "is_expanded": true,
          "module_details": {
            "module_type": "SMU",
            "Label": "SMU1",
            "value": "",
            "Device": "SMU-Keithley_26xx",
            "Channel": "Ch A",
            "Port": "COM7",
            "SweepValue": "SweepEditor",
            "SweepMode": "Voltage in V",
            "RouteOut": "Rear",
            "4wire": false,
            "Compliance": "0.0001",
            "SkipCompliance": false,
            "Speed": "Fast",
            "Range": "Auto",
            "RangeVoltage": "Auto",
            "Average": 1,
            "Configuration": "",
            "PostProcessingResistance": false,
            "PostProcessingConductance": false,
            "PostProcessingPower": false,
            "ShowPulse": false,
            "CheckPulse": false,
            "PulseCount": "1",
            "PulseOffLevel": "0.0",
            "PulseOnTime": "0.0002",
            "PulseOffTime": "0.2",
            "PulsePeriod": "1e-3",
            "PulseDelay": "0.0",
            "PulseMeasStart": 50,
            "PulseMeasTime": 1,
            "PulseRiseTime": "100e-9",
            "PulseFallTime": "100e-9",
            "PulseImpedance": "200e-3",
            "SweepEditor": {
              "sweeps": [
                {
                  "loop": "1",
                  "start": "0.0",
                  "end": "2.0",
                  "step_points": "0.05",
                  "scaling": "Step width",
                  "hold": "0.0"
                },
                {
                  "loop": "1",
                  "start": "2.0",
                  "end": "0.0",
                  "step_points": "0.05",
                  "scaling": "Step width",
                  "hold": "0.0"
                }
              ]
            },
            "ListSweepCheck": false,
            "ListSweepType": "Sweep",
            "ListSweepStart": "0.0",
            "ListSweepEnd": "1.0",
            "ListSweepStepPointsType": "Step width:",
            "ListSweepStepPointsValue": "0.1",
            "ListSweepDual": false,
            "ListSweepCustomValues": "",
            "ListSweepHoldtime": "0.1",
            "ListSweepDelaytime": "0.0",
            "Comment": ""
          }
        }
      ],
      "is_checked": true,
      "is_expanded": true,
      "module_details": {
        "module_type": "MakeFile",
        "Label": "MakeFile1",
        "value": "ID",
        "FileID": "ID",
        "ShowAdvancedOptions": false,
        "BranchIndex": true,
        "FileIndex": true,
        "ModuleLabels": true,
        "Comment": ""
      }
    }
  ],
  "data_type": "Sequencer",
  "version": "v1"
}

Thanks and best,
Axel