Difference between revisions of "MSC tutorial"
(→Introduction) |
(→Message) |
||
(2 intermediate revisions by the same user not shown) | |||
Line 58: | Line 58: | ||
msg Change_Mode : (System-Modes); | msg Change_Mode : (System-Modes); | ||
− | In | + | In this example, the file DataView.asn contains the following definition: |
+ | |||
+ | System-Modes ::= ENUMERATED { safe, operational, calibration } | ||
+ | |||
''NOTE: the MSC standard allows other notations and in principle the message parameters could take any form, including informal text - however from a tool standpoint, parsers require to rely on a well-defined notation so ASN.1 is used in practice.'' | ''NOTE: the MSC standard allows other notations and in principle the message parameters could take any form, including informal text - however from a tool standpoint, parsers require to rely on a well-defined notation so ASN.1 is used in practice.'' | ||
− | |||
== Conditions == | == Conditions == | ||
Line 132: | Line 134: | ||
:[[File:ClipCapIt-210224-160218.PNG]] | :[[File:ClipCapIt-210224-160218.PNG]] | ||
+ | In this example the MSC "Take Picture" will loop. | ||
== EXCEPTION == | == EXCEPTION == |
Latest revision as of 15:35, 24 February 2021
Contents
Introduction
MSC stands for Message Sequence Chart and it is a standard from the ITU-T: https://www.itu.int/rec/T-REC-Z.120.
The MSC standard describes a language used to capture a system's operational scenarios in a formal way, with the support of both a textual and graphical representation.
This is an example of a basic MSC chart:
There are two major uses of MSC in a system development lifecycle:
- For the specification of the expected behaviour of a system and production of validation material
- For the observation and recording of the actual system behaviour
The following sections present the language semantics and syntax, as they are used within TASTE
Basic MSC Concepts
Basic MSC represent scenarios of operation that exhibit the system components and their interactions.
Environment
The environment of a system is represented by a box around the diagram. The environment corresponds to any entity that can send messages to the instances that are visible in the current MSC chart.
Instance
An instance in a MSC is represented by a box and a vertical line. It corresponds to a component of the system.
In its textual form, an instance is declared like this:
instance Ground_Segment; ... endinstance;
Message
A message is a signal optionally containing parameters, and that corresponds to an asynchronous interaction between two instances.
In the textual form messages appear inside the two instance definitions being part of the communication (sender and receiver:
instance Operator; out Change_Mode(safe) to Mode_Manager; endinstance; instance Mode_Manager; in Change_Mode(safe) from Operator; endinstance;
The parameter of the message ("safe" in that example) follows the ASN.1 Value Notation syntax. The messages are all declared at the beginning of the MSC file and parameters reference a type declaration in an ASN.1 model:
language ASN.1; data DataView.asn; msg Change_Mode : (System-Modes);
In this example, the file DataView.asn contains the following definition:
System-Modes ::= ENUMERATED { safe, operational, calibration }
NOTE: the MSC standard allows other notations and in principle the message parameters could take any form, including informal text - however from a tool standpoint, parsers require to rely on a well-defined notation so ASN.1 is used in practice.
Conditions
Conditions are boxes that can appear either at the level of one instance, or shared between several instances. They can be used to specify a trigger for the MSC, or to specify anything related to the internal data of the component:
Actions
Actions are rectangular boxes allowing to specify what the instance does internally when it is triggered:
Timers
A timer can be set, reset, or can expire to specify time-related constraints:
In this example the Operator sets a timer and reset (cancels) it if the "Acknowledged" message is received on time. The Mode manager instance sets a timer to let some time pass (the timer expires) before reaching the Safe mode and sending the Acknowledged message.
Instance Creation
MSC can represent the dynamic creation of an instance from another instance. The instance can stop at any point in time.
Co-regions
Co-regions allow to specify that the ordering of messages received does not matter:
Comments
There are two kinds of comments : comments at chart level, and comments attached to one semantic element:
Advanced MSC Concepts
It is possible to structure individual MSC scenarii to support more advanced and complex system specifications. The tree representation allows to specify MSCs with the following relationships
AND
Express the fact that several MSCs execute in order (from left to right):
OR
One of the branches will run (to completion). A condition symbol at the start of the MSC charts can indicate what triggers the branch.
PARALLEL
MSC branches will run in parallel
REPEAT
Express a loop: the MSC will repeat itself after it completes
In this example the MSC "Take Picture" will loop.
EXCEPTION
Specify a MSC that will interrupt the one currently running (e.g. to model the reaction to a failure)