Documentation:Tutorial:Devices - MdsWiki
Navigation
Personal tools

From MdsWiki

(Difference between revisions)
Jump to: navigation, search
Revision as of 02:48, 30 December 2006 (edit)
WikiSysop (Talk | contribs)

← Previous diff
Revision as of 16:16, 17 March 2009 (edit)
Manduchi (Talk | contribs)

Next diff →
Line 1: Line 1:
-<big>'''The MDSplus tutorial'''+<big>'''Developing MDSplus Devices'''</big>
 + 
 +We already met devices in the previous discussion on actions and experiment sequences. This section will cover in detail MDSplus devices, an important feature for customizing MDSplus to any target experiment. <br />
 +So far, we have used MDSplus to store and retrieve data from pulse files, and to set-up automated sequences of operations to be performed during the experimental phases. If this were all the functionality of MDSplus, a lot of work would be required to build a real-world data acquisition system because every hardware device involved in the system would require the development of ad-hoc code for set-up and data retrieval. A software layer for integrating the device in the system would then be required for every kind of used device. If the same device were used somewhere else, however, it would be nice to avoid developing new code from scratch by re-using existing code. <br />
 +In order to ease re-using device-specific code, MDSplus provides a framework for integrating device-specific functionality into the system. Once integrated, the device support code becomes part of the MDSplus system, and can be promptly re-used elsewhere.
 + 
 + 
 +Every hardware device used in data acquisition is represented in the experiment model by a set of nodes, forming a subtree. Devices of the same type are represented by the same subtree structure. This is very similar to the definition of an Object in Object Oriented programming, and MDSplus defines a new data type, called Conglomerate, for this purpose. As an object instance contains a set of fields and defines a set of methods, a MDSplus device defines a subtree structure and a set of methods which can be declared in an action. For example, a transient recorder device will define an INIT method, which will be called before the shot for the device initialization, and a STORE method called after the shot for data readout.
 +MDSplus devices define also a constructor method, called ADD which is invoked when the associated subtree has to be added to the tree. You implicitly call this method when adding a new device using jTraverser in edit mode. We do so by selecting the Add device item in the popup menu, which prompts then for the type of the device and the name of the device top node (i.e. the root of the subtree).
 + 
 +We can now understand the meaning of the fields which are displayed when Method is selected for an action:
 + 
 + * Device: the path name (or tag) of the device top node;
 + * Method: the name of the method to be executed.
 + 
 +The current implementation of MDSplus defines a fairly large set of supported devices, but it is possible to develop new devices to support new hardware. The the next tutorial will explain how.
 + 
 +There is also another field which is always displayed unless an expression is defined. This field defines a timeout value and defines the action timeout (in seconds). If a value is assigned to the timeout and if the operation does not terminate within the specified time, the executing thread is discarded and the action is assumed to be aborted, so that the sequence can continue with the following actions.
-Work in progress....</big> 
Wiki test Wiki test
[[Documentation:Tutorial:DeviceSetup|Demo device setup creation]] [[Documentation:Tutorial:DeviceSetup|Demo device setup creation]]

Revision as of 16:16, 17 March 2009

Developing MDSplus Devices

We already met devices in the previous discussion on actions and experiment sequences. This section will cover in detail MDSplus devices, an important feature for customizing MDSplus to any target experiment.
So far, we have used MDSplus to store and retrieve data from pulse files, and to set-up automated sequences of operations to be performed during the experimental phases. If this were all the functionality of MDSplus, a lot of work would be required to build a real-world data acquisition system because every hardware device involved in the system would require the development of ad-hoc code for set-up and data retrieval. A software layer for integrating the device in the system would then be required for every kind of used device. If the same device were used somewhere else, however, it would be nice to avoid developing new code from scratch by re-using existing code.
In order to ease re-using device-specific code, MDSplus provides a framework for integrating device-specific functionality into the system. Once integrated, the device support code becomes part of the MDSplus system, and can be promptly re-used elsewhere.


Every hardware device used in data acquisition is represented in the experiment model by a set of nodes, forming a subtree. Devices of the same type are represented by the same subtree structure. This is very similar to the definition of an Object in Object Oriented programming, and MDSplus defines a new data type, called Conglomerate, for this purpose. As an object instance contains a set of fields and defines a set of methods, a MDSplus device defines a subtree structure and a set of methods which can be declared in an action. For example, a transient recorder device will define an INIT method, which will be called before the shot for the device initialization, and a STORE method called after the shot for data readout. MDSplus devices define also a constructor method, called ADD which is invoked when the associated subtree has to be added to the tree. You implicitly call this method when adding a new device using jTraverser in edit mode. We do so by selecting the Add device item in the popup menu, which prompts then for the type of the device and the name of the device top node (i.e. the root of the subtree).

We can now understand the meaning of the fields which are displayed when Method is selected for an action:

   * Device: the path name (or tag) of the device top node;
   * Method: the name of the method to be executed. 

The current implementation of MDSplus defines a fairly large set of supported devices, but it is possible to develop new devices to support new hardware. The the next tutorial will explain how.

There is also another field which is always displayed unless an expression is defined. This field defines a timeout value and defines the action timeout (in seconds). If a value is assigned to the timeout and if the operation does not terminate within the specified time, the executing thread is discarded and the action is assumed to be aborted, so that the sequence can continue with the following actions.


Wiki test

Demo device setup creation