Dynamic Reference Parameter

Inside this topic

Verifying Dynamic References
(Use Ctrl+F to search this topic.)

A dynamic reference parameter is a variation of the external reference parameter that lets you define a path to a value that is selected at run time during execution of the algorithm. The selection is based on information not available at configuration (for example, an operator entry, a recipe parameter passed from batch control, or a run-time value of a control variable).

The fields for a dynamic reference parameter are described in the following table.

Dynamic Reference Parameter Fields

Name and Purpose

Type

Configurable

Readable

Writable

.$REF - Provides a means
to change the parameter reference path or to read
the path currently in use
String No Yes Yes
.CST (Connection Status) - Provides a means to tell if
the reference has been resolved (that is, the value
has been found and can
be read)
Integer No Yes
-3 means 'external reference not resolved'
-2 means 'parameter not configured'
-1 means 'module not configured'
0 means 'good'
1 means 'not communicating'
No
.AWST (Asynchronous
Write Status) - Provides
a means to tell if the last attempt to write the
referenced parameter
was successful
Integer No Yes
-4 means 'write rejected'
-3 means 'external reference not resolved'
-2 means 'parameter not configured'
-1 means 'module not configured'
0 means 'success'
1 means 'not communicating'
2 means 'write pending'
No
.ST - The value of the ST
field of the referenced parameter. Use this field to copy the ST value from the dynamically referenced field to a local parameter's ST
field for use in subsequent
ST sensitive calculations.
Integer No Yes No

Note In the Expression Editor, the .CST field represents the communication status of the workstation and is parsed and validated as such in an expression. However, when the expression is downloaded, the .CST field is resolved as the reference parameter's communication status.

To allow flexibility when constructing or selecting dynamic reference paths, the use of strings is supported. A dynamic reference can be assigned a string constant (enclosed in quotation marks) or a string variable (enclosed in single quotes). Supported string functions, as described in the Strings topic, include the following:

Dynamic references are established by assigning a parameter reference path string to the .$REF field of a dynamic reference parameter. For example, if a tank has two input valves, INLETA and INLETB, the value for the dynamic reference parameter, INLET.$REF, can be assigned the setpoint of INLET_A using a statement, such as:

'INLET.$REF' := "//INLETA/SP"

Dynamic references should point to the parameter, not the field. You can now use 'INLET.CV' or 'INLET.ST', for example, in expressions to refer to the .CV and .ST fields of INLETA/SP. If you do not specify a field when using a reference in an expression, .CV is assumed.

Following is an example using a string variable to store the parameter reference path:

'STRINGVAR' := "INLETA/SP"
'INLET.$REF' := 'STRINGVAR'

The use of the .CV field of named set parameters in string expressions is not prevented. However, it only functions if the states to be used in assignments are configured to be user selectable, and, therefore, the state names are held in controllers. The use of named sets to convert integer values to path strings is not recommended since named sets are system global and, for this purpose, they must be specific to the unit module or the unit class.

Note If you do not include a reference field when using a dynamic reference, .CV is assumed. To use another field you must include that field in your reference. 

Dynamic references can be bound to module parameters or node parameters (including I/O parameters) in another node. You can also use existing (that is, non-dynamic) external reference parameters to place specific values into modules on this node.

Establishing a dynamic reference to a parameter in a unit module phase that is not loaded will not cause the phase to be loaded. Therefore, the phase attribute will not be read.

Writing a new string to the .$REF field immediately causes the values read from .CST and .AWST to go bad unless the connection is immediately established. It is recommended that the user test the value of these fields as needed. When .$REF is empty, the dynamic reference returns Good for .CST.


Verifying Dynamic References

There are facilities in diagnostics to observe unresolved references. However, it is recommended that you establish and verify dynamic references in SFC pulse/assignment type actions. If a dynamic reference is used, you should make sure that it is bound (that is, a value is assigned) before continuing the step. This can be done using pulse action confirmation or a transition condition.

To establish and verify dynamic references, the SFC expression could be written as follows: