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 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
<== Date ==> <== Thread ==>

Subject: Re: Is there any support for EPICS for IronPython (or anyone working on it)?
From: Matt Newville <newville@cars.uchicago.edu>
To: freddie.akeroyd@stfc.ac.uk
Cc: "Skorpenske, Harley David" <skorpenskehd@ornl.gov>, EPICS Tech Talk <tech-talk@aps.anl.gov>
Date: Sun, 14 May 2017 12:01:44 -0500
Hi Freddie,


On Sat, May 13, 2017 at 1:40 PM, <freddie.akeroyd@stfc.ac.uk> wrote:

Hi,

 

I’ve had a brief look at this – there doesn’t seem to be an  in_dll()  method on Arrays in IronPython, but I was able to work around it using:

 

    c_short_p = ctypes.POINTER(ctypes.c_short)

    value_offset0 = ctypes.c_short.in_dll(libca,'dbr_value_offset')

    dbr.value_offset = ctypes.cast(ctypes.addressof(value_offset0), (39*ctypes.c_short))


Great!  Thanks! I suspected it would need something like this cast, but had not tried to work out the details.

 

IronPython also looks to be a little more fussy about having types specified in function calls – so in the PyEpics call to   libca.ca_create_channel    I had to change    pvn    to    ctypes.c_char_p(pvn)     as otherwise only the first character of the PV name seemed to get passed into ca.dll   I suspect there may be a few other places where similar changes might be needed too as it’s not quite working yet. I’ve some time later next week when I could take a more detailed look with a debugger if that’s not too late for you.



Yes, I would not be surprised if there were several other places where type coercion might be more forgiving with CPython than IronPython.
Ideally, we could get to code that worked for CPython and IronPython, but if there needs to be some special cases for IronPython, that's fine.


I've not ever used IronPython, but I'll try to look into this too.   But if you or anyone else is interested in getting this working, that would be great -- Pull Requests for this would be most welcome!

--Matt Newville

References:
Re: Is there any support for EPICS for IronPython (or anyone working on it)? Hartman, Steven M.
Re: Is there any support for EPICS for IronPython (or anyone working on it)? Matt Newville
RE: Is there any support for EPICS for IronPython (or anyone working on it)? freddie.akeroyd

Navigate by Date:
Prev: RE: Is there any support for EPICS for IronPython (or anyone working on it)? freddie.akeroyd
Next: sending pickled python objects of epics channel access Madden, Timothy J.
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
Navigate by Thread:
Prev: RE: Is there any support for EPICS for IronPython (or anyone working on it)? freddie.akeroyd
Next: sending pickled python objects of epics channel access Madden, Timothy J.
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
ANJ, 15 May 2017 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·