Invoking the custom dialog box

To invoke a custom dialog associated with a compound block, the Create Dialog From Contained dialogConstants parameter in the Compound Properties dialog must be activated. When it is, you can no longer drill into the compound block. If there are no dialogConstants in a compound block, the Create Dialog Box Contained dialogConstants parameter is dimmed.

To switch between displaying the custom dialog and drilling into block hierarchy

1.    CTRL+right-click the compound block, or choose Edit > Block Properties and click the compound block.

2.    In the Compound Properties dialog, do one of the following:

To

Do this

Display the Auto Dialog

Activate Create Dialog From Contained Dialog Constants.

Enable drilling into the compound block

De-activate Create Dialog From Contained Dialog Constants.

3.    Click OK, or press ENTER.

4.                   

Examples

1. Custom dialog with five pre-selected values

This example steps you through creating an Auto Dialog with five values (0, 25, 50, 75, and 100) as inputs that have corresponding names (None, Quarter, Half, Three Quarters, and Full). The Auto Dialog ensures that only one of these values can be input, and when a name—for example, None—is selected, it displays the corresponding numeric value.

1.    Under Blocks > Signal Producers, drag a dialogConstant block into the workspace.

2.    Right-click the dialogConstant block.

3.    In the Dialog Constant Properties dialog, enter a name (Load), select the data type (Integer List), and enter the five values.

The output of the dialogConstant block will be the ordinal value of the selected item in the list, where the topmost item has a value 0.

4.    To transform the list index value to other values, wire the dialogConstant and five const blocks—with values set to 0, 25, 50, 75, and 100—to a case block:

5.    Encapsulate the dialogConstant block and associated const and case blocks in a compound block.

6.    CTRL+right-click over the Coke Machine Settings and select Create Dialog from Contained Dialog Constants.

When you right-click Coke Machine Settings, the newly created Auto Dialog containing all dialogConstant blocks appears.

2. Custom dialog with five varying data types

The dialogConstants displayed in the above Auto Dialog are:

Name of dialogConstant

Data Type

Value

Input Chip Type

Integer List

Birch

Digester Pipe Input Diameter

Double

32.5

Digester Start Level (%)

Double

50

Digester OutFlow Valve On

Boolean

1

Digester Temperature

Double

32

3. Auto Dialog box with buttons

You can logically organize dialogConstant blocks within a single Auto Dialog box to make them more easily accessible. This is accomplished in the compound block dialog using the Create Dialog From Contained Dialog Constants and the Create Buttons For Contained Compound Dialogs parameters.

For example, below is a complex battery subsystem:

Auto dialog db example

Each of the green and blue blocks is a compound block with an Auto Dialog associated with it. To access the Auto Dialog for a given compound block, right-click it. The figure below shows several of the Auto Dialogs that are accessible:

Auto Dialog example 2

To make it easier to access each Auto Dialog, you can encapsulate the entire Battery Branch subsystem in a compound block and configure the compound block to create a single Auto Dialog that provides access to each of the nested Auto Dialogs.

Auto Dialog dialog boxes 5

When you click the Battery Branch compound block, the following Auto Dialog appears:

Auto Dialog dialog boxes 6

You now have access to each of the nested Auto Dialogs by simply clicking the corresponding button in the Battery Branch custom dialog.