Documentation:Tutorial:Devices - MdsWiki
Navigation
Personal tools

From MdsWiki

(Difference between revisions)
Jump to: navigation, search
Revision as of 17:51, 17 March 2009 (edit)
Manduchi (Talk | contribs)

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

Next diff →
Line 11: Line 11:
Every hardware device used in data acquisition requires some associated information. For example, a generic ADC device may require: Every hardware device used in data acquisition requires some associated information. For example, a generic ADC device may require:
-* HW Address: the hardware address of the ADC device;+* ''HW Address'': the hardware address of the ADC device;
-* Sampling frequency: the sampling speed;+* ''Sampling frequency'': the sampling speed;
-* Post Trigger Samples: the number of samples taken after a trigger+* ''Post Trigger Samples'': the number of samples taken after a trigger
 + 
 +In addition to setup information, sampled signals will then be read from the device and stored in the pulse file. In MDSPlus all the information associated with a given device will be stored in a subtree of the pulse file. A different set of nodes, organized as a subtree, will be defined for every device declared in the pulse file, but the structure of such subtrees will be the same for all the devices of the same kind. Borrowing some Object Oriented terminology (we shall see that there are several similarities between objects and MDSplus devices), we define a device ''instance'' as the actual set of data items organized in a subtree and bringing all the information associated with the device, and a device ''type'' (or ''class''), as the description of the way device specific data are organized, as well as the set of operations (methods) which are defined for that kind of device.

Revision as of 18:00, 17 March 2009

Developing MDSplus Devices

Why Using MDSplus Devices
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 stuff 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.
This section will explain in detail how define a new device in MDSplus and how to integrate the support code for in the framework so that it can be re-used not only in the same system, but also by every other MDSplus user.
After a first introduction explaining the general concets of MDSplus devices, we shall use a simple test case: a simulated Transient Recorder and will show in details all the steps which are required to integrate such a device.

General Concepts
Every hardware device used in data acquisition requires some associated information. For example, a generic ADC device may require:

  • HW Address: the hardware address of the ADC device;
  • Sampling frequency: the sampling speed;
  • Post Trigger Samples: the number of samples taken after a trigger

In addition to setup information, sampled signals will then be read from the device and stored in the pulse file. In MDSPlus all the information associated with a given device will be stored in a subtree of the pulse file. A different set of nodes, organized as a subtree, will be defined for every device declared in the pulse file, but the structure of such subtrees will be the same for all the devices of the same kind. Borrowing some Object Oriented terminology (we shall see that there are several similarities between objects and MDSplus devices), we define a device instance as the actual set of data items organized in a subtree and bringing all the information associated with the device, and a device type (or class), as the description of the way device specific data are organized, as well as the set of operations (methods) which are defined for that kind of device.