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.