Review of Possible Development Environments



Yüklə 233 Kb.
tarix07.11.2018
ölçüsü233 Kb.
#78887
növüReview





Environment Proposal: Review of Possible Development Environments

(REV 1.1 - DATE 18.1.2007)





AT-MTM-IN-2006-XXX
EDMS no: XXXXX

18.01.2007



Pasquale.Arpaia@cern.ch

Domenico.Della Ratta@cern.ch
Prof. Pasquale Arpaia, Domenico Della Ratta University of Sannio.

Distribution: Louis Walkiers, Luca Bottura, Marco Buzio, Laurent Deniau, Giovanni Spiezia, Vitaliano Inglese, Stefano Tiso.

Keywords: Magnetic measurements, software, state of the art, programming languages.


Summary
In this document, available software environments are surveyed with the aim of highlighting their peculiarities for assessing suitability of each functional level of the Flexible Framework for Magnetic Measurements. In particular, a first screening, based on constraints arising from preliminary project requirements, is carried out.


  1. Levels in the structure of the Framework

In a preliminary architecture of the Framework, some levels, depending on the specific user can be identified according to their characteristics (Fig. 1):



    1. GUI,

    2. SCRIPT,

    3. PROGRAM CODE,

    4. HARDWARE/MIDDLEWARE.

It is worth to note that the hardware is imposed, thus, the present analysis is not related to the corresponding level.



Figure 1. Logical architectural levels.
Apart logical levels, also Network and Database are important aspects of the FFMM development.

In the following, according to the main requirements and characteristics of the above elements (i.e., GUI, Networking, Script, Program Code, Data Base, and Hardware/middleware), most significant software environments are reviewed.




  1. GUI

The GUI level is referred to the user (not expert in measurements) who wants to set the parameters for the measurement. Main requirements of this level are the easiness of use and the graphical portability.

Main possible software environments for this level are LabView and LabWindows/CVI (National Instruments [1]), and Java (Sun Microsystems [2]).

LabView and LabWindows/CVI are suitable solutions owing to their suitability for measurement environments and easiness for graphical interface, implementation useful to set all the test parameters. The main difference is that the former is a visual language, whereas the latter is a text language (C-based). This characteristic is important for code maintenance: it is easier to modify the code in the future.

As for the portability, LabView programs need LabView installed on the system: there could be problems related to the versions and systems compatibility.

LabWindows can generate an executable file, thus the only problems could be related to the systems compatibility.

Java is an object-oriented programming language whose application is compiled to bytecode (native machine code) at runtime by means of the Java virtual machine. Thus, it is necessary to have it on the system. In this way, the portability is provided on every machine.


  1. NETWORKING

For networking, main available solutions are CORBA (Common Object Request Broker Architecture [3]) and Web Service [4].



CORBA is a standard defined by the Object Management Group (OMG) enabling software components written in multiple computer languages and running on multiple computers to interoperate. The main advantage of CORBA is that the user does not need to work with object calls and data representation because a universal format for the representation of objects (IOR, Interoperable Object Reference) and data (CDR, Common Data Representation) is defined. The main disadvantage is that CORBA always uses a logical bus (ORB) for each service call; but it is not always possible to use it, especially on the non-client machines. In this case, ORB has to be bypassed and IIOP, a message passing protocol which is much more complex than ORB, has to be used.

Web service is a software system designed to support interoperable machine-to-machine interaction over a network. It is supported by main manufacturers in the field, like Microsoft, IBM, and HP. Web service is not a standard yet, but this could be an advantage since it allows more flexibility (but even a disadvantage since it could reduce the system interoperability). A web service uses the XML language (eXtensible Markup Language), which defines the format for the data passing and the interface used to define the structure of messages which should be passed.

The communication protocol used is SOAP (Simple Object Access Protocol): it is a protocol for exchanging XML-based messages over computer network, normally using HTTP. In this way it is possible to create a mechanism of RPC (Remote Procedure Call) on the network in a way that is transparent to the operating system and the program language.

The main advantages are that web service uses the http protocol and it can use many languages, like Python, Perl, C, Java and so on. Furthermore, it is simple to send and receive the XML documents on the network.

The main disadvantages are that the XML documents are more complicated to be compiled, their debug is not easy and it is heavy.

There are other software environments which could be used, like DCOM (Distributed Component Object Model of Microsoft) and MSMQ (Microsoft Message Queuing), but their disadvantage is the portability lack: a DCOM client only works with a DCOM server.


  1. SCRIPT

The SCRIPT level is accessed by an expert in magnetic measurements. Its main requirements are flexibility and simplicity.

For this level, main proposals are Python (open source programming language created by Guido van Rossum [5]), Java, Perl (open source created by Larry Wall [6]) and Jython [7].

Java could even be used at this level, but in average it may be a bottleneck for speed and memory efficiency. A problem could be the interface with C that is usually slow.

Python is an object-oriented programming language (interpreted) which has a strong support for integration with other languages and tools. It is easy, available and extensible in C, but it is not standardized. Its main disadvantage is the speed efficiency; in fact, if Java is 15x slower than C, Python is 100x slower than C. As for the interface with C, it is easier than in Java and Python. Compared to C, Python is a more flexible language.

