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: sending pickled python objects of epics channel access
From: "Kasemir, Kay" <kasemirk@ornl.gov>
To: "tech-talk@aps.anl.gov" <tech-talk@aps.anl.gov>
Date: Mon, 15 May 2017 23:43:24 +0000
Hi:

On 05/15/2017 05:00 PM, Madden, Timothy J. wrote:
> This is probably a bad idea... But if I were to take a python object,
> call pickle.dumps() to convert it into a string, I
> could then caput it to a waveform record. Then some other py client
> could caget, then call pickle.loads() from the
> waveform record. then we get the object back.  So we are sending python
> objects over epics CA.
>
> Has anyone tried this? Seems straightforward. Just how bad an idea is this?

As Steven and Andrew mentioned, this is not necessarily a bad idea and actually used successfully in practice.
At the SNS we use this with python & pcaspy on the server side, then typically CS-Studio displays with jython on the client side.

One caveat is that you want to use a recent version of pcaspy and EPICS base. Before 0.6.2 and EPICS 3.14.12.6, there was no support for varying array sizes.
Since those versions, your 'pickled' data can be sent as just that without extending the arrays to their max. size.

Also, pvAccess would eventually be the better choice, because it can natively send/receive custom data.
With the recently released update of pvaPy this appears almost trivial, but we have not used it in production, yet.

Thanks,
Kay

Replies:
Re: sending pickled python objects of epics channel access Ralph Lange
References:
sending pickled python objects of epics channel access Madden, Timothy J.
Re: sending pickled python objects of epics channel access Andrew Johnson

Navigate by Date:
Prev: Re: sending pickled python objects of epics channel access Hartman, Steven M.
Next: Re: sending pickled python objects of epics channel access 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
Navigate by Thread:
Prev: Re: sending pickled python objects of epics channel access Andrew Johnson
Next: Re: sending pickled python objects of epics channel access 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
ANJ, 15 May 2017 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·