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).
You can specify an initial reference path during configuration. The initial path is not required and can be left blank.
The fields for a dynamic reference parameter are described in the following table.
|
Name and purpose |
Type |
Configurable |
Readable |
Writeable |
|---|---|---|---|---|
|
.$REF - Use to change or read the current parameter reference path |
String |
Yes |
Yes |
Yes |
|
.CST (Connection Status) - indicates 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) - Indicates 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 status 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 |
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, include the following:
Numeric value to string conversion
String to numeric value conversion
Equal and not equal string comparison
String concatenation
A string selection function (SELSTR) that allows selection from five string constants or string parameters, based on an integer input to the string selection function
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 parameter of type string to store the parameter reference path:
'STRINGVAR.CV' := "//INLETA/SP" 'INLET.$REF' := 'STRINGVAR.CV'
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.
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 you test the value of these fields as needed. When .$REF is empty, the dynamic reference returns Good for .CST.