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

Subject: RE: Testing UIs against real databases using simulation mode
From: <[email protected]>
To: <[email protected]>, <[email protected]>
Date: Mon, 29 Nov 2010 09:20:08 +0000
Hi,

We've tried a few things like this at diamond. We started by creating
entire simulation databases, which worked well for testing guis, but
were very difficult to maintain, and didn't provide a very true
simulation, so now we try to simulate at the lowest possible level.

For serial devices, we write a python simulator which provides a socket
that we can connect an AsynIPPort to. This allows the database and
streamDevice protocol files to be tested before the device arrives. It
is a little more work than just stripping out the DTYP fields, but it's
relatively painless.
For example, a small example that just echoes anything it is sent back:

from dls_serial_sim import serial_device, CreateSimulation

class eurotherm2k(serial_device):
    def reply(self,command):
        return command
        
if __name__=="__main__":
    CreateSimulation(eurotherm2k)
    raw_input()

Let me know if you're interested and I'll put it up on our website.

The other thing I wrote a while back was a python class that created an
asyn port to simulate other asyn drivers. This proved quite useful for
creating a simulation for doing on-the-fly data processing using a
struck scalar card, however I need to go back and rewrite it using asyn
port driver to make it neater.

Thanks,
Tom Cobb,
Diamond Light Source Ltd.
Diamond House
Harwell Science and Innovation Campus
Didcot
Oxfordshire
OX11 0DE
Tel +44 (0) 1235 778582
 

> -----Original Message-----
> From: [email protected] 
> [mailto:[email protected]] On Behalf Of Angus Gratton
> Sent: 29 November 2010 05:57
> To: tech-talk
> Subject: Testing UIs against real databases using simulation mode
> 
> Does anyone have any tips on simulating hardware for easy/quick UI
> development?
> 
> My intention is to be able to test that a given UI and a database talk
> properly, before facing the problem of having the database talk to the
> hardware. I'm using wxPython w/ pyepics for the UIs.
> 
> I've read about the 'simulation mode' record fields in the Record
> Reference & App Developer's Guide, but I don't just want to switch a
> single record over to simulation mode. I want to control a soft IOC
> without any of my real target hardware, but with equivalent PV names.
> 
> Have I missed an available resource somewhere?
> 
> At the moment I'm thinking the easiest way may be to just run sed over
> my database file to change all the DTYPs to asyn soft records (all our
> hardware records are asyn), and then fix up the INP/OUT port 
> names. Then
> I can just poke in the values I need for UI testing at runtime, using
> iocsh or caget/caput.
> 
> Thanks in advance for any tips.
> 
> Cheers,
> 
> Angus
> 
> 
> 
> 

-- 
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
 





References:
Testing UIs against real databases using simulation mode Angus Gratton

Navigate by Date:
Prev: Testing UIs against real databases using simulation mode Angus Gratton
Next: Strange IOC crash Benjamin Franksen
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  <20102011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
Navigate by Thread:
Prev: Testing UIs against real databases using simulation mode Angus Gratton
Next: Re: Testing UIs against real databases using simulation mode J. Lewis Muir
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  <20102011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
ANJ, 29 Nov 2010 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·