Hi,
Rowland, J (James) wrote:
Hi Tim
At Diamond we use Python for beamline simulations, some using serial
ptys or socket servers to interface to the standard asyn drivers and
some recent ones implementing asyn ports in Python itself. We also use
some Python device support for waveform calculations, and we have even
written a Python interface to the portable channel access server (not so
useful). It's a good approach for simulations but considering how much
interface code we ended up writing I would recommend the SNL way of
doing things if you can get away with less tight integration with the
database. Your Python script would use the CA client libraries to
monitor PVs on the IOC and write back results. We use that method to
good effect with Matlab. You can easily add a new command to the IOC to
start the Python interpreter in-process like SNL does. I can send you
some examples if they would be useful. I think KEK also had some Python
device support.
>
> James
>
I have wrote a device support routine called devPy.
Currently I just tested ai/ao and waveform record support.
INP or OUT field of these device supports is something like:
field(INP, "@foo/bah;$(no)?signal=$(signal)")
When this record is initialized it create instance of class bah in a
module foo with argument specified in INP/OUT field.
At record processing read or write method of this python object will be
called.
I used this device support to support USB device in EPICS. I have Python
interface to this device and was much easier for me to write this
devPython device support.(and it was fun.)
It works for me and I wanted to extend it futher but cannot find much
time to it.
If you are interested in this software, I'm very happy to send source
code to you or put it on the web.
Thanks,
Noboru Yamamoto
J-PARC control group/J-PARC center(KEK & JAEA)
EPICS group/KEK
JAPAN
________________________________
From: [email protected] on behalf of Timothy Madden
Sent: Mon 04/08/2008 15:56
To: [email protected]
Subject: EPICS to Python / EPICS to Tcl
Folks
I want to make an IOC that does the following:
Serve PV's that call Asyn, They could BI, BO or any standard record.
Make an Asyn driver that is linked with a Python or Tcl interpreter.
The IOC written in C, would then call scripts which could be stored as
text files on the disk.
A record named "X" would call a script function named "X" and pass its
PV value to it. Likewise, the output of the script could be passed back
to the PV value. Python and Tcl interpreters provide ways for C to call
scripts, pass and retrieve data from scripts. Also, it is not too hard
to link an interpreter into a C program. All that is needed is to write
the ASYN-based C functions that call the interpreter. It could be done
in Linux or Cygwin.
In this way, one could make an IOC to do whatever one wanted without
ever messing a C compiler. The user would write a few scripts, make a
st.cmd file, and a db file. In this way, new IOCs could be very quickly
developed.
Has anyone already done this?
Tim Madden
<DIV><FONT size="1" color="gray">This e-mail and any attachments may contain confidential, copyright and or privileged material, and are for the use of the intended addressee only. If you are not the intended addressee or an authorised recipient of the addressee please notify us of receipt by returning the e-mail and do not use, copy, retain, distribute or disclose the information in or attached to the e-mail.
Any opinions expressed within this e-mail are those of the individual and not necessarily of Diamond Light Source Ltd.
Diamond Light Source Ltd. cannot guarantee that this e-mail or any attachments are free from viruses and we cannot accept liability for any damage which you may sustain as a result of software viruses which may be transmitted in or with the message.
Diamond Light Source Limited (company no. 4375679). Registered in England and Wales with its registered office at Diamond House, Harwell Science and Innovation Campus, Didcot, Oxfordshire, OX11 0DE, United Kingdom
</FONT></DIV>
- References:
- EPICS to Python / EPICS to Tcl Timothy Madden
- RE: EPICS to Python / EPICS to Tcl Rowland, J (James)
- Navigate by Date:
- Prev:
Re: Gated ADC Kazuro FURUKAWA
- Next:
EPICS support for PI C-862 Mercury motor controller Isenegger Andreas
- 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
- Navigate by Thread:
- Prev:
RE: EPICS to Python / EPICS to Tcl Rowland, J (James)
- Next:
Gated ADC Leicester, PJ (Pete)
- 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
|