diff --git a/ecmc_plugin_socketcan/ecmc_plugin_socketcanApp/src/ecmcSocketCAN.cpp b/ecmc_plugin_socketcan/ecmc_plugin_socketcanApp/src/ecmcSocketCAN.cpp index aa06313..62ec87e 100644 --- a/ecmc_plugin_socketcan/ecmc_plugin_socketcanApp/src/ecmcSocketCAN.cpp +++ b/ecmc_plugin_socketcan/ecmc_plugin_socketcanApp/src/ecmcSocketCAN.cpp @@ -194,7 +194,13 @@ void ecmcSocketCAN::doReadWorker() { if(destructs_) { break; } - + if(!connected_) { + timespec tempPauseTime; + tempPauseTime.tv_sec = 1; + tempPauseTime.tv_nsec = 0; + nanosleep(&tempPauseTime,NULL); + continue; + } // Wait for new CAN frame int bytes = read(socketId_, &rxmsg_, sizeof(rxmsg_)); if(bytes == -1) { @@ -420,7 +426,7 @@ void ecmcSocketCAN::initAsyn() { } // Add resultdata "plugin.can.read.error" - std::string paramName = ECMC_PLUGIN_ASYN_PREFIX + std::string(".read.error"); + std::string paramName = ECMC_PLUGIN_ASYN_PREFIX + std::string(".com.error"); errorParam_ = ecmcAsynPort->addNewAvailParam( paramName.c_str(), // name diff --git a/ecmc_plugin_socketcan/ecmc_plugin_socketcanApp/src/ecmcSocketCANWriteBuffer.cpp b/ecmc_plugin_socketcan/ecmc_plugin_socketcanApp/src/ecmcSocketCANWriteBuffer.cpp index 06dd534..e843c71 100644 --- a/ecmc_plugin_socketcan/ecmc_plugin_socketcanApp/src/ecmcSocketCANWriteBuffer.cpp +++ b/ecmc_plugin_socketcan/ecmc_plugin_socketcanApp/src/ecmcSocketCANWriteBuffer.cpp @@ -46,7 +46,7 @@ ecmcSocketCANWriteBuffer::ecmcSocketCANWriteBuffer(int socketId, int cfgDbgMode) bufferSwitchMutex_ = epicsMutexCreate(); lastWriteSumError_ = 0; writePauseTime_.tv_sec = 0; - writePauseTime_.tv_nsec = 2e6; // 1ms + writePauseTime_.tv_nsec = 2e6; // 2ms buffer1_.frameCounter = 0; buffer2_.frameCounter = 0;