Perl is a dynamic programming language which has many features of other languages (included C). It has great text manipulation capabilities, but it is also used for web development, network programming and GUI development. Its main disadvantages are the lack of versions portability and the interface with C that is usually complex and slow.

Jython is a 100 % Java version of the Python scripting language that allows compiling Python scripts to Java byte code that runs on any Java Virtual Machine. Jython does not replace Java, but it is complementary to Java and is especially suited for the following tasks:


  • Embedded scripting: Java programmers can add the Jython libraries to their system to allow end users to write simple or complicated scripts that add functionality to the application;

  • Interactive experimentation: Jython provides an interactive interpreter that can be used to interact with Java packages or with running Java applications. This allows programmers to experiment and debug any Java system using Jython;

  • Rapid application development: Python programs are typically 2-10X shorter than the equivalent Java program. This translates directly to increased programmer productivity. The seamless interaction between Python and Java allows developers to freely mix the two languages both during development and in shipping products.

Jython could have speed and memory efficiency problems since it introduces one more level in the Java architecture language.



  1. DSL (Domain – Specific Programming Language)

Figure 1 shows that DSL is a subset of the SCRIPT level. A domain-specific programming language (domain-specific language, DSL) is a programming language designed to be useful for a specific set of tasks. This is in contrast to general-purpose programming language (general-purpose language, GPL).

Its main aim is to describe the measurement algorithm in a high level way. A good way is to use functional languages1 (Lisp, HASKELL, Erlang [8]), but we are far from using them.

In Appendix there is an example of script made by Luca Bottura for the particular case of rotating coils. In the following, an analysis of script languages which could be used like DSL is done, highlighting their peculiarities.




  1. SDL (Specification and Description Language): it is an object-oriented, formal language defined by The International Telecommunications Union – Telecommunications Standardization Sector (ITU-T). The language is intended for the specification of complex, event-driven, real-time, and interactive applications involving many activities that communicate using discrete signals. The strength of SDL is its ability to describe the structure, behavior, and data of a system (real-time and distributed communicating systems).

  2. ADL (Architecture Description Language): in general an ADL is a language used to describe the architecture of a system, that is the syntax and semantics (how the components of a software system can be combined) of the system. Darwin and ASDL are two examples of ADL.

    1. Darwin is a language used to describe software architecture, which is orthogonal to the software system’s algorithm behavior. The description is constructed by creating instances of components and binding their interfaces together.

    2. ASDL (Architectural Style Description Language) is a formalism for modeling software architecture and architectural styles. An ASDL description of a software architecture is made up of three elements: templates, settings, and units. Templates represent interfaces of computational components that are available for inclusion into a software architecture. Settings represent architectures that have been built by instantiating templates and connecting their interfaces. Units represent system hierarchy: they can encapsulate settings so that their interfaces can be used as templates, or represent interfaces designed in a top-down manner.




  1. XML (eXtensible Markup Language): it is a W3C-recommended general-purpose markup language that supports a wide variety of applications. It is a markup language much like HTML but is not a replacement for HTML. In fact, HTML was designed to display data and to focus on how data looks, while XML was designed to describe data and to focus on what data is. XML does not DO anything, it was created to structure, store and to send information. A good definition is that it is a cross-platform, software and hardware independent tool for transmitting information.

  2. Perl: it is often used for Database queries, like in the HRS (Hardware Recognition System) for the SM18 LHC cryomagnet test benches.

  3. PDL (Program Description Language): it is a nontechnical, English-like form of notation which uses a few programming language structures to convey program logic precisely without sacrificing readability.

  4. C-shell: is more than just a command-interpreter and user interface. The shell is a programming language which can be used to create useful programs known as shell-scripts. Shell-scripts are analogous to batch files in MSDOS machines, but are far more flexible and powerful. Shell-scripts allow for the creation of variables and arrays, as well as providing conditional statements and a means for statement repetition. In fact, a shell program contains high-level programming language features:

    • variables for storing data

    • decision-making control (e.g. if and case statements)

    • looping abilities (e.g. for and while loops)

    • function calls for modularity

And it can also contain:

    • UNIX commands

    • pattern editing utilities (e.g. grep, sed, awk)




  1. PROGRAM CODE

The PROGRAM CODE is accessed by an expert in software as well as in magnetic measurement.

Its main requirements are portability and memory check capability. It also has to provide a client /server environment for database management and communication.

The proposal for this level is the object oriented C, which is portable, efficient in speed and memory, stable, natively extendable, fully standard (ISO C89) and it has many library and APIs [9].

In addition to the pure C language, there is the C++ language. C++ was born as an enhancement to the C programming language with the addition of classes, followed by, among other features, virtual functions, operator overloading, multiple inheritance, templates, and exception handling.

