Hi Tim
Sorry, I mentioned SNL because it also uses the CA client library for
database access, you don't actually need to run SNL on your IOC. We have
a Python CA client using ctypes, so the whole interface to the C library
is written in Python. We don't use pre-emptive callbacks so you do need
to call ca_pend_event periodically to service monitors but that's taken
care of by the library.
James
-----Original Message-----
From: Timothy Madden [mailto:[email protected]]
Sent: 05 August 2008 16:01
To: Rowland, J (James)
Cc: [email protected]
Subject: Re: EPICS to Python / EPICS to Tcl
James
Thanks for the email. Sounds like you have gone down this road before,
and just making Python a client may be the easiest way. I will dig into
the Python CA client stuff. Do you have to have a continuously running
Python loop to monitor the PV's. Do you really need an SNL program at
all of you have Python monitor PV's and do all the work? Seems like you
can just have an IOC with some standard PV's that don't do anything but
store values, and have Python do everything interesting.
Tim
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
>
> ________________________________
>
> 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>
>
<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)
- Re: EPICS to Python / EPICS to Tcl Timothy Madden
- Navigate by Date:
- Prev:
RE: Gated ADC Leicester, PJ (Pete)
- Next:
Re: Bergoz LR-BPM Monitoring system for LINAC Kazuro FURUKAWA
- 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 Timothy Madden
- Next:
Re: EPICS to Python / EPICS to Tcl Noboru Yamamoto
- 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
|