Converting from Design/CPN | CPN Tools help |
How-to |
The first step to transferring a model from Design/CPN to CPN Tools, is to save the model in XML format in Design/CPN. This is done by using the "Save XML..." entry in the File
menu. Note that the "Save" and "Save as..." entries will not save a model in XML format.
Important: Only the pages that are currently selected in Design/CPN will be saved when the "Save XML..." entry is selected. The Hierarchy
page can be used to select a group of pages. For example, all pages can be selected by:
Hierarchy
page. (The page name of the active window is shown in white on a black background.)
Group
menu
The converter is distributed together with CPN Tools for Windows.
The converter can be started from the Windows Start
menu, e.g. Start Menu => Programs => CPN Tools => Utils => converter
. After the converter has been started, a dialog box will appear, allowing you to select the file that is to be converted. Pressing the Open
button will convert the selected file.
The converter generates files with the extension .cpn
. For example, if the file HierarchicalProtocol.xml
is converted, then the file containing the converted model will have the name HierarchicalProtocol.cpn
. If the output file has the same name as an existing file, then a new dialog box will appear allowing you either to overwrite the existing file or to rename the output file.
You can load a model from a file that was generated by the converter.
During the syntax check of a converted model, inconsistencies between Design/CPN and CPN Tools will be discovered. For example, some functions that are available in Design/CPN are not available (under the same name) in CPN ML for CPN Tools. In many cases, a similar function with a different name will be available in CPN Tools. Colour-coded auras and highlights will reveal where the problems can be found.
Here, for example, the syntax check reveals that the function imin
is not available in CPN Tools. It can, however, be replaced with the function Int.min
.
Here is an overview of some of the keywords and functions that are different in Design/CPN and CPN Tools.
Design/CPN | CPNTools | Comment |
color | colset | Keyword used when declaring colour sets, CPN Tools should also recognize color and automatically convert it to colset. |
declare | Keyword used to declare additional functions and constants for colour sets. Obsolete in CPN Tools, as all relevant colour set functions are automatically defined for all colour sets. | |
pageref | Keyword for declaring a page reference variable. Not supported in CPN Tools. | |
instref | Keyword for declaring an instance reference variable. Not supported in CPN Tools. | |
+ | ++ | Multi-set addition, see multi-sets |
+ | +++ | Timed multi-set addition, see timed multi-sets |
- | -- | Multi-set subtraction, see multi-sets |
* | ** | Scalar multiplication, see multi-sets |
ran'cs() | cs.ran() | See colour set functions |
lt'cs(v1,v2) | cs.lt(v1,v2) | See colour set functions |
mkst_col'cs(v) | cs.mkstr(v) | See colour set functions |
mkstr_ms'cs(ms) | cs.mkstr_ms(ms) | See colour set functions |
cs | cs.all() | See colour set functions |
size'cs | cs.size() | See colour set functions |
ord'cs(v) | cs.ord(v) | See colour set functions |
col'cs(i) | cs.col(i) | See colour set functions |
mult'cs(ms1,...,msn) | cs.mult(ms1,...,msn) | See colour set functions |
in'cs(v) | cs.legal(v) | See colour set functions |
of_idi'cs(v) | cs.of_idi(v) | See colour set functions |
first'cs | Not supported in CPN Tools | |
last'cs | Not supported in CPN Tools | |
dist'cs | Not supported in CPN Tools | |
rot'cs | Not supported in CPN Tools | |
index'cs | Not supported in CPN Tools | |
clr'cs | Not supported in CPN Tools |
For more information about some of the functions that are available in CPN Tools, see the help pages for the individual colour sets and colour set functions.