EPICS Controls Argonne National Laboratory

Experimental Physics and
Industrial Control System

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

Subject: ASLO / AOFF scaling for ai and ao record
From: Stefan Heim <[email protected]>
To: EPICS tech talk <[email protected]>
Date: Fri, 13 Jul 2007 18:31:20 +0200
Hello all,

I have a device that came with a controller from the vendor. This controller 
offers a TCP/IP server you can connect to and send a certain set of commands 
to operate the device.

Using EPICS, asyn and streamdevice, it has been close to trivial to set up a 
basic softIOC to operate the device (essentially a getPosition/setPosition 
operation).

In the streamdevice protocol file I have (among others)

getX {
        out "Joe Crds ?";
        in "Joe Crds %f %*f %*f %*f %*f %*f %*f ";
}

setX {
        out "Joe AxisAbs 1 %(VAL)f";
        in "Joe started";
}

In the database I have (among others)

record (ai, "MyIOC:X")
{
        field (SCAN, ".1 second")
        field (DTYP, "stream")
        field (INP,  "@device.proto getX MYPORT")
	# EGU, HOPR, LOPR, PREC, warning limits, ... left out for brevity
}

record (ao, "MyIOC:setX")
{
        field (SCAN, "Passive")
        field (DTYP, "stream")
        field (INP,  "@device.proto setX MYPORT")
	# EGU, DRVL, DRVH, PREC, warning limits, ... left out for brevity
}

This works like a charm, I can do "caget MyIOC:X" to get the current position 
and "caput MyIOC:setX <targetpos>" to drive to a target position.

Now I want these records to operate in different, linearly transformed 
coordinates rather than in the device's very own coordinates, let's say for 
example

myCoords = -20.5 * devCoords + 5.3 .

Therefore, I added

        field (ASLO, "-20.5")
        field (AOFF, "5.3")

to the ai and ao records described above; for the ai record, this had the 
desired effect, i.e. the record now delivers the position in transformed 
coordinates.

However, the ao record _ignores_ ASLO and AOFF with a streamdevice device 
support. Is this the intended behaviour? Or a bug in streamdevice's device 
support for the ao record?

How are you supposed to solve the problem of linear coordinate transformations 
without adding a bunch of helper records (calc & calcout, or even motor) to 
the database? 

The LINR="Slope" ESLO/EOFF scaling of the ao record would be sufficient, if 
only RVAL was a double rather than a long; atm if you use it, it 
truncates "devices coordinates" to whole numbers after doing the correct 
transformation.

Any suggestions?

-Stefan

-- 
Stefan Heim, PhD Student X-ray microscopy
BESSY mbH, Albert-Einstein-StraÃe 15, D-12489 Berlin, Germany
voice: +49 30 6392 3177 fax: + 49 30 6392 4757 e-mail: [email protected]
BESSY mbH - Mitglied der Leibniz Gemeinschaft
Vorsitzender des Aufsichtsrates: Prof. Dr. Dr. h.c. mult. Joachim Treusch
GeschÃftsfÃhrer: Prof. Dr. Dr. h.c. Wolfgang Eberhardt, Prof. Dr. Eberhard 
Jaeschke 
Sitz Berlin, AG Charlottenburg, HRB 14635


Replies:
Re: ASLO / AOFF scaling for ai and ao record Stefan Heim
Re: ASLO / AOFF scaling for ai and ao record Tim Mooney

Navigate by Date:
Prev: Re: Scan question John Faucett
Next: Re: ASLO / AOFF scaling for ai and ao record Stefan Heim
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  <20072008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
Navigate by Thread:
Prev: Re: Scan question Emmanuel Mayssat
Next: Re: ASLO / AOFF scaling for ai and ao record Stefan Heim
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  <20072008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
ANJ, 10 Nov 2011 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·