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  <20172018  2019  2020  2021  2022  2023  2024  Index 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  <20172018  2019  2020  2021  2022  2023  2024 
<== Date ==> <== Thread ==>

Subject: Asyn: example driver for slow device?
From: "Konrad, Martin" <[email protected]>
To: EPICS Tech Talk <[email protected]>, Mark Rivers <[email protected]>
Date: Fri, 6 Jan 2017 22:30:41 +0000
Hi Mark,
I am intending to implement a driver for an FPGA-based device based on
asynPortDriver. One of the features my IOC should support is
reading/writing FPGA firmware from/to the device using waveform records.
My device supports reading/writing the firmware in small blocks.
Reading/writing a single block doesn't take too long but writing the
whole image can take a few minutes.

Here is what I have in mind:

- Set ASYN_CANBLOCK

1. Client reads firmware image from file, caputs it to the waveform record.
2. Asyn calls writeInt8Array in my driver which copies the data,
notifies the waveform-writer thread and returns. This releases the Asyn
lock and ensures other records can communicate with the device.
3. The waveform-writer thread iterates over the image and writes it
block-by-block in the background. I guess I need to acquire and release
some lock for each write operation to ensure these commands do not get
mixed up with communication initiated by other records. Would the
asynPortDriver::lock/unlock methods be the right way to handle this?
4. Once the waveform-writer thread is done it calls back Asyn to report
completion.

- For writes to simple registers the write function writes the data
immediately and calls Asyn to report completion.

Is this the right approach? Can you point me to drivers that I could use
as an example?

Thanks a lot,

Martin

-- 
Martin Konrad
Control System Engineer
Facility for Rare Isotope Beams
Michigan State University
640 South Shaw Lane
East Lansing, MI 48824-1321, USA
Tel. 517-908-7253
Email: [email protected]


Replies:
RE: Asyn: example driver for slow device? Mark Rivers

Navigate by Date:
Prev: RE: vxWorks 6.9 compiler problem on large file systems Mark Rivers
Next: Asyn and devices with changing register map Konrad, Martin
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  <20172018  2019  2020  2021  2022  2023  2024 
Navigate by Thread:
Prev: RE: vxWorks 6.9 compiler problem on large file systems Mark Rivers
Next: RE: Asyn: example driver for slow device? Mark Rivers
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  <20172018  2019  2020  2021  2022  2023  2024