---
title: "Complex Data Type Parameters"
id: "complex-data-type-parameters"
project: "MES User Manual"
url: "https://docs.sepasoft.com/articles/user-manual/complex-data-type-parameters"
updated: 2026-07-31T14:56:54Z
---

# Complex Data Type Parameters

**Sepasoft MES Module Suite**
 A Complex Data Type Parameter is a flexible method for holding array data within a chart. They are created in the Start Block and can be accessed via scripting in the Script Block, and are also available for mapping connections in the Enclosing Chart, BAPI Action and RFM Action blocks. Data can be passed into and returned from charts by the chart execution functions here: [system.mes.bc](/docs/display/BC/system.mes.bc). The chart.getParameterValue() function will return a Complex Data Type Parameter object with several methods available for data manipulation.

 * * *

 ## Creating a Complex Data Type Parameter

Complex Data Type Parameters are created in the **Start Block** of any chart.

### Create or Edit a New Data Type Parameter

Chart Parameters are created and edited in the Start Block's **Start Properties** pane:

![](/resources/Storage/user-manual/complex-data-type-parameters/Start%20Block%20-%20Start%20Properties.PNG)

Rules Regarding Complex Data Type Parameters

| ![Information](/resources/Storage/user-manual/user-manual/Info.png) | <ul><li>Naming must conform to XML naming rules (see below).</li><li>Indexing starts at 1, so B[1] is the first element in the array B[1 to n].</li><li>To pass/read values to/from the entire array remove &#39;[]&#39; from the path used to address the array within the Complex Data Type Parameter.</li><li>To address specific elements within an array via an iterator, keep &#39;[]&#39; in the path.</li><li>Do not write a value to an element that doesn&#39;t already exist (must use the&#160;<strong>.append</strong> method of the Complex Data Type Parameter object to add a new element and their initial values to Complex Data Type Parameters).</li></ul> |
| --- | --- |

 To create a new **Chart Parameter**, click ![](/resources/Storage/user-manual/complex-data-type-parameters/Add%20Button.PNG).

Configure the Chart Parameter using the **Edit Parameter** dialog box.

![](/resources/Storage/user-manual/complex-data-type-parameters/Start%20Block%20-%20Edit%20Parameter.PNG)

1. Name the new parameter in **Parameter Name** (refer to naming rules above).
2. Select the **Complex Data Type** radio button.
3. Click on the name of your new parameter in the **Complex Parameter Structure** area.
4. Click ![](/resources/Storage/user-manual/complex-data-type-parameters/Add%20Button.PNG)to add a row. Name it and select the **Data Type** in the **Complex Node Editor** area on the right. For an array instead of a list, select "Complex" from the **Data Type** drop-down. This will make this entry eligible for child elements.
5. Complete the list or array as needed.
6. Click **Save** to save the parameter (or **Cancel** to quit the edits).

Naming Rules

| ![Information](/resources/Storage/user-manual/user-manual/Info.png) | Naming must conform to XML naming rules.<br><br>Element names:<br><ul><li>Case-sensitive</li><li>Must start with a letter or underscore</li><li>Cannot start with the letters xml (or XML, or Xml, etc)</li><li>Can contain letters, digits, hyphens, underscores</li><li>Cannot contain spaces</li></ul><br>Also:<br><ul><li>Parameters must have unique names</li><li>Within a complex parameter, sibling nodes must have unique names</li></ul> |
| --- | --- |

 * * *

 ## Object Functions

