Hi,
I is writing motor device driver based on Model 3.
But I meet some problem which about rewriting WriteInt32 (asynUser *pasynUser, epicsInt32 value) function.
However, I changed the value of $(motor).CENE field in motor OPI, my WriteInt32() function cann’t be called.
And the value of other fields changed can call this function.
My WriteInt32() function is as follow:
------------------------------------------
asynStatus PDICLController::writeInt32(asynUser* pasynUser, epicsInt32 value)
{
int function = pasynUser->reason;
int status = asynSuccess;
PDICLAxis* pAxis;
static const char* functionName = "writeInt32";
pAxis = this->getAxis(pasynUser);
if (!pAxis) return asynError;
status = pAxis->setIntegerParam(function, value);
epicsPrintf("test :104 line :The function name:%d and the value :%d\n",function,value);
if (function == PDICLJoggingPosMethod_)
{
if(value!=0)
{
status = pAxis->Jogging_move_pos();
}
}
if (function == PDICLJoggingNegMethod_)
{
if(value!=0)
{
status = pAxis->Jogging_move_neg();
}
}
else {
// Call base class method
status = asynMotorController::writeInt32(pasynUser, value);
}
pAxis->callParamCallbacks();
return (asynStatus)status;
}
-------------------------
When I change the state of $(motor).CENE field , just the motorUpdateStatus_ function that is called which mark is 26
and the motorClosedLoop_ function cann’t be called which mark is 19.
Mennwhile I test the motorStop_ function which mark is 4.
The test result of the shell of ioc is as follow
-------------------------
epics> test :104 line :The function name:26 and the value :0
test :104 line :The function name:4 and the value :0
test :104 line :The function name:26 and the value :0
test :104 line :The function name:26 and the value :0
-------------------------
I see other motor module’s device driver have done as same.
What’s going wrong about my code?
Any suggestions or comments would be appreciated.
Best regards!
Zongyang yue