Beruflich Dokumente
Kultur Dokumente
User Guide
TM
1.1
AVEVASolutionsLimited
Disclaimer
1.1 AVEVA does not warrant that the use of the AVEVA software will be uninterrupted, error-free or free from viruses.
1.2 AVEVA shall not be liable for: loss of profits; loss of business; depletion of goodwill and/or similar losses; loss of
anticipated savings; loss of goods; loss of contract; loss of use; loss or corruption of data or information; any special,
indirect, consequential or pure economic loss, costs, damages, charges or expenses which may be suffered by the user,
including any loss suffered by the user resulting from the inaccuracy or invalidity of any data created by the AVEVA
software, irrespective of whether such losses are suffered directly or indirectly, or arise in contract, tort (including
negligence) or otherwise.
1.3 AVEVA's total liability in contract, tort (including negligence), or otherwise, arising in connection with the performance
of the AVEVA software shall be limited to 100% of the licence fees paid in the year in which the user's claim is brought.
1.4 Clauses 1.1 to 1.3 shall apply to the fullest extent permissible at law.
1.5 In the event of any conflict between the above clauses and the analogous clauses in the software licence under which
the AVEVA software was purchased, the clauses in the software licence shall take precedence.
Copyright
Copyright and all other intellectual property rights in this manual and the associated software, and every part of it
(including source code, object code, any data contained in it, the manual and any other documentation supplied with it)
belongs to, or is validly licensed by, AVEVA Solutions Limited or its subsidiaries.
All rights are reserved to AVEVA Solutions Limited and its subsidiaries. The information contained in this document is
commercially sensitive, and shall not be copied, reproduced, stored in a retrieval system, or transmitted without the prior
written permission of AVEVA Solutions Limited. Where such permission is granted, it expressly requires that this copyright
notice, and the above disclaimer, is prominently displayed at the beginning of every copy that is made.
The manual and associated documentation may not be adapted, reproduced, or copied, in any material or electronic form,
without the prior written permission of AVEVA Solutions Limited. The user may not reverse engineer, decompile, copy, or
adapt the software. Neither the whole, nor part of the software described in this publication may be incorporated into any
third-party software, product, machine, or system without the prior written permission of AVEVA Solutions Limited, save as
permitted by law. Any such unauthorised action is strictly prohibited, and may give rise to civil liabilities and criminal
prosecution.
The AVEVA software described in this guide is to be installed and operated strictly in accordance with the terms and
conditions of the respective software licences, and in accordance with the relevant User Documentation. Unauthorised or
unlicensed use of the software is strictly prohibited.
Copyright 2012 to current year. AVEVA Solutions Limited and its subsidiaries. All rights reserved. AVEVA shall not be
liable for any breach or infringement of a third party's intellectual property rights where such breach results from a user's
modification of the AVEVA software or associated documentation.
AVEVA Solutions Ltd, High Cross, Madingley Road, Cambridge, CB3 0HB, United Kingdom
Trademark
AVEVA, AVEVA Everything3D and AVEVA E3D are registered trademarks of AVEVA Solutions Limited or its
subsidiaries. Unauthorised use of the AVEVA, AVEVA Everything3D and AVEVA E3D trademarks is strictly
forbidden.
AVEVA product/software names are trademarks or registered trademarks of AVEVA Solutions Limited or its subsidiaries,
registered in the UK, Europe and other countries (worldwide).
AVEVAPMLStudioUserGuide
Revision Sheet
Date
Version
Comments / Remarks
May 2015
1.1
First Release
AVEVAPMLStudioUserGuide
Introduction
AVEVA PML Studio will be made available to AVEVA customers who want to increase
their productivity and improve the quality and maintainability of their valuable PML
customisations. AVEVA PML Studio will not be a commercial product, it will be an
unsupported, freely distributable tool to help experienced PML programmers to work more
efficiently.
AVEVA PML Studio supports the following file types:
1.1
Error checking
Autocomplete
Intellisense
Syntax highlighting
Smart indenting
Code folding
Code warnings
Issue navigation
Autoformatting
Real-time feedback
Smart tooltips
Spell checking
Prerequisite
AVEVA PML Studio is based on the Microsoft Visual Studio 2010 Shell (Isolated) and it is
a prerequisite that this is installed prior to installing PML Studio. Click here to download.
1:1
1.1
1.2
Guide Structure
The AVEVA PML Studio User Guide is divided into the following sections:
Frequently Asked Questions
PML Menu
PML Explorer
Text Editor
Error List
Output
Properties
Navigation Bar
PMLCop
PML Documentation
1.3
is
only
available
for
AVEVA
Spell Checker
Grammar Checker
Styling
Snippets
Templates
1:2
1.1
Can we debug code, i.e. insert break points and query variable values?
No.
1.4
PML Menu
The PML Menu provides you with easy access to PML commands.
1:3
1.1
1.5
PML Explorer
Styling
Document
PML Explorer
The PML Explorer provides you with an organised view of your PMLLIB as well as access to
many of the commands that pertain to them. PML Explorer can be found in the View and
PML menu.
1:4
1.1
Toolbar
The available options are:
Select Folder
Refresh All
Refreshes all folders and files in the PML Explorer. Used for
updating changes done outside PML Studio.
Collapse All
Configuration
Search
Allows you to search for a PML file in the tree view of the
PML Explorer.
1:5
1.1
Tree View
Displays a tree view of all folders and acceptable files in the selected folder. Acceptable files
are PML files or files with extensions defined in the Configuration dialog.
Folder
PML File
Object,
Form,
Function, Command
Member
Method
Other File
Icon for all other files. These are the extensions defined
by the user in the Configuration dialog.
Context Menu
The available options are:
Hide
Open
Show in Windows
Explorer
Refresh
Add
Delete
Production
Check
Document
Ready
1:6
1.1
1.5.1
PMLNet Reference
To have intellisense for PMLNet objects a PMLNet Folder must be identified.
Toolbar
The available options are:
1.6
Refresh
Delete
Text Editor
The text editor is the word processor of the integrated development environment (IDE).
1.6.1
Syntax Highlighting
PML Studio highlights different parts of the code to improve readability. There are six
different types of text in a PML file displayed in the text editor window.
Keyword: BLUE
define, setup,.....
String: MAROON
,
Number: BLACK
[0-9]
1:7
1.1
Identifier: BLACK
!variable, .refreshDraftCanvas, ...
Text: BLACK
=, *, ...
These colours and fonts can be changed in Tools, Options, Environment, Fonts and Colors.
The Display item names match the ones above.
1.6.2
Bracket Highlighting
Highlights brackets when the cursor is placed to the left of an open bracket or the right of a
close bracket. The colour of the highlight can be changed in Tools, Options, Environment,
Fonts and Colours. Change the Item Background colour for Brace Matching (Rectangle).
1:8
1.1
From Microsoft: When you type a closing bracket, both it and its matching bracket remain
highlighted for a few seconds, or until you type another key or move the cursor. This makes
visually identifying code blocks much easier. In addition, this may help identify mismatched
or missing brackets.
1.6.3
Variable Highlighting
Highlights all references to the same local variable when the cursor is placed on a local
variable. It will also highlight the references in strings. The colour of the highlight can be
changed in the same place as Bracket Highlighting.
1.6.4
1.6.5
Tooltips
Indicates the type and description of an object. The description is taken from comments in
the file header and above methods and members.
1:9
1.1
1.6.6
Auto-Completion
Completion list after '!'. Local Variables, Global Variables and '!this'.
Completion list after '.' All members and methods of the previous object, including built-in
ones such as '.eq'.
Full completion list called with CTRL+SPACEBAR, ALT+RIGHT ARROW or CTRL+J. Local
Variables, Global Variables, '!this' and common code blocks (i.e. IF). It can also be activated
in Menu Edit -> IntelliSense -> List Members.
1:10
1.1
1.6.7
Method Tip
Displays information about the method or function and the possible parameters. The
information is displayed when typing the parameters (specifically '(' and ',') or when
CTRL+SHIFT+SPACEBAR is pressed. It can also be activated in Menu Edit -> IntelliSense
-> Parameter Info.
1.6.8
Go To Declaration
Local variables
Supported. Goes to the first appearance of the local variable in the file.
Forms, Objects, Functions, Commands
Supported. As long as they are not in built (i.e. ARRAY) and the files are local (i.e.
both in the same PMLLIB directory)
Methods and members
Supported. As long as they are not members and methods of in built types (i.e.
ARRAY) and the files are local (i.e. both in the same PMLLIB directory)
Global variables
Not supported.
1:11
1.1
Go To Declaration is accessed through the text editor context menu. It is disabled for text
without declarations and will not work on in built types such as ARRAY.
1.6.9
Go To Reference
Not supported yet. Opens the documentation of the PML file created by PML Doc.
1.7
Error List
Displays errors, warnings and messages for a PML file. These can be navigated to and
sorted.
Errors are marked with a red underline. Some examples of errors: missing ENDIF,
unmatched brackets, missing '!'.
1:12
1.1
Warnings are marked with a blue underline. Some examples of warnings: Missing brackets
on IF, unused variables, spelling mistakes, grammar mistakes.
Messages are not marked with a underline. An example of a message is deprecated code.
1.8
Output
Displays output from external tools such as PML Doc and PML Cop.
Note: Currently only available within AVEVA.
1.8.1
PMLCop Output
PMLCop output allows you to navigate to the errors, warnings and messages by double
clicking on the line with the filename and line number.
1:13
1.1
1.9
Properties
Shows the properties of a PML file such as the file description and when it was last
modified.
Note: The properties are not editable.
1.9.1
File Properties
Only the date last modified, size and its read only status are taken from the file properties
and displayed in the Properties Window.
1:14
1.1
1.9.2
1.10
Navigation Bar
Allows easy navigation in a PML file. The left navigation bar contains the main declaration in
the file. For a pmlobj file this is the 'define object ...' line. The right navigation contains all the
declarations in the PML file. These are members and methods. The navigation bar will keep
track of the current position of the caret and will navigate to a declaration when selected.
The list in the navigation bar matches the list in the PML Explorer and so do the icons.
1:15
1.1
1.11
PMLCop
PMLCop is a console application that will check PML files. It prints a report to the Output
Window. PML Cop can be accessed through the PML Explorer.
Note: It is currently only available to internal AVEVA employees and has not yet been
released externally.
1:16
1.1
1.11.1
Run PMLCop
'Run PML Cop' will run PML Cop normally while printing all output to the Output Window. It
will only report on Errors and Warnings. It will not report spelling or grammar warnings. PML
Cop also has harsher rules than PML Studio and will report '$P' and 'Q VAR ...' as errors.
This is due to PML Cop assuming the file is production ready and those lines are not
acceptable in production code.
1.12
PML Documentation
PMLDoc is a console application that will document PML files. It creates a folder of html files
for each PML file. PML Documentation can be accessed through the PML Menu or the PML
Explorer. It is currently only available to internal AVEVA employees and has not yet been
released externally.
PML Menu:
1:17
1.1
1.13
Document All
1:18
1.1
1.14
Spell Checker
The Spell checker is turned off and on in Tools -> Options -> Text Editor -> PML -> Spell
Checker. Checking for spelling mistakes in strings and comments can be turned off and on
separately. Individual words to be added to the spell checker are added in the first list titled
Accepted Words. Files of words to be accepted are added in the second list titled Accepted
Words in dictionary Files. This spell checker is based on Hunspell.
1:19
1.1
1.14.1
1.14.2
Additional Dictionaries
You can also add files containing words you want accepted by the spell checker. These files
must be the same form as AVEVA specific dictionaries. They must have the '.dic' extension,
each word is on a separate line and '#' denotes comments.
1.14.3
1:20
1.1
1.15
Grammar Checker
The Grammar checker is turned off and on in Tools -> Options -> Text Editor -> PML ->
Grammar Checker. The default is off. Checking for grammar mistakes in strings and
comments can be turned off and on separately.
Note: The grammar checker comes from Microsoft Word, and requires a local installation
of Microsoft Word to function correctly.
1:21
1.1
1.16
Styling
Styles PML files by fixing casing, indentation and adding brackets.
1:22
1.1
Fix Casing
Add Brackets
Fill Indentation
Fix All
1.17
Removes tabs.
Snippets
Snippets are insertable reusable snippets of PML code.
1.17.1
Using Snippets
The default snippets are stored in the PML Studio installation folder. Various snippets are
available such as a DO loop or a basic outline of an Object. The list of snippets can be found
in Tools -> Code Snippets Manager.
They can be activated in many ways:
Default shortcut Ctrl+K, Ctrl+X (though this is changeable see Tools -> Options...)
Type the shortcut for a snippet (i.e. "if" for IF block) and press tab.
1:23
1.1
Insert snippet will add the snippet of code with highlighted placeholders for additional
information.
SurroundsWith is used when code is selected. The selected code is surrounded by the
snippet; this is useful when creating an IF Block.
1.17.2
Important Snippets
There are documentation snippets for methods and files, their short cuts are "docm" and
"docf" respectively. There are also snippets for objects, forms, methods etc. with headers
already included.
1.17.3
Create Snippet
1. Create a folder, "MyDocuments\PML Studio\Snippets" is suggested but not necessary
1:24
1.1
2. Place all snippets in this folder and any sub folders. Snippets must have the extension
".snippet"
3. Register the folder with the Code Snippets Manager using the "Add.." button, under the
correct Language - PML
1.18
Templates
The standard layout and components of a PML file are stored in a template file, for example
a pmlobj file containing a header, Object and a Method.
1.18.1
Default PML files - These are standard simple files that are stored in the installation
directory.
1:25
1.1
1.18.2
1.18.3
Templates
File Name
Author
Date Created
Description
Create Template
All user created templates must be placed in MyDocuments\PML Studio\Templates (or
MyDocuments\Visual Studio [version]\Templates\MyPMLTemplates for the integrated PML
Studio). Also a VSDIR file must be created to provide information about the templates. The
format of a VSDIR file can be found here. There should only be one VSDIR file in the folder.
All user created templates will only appear in the PML Explorer New File Dialog.
1:26
1.1
AVEVAPMLStudioUserGuide