The **chart.getParameterValue()** function will return a Complex Data Type Parameter as a Pythonic object (dictionary, list, string, integer, real, etc., with type Date being represented in Ignition [Date](https://docs.inductiveautomation.com/display/DOC79/Dates) format). Therefore, the usual Python methods are available for data manipulation, such as:

.append()
Appends an element to a Pythonic List. Note that indexing begins at '1' instead of '0'.

Code Snippet

Code

```
list = chart.getParameterValue('@A/B[1]/C')
list.append('nine')
chart.setParameterValue('@A/B[1]/C', list)
```
Before

Code

```
<?xml version="1.0" encoding="UTF-8"?>
 <A>
    <B>
      <C>five</C>
      <C>six</C>
    </B>
    <B>
      <C>simple</C>
       <C>four</C>
    </B>
 </A>
    
   
```

After

Code

```
<?xml version="1.0" encoding="UTF-8"?>
 <A>
    <B>
      <C>five</C>
      <C>six</C>
      <C>nine</C>
    </B>
    <B>
      <C>simple</C>
      <C>four</C>
    </B>
 </A>

```


.remove()
Removes an element from a Pythonic List. Note that indexing begins at '1' instead of '0'.

Code Snippet

Code

```
list = chart.getParameterValue('@A/B[2]/C')
list.remove('four')
chart.setParameterValue('@A/B[2]/C', list)
```
Before

Code

```
<?xml version="1.0" encoding="UTF-8"?>
 <A>
    <B>
      <C>five</C>
      <C>six</C>
      <C>nine</C>
    </B>
    <B>
      <C>simple</C>
      <C>four</C>
    </B>
 </A>

```

After

Code

```
<?xml version="1.0" encoding="UTF-8"?>
 <A>
    <B>
      <C>five</C>
      <C>six</C>
      <C>nine</C>
    </B>
    <B>
      <C>simple</C>
    </B>
 </A>
   
   
```


 * * *

 ## Example 1

 In this example chart, the **Iteration Block**, **Decision Block** and **Aggregation** **Block** have the ability to utilize Chart Parameters with 'Complex Array' parameter nodes created in the **Start Block**.
 * * *
 The following example showcases a typical Chart Parameter with complex array parameter nodes, named ***NestedArray***, which is comprised of a root (***NestedArrayRoot***), a child element (***A[ ]***) of type 'Complex Array', and an array of type 'Integer' (***B[ ]***) as child of that. It is being fed a value from the calling button script. The chart iterates through each of the four ***A[ ]*** elements, and for each one, iterates through all four ***B[ ]*** elements.

 * * *

 ### Start Block

The root level of the Chart Parameter, ***NestedArray***, is created by default. It is empty and requires one or more child elements to be useful.

Child element ***A[ ]***is created as 'Complex Array' since the **Array** checkbox is checked. This creates an iterable series of  array elements, starting at 0.

Child element ***B[ ]*** is created under ***A[ ]*** as data type 'Integer Array' (since the **Array** checkbox is checked) to hold data values. It is not set as type 'Complex Array' because that would make it an iterable series of  array elements which would require at least one of its own child elements to hold data values.

![](/resources/Storage/user-manual/example-complex-array-iteration/Nested%20Iteration%20Chart_1x.png)

 * * *

 ### Iteration Block: A Loop

This block loops through each instance of the empty complex array element node ***A[ ]***, starting with 0.

Note that there are two choices in the drop-down **Array Path** menu, one for each level of the array. The first is for the empty complex array element node, ***A[ ]***, and the second is for the integer array, ***B[ ]***:

![](/resources/Storage/user-manual/example-complex-array-iteration/image2020-2-14_8-45-13.png)

**Array Path selection for "A Loop" Iteration Block**

 * * *

 ### Script Block: A Loop

This script merely outputs the current value of ***A[ ]*** to the Ignition gateway Log. In this example, each instance of ***A[ ]*** contains a dictionary of that element's associated integer array, ***B[ ]***:

***A[0] → {'B' : [0, 1, 2]}A[1] → {'B' : [10, 11, 12]}A[2] → {'B' : [20, 21, 22]}***

![](/resources/Storage/user-manual/example-complex-array-iteration/image2020-2-14_8-55-27.png)

**Log output for "A Loop" Script Block (in this example, for A[0])**

 * * *

 ### Iteration Block: B Loop

This block loops through each instance of the integer array element ***B[ ]*** at the current instance of ***A[ ]***, starting with 0.

Note that there is no longer two choices in the drop-down **Array Path** menu. The empty complex array element node, ***A[ ]***, has already been claimed by the first Iteration Block, leaving only one remaining choice (the integer array, ***B[ ]***).

![](/resources/Storage/user-manual/example-complex-array-iteration/image2020-2-14_9-1-13.png)

**Array Path selection for "B Loop" Iteration Block**

 * * *

 ### Script Block: B Loop

This script merely outputs the current integer value of ***B[ ]*** at the current instance of ***A[ ]***, to the Ignition gateway Log. In this example, each instance of ***B[ ]*** contains a series of integers previously assigned by the button script:

***A[0] / B[0] → 0A[0] / B[1] → 1A[0] / B[2] → 2***

***A[1] / B[0] → 10A[1] / B[1] → 11A[1] / B[2] → 12***

***A[2] / B[0] → 20A[2] / B[1] → 21A[2] / B[2] → 22***

![](/resources/Storage/user-manual/example-complex-array-iteration/image2020-2-14_9-6-24.png)

**Log output for "B Loop" Script Block (in this example, for A[0])**

 * * *

 ### Button Script

A window with a single Ignition **Button** component is used to:

* Name the chart to be executed (***Nested Iteration***).
* Assign integer values to each instance of integer array ***B[ ]*** in Chart Parameter ***NestedArray***.
* Pass in ***NestedArray*** and execute the chart ***Nested Iteration***.

![](/resources/Storage/user-manual/example-complex-array-iteration/Button.PNG)

![](/resources/Storage/user-manual/example-complex-array-iteration/Button%20Script.PNG)

**Ignition Button script on window**

 * * *

 ### Log Output

The Ignition gateway Log records the output from the two **Script Blocks** that use logger commands to write out the current values of ***A[ ]*** and ***B[ ]*** per the nested chart execution sequence (remember: read from bottom upwards).

![](/resources/Storage/user-manual/example-complex-array-iteration/Log.PNG)

**Sepasoft MES Module Suite**