Aller au contenu principal

Sequence Diagram

This element represents a Sequence Diagram, where the lifelines align with the model part instances, and it is necessary to configure the flows.

All configurations are accessible in the right sidebar under the "Sequence diagram parameter" tab.
Simply choose the desired lifelines and flows for display by selecting the corresponding checkboxes:

Sequence Diagram Animation

If you click on any of the interactions in the Sequence Diagram, a label with all its parameters will appear on the screen.

When the user pauses the simulation, an 'Export' button appears next to the diagram, allowing the user to export an SVG snapshot of the sequence diagram in its current state.

This element must be used with HMI context.

Ordering lifelines

You can arrange the lifelines in your sequence diagram to suit your needs once your model parts are instantiated in your scenario.

Four lifelines are in a random order: Customer, Chef, Server, Kitchen

To reorder your lifelines, right-click on the sequence diagram and select "Edit and sort model parts/flows" from the available options:

Right-clicking on the diagram, letting you choose Edit and sort model parts from the available options.

You can now drag and drop the different lifelines up or down to arrange them in the desired order. Additionally, you can remove lifelines by dragging them to the left box, and add lifelines by dragging them to the right box.

Two boxes are available, the left one called Available Model Part Instances is empty, the right one called Selected Model Part Instances contains Customer, Chef, Server, Kitchen in that order. An arrow indicates that dragging Server up can change the order of the lifelines

Click Save when you have arranged the lifelines in the desired order. The previous step should organize the lifelines as specified:

The four lifelines are now in order: Customer, Server, Chef, Kitchen

Changing colors

You can change the color of both lifelines and specific flows between lifelines.

To change the color of a specific lifeline, go to the Project tab and find the associated executable in the Executables section. In Model parts, you will find the different lifelines that can be instantiated into your scenario. Each can be edited to be associated with a specific color:

Several fields are displayed: Name, Color, Type. The Color field is the one we are interested in. One lifeline is now red. The others are still black.

Still in the Executables section of the Scenario tab, you can find a specific flow in both the "Flows (model to simu)" and "Flows (simu to model)" folders. By opening the flow configuration, where you can change the sources and targets of the flow, you can also change the color of this flow:

In the flow configuration menu, the flow is set to go from Customer to Server, and the Color field can be edited.

Each time the flow is supposed to appear in the diagram, it will appear with the color previously set:

A green flow is displayed between lifelines.

Condition marks

Condition marks can be used to display an internal value or state sequentially.

To create this kind of display in your sequence diagram, you first need a simulation flow directed to the Engineer in your modeling tool. This flow must carry the parameter you want to display. In the example below, the simulation flow "SIMU_send_led_state" carries the LED state.

A simulation flow is sent to the Engineer, containing the parameter to be displayed.

In Virtual Bench, after setting up all the other necessary flows along with their model parts, you will also have to configure the simulation flow. To designate this flow for condition marks, you will need to select the relevant model part as a target, and as a target only.

Flow configuration popup in which no sources are selected, and only the Internal model part is selected as a target.

For the condition mark to actually be displayed, you must add the simulation flow to the list of flows to display. To do this, in Edit Mode, right-click on your sequence diagram and select the Edit and sort model parts/flows option. In the Available Flows section (bottom left), select the relevant simulation flow and click the "+" icon to add it to the Selected Flows section (bottom right). Finally, click Save.

On the Edit and Sort configuration page, the needed flow is selected and added using the + button.

It should be all set. When running the simulation, the condition marks should look something like this:

After receiving the flow to turn it on, the state of the LED system is displayed as ON. After receiving the flow to turn it off, the state of the LED system is displayed as OFF.

Internal activity Representation

Internal activities can be displayed to show what is happening inside a system or sub-system.

First, you need to create a simulation flow connected to the Engineer in your modeling tool.

A Simulation flow is sent to the Engineer.

When opening the configuration of your simulation flow, you will need to select the relevant model part as both a source AND a target.

Flow configuration popup in which the internal model part has been selected as a source and also as a target.

In Edit mode, add the simulation flow to the list of flows to display.

When running the simulation, the internal activities should appear:

User flows are sent to a LED System lifeline, after receiving the flow to request to turn it on and off, an internal activity appears after both requests.

Icon

Sequence Diagram

HMI Representation

Sequence Diagram Representation

External parameters

Show/Hide all parameters
parametereditable via "Parameter" tabupdatable via a mappingdescriptionunittype
X-axis position✔️✔️Position of the element on the X-axis.pxInteger number
Y-axis position✔️✔️Position of the element on the Y-axis.pxInteger number
Width✔️✔️Length of the element on the X-axis.pxInteger number
Height✔️✔️Width of the element on the Y-axis.pxInteger number
Visibility✔️✔️This parameter allows you to choose if you want the element to be visible or not on the scene during the execution of the scenario. If the item is part of a group, it can inherit the value of that group.-Enumeration (visible, hidden, inherit)
Angle✔️✔️Angle of rotation of the element compared to its initial position.degreeDecimal number
Model partsList of selected model parts to display.-Array of Text
FlowsList of selected flows to display.-Array of Text
Update period✔️✔️Periodically update the diagram.-Decimal number

Triggered behaviours

See Triggered behaviours and events page for more explanation: Triggered behaviours and events.

Show/Hide all triggered behaviours

Destroy

At the reception of the flow, the element is destroy.

No parameters for this triggered behaviour.

Events

See Triggered behaviours and events page for more explanation: Triggered behaviours and events.

Show/Hide all events
eventdescription
On Parameter Value ChangedThe element can send information to the model when the value of the selected parameter has changed
At initializationThe Sequence Diagram can send information to the model once at initialization
ContinuallyThe Sequence Diagram can send information to the model continuously