---
title: "Example - Enclosing Chart"
id: "example-enclosing-chart"
project: "MES User Manual"
url: "https://docs.sepasoft.com/articles/user-manual/example-enclosing-chart"
updated: 2026-07-31T14:57:00Z
---

# Example \- Enclosing Chart

**Sepasoft MES Module Suite**
 This example chart contains an Enclosing Chart block with an enclosed chart. As shown below, a single data value is passed in from an Ignition Button script, passed into the enclosed chart, doubled, then passed back out to the main chart and back to the button script, demonstrating how parameters values can be passed to/from a chart and to/from an enclosed chart.

![](/resources/Storage/user-manual/example-enclosing-chart/Diagram_1x.png)

 * * *

 ### Chart Hierarchy

The chart, ***Main Chart***, contains an Enclosing Chart Block, which 'encloses' the chart ***Enclosed Chart***:

![](/resources/Storage/user-manual/example-enclosing-chart/Main%20Chart.PNG)

The enclosed chart, ***Enclosed Chart***, contains a Script Block, which reads the value of the Chart Parameter ***enclosed\_in***, multiplies it by 2, then writes the result to ***enclosed\_out***.

![](/resources/Storage/user-manual/example-enclosing-chart/Enclosed%20Chart.PNG)

![](/resources/Storage/user-manual/example-enclosing-chart/Enclosed%20Chart%20-%20Script%20Block.PNG)

* * *

### Start Block - Main Chart

The Start Block in ***Main Chart*** has two Chart Parameters defined (type Integer):

![](/resources/Storage/user-manual/example-enclosing-chart/Main%20Chart%20-%20Start%20Parameters.PNG)

### Start Block - Enclosed Chart

The Start Block in ***Enclosed Chart*** also has two Chart Parameters defined (type Integer):

![](/resources/Storage/user-manual/example-enclosing-chart/Enclosed%20Chart%20-%20Start%20Parameters.PNG)

* * *

### Mapping

The **Input** tab maps what parameters from the 'parent' chart will get passed down into the selected enclosed chart. In this example, the Chart Parameter ***main\_in*** in ***Main Chart*** is mapped to the Chart Parameter ***enclosed\_in*** in ***Enclosed Chart***. When execution control is about to pass 'into' the Enclosing Chart Block, the current value of ***main\_in*** will first get passed into ***enclosed\_in*** in ***Enclosed Chart***:

![](/resources/Storage/user-manual/example-enclosing-chart/Enclosing%20Chart%20Block%20-%20Mapping%20-%20Input.PNG)

The **Output** tab maps what parameters from the enclosed chart will get passed back up to the 'parent' chart. In this example, the Chart Parameter ***enclosed\_out*** in ***Enclosed Chart*** is mapped to the Chart Parameter ***main\_out*** in ***Main Chart***. When execution control is about to pass back up to the chart ***Main Chart***, the current value of ***enclosed\_out*** will first get passed into ***main\_out*** in ***Main Chart***:

![](/resources/Storage/user-manual/example-enclosing-chart/Enclosing%20Chart%20Block%20-%20Mapping%20-%20Output.PNG)

* * *

### Button Script

A simple script is written to the **actionPerformed** event handler of the '***Multiply by 2***' button, which reads a user-input value from the **Text Field** component and passes it into ***Main Chart*** , waits for the Python dictionary, ***r***, to be returned, retrieves the value for ***main\_out*** from it and finally writes it to the **LED Display** component.

![](/resources/Storage/user-manual/example-enclosing-chart/image2019-4-23_16-2-1.png)

![](/resources/Storage/user-manual/example-enclosing-chart/Button%20Script.PNG)

**Sepasoft MES Module Suite**