13
Property Property interfacing to interfacing to Hardware: Hardware: DevIO DevIO ACS Development Team

Property interfacing to Hardware: DevIO ACS Development Team

Embed Size (px)

Citation preview

Page 1: Property interfacing to Hardware: DevIO ACS Development Team

Property interfacing Property interfacing

to Hardware: to Hardware:

DevIODevIO

ACS Development Team

Page 2: Property interfacing to Hardware: DevIO ACS Development Team

ACS Training for VLT Developers, February 2004

DevIO 2

ALMA Project

Contents

• problem

• DevIO concept

• implementations

• implementing new DevIO

Page 3: Property interfacing to Hardware: DevIO ACS Development Team

ACS Training for VLT Developers, February 2004

DevIO 3

ALMA Project

Problem Statement

• Connecting properties with (physical) devices (sensors, motors, controllable units) in a generic way

• This implies:– Communication with hardware device (points)– Data conversion (i.e. from raw data (binary,

hex, …) into engineer units (ampers, …))

Page 4: Property interfacing to Hardware: DevIO ACS Development Team

ACS Training for VLT Developers, February 2004

DevIO 4

ALMA Project

ACS Architecture

ContainerContainerContainer

Manager

Hardware accessConfiguration

Database

CORBA communication

ACS framework

BACI

DevIO

Monitor/control call path

Compo-nent

Compo-nent

Compo-nent

Compo-nent

Compo-nent

Compo-nent

...

(G)UI application(G)UI application(G)UI application

Page 5: Property interfacing to Hardware: DevIO ACS Development Team

ACS Training for VLT Developers, February 2004

DevIO 5

ALMA Project

Property Servant Implementation Class Diagram

See p. 24, ACS Architecture

Page 6: Property interfacing to Hardware: DevIO ACS Development Team

ACS Training for VLT Developers, February 2004

DevIO 6

ALMA Project

Bridge pattern and DevIO

• bridge design pattern is used:

m_devIO

RO<T><baci>

...

RW<T><baci>

...set_sync()set_async()

...

Property<T><baci>

...getDevIO()get_sync()get_async()

...

DevIO<T><baci>

intializeValue()read()write()

DevIOMem<T>

intializeValue()read()write()

DevIOCAN<T>

intializeValue()read()write()

. . .

Page 7: Property interfacing to Hardware: DevIO ACS Development Team

ACS Training for VLT Developers, February 2004

DevIO 7

ALMA Project

Implementation (C++)

• DevIO: C++ abstract template class• DevIOMem: Default implementation provided by

ACS• HW specific access provided by specific DevIOXXX implementation

• one method for read and one for write data• example:

– ROdouble/RWdouble uses read/write methods from DevIOXXX<double>

Page 8: Property interfacing to Hardware: DevIO ACS Development Team

ACS Training for VLT Developers, February 2004

DevIO 8

ALMA Project

DevIO Implementations

• Current implementations:– Memory: DevIOMem– TICS: CAN bus: devIOCAN– APEX: Socket: DevIOSock, DevIOUDPSock

– HPT: Shack-Hartmann sensor unit, Heidenhains encoder board, …

• DevIOMem default implementation used by properties

Page 9: Property interfacing to Hardware: DevIO ACS Development Team

ACS Training for VLT Developers, February 2004

DevIO 9

ALMA Project

DevIO interface class

Template <class T> class DevIO {public:

virtual ~DevIO(){}; virtual bool initializeValue()=0;

virtual T read(int& errcode, unsigned long long& timestamp);

virtual void write(const T& value, int&

errcode, unsigned long long& timestamp);

};//class DevIO

Page 10: Property interfacing to Hardware: DevIO ACS Development Team

ACS Training for VLT Developers, February 2004

DevIO 10

ALMA Project

Usage

• creating a property that uses the default DevIO (DevIOMem):p = new ROdouble(…, …);

• createing a property that uses another DevIO (DevIOXXX) implementation:m = new devIOXXX<double>(…);p = new ROdouble(…, …, m);

• accessing a DevIODevIO *dev = p->getDevIO();

Page 11: Property interfacing to Hardware: DevIO ACS Development Team

ACS Training for VLT Developers, February 2004

DevIO 11

ALMA Project

Drawbacks

• It may need different implementation for different conversions

• Split: – Conversion– communication (read & write)

Page 12: Property interfacing to Hardware: DevIO ACS Development Team

ACS Training for VLT Developers, February 2004

DevIO 12

ALMA Project

New DevIO implementation

• Inherit DevIO template class

• Implement:– read– write (if needed)

Page 13: Property interfacing to Hardware: DevIO ACS Development Team

ACS Training for VLT Developers, February 2004

DevIO 14

ALMA Project

References

• ALMA Common Software Architecture, ALMA-SW-0016

• ALMA Common Software Release Notes

• ACS web site