Commit ad3b00ee authored by kpetersn's avatar kpetersn
Browse files

Added LN pump mode and speed control.

parent cf3fd753
......@@ -80,6 +80,30 @@ record(bo, "$(P)$(T):heating")
field(VAL, "0")
}
record(bo, "$(P)$(T):lnpMode")
{
field(DTYP, "asynInt32")
field(OUT, "@asyn($(PORT),$(ADDR))LNP_MODE_OUT_VALUE")
field(PINI, "YES")
field(ZNAM, "Manual")
field(ONAM, "Auto")
field(VAL, "1")
}
record(longout, "$(P)$(T):lnpSpeed")
{
field(DTYP, "asynInt32")
field(OUT, "@asyn($(PORT),$(ADDR))LNP_SPEED_OUT_VALUE")
field(PINI, "YES")
field(OMSL, "closed_loop")
field(DRVH, "100")
field(DRVL, "0")
field(VAL, "0")
field(HOPR, "100")
field(LOPR, "0")
field(EGU, "%")
}
record(longin, "$(P)$(T):controllerConfig_RBV")
{
field(DTYP, "asynInt32")
......
......@@ -33,6 +33,7 @@ Linkam::Linkam(const char *portName, const epicsUInt32 commType, const epicsUInt
createParam(rampRateInValueString, asynParamFloat64, &rampRateInValue_);
createParam(heaterPowerInValueString, asynParamFloat64, &heaterPowerInValue_);
createParam(heatingOutValueString, asynParamInt32, &heatingOutValue_);
createParam(lnpModeOutValueString, asynParamInt32, &lnpModeOutValue_);
createParam(controllerConfigInValueString, asynParamInt32, &controllerConfigInValue_);
createParam(controllerErrorInValueString, asynParamInt32, &controllerErrorInValue_);
createParam(controllerStatusInValueString, asynParamInt32, &controllerStatusInValue_);
......@@ -53,6 +54,12 @@ Linkam::Linkam(const char *portName, const epicsUInt32 commType, const epicsUInt
// Force the device to connect now
connect(this->pasynUserSelf);
//
readControllerConfig();
//
readStageConfig();
//epicsThreadSleep(5.0);
}
......@@ -344,7 +351,17 @@ asynStatus Linkam::writeInt32(asynUser *pasynUser, epicsInt32 value)
// Enable/disable heating
status = setHeating(value);
}
} else if (function == lnpModeOutValue_) {
// Set Manual/Auto LNP mode
status = setLnpMode(value);
} else if (function == lnpSpeedOutValue_) {
// Set LN pump speed (0-100%)
status = setLnpSpeed(value);
}
callParamCallbacks();
if (status == 0) {
......@@ -376,6 +393,40 @@ asynStatus Linkam::setHeating(epicsInt32 value)
return (status) ? asynSuccess : asynError;
}
asynStatus Linkam::setLnpMode(epicsInt32 value)
{
bool status;
static const char *functionName = "setLnpMode";
this->lock();
// Manual = 0 = false ; Auto = 1 = true
status = SetLnpMode((value==1) ? true : false);
this->unlock();
asynPrint(this->pasynUserSelf, ASYN_TRACEIO_DRIVER,
"%s:%s, port %s, value = %d\n",
driverName, functionName, this->portName, value);
return (status) ? asynSuccess : asynError;
}
asynStatus Linkam::setLnpSpeed(epicsInt32 value)
{
bool status;
static const char *functionName = "setLnpSpeed";
this->lock();
// 0-100%
status = SetLnpMode(value);
this->unlock();
asynPrint(this->pasynUserSelf, ASYN_TRACEIO_DRIVER,
"%s:%s, port %s, value = %d\n",
driverName, functionName, this->portName, value);
return (status) ? asynSuccess : asynError;
}
asynStatus Linkam::readInt32(asynUser *pasynUser, epicsInt32 *value)
{
int function = pasynUser->reason;
......@@ -433,11 +484,17 @@ asynStatus Linkam::readControllerConfig()
this->lock();
this->controllerConfig_ = GetControllerConfig();
this->unlock();
if (controllerConfig_ & ( (epicsUInt64)1 << (int)u64LnpReady ) )
controllerLnpReady_ = 1;
else
controllerLnpReady_ = 0;
this->unlock();
asynPrint(this->pasynUserSelf, ASYN_TRACEIO_DRIVER,
"%s:%s, port %s, controllerConfig_ = %llx\n",
driverName, functionName, this->portName, this->controllerConfig_);
"%s:%s, port %s, controllerConfig_ = %llx; controllerLnpReady_ = %d\n",
driverName, functionName, this->portName, this->controllerConfig_, this->controllerLnpReady_);
return asynSuccess;
}
......@@ -480,9 +537,19 @@ asynStatus Linkam::readStageConfig()
this->stageConfig_ = GetStageConfig();
this->unlock();
if (stageConfig_ & ( (epicsUInt64)1 << (int)u64SupportsLNPMan ) )
stageLnpManual_ = 1;
else
stageLnpManual_ = 0;
if (stageConfig_ & ( (epicsUInt64)1 << (int)u64SupportsLNPAuto ) )
stageLnpAuto_ = 1;
else
stageLnpAuto_ = 0;
asynPrint(this->pasynUserSelf, ASYN_TRACEIO_DRIVER,
"%s:%s, port %s, stageConfig_ = %llx\n",
driverName, functionName, this->portName, this->stageConfig_);
"%s:%s, port %s, stageConfig_ = %llx, stageLnpManual_ = %d, stageLnpAuto_ = %d\n",
driverName, functionName, this->portName, this->stageConfig_, stageLnpManual_, stageLnpAuto_);
return asynSuccess;
}
......@@ -495,9 +562,12 @@ void Linkam::report(FILE *fp, int details)
if (details >= 1)
{
fprintf(fp, " controller config = %llx\n", controllerConfig_);
fprintf(fp, "\tLNP Ready = %d\n", controllerLnpReady_);
fprintf(fp, " controller error = %lx\n", controllerError_);
fprintf(fp, " controller status = %llx\n", controllerStatus_);
fprintf(fp, " stage config = %llx\n", stageConfig_);
fprintf(fp, "\tLNP Manual = %d\n", stageLnpManual_);
fprintf(fp, "\tLNP Auto = %d\n", stageLnpAuto_);
}
fprintf(fp, "\n");
}
......
......@@ -16,6 +16,31 @@ static const char *driverName = "Linkam";
#define u32Heater1LimitRW 2
#define u32Heater1PowerR 3
// eSTAGECONFIG Enumeration
#define u64StandardStage 0
#define u64HighTempStage 1
#define u64PeltierStage 2
#define u64SupportsLNPMan 21
#define u64SupportsLNPAuto 22
#define u64SupportsHeater1Present 26
#define u64Heater1SupportsTemperatureControl 27
#define u64SupportsVacuum 48
#define u64SupportsHumidity 52
// eCONTROLLERCONFIG Enumeration
#define u64SupportsHeater 0
#define u64LnpReady 36
// eSTATUS Enumeration
#define u64ControllerError 0
#define u64Heater1RampSetpoint 1
#define u64Heater1Started 2
#define u64VacuumSetPoint 5
#define u64VacuumControlStarted 6
#define u64HumidityRampSetpoint 9
#define u64HumidityControlStarted 10
#define u64LnpCoolingStarted 11
#define u64LnpCoolingAuto 12
/* These are the drvInfo strings that are used to identify the parameters.
* They are used by asyn clients, including standard asyn device support */
......@@ -26,6 +51,8 @@ static const char *driverName = "Linkam";
#define rampRateInValueString "RAMP_RATE_IN_VALUE" /* asynFloat64 r/o */
#define heaterPowerInValueString "HEATER_POWER_IN_VALUE" /* asynFloat64 r/o */
#define heatingOutValueString "HEATING_OUT_VALUE" /* asynInt32 r/w */
#define lnpModeOutValueString "LNP_MODE_OUT_VALUE" /* asynInt32 r/w */
#define lnpSpeedOutValueString "LNP_SPEED_OUT_VALUE" /* asynInt32 r/w */
#define controllerConfigInValueString "CONTROLLER_CONFIG_IN_VALUE" /* asynInt32 r/o */
#define controllerErrorInValueString "CONTROLLER_ERROR_IN_VALUE" /* asynInt32 r/o */
#define controllerStatusInValueString "CONTROLLER_STATUS_IN_VALUE" /* asynInt32 r/o */
......@@ -55,6 +82,8 @@ protected:
int rampRateInValue_;
int heaterPowerInValue_;
int heatingOutValue_;
int lnpModeOutValue_;
int lnpSpeedOutValue_;
int controllerConfigInValue_;
int controllerErrorInValue_;
int controllerStatusInValue_;
......@@ -70,6 +99,8 @@ private:
asynStatus setRampRate(epicsFloat64 value);
asynStatus readHeaterPower(epicsFloat64 *value);
asynStatus setHeating(epicsInt32 value);
asynStatus setLnpMode(epicsInt32 value);
asynStatus setLnpSpeed(epicsInt32 value);
asynStatus readControllerConfig();
asynStatus readControllerError();
asynStatus readControllerStatus();
......@@ -86,6 +117,9 @@ private:
epicsUInt32 controllerError_;
epicsUInt64 controllerStatus_;
epicsUInt64 stageConfig_;
short controllerLnpReady_;
short stageLnpAuto_;
short stageLnpManual_;
};
#define NUM_PARAMS ((int)(&LAST_LINKAM_PARAM - &FIRST_LINKAM_PARAM + 1))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment