Programmable Macro Language

From HandWiki
Short description: Domain specific language developed by AVEVA

Programmable Macro Language (PML) is a domain specific language developed by AVEVA to enable customisation of their plant and marine design products. PML is a file-based interpreted language that enables an application developer to design Microsoft Windows form-based add-ins that can be included within an AVEVA product such as Plant Design Management System (PDMS).

History

PML originated from the Computer-Aided Design Centre (or CADCentre) which was established in Cambridge UK in 1967 by the UK Ministry of Technology. CADCentre, which later became AVEVA, carried out a great deal of early pioneering CAD research. Early staff members went on to become prominent in the worldwide CAD community, such as brothers Dick and Martin Newell. CADCentre was arguably the most important single factor in the transformation of Cambridge into one of the world's high technology centers within a few years in the late 1970s and early 1980s.

The PML language facilitates the customisation of the Plant Design Management System (PDMS) system so that it may be used in industries such as marine, offshore and onshore oil & gas, chemical & process plants, and mining.

There are currently three iterations of the PML language.

  • PML 1 - A basic macro/command language with Window Form capabilities.
  • PML 2 - An advanced version of PML 1 to include object-oriented capability for forms and menus.
  • PML.NET - An alternative PML mechanism to facilitate the use of Microsoft .NET controls into a PML environment.

Example

The following PML code prints the classic "Hello World" string on the PDMS Command Window.

define function !!HelloWorld()
    --Create a string containing the text to print:
    !a = 'Hello World'
    
    --Print the "Hello World" string on the PDMS console:
    $P $!a
endfunction

This code defines a new PML function called "!!HelloWorld" that takes no parameters and returns no value. It simply assigns the string 'Hello World' to the local variable "!a" and then calls the "$P" command to print the text on the Command Window within PDMS. In order for this example to work, the code should be placed inside a file called "helloworld.pmlfnc". The extension is not mandatory, but the filename should be the same as the function name (PML is not case sensitive). That file should be placed inside a directory where PDMS searches for PML code during its initialization process.

External links