create new tag
, view all tags


Draw message sequence charts (MSCs) using the mscgen utility


A TWiki plugin for the mscgen utility. Parses message sequence chart (MSC) descriptions and produces PNG images as the output. MSCs are described using a simple markup language written between %MSC% and %ENDMSC% tags.

MSC is an interaction diagram from the SDL family very similar to UML's sequence diagram. MSCs are popular for describing communication behaviour in real-time systems, telecommunication, protocol software etc.

Input: Output:
msc {

    a [label="Alice"],b [label="Bob"];

    a=>b [label="INVITE"];
    a<=b [label="180 Ringing"];
    a<=b [label="200 OK"];
    a=>b [label="ACK"];
Example graph generated by MessageSequenceChartPlugin

Syntax Rules

Enclose the description for your MSC within %MSC% and %ENDMSC% tags.

mscgen language:


Fictional process

You type: You get:
msc {

  a->b [ label = "ab()" ] ;
  b->c [ label = "bc(TRUE)"];
  c=>c [ label = "process(1)" ];
  c=>c [ label = "process(2)" ];
  c=>c [ label = "process(n)" ];
  c=>c [ label = "process(END)" ];
  a<<=c [ label = "callback()"];
  ---  [ label = "If more to run", ID="*" ];
  a->a [ label = "next()"];
  a->c [ label = "ac1()\nac2()"];
  b<-c [ label = "cb(TRUE)"];
  b->b [ label = "stalled(...)"];
  a<-b [ label = "ab() = FALSE"];

Fictional client-server protocol

You type: You get:
msc {
 arcgradient = 8;

 a [label="Client"],b [label="Server"];

 a=>b [label="data1"];
 a-xb [label="data2"];
 a=>b [label="data3"];
 a<=b [label="ack1, nack2"];
 a=>b [label="data2", arcskip="1"];
 a<=b [label="ack3"];

Plugin Installation & Configuration

Note: You do not need to install anything on the browser to use this plugin. The following instructions are for the administrator who installs the plugin on the TWiki server.

1. Install mscgen

Instructions and installation packages can be found from http://www.mcternan.me.uk/mscgen/.

2. Install MessageSequenceChartPlugin

  • For an automated installation, run the configure script and follow "Find More Extensions" in the in the Extensions section.

  • Or, follow these manual installation steps:
    • Download the ZIP file from the Plugins home (see below).
    • Unzip MessageSequenceChartPlugin.zip in your twiki installation directory. Content:
File: Description:
data/TWiki/MessageSequenceChartPlugin.txt Plugin topic
lib/TWiki/Plugins/MessageSequenceChartPlugin.pm Plugin Perl module
    • Set the ownership of the extracted directories and files to the webserver user.
    • Install the dependencies (if any).

  • Plugin configuration and testing:
    • Run the configure script and enable the plugin in the Plugins section.
    • Configure additional plugin settings in the Extensions section if needed. All settings start with $TWiki::cfg{Plugins}{MessageSequenceChartPlugin}, and on many systems, these are optional.
Setting Description
{mscGenCmd} Path to mscgen executable on your system. Default value is /usr/bin/mscgen.
{mscScript} Path to the MessageSequenceChart.pl script (should be in your tools directory). E.g. /var/www/twiki/tools/MessageSequenceChart.pl.
{Debug} Debug plugin. See output in data/debug.txt.
    • Test if the installation was successful: See example above.

Plugin Info

Plugin Author: TWiki:Main.AnttiHaapakangas
Copyright: © 2012 TWiki:Main.AnttiHaapakangas
© 2012 TWiki:TWiki.TWikiContributor
License: GPL (Gnu General Public License)
Plugin Version: 22613 (2012-02-13)
Change History:  
2012-02-13: Fixed error handling and reporting
2012-02-09: Checked in to SVN
2012-02-08: Initial version
TWiki Dependency: $TWiki::Plugins::VERSION 1.1
mscgen>=0Required. Available from http://www.mcternan.me.uk/mscgen/.
Plugin Home: http://twiki.org/cgi-bin/view/Plugins/MessageSequenceChartPlugin
Feedback: http://twiki.org/cgi-bin/view/Plugins/MessageSequenceChartPluginDev
Appraisal: http://twiki.org/cgi-bin/view/Plugins/MessageSequenceChartPluginAppraisal

Related Topics: TWikiPlugins, DeveloperDocumentationCategory, AdminDocumentationCategory, TWikiPreferences

Edit | Attach | Watch | Print version | History: r6 < r5 < r4 < r3 < r2 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r6 - 2013-10-16 - PeterThoeny
  • Learn about TWiki  
  • Download TWiki
This site is powered by the TWiki collaboration platform Powered by Perl Hosted by OICcam.com Ideas, requests, problems regarding TWiki? Send feedback. Ask community in the support forum.
Copyright © 1999-2016 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.