| Prev | Next | Start of Chapter | End of Chapter | Contents | Index | (3 out of 12)

Basic Block Behavior

Most blocks share a basic core of menu choices and attributes in tables. This core lets you:

This section describes how these basic menu choices and table attributes work.

For information on common attributes that you can configure for blocks, see "Specifying Initial Values", "Specifying a History of Values to Maintain", and "Specifying How to Handle Multiple Values".

Reading Notes and Errors

The Notes and Error attributes of a block display the status of the block. These attributes appear in the table for the block. You cannot edit these attributes.

To display the notes and error for a block:

The following figure illustrates the table for a High Value observation block:


Different parts of G2 write to these attributes. The G2 engine writes to the Notes attribute, and the NOL software that is built on top of G2 writes to the Error attribute.

Most of the errors you encounter while developing an application appear in a block's Error attribute. When there is no error, this attribute contains the null string (""). When NOL finds an error, it turns the color of the affected block to the error color (yellow, by default) and writes a description of the error to the Error attribute of the affected block and to the Error Queue. After you fix the error, select reset from the block's menu to clear the Error attribute.

Sometimes you will find messages in the Notes attribute. This attribute is where G2 writes status and error information. It contains OK if G2 finds no errors in the object. Note that the Notes attribute may contain OK even if NOL finds an error in the block.

Adding Comments to a Block

To add comments to an application:

The following figure shows the table for a Bias block with a text string in the Comments attribute:


To show the comments with a block:

Resetting Blocks

When you first start G2, NOL automatically resets all the blocks in the application.

Sometimes you need to reset individual blocks, for example, when an error occurs. You might also want to reset all the blocks in the application. You can reset any block manually by using a menu choice.

To manually reset an individual block:

To reset all the blocks in your diagram:

NOL displays a confirmation message before it resets all blocks and reports the status of all blocks it finds and resets them.

When you reset a block, NOL does the following:

Resetting blocks does not set the values of the attributes in the configuration table to their default values.

Evaluating Blocks

When you test an application, you sometimes need to evaluate manually a block even though it has not received new data. You can evaluate any block manually by using a menu choice.

To evaluate a block manually:

The block uses the data already in the path.

When you evaluate an entry point, the current value is propagated with a new timestamp.

When you evaluate a block with a single input control path, the block acts as if it has received a new control signal.

When you manually evaluate a block, the block uses its existing input values. Thus, for certain blocks, manually evaluating the block has no effect, for example, manually evaluating an observation block.

Overriding Block Values

When you test an application, you frequently need to override a block's output value to make sure your application responds to it correctly or to pin-point exactly where an error is happening. In addition, to test a diagram that uses entry points that have not yet been connected to a real data source, you need to override the entry point.

Many blocks let you manually change a block's output value with the override menu choice. You can override any of these types of blocks:

Entry Points
Observations
Signal Generators
Conclusion block

To override the value of a block:

  1. Select override from the block's menu.

  2. Click the type-in box that appears, enter a value, and press Return.

  3. Click OK to apply the value and close the dialog.


Tip: To apply the value and leave the dialog open, select Apply. To prevent applying the value you have entered and close the dialog, select Cancel.
Overriding the value of a block does two things:

For example, here is an override dialog for a Numeric Entry Point connected to a Summation block:


The Quality of the output path value of the block you override is manual. The Quality of the output path value for downstream blocks that calculate values based on a manual value is also manual. For example, here is the table for the output path of the Summation block in the example:


Once the block is locked, only the manual override value is propagated downstream.

Depending on the type of block whose value you are overriding, NOL displays one of several different dialogs:

When overriding... You get an override dialog with...
A data block
An edit box for entering a number
An inference block
Radio buttons for selecting .true, .false, or unknown

NOL displays a dialog box that lets you enter a value. There are five different override dialogs:

All the dialog boxes have OK, Apply, and Cancel buttons. To change the value and close the dialog box, click OK. To change the value and leave the dialog box open so you can enter different values later, click Apply. To close the dialog box without changing the value, click Cancel.

