Commit df7c9bd0 authored by kpetersn's avatar kpetersn
Browse files

The temperature now reads, but the code needs to be simplified

parent 80528a8a
record (ai, "$(P)$(T):temperature_RBV")
record(ai, "$(P)$(T):temperature_RBV")
{
field(DTYP, "asynInt32")
#!field(INP, "@asyn($(PORT),0)TEMPERATURE_IN_VALUE")
field(INP, "@asyn($(PORT))TEMPERATURE_IN_VALUE")
field(DTYP, "asynFloat64")
field(INP, "@asyn($(PORT),$(ADDR))TEMPERATURE_IN_VALUE")
field(PINI, "YES")
field(LINR, "NO CONVERSION")
field(HOPR, "2000.0")
field(LOPR, "-300.0")
#!field(ASLO, "1.0")
#!field(AOFF, "0.0")
#!field(HOPR, "2000.0")
#!field(LOPR, "-300.0")
field(PREC, "3")
field(SCAN, "Passive")
}
......@@ -46,33 +46,34 @@ Linkam::Linkam(const char *portName) : asynPortDriver(portName, MAX_CONTROLLERS,
//OpenComms(false, 0, 0);
}
asynStatus Linkam::readInt32(asynUser *pasynUser, epicsInt32 *value)
asynStatus Linkam::readFloat64(asynUser *pasynUser, epicsFloat64 *value)
{
int function = pasynUser->reason;
asynStatus status;
static const char *functionName = "readInt32";
static const char *functionName = "readFloat64";
asynPrint(pasynUser, ASYN_TRACEIO_DRIVER,
"%s:%s, port %s, function = %d\n",
driverName, functionName, this->portName, *value);
driverName, functionName, this->portName, function);
if (function == temperatureInValue_) {
status = readTemperature();
status = readTemperature(value);
} else {
status = asynPortDriver::readInt32(pasynUser,value);
status = asynPortDriver::readFloat64(pasynUser,value);
}
//callParamCallbacks();
callParamCallbacks(0);
callParamCallbacks();
//callParamCallbacks(0);
return (status==0) ? asynSuccess : asynError;
}
asynStatus Linkam::readTemperature()
asynStatus Linkam::readTemperature(epicsFloat64 *value)
{
static const char *functionName = "readTemperature";
temperatureRbv_ = GetValue(0);
*value = temperatureRbv_;
setDoubleParam(temperatureInValue_, temperatureRbv_);
asynPrint(this->pasynUserSelf, ASYN_TRACEIO_DRIVER,
......
......@@ -22,7 +22,7 @@ public:
Linkam(const char *portName);
/* These are the methods that we override from asynPortDriver */
virtual asynStatus readInt32(asynUser *pasynUser, epicsInt32 *value);
virtual asynStatus readFloat64(asynUser *pasynUser, epicsFloat64 *value);
protected:
int temperatureInValue_;
......@@ -30,7 +30,7 @@ protected:
#define LAST_LINKAM_PARAM temperatureInValue_;
private:
asynStatus readTemperature();
asynStatus readTemperature(epicsFloat64 *value);
float temperatureRbv_;
char* wrapperVersion_;
......
......@@ -17,7 +17,7 @@ linkam_registerRecordDeviceDriver pdbbase
#dbLoadRecords("db/xxx.db","user=kpetersnHost")
#
dbLoadRecords("$(LINKAM)/db/Linkam_T96.db", "P=kmp:,T=tc1,PORT=$(PORT)")
dbLoadRecords("$(LINKAM)/db/Linkam_T96.db", "P=kmp:,T=tc1,PORT=$(PORT),ADDR=0")
dbLoadRecords("$(ASYN)/db/asynRecord.db", "P=kmp:,R=asyn,PORT=$(PORT),ADDR=0,OMAX=255,IMAX=255")
## Run Linkam C# code
......
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