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  2020  2021  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  2020  2021  2022  2023  2024  <2025
<== Date ==> <== Thread ==>

Subject: pvaPy syntax
From: Pierrick M Hanlet via Tech-talk <tech-talk at aps.anl.gov>
To: "tech-talk at aps.anl.gov" <tech-talk at aps.anl.gov>
Date: Tue, 6 May 2025 03:12:19 +0000
I have an IOC which serves the PVs to which I want to read and write.  I run pvaPy in
a python program which is a digital twin (DT).  For scalars, I'm successful in reading
from and writing to the PVs from my IOC.  I'm having trouble, presumably syntax, with
lists and dictionaries.

For my lists, I'm doing:

In accelParams.py, I have a function beam_params() in which:
histx_list = []
histx_list = pvaccess.Channel('WFE:MEBT_PHYS_ALSC:histX')
...
return((...,histx_list,...))

In my DT:
from accelParams import beam_params
...,histx_list,...=beam_params()
...
fill list name histx
...
histx_list.putScalarArray('histx_list','histx','INT')    <<<===== this is line 988

I don't understand the documentation; I thought that I could use the simplest form of this:
histx_list.putScalarArray('histx')

I don't understand the error messages either; they always appear to ask for one more argument
than I provide:
===================================================================================================
Error in main: Python argument types in
     Channel.putScalarArray(Channel, str, str, str)
did not match C++ signature:
     putScalarArray(Channel {lvalue}, boost::python::list valueList)
     putScalarArray(Channel {lvalue}, boost::python::list valueList, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > requestDescriptor)
Traceback (most recent call last):
   File "/home/epics/Simulations/DigitalTwin/MEBT_DT/MEBT_DT_04MAY_2025_v1.py", line 1035, in <module>
     main()
   File "/home/epics/Simulations/DigitalTwin/MEBT_DT/MEBT_DT_04MAY_2025_v1.py", line 988, in main
     histx_list.putScalarArray('histx_list','histx','INT')
Boost.Python.ArgumentError: Python argument types in
     Channel.putScalarArray(Channel, str, str, str)
did not match C++ signature:
     putScalarArray(Channel {lvalue}, boost::python::list valueList)
     putScalarArray(Channel {lvalue}, boost::python::list valueList, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > requestDescriptor)
===================================================================================================

The second question is with regards to connecting a dictionary with a scalar array.  In beam_params(),
I have:
twissx_dict = {}
twissx_dict = pvaccess.Channel('WFE:MEBT_PHYS_ALSC:TwissX').getIntrospectionDict()
Is this what I should be using, or is a simple Channel() sufficient?

Many thanks,
Pierrick



-- 
Pierrick Hanlet
Fermi National Accelerator
Accelerator Front End Controls
+1-630-840-5555 -- lab
+1-312-687-4980 -- mobile

"Whether you think you can or think you can't, you're right" -- Henry Ford


Replies:
Re: pvaPy syntax Veseli, Sinisa via Tech-talk

Navigate by Date:
Prev: RE: EPICS build problem Freddie Akeroyd - STFC UKRI via Tech-talk
Next: IOC warning when connecting to 64 devices Abdalla Ahmad 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  2020  2021  2022  2023  2024  <2025
Navigate by Thread:
Prev: oac-tree is public on github Van Herck Walter via Tech-talk
Next: Re: pvaPy syntax Veseli, Sinisa 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  2020  2021  2022  2023  2024  <2025
ANJ, 06 May 2025 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions ·
· Download · Search · IRMIS · Talk · Documents · Links · Licensing ·