The motor should shut off if any of the following three conditions occurs:
The block valve is closed.
The tank level is less than 100 gallons.
The regulatory valve is less than 5 percent open.
Now we need a way to specify these requirements. The condition blocks serve this purpose. Each condition will have associated with it an expression that identifies the condition precisely in mathematical or logical terms. Expressions are made up of operands, operators, functions, constants, and keywords.
Two guidelines for writing an expression for a condition are:
The expression must end with a semi-colon (;).
Parameter values are enclosed by single quotes (').
The DeltaV system provides an Expression Editor to help you define these
expressions. After you have entered an expression, the Expression Editor checks the syntax, indicates problems, and identifies any unresolved parameters. The Expression Editor is accessed through the Object menu or context menu (right mouse click) for Action, Calculation/Logic, and Condition function blocks. The dialog box for the Expression Editor looks like this:
The Expression Editor inserts the characters shown in the following table when constructing expressions. If you type the expressions without using the Expression Editor, you need to use these characters in the same way.
Parameter Tagnames
Parameter values are defined by their tagnames (tags, for short) in the form:
module/function block/parameter
When identifying parameter tags, you can build the tags from scratch by typing them in or you can use the parameter browser, which is a tool for searching the database.
Table 4-1 Characters for Constructing Expressions
Characters Use Example
/ Precedes a reference to an internal parameter (one within the current module).
Use the Insert Internal Parameter button to browse for these parameters.
^/ Precedes a reference to an internal parameter up one block level. Use the Insert Internal Parameter button to browse for these parameters.
// Precedes a reference to an external parameter (one within another module). Use the Insert External Parameter button to browse for these parameters.
'//XV-101/DC1/PV_D.CV'
# # In Batch processing, used to enclose an alias.
: Used to separate a named set from the named set value.
'vlvnc-sp:OPEN’
:= Used to assign values. Step actions use this operator. The value of the right operand is assigned to the left operand.
'SP':='SFCCTRL:IDLE'
= Used to compare values. Similar operators include >, <, >=, <=,!= (not equal to), <> (not equal to). Transitions use these operators.
'SP'='SFCCTRL:START'
+ Used for addition of numeric values or for concatenation of strings.
' ' Single quotes are used to enclose parameters.
" " Double quotes are used to enclose strings.
; Used to continue action statements on subsequent lines of the Expression Editor.
Interlock Conditions
In this procedure, we will use the Expression Editor to specify the interlock conditions on the three condition blocks.
¾
To specify the first interlock condition (the block valve is closed)1. Click the Arrange Windows button on the toolbar (or select Window | Arrange Windows) so that you can see all the views again.
2. Select the block named CND1.
3. Click the right mouse button and select Expression from the menu to open the Expression Editor.
4. Highlight and delete the default first line of FALSE.
5. Click the Insert External Parameter button. This button browses for parameters that are external to the current parameter.
The Browse dialog box opens.
6. Double-click TANK-101.
7. Double-click these items in each succeeding level: XV-101, DC1, PV_D and CV.
The Expression Editor assembles the tagname and puts it in the Expression box.
8. Click or type “=”.
9. Click Insert Named State, browse for the named set vlvnc-pv, select the state CLOSED, and click OK.
10. Type a semicolon at the end of the expression.
The completed expression now reads as follows:
'//XV-101/DC1/PV_D.CV' = 'vlvnc-pv:CLOSED';
XV-101 is the module for the block valve; DC1 is the function block; PV_D.CV is the current value for the process value; and CLOSED is one of the states in the named set, vlvnc-pv. The expression indicates that an interlock should occur (the motor should shut off) if the block valve is closed. (A named set is simply a way to define names and equate them to integer values. Named sets are defined in the DeltaV Explorer, under System Configuration | Setup.)
11. Click Parse.
The Expression Editor checks the syntax. If there are any errors, correct them.
12. Click OK.
¾
To specify the second condition1. Select the CND2 block and use the Expression Editor to specify the interlock condition as:
'//LI-101/AI1/PV.CV'< 100;
LI-101 is the control module for the level indicator. AI1 is the analog input function block. PV.CV is the parameter for the analog input current value. The expression indicates that an interlock should occur (the motor should shut off) if the tank level goes below 100 gallons.
2. Click Parse, correct if necessary, and click OK.
¾
To specify the third condition (the regulatory valve is less than 5 percent open)1. Select the CND3 block and use the Expression Editor to specify the interlock condition as:
'//FIC-101/PID1/PV.CV' < 5;
FIC-101 is the module for controlling the outlet flow (regulatory) valve. PID1 is the loop function block, and PV.CV is the parameter indicating the current state of the valve (percent open). The expression indicates that an interlock should occur if the valve is less than 5 percent open.
2. Parse the expression and click OK.
¾
To specify the DSTs for MTR-1011. In the Function Block diagram, click the Device Control function block, DC1.
2. In the Parameter window, double-click the IO_IN_1 parameter. (This is the parameter for the run status signal.)
3. In the Properties dialog box, type XI-1 in the Device Tag field and click OK.
(If you have configured the controller and I/O channels, as described in Chapter 8, you can browse for the Device Tag under the controller.)
The parameter field is automatically set to the correct parameter, FIELD_VAL_D.
4. Double-click the IO_OUT_1 parameter. (This is the output signal from the Discrete Loop block to the field device.)
5. In the Properties dialog box, type ZX-1 in the Device Tag field and click OK.
The parameter field is automatically set to OUT_D.