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  <20122013  2014  2015  2016  2017  2018  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  <20122013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
<== Date ==> <== Thread ==>

Subject: Re: ISEG EHS device support on the Raspberry Pi Computer
From: "Florian Feldbauer" <[email protected]>
To: [email protected]
Cc: [email protected]
Date: 11 Sep 2012 16:38:30 +0200

On 09/11/2012 04:02 PM, [email protected] wrote:
I would have thought the "%8R" stream device converter would do the job.
As far as I understood, %R would result in a 32 bit bitstream, right?
So this could be used, if the driver understands bitstreams.

The conversion I mentioned was needed by our "old" interfaces. The drivers wanted something
like this: "m s 201 4 a2 3f 52 31\r"
Where "m s" signales the driver a standard data frame, 201 is the can id as 3 digit hex, 4 the data length code and "a2...31" the 4 data bytes as 2 digit hex each. Every field is separated with blanks.
In this case %R could not be used and we needed the conversion.

So one needs an asyn driver, which gets a bitstream from streamDevice and then filling this bitstream in a can_frame structure which is send to our kernel module.

Mark, would this be possible by just writing a class dirived from asynPortDriver?
I haven't looked in the code/headers yet.

Best regards,
Florian

-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Florian Feldbauer
Sent: 11 September 2012 14:46
To: Mark Rivers; EPICS tech talk
Subject: Re: ISEG EHS device support on the Raspberry Pi Computer

Hi,

thanks for your replies. Writing an asyn driver seems a pretty good idea.

But for the EHS modules from ISEG, I don't think StreamDevice would be
feasible.
Maybe I'm biased due to our old CAN interfaces.
Up to now we used asynDriver and StreamDevice to control these modules.
But our CAN interfaces were in principal
RS232- or USB-to-CAN converters which read/write ASCII-Strings. Every
single byte from the can frame was coded as 2 digit hex value
separated by blanks (somethink like "ab 24 1f 05").
The EHS modules use 32bit float values for currents, voltages and
temperatures. So we needed to convert a IEEE754 32bit float
to something which stream could write like "%02x %02x %02x %02x", or the
other way around.

Therefore I think a device support for this modules would be more feasible.
Sure, if we write our own asyn driver one could think about an interface
which reads/writes bitstreams, so we don't need such a conversion.

Best regards,
Florian


On 09/10/2012 04:53 PM, Mark Rivers wrote:
Hi Florian,

I would encourage you to consider whether you should write device support at all.  I am copying Bruno on this as well, because I meant to respond to his earlier thread "aiRecord conversion" with a similar comment.

Instead of writing device support you should really consider writing an asyn driver.  If you do that then device support is done for you, and you don't need to worry about all the details of how records interact with device support.  Writing an asyn driver is actually quite easy.  There are many advantages:

- Support for synchronous and asynchronous devices requires a single-bit change in your driver's registration.
- Support for I/O Intr scanned records is easy.
- The device support is already debugged.
- You get the asynTrace capabilities for standard debugging support.
- You free the developer to use whatever records they want, rather than only the records you support in your device support.
- If you use asynPortDriver as your base class most of the details asyn are hidden from you.  You don't need to worry about registering the port, registering the interfaces, how to do callbacks, etc.

In your case you might also be able to use StreamDevice.  I don't know enough about the CAN interface to know if this is feasible or not.

There are lots of examples of asyn drivers, including testAsynPortDriverApp in the asyn package, the Modbus driver, and many other drivers in the synApps package.

Mark


-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Florian Feldbauer
Sent: Monday, September 10, 2012 6:24 AM
To: EPICS tech talk
Subject: ISEG EHS device support on the Raspberry Pi Computer

Dear all,

at Bochum university, we have developed a CAN bus interfacefor the
Raspberry Pi computer [1]
using the SJA1000 stand-alone CAN controller.

We are using this interface to control the high voltage power supply modules
EHS 8 620p-F and EHS 8 210p-F from ISEG [2] via the crate controller ECH238.

I have programmed a device support for these high voltage modules based
on our Raspberry Pi Can interface.
You can find the sources for the device support as well as the schematic
of our CAN interface on github:
https://github.com/ffeldbauer/epics_RPi_can

I will upgrade this repository with a device support for our Wiener VME
crate, and some custom hardware.
The VME crate has an CAN interface which can be used to read out
voltages, currents, temperature and status of the crate.

Up to now the driver support in EPICS is only synchronous. Is there any
documentation on how to program an
asynchronous driver support? For some other devices we would need an
asynchronous support.

Best regards,
Florian

[1] http://www.raspberrypi.org/
[2] http://www.iseg-hv.com/en/products/product-details/product/21/





References:
ISEG EHS device support on the Raspberry Pi Computer Florian Feldbauer
RE: ISEG EHS device support on the Raspberry Pi Computer Mark Rivers
Re: ISEG EHS device support on the Raspberry Pi Computer Florian Feldbauer
RE: ISEG EHS device support on the Raspberry Pi Computer peter.owens

Navigate by Date:
Prev: Re: GigE Vision & GeniCam standard SDK (areaDetector) J. Lewis Muir
Next: Re: camonitor bug for string as array of chars Ralph Lange
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  <20122013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
Navigate by Thread:
Prev: RE: ISEG EHS device support on the Raspberry Pi Computer peter.owens
Next: Re: ISEG EHS device support on the Raspberry Pi Computer Eric Norum
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  <20122013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
ANJ, 18 Nov 2013 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·