EPICS Controls Argonne National Laboratory

Experimental Physics and
Industrial Control System

1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  <20182019  2020  2021  2022  2023  2024  Index 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  <20182019  2020  2021  2022  2023  2024 
<== Date ==> <== Thread ==>

Subject: Re: How to work with motor record position counts larger than 2147483648?
From: Torsten Bögershausen <[email protected]>
To: Mark Rivers <[email protected]>, "'Sobhani, Bayan'" <[email protected]>, "[email protected]" <[email protected]>
Date: Tue, 23 Jan 2018 13:58:06 +0100
Hej Alex,
I need to correct myself.

A prototype which should have the RBV/DRBV field working is here:

<https://github.com/EuropeanSpallationSource/motor/commit/ed71166ba2c5a83b23e8528ab7196feefad25a5f>

Note that RRBV is wrapping around.

If you have a chance to test it, please let us know the results.

/Torsten



On 23/01/18 06:31, Torsten Bögershausen wrote:
Thanks for the report.

There is even an older discussion here:
https://github.com/epics-modules/motor/issues/8


And the situation can be improved:
<https://github.com/EPICS-motor-wg/axis/commit/7a125b9c90298a111d20555e6e3794ae9e16fb21>

I am working on a "backport" to the motor module,
this will take some days.
/Torsten


On 23/01/18 00:02, Mark Rivers wrote:
Hi Alex,

The problem is that the RRBV field in the motor record is a 32-bit integer:

This is from motorRecord.dbd:

         field(RRBV,DBF_LONG) {

                 prompt("Raw Readback Value")

                 special(SPC_NOMOD)

         }

The motor driver reads back the theoretical and encoder positions as doubles, but then they is converted to 32-bit integers in devMotorAsyn.c to be compatible with the fields in the record.

     if ( pPvt->needUpdate )

     {

         epicsInt32 rawvalue;

         rawvalue = (epicsInt32)floor(pPvt->status.position + 0.5);

         if (pmr->rmp != rawvalue)

         {

             pmr->rmp = rawvalue;

             db_post_events(pmr, &pmr->rmp, DBE_VAL_LOG);

         }

         rawvalue = (epicsInt32)floor(pPvt->status.encoderPosition + 0.5);

         if (pmr->rep != rawvalue)

         {

             pmr->rep = rawvalue;

             db_post_events(pmr, &pmr->rep, DBE_VAL_LOG);

         }

Mark

*From:* [email protected] [mailto:[email protected]] *On Behalf Of *Sobhani, Bayan
*Sent:* Monday, January 22, 2018 4:20 PM
*To:* [email protected]
*Subject:* How to work with motor record position counts larger than 2147483648?

I am working on adapting the SmarAct MCS motor record driver for the MCS2, which seems to record its position in picometers unlike the MCS’s nanometers.

I have the following code in my polling function:

Int64_t val = getp(0); //Gets position of channel 0 positioner

printf(“%f\n”,(double) val); //prints -6000093133.000000

setDoubleParam(c_p_->motorEncoderPosition_,(double)val);

setDoubleParam(c_p_->motorPosition_,(double)val);

…

callParamCallbacks();

return asynSuccess;

But when I look at the motor record, the RRBV is shown as -2147483648. I looked at asynMotorController.cpp and saw the line:

createParam(motorEncoderPositionString,        asynParamFloat64, &motorEncoderPosition_);

Shouldn’t this mean I can write 64-bit floating point values to motorEncoderPosition_ (i.e. larger than 2147483648)? How should I go about working with position counts larger than 2147483648?

Alex


References:
How to work with motor record position counts larger than 2147483648? Sobhani, Bayan
RE: How to work with motor record position counts larger than 2147483648? Mark Rivers
Re: How to work with motor record position counts larger than 2147483648? Torsten Bögershausen

Navigate by Date:
Prev: Re: PV Scan - Set values Anton Derbenev
Next: Re: PV Scan - Set values Ralph Lange
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  <20182019  2020  2021  2022  2023  2024 
Navigate by Thread:
Prev: Re: How to work with motor record position counts larger than 2147483648? Torsten Bögershausen
Next: PV Scan - Set values Pilar Gil Jaldo
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  <20182019  2020  2021  2022  2023  2024 
ANJ, 23 Jan 2018 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·