| Prev | Next | Start of Chapter | End of Chapter | Contents | Index | (7 out of 14)

Connecting Blocks

Once you have cloned several blocks and placed them on a workspace, the next step in creating a diagram is to connect the blocks.

You will notice that the blocks on the palettes contain varying numbers and types of input and output stubs, depending on the block. A stub is a connection path that has not yet been connected. GDA blocks name all their connection stubs. A named connection stub is called a port. An input port carries data to a block, and an output port carries data from a block. If you add a connection stub to a block interactively, the stub is not named.

For example, a Numeric Entry Point has only an output stub because it is the starting point of a diagram, and an Exponential Filter has an input stub and an output stub because it takes an input value and passes an output value:


Connecting Blocks by Connecting Stubs

The majority of blocks have a fixed number of input and output stubs to which you must connect directly. The block performs its operation on the specific input path or paths that the block defines.

Some blocks have multiple input paths, all of which are fixed, where the order and meaning of the input stubs is fixed. For example, a Difference block subtracts the value on the bottom input data path from the value on the top input data path.

Suppose you want to connect the two blocks shown in the previous diagram, a Numeric Entry Point and an Exponential Filter, both of which process numbers.

To connect two blocks together:

Once you have connected two blocks together, the connection between the blocks is called a path. Notice that the path has an arrow to indicate the direction of flow of the data:



Tip: When connecting blocks, you can only connect stubs of the opposite direction together.
To see the direction of flow of any stub:


Note: You cannot delete the output stub of any block because all output stubs are named ports that the block requires to process.

Creating Vertices in Path Connections

Sometimes, a diagram requires a connection other than a straight line. One way to accomplish this is to drag a connected block to a new location to create a vertex automatically in the existing path connection:


Sometimes, the automatically created vertex is not exactly in the desired location, and sometimes, you need more than two vertices. You can create custom vertices when you create the path between two blocks.

To create path vertices when you create the path:

  1. Click on the output stub of the upstream block and hold down the mouse button.

  2. Drag the mouse to the location of the first vertex, then drag it perpendicularly to create the first vertex.

  3. Move the mouse to the location of the second vertex and click to create the vertex.

  4. Continue moving the mouse and creating vertices until you are ready to connect the block, then click on the input stub of the downstream block to connect the two stubs.

For example, here is a path connection with two vertices positioned in the middle between two blocks:


Here is a path connection with four vertices:


Deleting Paths

Sometimes you need to delete the path between two blocks to connect to other blocks.

To delete the path between two blocks:

In general, you cannot delete the default stubs on a block. If you attempt to do this by dragging the stub into the block, NOL displays a popup indicating that you are deleting a required stub:


The exception to this rule is deleting the input stubs on peer input blocks, as the following heading explains.

Connecting to Peer Input Blocks

Whereas most blocks have a fixed number of input stubs leading into the block, some blocks can have any number of input paths, where the order of the inputs is unimportant. For example, the Summation block can add together any number of inputs, and the sum is the same regardless of the order in which it adds the inputs.

Blocks that can have any number of inputs and do not require that the inputs come in a specific order are called peer input blocks, because their inputs are treated all alike or as "peers." Here are some non-peer input blocks and some peer input blocks:


When connecting to a peer input block, you can connect to an existing input stub of the block, or you can connect to the block itself. All peer input blocks have three input ports by default, but you can add or delete ports as needed. This is legal because peer input blocks do not refers to ports by name.

This figure shows Summation blocks that are connected to two, three, and four Entry Points:


To connect to a peer input block:

You can connect as many input paths into the block as required for the operation. You can also delete existing input stubs as required to make the paths evenly spaced.


Note: Peer input blocks ignore input ports that are not connected, as described in "Determining How Blocks Use No-value Inputs".
To remove an input stub:


Note: When you delete the input stubs of peer input blocks, you must leave at least one input stub on the block, otherwise the block will not function properly.
To change the size of the block to add more ports:

These are the peer input blocks that are available in NOL:







Connecting the Various Types of Paths

NOL supports a variety of path types, which carry a variety of data types. For general information on the types of paths and the data they carry, see "Using Paths".


Tip: When connecting blocks, you can only connect stubs of the same type together.
This diagram shows several different types of paths between various blocks. The diagram monitors and filters two different streams of data values. The data values are converted into truth values (true or false), using observation blocks. The truth values then flow into a logic gate, which performs a boolean AND operation on its two inputs. If the top filtered value exceeds 100 and the bottom filtered value is less than 5, then the diagram sends a control signal, which increments a counter.


Using Path Splitters

Sometimes more than one downstream block requires input from the same upstream block. To do this, connect the input stub from one block to the path joining two other blocks using a path splitter.

For example, you might want to use a single entry point as input to several different observation blocks to propagate different inference values down different paths based on the data value.

To use a single entry point as input to several blocks:

  1. Clone a Sine Wave block from the palette.

  2. Clone a Low Value observation and a High Value observation from the palette, placing them one above the other and to the right of the Sine Wave.

  3. Connect the Sine Wave to the High Value observation block.

  4. To create a path splitter, connect the input stub from the Low Value observation block to the path you just created.

The diagram looks like this. This diagram tests whether the signal is above 0 or below 0. The High Value observation block passes .true if the value is above 0, .false otherwise. The Low Value observation block passes .true if the value is below 0, .false otherwise. Observe the diagram to see how the output inference paths change.


Note that you cannot connect the output stub from a block to a path joining two blocks using a path splitter because this results in a feedback loop.


Avoiding Illegal Connections

When connecting blocks, the requirements are:

| Prev | Next | Start of Chapter | End of Chapter | Contents | Index | (7 out of 14)

Copyright © 1996, Gensym Corporation, Inc.