There are many software development environments for C language. The most important for Windows systems are Microsoft Visual C++, which is included in Microsoft Visual Studio, and Borland C. Microsoft Visual C++ is an integrated development environment with tools for developing and debugging C++ code and for easily creating visual environments.




  1. DATABASE

For Database, CERN imposes to use Oracle.




  1. HARDWARE/MIDDLEWARE

At this level, software environments strictly depend on the available hardware.


Appendix
Example of script by Luca Bottura
#!/usr/bin/FLEXDAQ

#

# hardware configuration for corrector MM DAQ System



# ==================================================

#
#


# take the components required off-the-shelf

# and define their names in the system

#
motor maxon RE-40

motor_driver maxon LSC-30/2

encoder heidenhain ROD-880

trigger CERN DG-01

coil h-co62

absolute_switch CERN GdA-01

compensated_switch CERN GdA-01

absolute_integrator CERN PDI-01

compensated_integrator CERN PDI-01

power_supply CERN LEP


#

# assemble the components mechanically

#
connect coil encoder motor
#

# assemble the components electrically

#
cable motor motor_driver

cable encoder trigger

cable coil.A absolute_switch.1

cable coil.B absolute_switch.2

cable coil.C absolute_switch.3

cable coil.D absolute_switch.4

cable coil.E absolute_switch.5

cable coil.A compensated_switch.1

cable coil.B compensated_switch.2

cable coil.C compensated_switch.3

cable coil.D compensated_switch.4

cable coil.E compensated_switch.5

cable absolute_switch absolute_integrator.signal

cable trigger absolute_integrator.trigger.in

cable compensated_switch compensated_integrator.signal

cable absolute_integrator.trigger.out compensated_integrator.trigger.in


#

# define computer interconnects as special cables

#
control_signal USB.001 motor_driver

control_signal USB.002 absolute_switch

control_signal USB.003 compensated_switch

control_signal serial.003 power_supply

control_signal PXI.000 absolute_integrator

control_signal PXI.001 compensated_integrator

control_signal PXI.002 trigger
#

# define the measurement procedure

#
measurement
# user's defined configuration parameters (local variables)

user magnet_name "magnet name ?"

user rotation_speed "motor rotation speed ?"

user power_supply_current "magnet current ?"

user measurement_number "number of measurements ?"

user measurement_file "name of result file for number of measurements ?"


# check intelligent hardware

check motor_driver

check trigger

check absolute_switch

check compensated_switch

check absolute_integrator

check compensated_integrator

check power_supply


# start UI and get user parameters

get magnet_name, rotation_speed, power_supply_current, measurement_number, \

measurement_file

# store the configuration in the results file

write measurement_file \

magnet_name, rotation_speed, power_supply_current


# configure motor

motor_driver "rotate clockwise"

motor_driver "speed $rotation_speed"
# define the coil interconnect

absolute_switch "switch +1"

compensated_switch "switch +1 -2 -3 +4"
# configure trigger module

trigger "divide 8"


# configure integrators

absolute_integrator "external trigger"

absolute_integrator "gain auto"

compensated_integrator "external trigger"

compensated_integrator "gain auto"

absolute_integrator "master"

absolute_integrator "oneshot"

compensated_integrator "slave"


# switch power supply on

power_supply "on"


# set the current in the power supply

power_supply "rampto $power_supply_current"


# launch the motor rotation and wait till the rotation speed is constant (motor OK)

motor "go"

while .not.motor.ok; end
repeat measurement_number
# reset integrators so that measurements can start as of the next index

reset absolute_integrator

reset compensated_integrator}

set timing 1


# read integrators

at timing 1 {

while .not.absolute_integrator.end

absolute_time = absolute_integrator.time

absolute_counts = absolute_integrator.count

compensated_time = compensated_integrator.time

compensated_counts = compensated_integrator.count

end}


set timing 2
# read absolute time

at timing 1 {

time_start = GPS.time }

at timing 2 {

time_end = GPS.time }
# read current

at timing 1 {

current_start = power_supply.current}

at timing 2 {

current_start = power_supply.current}

# store the results in a file

write measurement_file \

time_start, time_end, \

current_start, current_end, \

absolute_time, absolute_count, \

compensated_time, compensated_count
end
end

References


[1] http://www.ni.com/

[2] http://java.sun.com/

[3] http://www.omg.org/docs/formal/04-03-12.pdf

[4] http://www.w3.org/TR/ws-arch/

[5] http://www.python.org/

[6] http://www.perl.org/

[7] http://www.jython.org/Project/index.html

[8] http://www.erlang.org/index.html



[9] Laurent Deniau, CERN AT/MTM-AS, “Measurement Analysis Software (Concepts and Invariants)

1 Functional programming is a programming paradigm that conceives computation as the evaluation of mathematical functions and avoids state and mutable data. Functional programming emphasizes the application of functions, in contrast with imperative programming, which emphasizes changes in state and the execution of sequential commands.


/



Yüklə 233 Kb.

Dostları ilə paylaş:




Verilənlər bazası müəlliflik hüququ ilə müdafiə olunur ©genderi.org 2024
rəhbərliyinə müraciət

    Ana səhifə