- Added Makefile.RHEL8 for RHEL8
- Added a interMessagePeriod to SINQController, pmacController and MasterMACSController. Also a iocsh command to modify this at runtime
This commit is contained in:
40
Makefile.RHEL8
Normal file
40
Makefile.RHEL8
Normal file
@ -0,0 +1,40 @@
|
||||
# This build the sinq extensions for the PSI EPICS setup
|
||||
include /ioc/tools/driver.makefile
|
||||
|
||||
MODULE=sinq
|
||||
BUILDCLASSES=Linux
|
||||
EPICS_VERSIONS=7.0.7
|
||||
ARCH_FILTER=RHEL%
|
||||
|
||||
# additional module dependencies
|
||||
REQUIRED+=SynApps
|
||||
REQUIRED+=stream
|
||||
REQUIRED+=scaler
|
||||
REQUIRED+=asynMotor
|
||||
|
||||
# using a test version
|
||||
#scaler_VERSION=2024
|
||||
|
||||
LIBVERSION=2024
|
||||
|
||||
TEMPLATES += sinqEPICSApp/Db/dimetix.db
|
||||
TEMPLATES += sinqEPICSApp/Db/slsvme.db
|
||||
TEMPLATES += sinqEPICSApp/Db/spsamor.db
|
||||
|
||||
DBDS += sinqEPICSApp/src/sinq.dbd
|
||||
|
||||
# What we need at SINQ
|
||||
SOURCES += sinqEPICSApp/src/devScalerEL737.c
|
||||
SOURCES += sinqEPICSApp/src/SINQController.cpp
|
||||
SOURCES += sinqEPICSApp/src/SINQAxis.cpp
|
||||
SOURCES += sinqEPICSApp/src/EL734Driver.cpp
|
||||
SOURCES += sinqEPICSApp/src/NanotecDriver.cpp
|
||||
SOURCES += sinqEPICSApp/src/stptok.cpp
|
||||
SOURCES += sinqEPICSApp/src/PhytronDriver.cpp
|
||||
SOURCES += sinqEPICSApp/src/EuroMoveDriver.cpp
|
||||
SOURCES += sinqEPICSApp/src/pmacAsynIPPort.c
|
||||
SOURCES += sinqEPICSApp/src/pmacAxis.cpp
|
||||
SOURCES += sinqEPICSApp/src/pmacController.cpp
|
||||
SOURCES += sinqEPICSApp/src/drvAsynMasterMACSPort.c
|
||||
SOURCES += sinqEPICSApp/src/MasterMACSDriver.cpp
|
||||
# MISCS would be the place to keep the stream device template files
|
@ -150,7 +150,7 @@ asynStatus
|
||||
/* read with a short timeout in order to remove duplicate messages
|
||||
* from the line. This also serves to slow down communication
|
||||
*/
|
||||
pasynOctetSyncIO->read(pasynUserController_, mmacsResponse, 35, .05, &in, &reason);
|
||||
pasynOctetSyncIO->read(pasynUserController_, mmacsResponse, 35, interMessageSleep/1000., &in, &reason);
|
||||
|
||||
/* pack data for MasterMACS */
|
||||
len = strlen(command) + 6;
|
||||
|
@ -5,10 +5,16 @@
|
||||
Code lifted from Torsten Boegershausen ESS code.
|
||||
|
||||
Mark Koennecke, March 2017
|
||||
|
||||
Added code to manage an interMessageSleep
|
||||
|
||||
Mark Koennecke, February 2024
|
||||
*/
|
||||
|
||||
#include "SINQController.h"
|
||||
#include "asynMotorController.h"
|
||||
#include "epicsExport.h"
|
||||
#include "iocsh.h"
|
||||
|
||||
SINQController::SINQController(const char *portName, const char *SINQPortName, int numAxes, const int& extraParams)
|
||||
: asynMotorController(portName, numAxes+1, NUM_MOTOR_DRIVER_PARAMS+extraParams,
|
||||
@ -20,6 +26,53 @@ SINQController::SINQController(const char *portName, const char *SINQPortName, i
|
||||
{
|
||||
createParam(motorMessageIsFromDriverString, asynParamInt32, &motorMessageIsFromDriver_);
|
||||
createParam(motorMessageTextString, asynParamOctet, &motorMessageText_);
|
||||
|
||||
interMessageSleep=20;
|
||||
}
|
||||
|
||||
/** Set the interMessageSleep at runtime */
|
||||
asynStatus SINQController::setInterMessageSleep(int messageSleep)
|
||||
{
|
||||
lock();
|
||||
interMessageSleep = messageSleep;
|
||||
unlock();
|
||||
return asynSuccess;
|
||||
}
|
||||
|
||||
extern "C" {
|
||||
|
||||
asynStatus setInterMessageSleep(const char *portName, int messageSleep)
|
||||
{
|
||||
SINQController *pC;
|
||||
static const char *functionName = "setIntermessageSleep";
|
||||
|
||||
pC = (SINQController*) findAsynPortDriver(portName);
|
||||
if (!pC) {
|
||||
printf("%s:%s: Error port %s not found\n", "SINQController", functionName, portName);
|
||||
return asynError;
|
||||
}
|
||||
|
||||
return pC->setInterMessageSleep(messageSleep);
|
||||
}
|
||||
|
||||
|
||||
/* setInterMessageSleep */
|
||||
static const iocshArg setInterMessageSleepArg0 = {"Controller port name", iocshArgString};
|
||||
static const iocshArg setInterMessageSleepArg1 = {"inter message sleep time", iocshArgInt};
|
||||
static const iocshArg * const setInterMessageSleepArgs[] = {&setInterMessageSleepArg0,
|
||||
&setInterMessageSleepArg1};
|
||||
static const iocshFuncDef setInterMessageSleepDef = {"setInterMessageSleep", 2, setInterMessageSleepArgs};
|
||||
|
||||
static void setInterMessageSleepCallFunc(const iocshArgBuf *args)
|
||||
{
|
||||
setInterMessageSleep(args[0].sval, args[1].ival);
|
||||
}
|
||||
|
||||
static void SINQControllerRegister(void)
|
||||
{
|
||||
iocshRegister(&setInterMessageSleepDef, setInterMessageSleepCallFunc);
|
||||
}
|
||||
epicsExportRegistrar(SINQControllerRegister);
|
||||
|
||||
} // extern C
|
||||
|
||||
|
@ -18,11 +18,15 @@ class epicsShareClass SINQController : public asynMotorController
|
||||
{
|
||||
public:
|
||||
SINQController(const char *portName, const char *SINQPortName, int numAxes, const int& extraParams=2);
|
||||
|
||||
asynStatus setInterMessageSleep(int messageSleep);
|
||||
|
||||
friend class SINQAxis;
|
||||
protected:
|
||||
int motorMessageIsFromDriver_;
|
||||
int motorMessageText_;
|
||||
|
||||
int interMessageSleep; // minimum time between message to the controller in microseconds
|
||||
// for slowing down communication to weak controllers.....
|
||||
};
|
||||
|
||||
|
||||
|
@ -300,7 +300,7 @@ setIntegerParam(this->motorStatusCommsError_, 0);
|
||||
}
|
||||
}
|
||||
|
||||
usleep(20); // slow down communication somewhat
|
||||
usleep(interMessageSleep); // slow down communication somewhat
|
||||
|
||||
asynPrint(lowLevelPortUser_, ASYN_TRACEIO_DRIVER, "%s: response: %s\n", functionName, response);
|
||||
debugFlow("Received: ");
|
||||
|
@ -9,6 +9,7 @@ registrar(pmacControllerRegister)
|
||||
registrar(pmacAsynIPPortRegister)
|
||||
registrar(drvAsynMMACSPortRegisterCommands)
|
||||
registrar(MasterMACSRegister)
|
||||
registrar(SINQControllerRegister)
|
||||
|
||||
#--------------------------------------------------------
|
||||
# With the PSI module build system, including these items actually
|
||||
|
Reference in New Issue
Block a user