| Prev | Next | Start of Chapter | End of Chapter | Contents | Glossary | Index | Comments | (4 out of 11)

Using Remote Data Service

One use of a G2 to G2 connection allows remote data service to one or more variables.

To configure the KB for remote data service:

  1. Create at least one data interface object, as described in Creating Data Interface Objects.

  2. Create one or more G2-to-G2-variables as described next, which are variables that can receive values from (and, in some cases, send data to) the remote G2 process.

Creating a G2-to-G2 Variable

A g2-to-g2 variable is a variable subclass that includes the G2-TO-G2-DATA-SERVICE as one of its direct superior classes.

To create a g2-to-g2 variable:

  1. Define a subclass of any of the system-defined variable classes, and include the mixin class G2-TO-G2-DATA-SERVICE as one of the direct superior classes. The mixin provides the additional attributes needed for G2 to G2 data service. Give the subclass any unique name.

  2. Edit the Attribute-initializations Validity-interval attribute to specify any time interval, or indefinite. Data servers other than the Inference Engine cannot have a validity interval of supplied, which is the default.

  3. Optionally, customize the new class in any other way.

  4. Create an instance of the new class and open its table.

Using the G2-TO-G2-DATA-SERVICE mixin class sets the Data-server attribute of the variable to G2 data server, and adds two additional attributes, G2-to-g2-interface-name and Remote g2-expression.

Specifying the G2 Data Interface

The G2-to-g2-interface-name attribute specifies the data interface object through which you want G2 to obtain values for the variable.

Enter the name of the data interface object that this variable should use.

Defining the Remote G2 Expression

Edit the Remote-g2-expression attribute to indicate what expression you want G2 to evaluate on the remote G2.

G2 uses this expression to compute a value for the variable. The expression can include references to any item in the remote G2, but it cannot contain references to items on the local system. For example, to get the current time from the remote machine, you could enter the current time for the Remote-g2-expression attribute.

Considering Network Access Configurations

Be aware that all items can include configuration statements that can affect network access. For example, an item could be configured with this statement:

If the expression in this attribute references a remote item configured this way, G2 will be unable to compute a value for the variable. To the local G2, an item with such a configuration statement is indistinguishable from a deactivated item.

Example of Remote Data Service

The next figure illustrates how a symbolic variable has been defined and is displaying the current run state of the remote G2, available as an attribute of the Miscellaneous Parameters system table, using the expression:

When the variable requires a value, it receives one by evaluating its expression through the kmann-to-jmann object, which is a G2-TO-G2-DATA-INTERFACE object.

A variable in the local KB can evaluate to a variable in the remote G2, simply by referring to the remote variable by name. When a local variable refers to a remote variable in this way, the two variables are further associated. If the local G2 executes a set action on the local variable, the remote G2 concludes that the remote variable is equal to the value of the local G2 variable. In this way, the local G2 can send information to (as well as receive information from) the remote G2 process.

Also, multiple variables in the local KB can use a single G2-to-g2 data-interface object through which to obtain their values, or you can create multiple data interface objects to provide remote data service to different variables.

| Prev | Next | Start of Chapter | End of Chapter | Contents | Glossary | Index | Comments | (4 out of 11)

Copyright © 1997 Gensym Corporation, Inc.