EPICS Home

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  <20212022  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  <20212022  2023  2024  2025 
<== Date ==> <== Thread ==>

Subject: Creating calc record in Python softioc
From: Paul Nord via Tech-talk <tech-talk at aps.anl.gov>
To: EPICS tech-talk <tech-talk at aps.anl.gov>
Date: Fri, 5 Feb 2021 12:23:22 -0600
According to the documentation, this should work:
#!/usr/local/epics/modules/pythonIoc/pythonIoc
from softioc import softioc, builder
builder.SetDeviceName('XX')
rec = builder.aIn('VALUE')
calc = builder.records.calc('CALC', CALC = 'A*B', A = rec, B = 42)
rec.FLNK = builder.PP(calc)

It chokes when assigning rec to input A.
  File "/usr/local/epics/modules/epicsdbbuilder/epicsdbbuilder/recordbase.py", line 190, in __ValidateField
    self._validate.ValidFieldValue(fieldname, str(value))
  File "/usr/local/epics/modules/epicsdbbuilder/epicsdbbuilder/dbd.py", line 111, in ValidFieldValue
    'Can\'t write "%s" to field %s: %s' % (value, name, message)
AssertionError: Can't write "XX:VALUE" to field A: not a number

Does anyone have a working example of using a calc record in python softioc?

Paul


Replies:
Re: Creating calc record in Python softioc Johnson, Andrew N. via Tech-talk

Navigate by Date:
Prev: Re: How To Compile EPICS7 at RTEMS5.1 Heinz Junkes via Tech-talk
Next: Re: Creating calc record in Python softioc Johnson, Andrew N. 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  <20212022  2023  2024  2025 
Navigate by Thread:
Prev: Re: How To Compile EPICS7 at RTEMS5.1 Heinz Junkes via Tech-talk
Next: Re: Creating calc record in Python softioc Johnson, Andrew N. 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  <20212022  2023  2024  2025