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: "Hartman, Steven M." <hartmansm@ornl.gov>
To: "Madden, Timothy J." <tmadden@aps.anl.gov>
Cc: "tech-talk@aps.anl.gov" <tech-talk@aps.anl.gov>
Date: Mon, 15 May 2017 23:32:21 +0000
> On May 15, 2017, at 6:00 PM, Madden, Timothy J. <tmadden@aps.anl.gov> 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?


Hi Tim—

We are doing this. We use pcaspy [1] on our beam lines as a python “IOC” for some applications. In some cases, we need to transfer a table generated by the Python code. We pickle the table into a CA byte waveform, transfer with channel access, un-pickle in a Python script associated with a CS-Studio GUI and display the table in a CS-Studio table widget for the user. This works reasonably well. The arrays can be large, but our update rate is typically low for these cases. 

We *should* be using pvAccess instead of Channel Access for this, though, The limitation has been the ease of creating these python services with pcaspy. However, we see that now pvaPy [2] can also be used as a server. Since CS-Studio is already a pvAccess client, this will be much easier, and pvAccess is better suited to this structured data than Channel Access. We are just starting to look at this approach.


[1] https://github.com/paulscherrerinstitute/pcaspy
[2] https://github.com/epics-base/pvaPy

-- 
Steven Hartman
hartmansm@ornl.gov




References:
sending pickled python objects of epics channel access Madden, Timothy J.

Navigate by Date:
Prev: Re: sending pickled python objects of epics channel access Andrew Johnson
Next: Re: sending pickled python objects of epics channel access Kasemir, Kay
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 Wang Xiaoqiang
Next: Callback queue overflow Eric Norum
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, 16 May 2017 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·