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  2018  2019  <20202021  2022  2023  2024  2025  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  2018  2019  <20202021  2022  2023  2024  2025 
<== Date ==> <== Thread ==>

Subject: RE: ASLO doesn't work
From: "Mercado, Ronaldo \(DLSLtd, RAL, LSCI\) via Tech-talk" <tech-talk at aps.anl.gov>
To: 'Ben Franksen' <benjamin.franksen at helmholtz-berlin.de>, "'tech-talk at aps.anl.gov'" <tech-talk at aps.anl.gov>
Date: Thu, 17 Sep 2020 16:23:12 +0000
I can confirm that Ben has correctly diagnosed that device support returns "2" (no convert) for float data types.

The code below comes from S7nodaveAiRecord.h of s7nodave (https://oss.aquenos.com/epics/s7nodave/ )
The comments have mode details.

    virtual long processRecord()
    {
        long status = S7nodaveInputRecord::processRecord();
        if (status == RECORD_STATUS_OK) {
            // If the PLC is using the float data-type, we do not want the                                                                                                               
            // VAL field of this record to be overwritten with a value                                                                                                                   
            // calculated using the RVAL field. Instead we use the VAL field                                                                                                             
            // directly. We signal this to the record's readValue routine by                                                                                                             
            // returning the special value RECORD_STATUS_OK_NO_CONVERT instead                                                                                                           
            // of RECORD_STATUS_OK.                                                                                                                                                      
            if (this->recordAddress->getPlcDataType() == plcDataTypeFloat) {
                return RECORD_STATUS_OK_NO_CONVERT;
            } else {
                return RECORD_STATUS_OK;
            }
        } else {
            return status;
        }
    };

Cheers,
Ronaldo

-----Original Message-----
From: Tech-talk <tech-talk-bounces at aps.anl.gov> On Behalf Of Ben Franksen via Tech-talk
Sent: 17 September 2020 16:02
To: tech-talk at aps.anl.gov
Subject: Re: ASLO doesn't work

Am 17.09.20 um 11:10 schrieb Vishnu Patel via Tech-talk:
> I have tried to divide the value of ai record using ASLO field. But It doesn't work.
> 
> record(ai, "AI0") {
>     field(DTYP,"s7nodave")
>     field(INP,"@lcpcPLC DB6.DBD36 float")
>     field(LINR,"LINEAR")
>     field(HOPR,"20")
>     field(LOPR,"0")
>     field(ASLO,"0.001")
>     field(PREC,"4")
>     field(SCAN,"1 second")
>     field(EGU,"Bar")
>     field(EGUF,"32767")
>     field(EGUL,"-32768")
> }

None of the replies so far have offered an explanation of exactly /why/ this doesn't work. Judging from the aiRecord.c code and the format of the INP link, I venture that the device support indicates to the record support that it already did the conversion and wrote the VAL field by returning 2 instead of 0 from its read() method. To teh record support this indicates that it should completely ignore all conversion related fields (RVAL, LINR, EGUF, EGUL, ASLO, AOFF, ESLO, EOFF, ROFF).

Cheers
Ben


-- 
This e-mail and any attachments may contain confidential, copyright and or privileged material, and are for the use of the intended addressee only. If you are not the intended addressee or an authorised recipient of the addressee please notify us of receipt by returning the e-mail and do not use, copy, retain, distribute or disclose the information in or attached to the e-mail.
Any opinions expressed within this e-mail are those of the individual and not necessarily of Diamond Light Source Ltd. 
Diamond Light Source Ltd. cannot guarantee that this e-mail or any attachments are free from viruses and we cannot accept liability for any damage which you may sustain as a result of software viruses which may be transmitted in or with the message.
Diamond Light Source Limited (company no. 4375679). Registered in England and Wales with its registered office at Diamond House, Harwell Science and Innovation Campus, Didcot, Oxfordshire, OX11 0DE, United Kingdom


References:
ASLO doesn't work Vishnu Patel via Tech-talk
Re: ASLO doesn't work Ben Franksen via Tech-talk

Navigate by Date:
Prev: Re: ASLO doesn't work Ben Franksen via Tech-talk
Next: Re: ASLO doesn't work 李刚 via Tech-talk
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  2018  2019  <20202021  2022  2023  2024  2025 
Navigate by Thread:
Prev: Re: ASLO doesn't work Ben Franksen via Tech-talk
Next: Re: ASLO doesn't work 李刚 via Tech-talk
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  2018  2019  <20202021  2022  2023  2024  2025 
ANJ, 17 Sep 2020 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions ·
· Download · Search · IRMIS · Talk · Documents · Links · Licensing ·