Overriding a Data Block

A data block displays the dialog box in the following figure. The dialog contains a type-in box where you can enter a number or string.

To enter a value:

  1. Click in the edit box, enter the value, and press the Return key.

  2. To pass the value, click OK or Apply.



Caution: You must press the Return key to exit the edit box before you click OK or Apply. If you do not, the dialog box will pass the value previously in the dialog box.

Overriding a Control Block

A control block displays the dialog box in this figure. The dialog box does not let you enter a value. Instead, clicking OK or Apply sends a single control signal down the block's output path.


Overriding a Discrete Inference Block

An inference block whose Logic attribute is set to discrete displays the dialog box in this figure. It contains a list of three radio buttons: one each for .true, unknown, and .false.

To override the value:

Overriding a Vector Block

When you first override the Vector Entry Point, NOL asks you to enter the dimension of the vector:


Once you specify the dimension of the vector and select OK, NOL displays a spreadsheet for editing the vector:


For information on using a spreadsheet to override a vector block, see "Using the GXL Spreadsheet to Edit Data".

Locking and Unlocking Blocks

Once you override a block's value, the block displays a lock symbol and an "M" on the icon, indicating that it is locked and the override is manual. For example:

When a block is locked, it does not respond to input or pass another value.

To let a block that you have overridden pass values normally again:

You can also manually lock a block to prevent it from passing its data downstream.

To stop a block from passing its value:

You can only lock and unlock blocks that you can also override. Typically, to prevent data from propagating downstream, you disable evaluation, as described in "Enabling and Disabling Evaluation".

Enabling and Disabling Evaluation

Sometimes you want to stop a block from passing its output value and responding to new input values. For example, you may want to disable part of your application so you can concentrate on another part.

You can enable and disable evaluation of any individual block in a diagram or all blocks on a workspace.


Caution: Enabling and disabling blocks and workspaces for evaluation is different from enabling and disabling blocks and workspaces in G2. Do not use the G2 menu choices enable and disable for blocks or KB Workspace > Enable and KB Workspace > Disable for workspaces.
By default, all blocks are enabled for evaluation. Enabling or disabling a block enables or disables any attached capabilities and restrictions as well.

To disable evaluation of a single block:

Selecting this menu choice causes the block to stop evaluating and data to stop flowing downstream from the block.

To enable evaluation of a single block:

Selecting this menu choice causes the block to evaluate, which causes data to flow downstream again.

To disable evaluation of all blocks on a workspace:

Selecting this menu choice causes all blocks on the workspace to stop evaluating.

To enable evaluation of all blocks on a workspace:

Selecting this menu choice causes all blocks on the workspace to evaluate again.


Note: When you enable or disable evaluation of blocks on an Encapsulation or Single-source Encapsulation block's workspace, you enable or disable all blocks on the workspace, including blocks on any subworkspaces of nested encapsulations.

Saving a Block's Data After Resetting G2

Blocks that store vector or data pair values can lose those values when you reset G2 or when you save the KB. These values include:

To preserve those block's values before you reset G2 or save your KB:

The block stores its values and automatically restores them when you restart G2 is or you load the file containing the KB.

To restore a block to the values it had when you last chose make permanent:

This command is useful if you have changed a block's values after you made them permanent, but you change your mind and want to undo the changes.


Note: Two blocks in the Action Utilities palette perform the same action as these menu choices: the Make Permanent block and the Restore Permanent Values block.

Clearing Block Errors

Sometimes a block produces an error when it evaluates, in which case the block turns yellow and an error message appears. You can clear the error on an individual block without resetting the block by using a menu choice. Resetting a block also clears any errors in the block, as described in "Resetting Blocks".

To clear an error in a block:

| Prev | Next | Start of Chapter | End of Chapter | Contents | Index | (3 out of 12)

Copyright © 1996, Gensym Corporation, Inc.