CG39-22r8: APACS+ ACM Standard Function Blocks

Siemens
Energy & Automation, Inc.
Configuration Guide
CG39-22
Rev: 8
August 2002
APACS+™
Advanced Control Module (ACM)
Standard Function Blocks
Version 4.40 and Higher
!Notes
CG39-22
Contents
Table of Contents
Section
Title
1.0
1.1
1.2
1.3
Introduction....................................................................................................................1-1
Product Description ......................................................................................................1-1
Product Support ............................................................................................................1-2
Related Literature .........................................................................................................1-4
2.0
Standard Function Blocks.............................................................................................2-1
3.0
3.1
3.2
3.3
3.4
3.5
3.6
3.6.1
3.6.2
3.6.3
3.6.4
3.7
3.8
3.9
3.10
3.11
3.12
3.13
3.14
3.15
3.16
3.17
3.18
3.19
3.20
3.21
3.22
3.23
Dynamic Function Blocks..............................................................................................3-1
Setpoint Function Block (SETPNT).............................................................................3-2
PID Function Block (PID)............................................................................................3-6
Auto/Manual Function Block (AM) .............................................................................3-9
PD Function Block (PD).............................................................................................3-12
ID Function Block (ID) ..............................................................................................3-15
PID Incremental Output Function Blocks ..................................................................3-17
Gain Function Block (GAIN)...............................................................................3-18
Integral Function Block (INTEGRL)...................................................................3-20
Derivative Function Block (DERIV) ...................................................................3-21
Increment-to-Position Function Block (INCRPOS) ............................................3-24
PID Error Input Function Block (Non-Interacting) (PID_ERR) ................................3-25
On/Off with Derivative Controller (ON_OFF)...........................................................3-28
Programmer Function Block (PGRMR).....................................................................3-31
Lead/Lag Function Block (LEADLAG).....................................................................3-34
Rate Limiter Function Block (RATELIM).................................................................3-36
Ramp Generator Function Block (RAMPGEN).........................................................3-37
Scaler Function Block (SCALER)..............................................................................3-40
Filter Function Block (FILTER).................................................................................3-41
Track and Hold Function Block (TRK_HLD)............................................................3-43
Impulse Function Block (IMPULSE).........................................................................3-44
Dead Time Table Function Block (DEADTIM).........................................................3-46
Delayed Error Function Block (DEL_ERR)...............................................................3-48
Batch Switch Function Block (BAT_SW) .................................................................3-49
EAM Totalizer Function Block (EAM_TOT) ............................................................3-51
Totalizer Function Block (TOTAL) ...........................................................................3-53
Accumulator Function Block (ACCUM) ...................................................................3-56
Loop Status Function Block (LP_STAT) ...................................................................3-57
4.0
4.1
4.2
4.3
4.4
4.5
4.6
4.7
4.8
Compare and Select Function Blocks ..........................................................................4-1
Equal Function Block (EQ) ..........................................................................................4-1
Inequality Function Block (NE) ...................................................................................4-2
Greater Than Function Block (GT) ..............................................................................4-2
Greater or Equal Function Block (GE).........................................................................4-3
Less Than Function Block (LT) ...................................................................................4-3
Less or Equal Function Block (LE) ..............................................................................4-4
Binary Selector Switch Function Block (SEL).............................................................4-5
Low Selector or Function Block (MIN) .......................................................................4-5
August 2002
Page
i
Contents
4.9
4.10
4.11
4.12
4.13
CG39-22
High Selector Function Block (MAX) .........................................................................4-6
Middle of Three Selector Function Block (MID_SEL)................................................4-7
Limiter Function Block (LIMIT)..................................................................................4-7
Multiplexer Switch Function Block (MUX).................................................................4-8
State Function Block (STATE) ....................................................................................4-9
5.0
5.1
5.2
5.3
5.4
5.5
5.6
5.7
5.8
Logic Function Blocks ...................................................................................................5-1
AND Function Block (AND) .......................................................................................5-1
OR Function Block (OR)..............................................................................................5-2
Exclusive OR Function Block (XOR) ..........................................................................5-2
NOT Function Block (NOT) ........................................................................................5-3
SR Flip-Flop Function Block (SR) ...............................................................................5-3
RS Flip-Flop Function Block (RS) ...............................................................................5-4
Rising Edge Detect Trigger Function Block (R_TRIG)...............................................5-5
Falling Edge Detect Trigger Function Block (F_TRIG) ..............................................5-6
6.0
6.1
6.2
6.3
6.4
Shift and Rotate Function Blocks.................................................................................6-1
Shift Left Function Block (SHL)..................................................................................6-1
Shift Right Function Block (SHR) ...............................................................................6-2
Rotate Left Function Block (ROL)...............................................................................6-2
Rotate Right Function Block (ROR) ............................................................................6-3
7.0
7.1
7.2
7.3
7.4
7.5
7.6
7.7
7.8
7.9
7.10
7.11
7.12
7.13
7.14
7.14.1
7.14.2
7.14.3
7.15
7.15.1
7.15.2
7.15.3
7.16
Arithmetic Function Blocks ..........................................................................................7-1
Addition Function Block (ADD) ..................................................................................7-1
Subtraction Function Block (SUB)...............................................................................7-2
Multiplication Function Block (MUL) .........................................................................7-3
Division Function Block (DIV) ....................................................................................7-3
Square Root Function Block (SQRT)...........................................................................7-4
Absolute Value Function Block (ABS) ........................................................................7-4
Linear Characterizer Function Block (LINCHR) .........................................................7-5
Weighted Average Function Block (WT_AVG) ..........................................................7-6
Moving Average Function Block (MOV_AVG)..........................................................7-7
Logarithm Base 10 Function Block (LOG) ..................................................................7-9
Exponentiation Function Block (EXPT) ......................................................................7-9
Natural Logarithm Function Block (LN)....................................................................7-10
Natural Exponentiation Function Block (EXP)..........................................................7-10
Trigonometric Function Blocks..................................................................................7-11
Sine Function Block (SIN)...................................................................................7-11
Cosine Function Block (COS) .............................................................................7-12
Tangent Function Block (TAN) ...........................................................................7-12
Inverse Trigonometric Function Blocks .....................................................................7-13
Arcsine Function Block (ASIN)...........................................................................7-13
Arccosine Function Block (ACOS) .....................................................................7-14
Arctangent Function Block (ATAN) ...................................................................7-14
Conversion Function Block (CONVERT)..................................................................7-15
8.0
8.1
8.2
8.3
Move Function Blocks ...................................................................................................8-1
Data Move Function Block (MOVE) ...........................................................................8-1
Set Value Funtion Block (SET_VAL)..........................................................................8-3
Set Bit Function Block (SET_BIT) ..............................................................................8-4
ii
August 2002
CG39-22
Contents
9.0
9.1
9.2
9.3
9.4
9.5
9.6
Communications Function Blocks................................................................................9-1
Send and Receive Communication Blocks (SEND, RCV)...........................................9-2
Un-interlocked Send and Un-interlocked Receive Blocks (USEND, URCV) .............9-4
Read Function (READ) ................................................................................................9-5
Write Function Block (WRITE) ...................................................................................9-8
Broadcast-in and Broadcast-out Function Blocks (BCSTIN, BCSTOUT) ................9-10
Connect Function Block (CONNECT).......................................................................9-13
10.0
10.1
10.2
10.3
10.4
10.5
Timing Function Blocks ..............................................................................................10-1
On-Delay Timer Function Block (TON) ....................................................................10-1
Off-delay Timer Function Block (TOF) .....................................................................10-2
Retentive Timer Function Block (ROT).....................................................................10-3
Timed Pulse Function Block (TP) ..............................................................................10-5
Repeat Cycle Timer Function Block (RECYCL) .......................................................10-6
11.0
11.1
11.2
11.3
Counting Function Blocks...........................................................................................11-1
Up Counter Function Block (CTU) ............................................................................11-1
Down Counter Function Block (CTD) .......................................................................11-2
Up/Down Counter Function Block (CTUD) ..............................................................11-3
12.0
12.1
12.2
12.3
12.4
Alarm Function Blocks................................................................................................12-1
HLL Analog Alarm Function Block (HLLAALM)....................................................12-1
HLL Analog Alarm 4 Function Block (HLLAA4).....................................................12-8
HLL Discrete Alarm Function Block (HLLDALM) ................................................12-14
HLL Discrete Alarm 1 Function Block (HLLDA1) .................................................12-17
13.0
13.1
13.1.1
13.1.2
13.2
13.2.1
13.2.2
13.2.3
13.2.4
13.2.5
13.3
13.3.1
13.3.2
13.3.3
13.3.4
13.4
13.4.1
13.4.2
13.5
13.5.1
13.5.2
13.5.3
13.6
Array Function Blocks ................................................................................................13-1
Matrix Dimensions Function Blocks ..........................................................................13-1
Find Matrix Dimension Function Block (MAT_DIM) ........................................13-2
Matrix Bounds Function Block (MAT_BND) .....................................................13-2
Matrix Move Function Blocks....................................................................................13-3
Matrix Load Function Block (MATLOAD) ........................................................13-3
Matrix Unload Function Block (MATUNLD).....................................................13-5
FIFO Function Block (FIFO) ...............................................................................13-6
LIFO Function Block (LIFO)...............................................................................13-9
Matrix Copy Function Block (MATCOPY) ......................................................13-11
Arithmetic Matrix Blocks.........................................................................................13-13
Matrix Add, Subtract, Multiply , Divide Function Blocks.................................13-13
Matrix Bias Function Block (MATBIAS) .........................................................13-16
Matrix Scaler Function Block (MATSCLR)......................................................13-18
Matrix Square Root Function Block (MATSQRT)............................................13-20
Logic Matrix Function Blocks..................................................................................13-21
Matrix AND, OR, XOR Function Blocks (MAT_AND, MAT_OR, MAT_XOR)13-22
Matrix NOT Function Block (MAT_NOT) .......................................................13-24
Fan In/Out Function Blocks .....................................................................................13-26
Boolean Fan-In Function Block (BFAN_IN).....................................................13-26
Array Fan-In Function Block (AFAN_IN) ........................................................13-27
Matrix Fan-Out Function Block (FAN_OUT) ...................................................13-28
Index Check Function Block (INDXCHK) ..............................................................13-28
August 2002
iii
Contents
CG39-22
14.0
14.1
14.2
14.3
Data Quality Function Blocks.....................................................................................14-1
Quality Check Function Block (QUAL_CK) .............................................................14-1
Basic Quality Function Block (QUALBAS) ..............................................................14-2
Set Quality Function Block (SETQUAL)...................................................................14-3
15.0
15.1
15.2
Chart Function Blocks.................................................................................................15-1
Chart Mode Function Block (CHRTMOD .................................................................15-1
Chart Data Function Block (CHRTDTA)...................................................................15-4
16.0
16.1
16.2
16.3
16.4
16.5
16.6
16.7
16.8
16.9
16.10
16.11
16.12
16.13
16.14
Resource Blocks ...........................................................................................................16-1
Error Log Function Block (ERR_LOG) .....................................................................16-1
Error Status Function Block (ERRSTAT)..................................................................16-4
Memory Statistics Function Block (MEMSTAT) ......................................................16-6
Partial I/O Scan Function Block (PART_IO).............................................................16-8
Real-time Clock Block (RTC) ....................................................................................16-9
Redundancy Control Block (REDCTRL).................................................................16-10
Resource Status Block (RSCSTAT).........................................................................16-11
Security Control Block (SECURTY) .......................................................................16-14
Time Synchronization Function Block (TIMESYNC).............................................16-16
Total I/O Scan Function Block (TOT_IO) ...............................................................16-23
Module Information Function Block (MODINFO)..................................................16-25
System Information Block (SYSINFO)....................................................................16-28
Resource Alarm Block (RSCALRM).......................................................................16-30
Clock Block (CLOCK) .............................................................................................16-33
17.0
Hold Function Blocks (HLD****) ..............................................................................17-1
18.0
18.1
18.2
18.3
18.4
18.5
18.6
18.7
18.8
18.9
18.10
18.11
String Function Blocks ................................................................................................18-1
String Length Block (LEN) ........................................................................................18-1
Leftmost Characters of String (LEFT) .......................................................................18-2
Rightmost Characters of String (RIGHT)...................................................................18-3
Middle Characters of String (MID) ............................................................................18-3
Concatenate String Characters (CONCAT)................................................................18-4
Insert Characters into String Block (INSERT) ...........................................................18-5
Delete Characters in a String (DELETE) ...................................................................18-6
Replace String Characters Block (REPLACE)...........................................................18-7
Find String Characters Block (FIND).........................................................................18-8
Make APACS Path Block (PATHMAK) ...................................................................18-8
APACS Path Split Block (PATHSPL) .......................................................................18-9
19.0
19.1
19.2
19.3
Diagnostic Function Blocks.........................................................................................19-1
Get Time Block (GTTIME)........................................................................................19-1
Memory Read Block (MEM_READ).........................................................................19-1
Memory Statistic Block (MEM_STAT).....................................................................19-1
iv
August 2002
CG39-22
Contents
List of Tables
Table
Title
Page
Table 1–2 TIC Contact Information..........................................................................................................1-3
Table 3–1 Loop Status Word Logic States .............................................................................................3-59
Table 7–1 Conversion Between Data Types (Part 1)..............................................................................7-15
Table 8–1 Behavior of Elements Directly Connected to a Disabled MOVE Block .................................8-2
Table 12–1
Table 12–2
Table 12–3
Table 12–4
Status and CMD Output Values...........................................................................................12-4
CMD Values ......................................................................................................................12-12
CMD Values ......................................................................................................................12-15
CMD Values ......................................................................................................................12-18
Table 16–1
Table 16–2
Table 16–3
Table 16–4
Status Output Diagnostic Messages...................................................................................16-20
Track Output Messages......................................................................................................16-22
Resource Alarms................................................................................................................16-30
Resource Alarm Block Softlist Parameters........................................................................16-32
List of Illustrations
Figure
Title
Figure 2–1
Figure 2–2
Typical Function Block ...................................................................................................2-1
Data Type Assignment Example .....................................................................................2-2
Figure 13–1
Figure 13–2
Figure 13–3
Figure 13–4
Matrix Load Operation ..................................................................................................13-3
Matrix Unload Operation...............................................................................................13-5
First In First Out Operation ...........................................................................................13-7
Last In First Out Operation ..........................................................................................13-10
Figure 15–1
CHRTMOD Function Block..........................................................................................15-2
August 2002
Page
v
Contents
CG39-22
Significant Changes for Revision 8
Entire document updated for consistency with current Help Files.
Siemens Energy & Automation, Inc., assumes no liability for errors or omissions in this document or for the application and use of
information included in this document. The information herein is subject to change without notice.
Procedures included in this document have been reviewed for compliance with applicable approval agency requirements and are considered
sound practice. Neither Siemens Energy & Automation, Inc., nor these agencies are responsible for repairs made by the user.
ProcessSuite, QUADLOG, 4-mation, and APACS+ are trademarks of Siemens Energy & Automation, Inc. All other trademarks are the
property of their respective owners.
© 2002 Siemens Energy & Automation, Inc. All rights reserved.
vi
August 2002
CG39-22
1.0
Introduction
Introduction
This Configuration Guide describes the standard function blocks used to configure the APACS+
Advanced Control Module (ACM). These function blocks are configuration elements used by
ProcessSuite® 4-mation™ software to configure APACS+ process automation systems.
This guide is intended to be used in conjunction with the configuration procedures located in Using the
ProcessSuite 4-mation Configuration Software (document number CG39-20). It contains the following
sections:
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
1.1
Section 1, Introduction
Section 2, Standard Function Blocks
Section 3, Dynamic Function Blocks
Section 4, Compare and Select Function Blocks
Section 5, Logic Function Blocks
Section 6, Shift and Rotate Function Blocks
Section 7, Arithmetic Function Blocks
Section 8, Move Function Blocks
Section 9, Communications Function Blocks
Section 10, Timing Function Blocks
Section 11, Counting Function Blocks
Section 12, Alarm Function Blocks
Section 13, Array Function Blocks
Section 14, Data Quality Function Blocks
Section 15, Chart Function Blocks
Section 16, Resource Function Blocks
Section 17, Hold Function Blocks
Section 18, String Function Blocks
Section 19, Diagnostic Function Blocks
Product Description
The Function Block language is primarily used to configure function block networks. A function block
network consists of a series of function blocks connected to perform a regulatory control application.
Each function block within the network processes input variables and provides one or more outputs.
This document provides a graphic symbol, description, and detailed reference information for each of the
standard (factory supplied) function blocks included as an integral part of 4-mation.
A function block network is graphically analogous to signal flow. Signal flow is from the output (right)
side of a function block to the input (left) side of another function block.
Some function blocks are extensible. This means the standard number of inputs accepted by the block
can be extended.
August 2002
1-1
Introduction
1.2
CG39-22
Product Support
Product support can be obtained from a Technical Information Center (TIC). Each regional TIC is a
customer service center that provides direct telephone support on technical issues related to the
functionality, application, and integration of all products supplied by Siemens regional TIC contact
information is provided in Table 1–1. Your regional TIC is the first place you should call when seeking
product support information. When calling, it is helpful to have the following information ready:
•
Caller name and company name
•
Product part number or model number and version
•
If there is a problem with product operation:
- Whether the problem is intermittent
- The steps performed before the problem occurred
- Any error messages or LED indications displayed
- Installation environment
Customers that have a service agreement (ServiceSuite or Field Service Agreement) are granted access to
the secure area of our Web site (http://www.smpa.siemens.com/TechServices/TechLibrary.asp). This area
contains a variety of product support information. To log on, you will be prompted to enter your
username and password.
1-2
August 2002
CG39-22
Introduction
Table 1–1 TIC Contact Information
TIC
NORTH AMERICA
Tel:
+1 215 646 7400, extension 4842
Fax:
+1 215 283 6343
E-mail:
Hours of Operation:
Secure Web Site:
TIC
ASIA
8 a.m. to 5 p.m. eastern time
Monday – Friday (except holidays)
www.smpa.siemens.com/techservices
Tel:
+65 299 6051
Fax:
+65 299 6053
E-mail:
Hours of Operation:
Secure Web Site:
TIC
EUROPE
[email protected]
[email protected]
9 a.m. to 6 p.m. Singapore time
Monday – Friday (except holidays)
www.smpa.siemens.com/techservices
Tel:
+44 1935 470172
Fax:
+44 1935 706969
E-mail:
[email protected]
Hours of Operation:
8:30 a.m. to 5:15 p.m. GMT/BST
Monday – Thursday
(except holidays)
8:30 a.m. to 4:00 p.m. GMT/BST
Friday (except holidays)
Secure Web Site:
August 2002
www.smpa.siemens.com/techservices
1-3
Introduction
1.3
CG39-22
Related Literature
The following literature is available from Siemens. Generally, all needed documentation is supplied on a
CD-ROM supplied with your system. Refer to it as needed or as directed in text.
•
Getting Started with ProcessSuite 4-mation Configuration Software (document number SG39-12)
•
Using the ProcessSuite 4-mation Configuration Software (document number CG39-20)
•
ProcessSuite 4-mation Configuration Software Messages and Diagnostic Codes (document number
CG39-21)
The document files are in the Adobe® Acrobat® portable document format (PDF). You will need the
Acrobat Reader to view or print them. This reader is also provided on the CD.
"
1-4
August 2002
CG39-22
2.0
Standard Function Blocks
Standard Function Blocks
Standard function blocks are configuration elements within the Advanced Control Module (ACM) system
software supplied with 4-mation. These blocks provide a set of commonly used functions to ease
configuration tasks. They were designed to comply with the IEC 61131-3 standard and can be used in
any of the available configuration languages according to the rules of that language. For example, in a
Sequential Function Chart (SFC), a function block only can be used in the body of action or transition.
Function blocks can have multiple inputs and outputs. Generally, inputs enter on the left of the block and
outputs depart from the right of the block.
Each function block has a type name located inside the block at the top. This name describes the
function the block performs or what type of block it is. For example: ADD, PID, and XOR are type
names and they describe the function of each block. Function blocks can be assigned an instance name
to uniquely identify the block. Instance names are located on top of the block, outside the block
boundary. However, it is only necessary to assign an instance name to a function block when reading the
inputs or writing to either the outputs or softlist parameters externally (from outside the control module).
Figure 2–1 shows the basic graphical form of a function block.
INSTANCE_NAME
TYPE_NAME
Data Type
INPUT1
OUTPUT1
Data Type
Data Type
INPUT2
OUTPUT2
Data Type
Figure 2–1 Typical Function Block
Generally, function blocks that accept inputs of ANY or ANY_NUM data type have outputs of ANY or
ANY_NUM data type. Each function block assumes that all of the ANY (or ANY_NUM) inputs are the
same data type as the first ANY (or ANY_NUM) input assigned. The mixing of data types on the inputs
and outputs of a block is not prevented, but it may lead to unpredictable results. Function blocks labeled
with the ANY (or ANY_NUM) data type on an output must have a local variable on the output or must be
wired to a typed input to assign the data type. A missing data type on an output is indicated in the on-line
mode by the TAG NOT FOUND error code on the output.
If an ANY or ANY_NUM type output is wired to an ANY or ANY_NUM type input of another block, a
default of REAL is assigned as the data type. To change the default of REAL type to a different data
type, the output could be wired to any variable (local or global) of the correct data type (see Figure 2–2).
After the network is downloaded, the added variable can be deleted; the function block output will retain
the correct data type.
August 2002
2-1
Standard Function Blocks
CG39-22
Integer
Local Variable with
Data Type of Integer
00001125
Figure 2–2 Data Type Assignment Example
The standard function blocks are divided into sections according to function. For example, the
Dynamic function blocks all perform time-dependent functions, the Selection function blocks all
perform selection functions, etc. The entire collection of standard function blocks are described
in the remaining sections of this Guide.
"
2-2
August 2002
CG39-22
3.0
Dynamic Function Blocks
Dynamic Function Blocks
The Dynamic function blocks are a subset of the standard function blocks. They execute complex
equations that are time dependent. Since time is a variable in these equations, these function blocks have
knowledge of the execution time interval (defined as the time period between the input sample and the
implementation of the output to the process). This is accomplished by using a fixed execution period for
function blocks. If derived coefficients of tuning parameters are used, these coefficients will be updated
whenever the execution interval of the function block changes.
The inputs, outputs, and softlist parameters use engineering units. Control inputs use BOOL type data as
they represent TRUE/FALSE parameters.
Generally, tuning parameters are available in a softlist and are not hard-wired to the blocks. Softlist
parameters can be initialized at configuration time and can be modified on-line using 4-mation’s Softlist
dialog box or with a Set Value (SET_VAL) function block.
For memory usage and ACM execution time information on all standard configuration elements see
Appendix C in Using the ProcessSuite 4-mation Configuration Software (document number CG39-20).
A listing of Dynamic function blocks is presented here. Individual blocks are detailed in the subsections
that follow.
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
Setpoint
PID
Auto/manual
PD
ID
PID Incremental Output
PID Error Input
On/Off
Programmer
Lead/Lag
Rate Limiter
Ramp Generator
Scaler
Filter
Track and Hold
Impulse
Dead Time
Delayed Error
Batch Switch
EAM Totalizer
Totalizer
Accumulator
Loop Status
August 2002
3-1
Dynamic Function Blocks
3.1
CG39-22
Setpoint Function Block (SETPNT)
SETPNT
REAL
BOOL
REAL
BOOL
REAL
BOOL
PV
AUTO
ESP
EXTRNL
TARGET
RAMP
SP
ISP
CSP
LL
HL
RTIME
HOLD
REAL
REAL
REAL
BOOL
BOOL
TIME
BOOL
The symbol of the Setpoint function block is shown above. The setpoint (SP) can be derived from two
user-specified sources:
•
Internal setpoint (ISP)
•
External setpoint (ESP)
The setpoint is limited by both low and high softlist limits (LOLIM and HILIM) which prevent the
setpoint from being inadvertently driven beyond a process operating limit. The internal setpoint can be
changed via the (ISP) output, the computer setpoint (CSP), or the Setpoint function block itself (in track
or ramp mode). A SET_VAL function block can also be used to change the (ISP).
The Setpoint function block may write either the track variable, (PV) (presumably the control loop
process variable), or the external setpoint (ESP) to its internal setpoint, depending on the modes and
options selected. The computer setpoint is typically written to by an operator command to change the
internal setpoint. The (SP) value is assigned to (CSP) as well, thus making the (CSP) the only variable to
which an external device needs to interface; however, it is preferred that an external device read the (SP)
output and write to the (ISP) output. All values are in engineering units. An additional internal setpoint
copy exists in the softlist (SLIST_SP) to retain the (ISP) value for use after a download. During on-line
execution, the softlist value is only used when it has been changed by command or via softlist download.
The Setpoint function block has a ramping feature that allows you to create a ramping setpoint. Ramping
is allowed only when (AUTO) is TRUE and (EXTRNL) is FALSE. The ramp start point is the ISP. You
are to enter a target endpoint (TARGET) and either a ramp time (RTIME) or a ramp rate (RRATE). The
USE_RRATE_SW softlist switch determines which parameter is used (RTIME) or (RRATE). If
USE_RRATE_SW is FALSE, (RTIME) is used; if USE_RRATE_SW is TRUE, (RRATE) is used.
When (RAMP) makes a transition from FALSE to TRUE, the block initializes the ramp mode. As long
as (RAMP) is TRUE, (AUTO) is TRUE, and (EXTRNL) is FALSE, ramping is in effect. The SETPNT
function block does not ramp while in manual or external modes. If the block goes into external or
manual while it previously had been in automatic and ramping, the ramping mode is turned off. To reenable ramping, the block has to be placed into internal mode (EXTRNL)=FALSE, into automatic mode
(AUTO)=TRUE and then placed in the ramp mode (RAMP)=TRUE. The (OUT) output reflects the
ramping of the block and the (RTIME) output decrements to show the remaining ramp time. The RRATE
must always be entered as positive; ramp direction is based on the relationship of the target and the
starting point. RRATE is updated if (RTIME) is used, and (RTIME) is updated if RRATE is used. The
(ISP) cannot be changed if ramping is active.
3-2
August 2002
CG39-22
Dynamic Function Blocks
NOTE
The ramp mode is not be initialized if either (RTIME)=0 or if both
USE_RRATE_SW is FALSE and RRATE=0.
The HOLD mode is in effect if the (RAMP) input changes from TRUE to FALSE while the (RTIME) is
greater than zero. The (HOLD) output is TRUE to indicate this mode. While in the hold mode, the (SP)
output is held at its last value. After a FALSE to TRUE transition of the (RAMP) input while (RTIME) is
greater than zero but less than its initial value, the ramp mode is continued. The ramp mode can be
continued in two different ways. First, if none of the three ramp parameters (TARGET, RTIME or
RRATE) have changed, the ramp is continued using the same ramp rate as previous to the HOLD mode,
and the current ISP as the restart value; however, the remaining ramp time (RTIME) is recalculated.
Secondly, if any of the three ramp parameters (TARGET, RTIME, or RRATE) have changed, the new
inputs are used just as if the ramp mode was being initialized for the first time. When the (TARGET) has
been reached, the (RAMP) input is reset. To cancel a ramp, first place the block in hold mode (RAMP) =
FALSE, set the (RTIME) value to zero for a time mode ramp, or the (RRATE) value must be set to zero
for a rate mode ramp.
NOTE
When a ramp is finished, the (RAMP) input is reset (RAMP)=FALSE.
SETPNT FUNCTION BLOCK DIAGRAM
ISP
CSP CHANGE
OCCURRED
VIA COMMAND
(MOMENTARY)
RAMP
PVTRK &
-AUTO
ESPTRK &
EXTRNL
. . .F
EXTRNL
.T . . .F . .F
CSP
T
.T . .ISP .F .
T
.
ISP
TARGET
RAMP
AUTO
PV
ESP
August 2002
F
RAMP
FUNCTION
LL
HL
SP
T
RTIME
HOLD
CSP
LOLIM
HILIM
3-3
Dynamic Function Blocks
CG39-22
The inputs and outputs of the Setpoint (SETPNT) function block are defined as follows:
PV
This is an input variable for internal setpoint tracking. This input is typically the control
loop process variable in a simple single loop control application.
AUTO
This is the Auto Mode input. When (EXTRNL) is FALSE and (AUTO) is TRUE,
(SP)=(ISP) if (ISP) does not exceed the limits LOLIM and HILIM
ESP
This is the External setpoint input.
EXTRNL This is the External Mode input. When (EXTRNL) is TRUE, (SP)=(ESP) if (ESP) does
not exceed the limits LOLIM and HILIM.
TARGET This is the endpoint to which the block is ramping and will indicate direction of the
ramp.
RAMP
This is the ramp mode input. When TRUE, the block is in ramp mode. This input is
automatically set to FALSE when a ramp is finished.
SP
This is the calculated output (setpoint) variable that is subject to limits.
ISP
This is the Internal setpoint output
CSP
This is the Computer setpoint output.
LL
This is a Boolean output which is TRUE when the algorithm is imposing a low limit on
(SP), i.e. (ESP) or (ISP) is less than LOLIM.
HL
This is a Boolean output which is TRUE when the algorithm is imposing a high limit on
(SP), i.e. (ESP or ISP) is greater than HILIM
RTIME
This is the ramp time output. It is a TIME data type. It can be written to as a duration
variable in the format T#?d?h?m?s?ms.
HOLD
This is the ramp hold status output.
3-4
August 2002
CG39-22
Dynamic Function Blocks
Softlist Parameters
The remaining SETPNT inputs are accessed via the softlist. The value of these inputs can be changed via
commands from an operator interface or a Set Value (SET_VAL) function block, but they cannot be
“wired” to the block. Below is a description and initial value for each softlist parameter.
SLIST_SP
This is the Internal setpoint of the softlist array.
LOLIM
This is the setpoint low limit softlist input.
HILIM
This is the setpoint high limit softlist input.
RRATE
This is the ramp rate softlist input. It is a real value entered in
engineering units per minute; it must be positive.
USE_RRATE_SW
This is the softlist switch which, when FALSE, means use the
(RTIME) value to calculate the RRATE and, when TRUE, means
use the RRATE value to calculate the (RTIME).
PVTRK
This is a boolean softlist parameter. Setting PVTRK=TRUE
causes the Internal setpoint to track the (PV) Input when
ESPTRK=FALSE or (EXTRNL)=FALSE and (AUTO)=FALSE.
ESPTRK
This is a boolean softlist parameter. Setting ESPTRK=TRUE
causes the Internal setpoint to track the External setpoint when
(EXTRNL)=TRUE.
Parameter
Units
Initial Value
Min Value
Max Value
SLIST_SP
Engr
0.0
NA
NA
LOLIM
Engr
0.0
LOLIM must be less than HILIM
HILIM
Engr
100.0
HILIM must be greater than LOLIM
RRATE
Engr/Min
0.0
NA
NA
USE_RRATE_SW
BOOL
FALSE
FALSE
TRUE
PVTRK
BOOL
TRUE
FALSE
TRUE
ESPTRK
BOOL
TRUE
FALSE
TRUE
Where NA indicates not applicable.
August 2002
3-5
Dynamic Function Blocks
3.2
CG39-22
PID Function Block (PID)
PID
REAL
REAL
REAL
BOOL
BOOL
PV
SP
FDBK
AUTO
INIT
OUT
ERR
REAL
REAL
The symbol of the PID function block is shown above. This block performs the functions of a standard
Proportional-Integral-Derivative controller. It can also be used as a PI controller by setting the derivative
time equal to 0.0 min. This block utilizes reset feedback, allowing for various control schemes including
override, reset limiting, etc. When (AUTO) = FALSE, the block is in tracking mode [(OUT) = FDBK)].
The PID block inputs ((PV), (SP), (FDBK)) and the outputs ((OUT), (ERR)) are in engineering units.
The PID equation is defined using normalized values. Engineering values are converted to and from
normalized values with user-defined operating limits for both the process input and process output. The
operating limits are obtained from the process flowsheets or sensor/actuator ranges. Any transition of the
(INIT) input causes execution of the initialization equations which recalculate the reset component so that
the (OUT) output will not experience a bump due to proportional action.
NOTE
Normal limits for the TI softlist value are from 0.001 to 4000.0. In the
special case of TI = 4000.0, all integral action is removed from the
output calculation.
The internal structure of the PID block is shown in the following diagram:
3-6
August 2002
CG39-22
Dynamic Function Blocks
PID FUNCTION BLOCK DIAGRAM
AUTO
τ DS
PV
> τD
S+1
DG
+
>
Σ
+
>
+
> A
Σ
-
+
> PG
>
+
+
-1
..
.
F
> OUT
Σ
> ERR
T
Σ
R
SP
1
> τ S+1
I
FDBK
+
PV
>
-
SP
The inputs and outputs of the PID function block are defined as follows:
PV
This is the process variable input.
SP
This is the setpoint input.
FDBK
This is the reset feedback input.
AUTO
This is the track command input. When this input is FALSE, the block
is in a tracking mode [(OUT)=(FDBK)]. In addition, transitions of this
input cause initialization to be performed.
INIT
This is a second mode/status input to the block. Transitions of the INIT
input cause the initialization equation to be performed but does not cause
the mode of the block to change. Initialization causes the reset
component to be recalculated so that (OUT) remains the same. This
input is typically used to cause initialization upon changes in the source
of the setpoint (e.g. internal-to-external or external-to-internal).
OUT
This is the calculated output. It is limited from -3.3 to +103.3% of
range EOUTL to EOUTH.
ERR
This is the error output [(PV) - (SP)].
August 2002
3-7
Dynamic Function Blocks
CG39-22
Softlist Parameters
The tuning coefficients (PG, TI, TD, DG) and the remaining PID inputs are accessed via the softlist.
PG
This is the Proportional Gain input to the block.
TI
This is the Integral Time input (in minutes per repeat) to the
block.
TD
This is the Derivative Time input to the block.
DG
This is the Derivative Gain input to the block.
DIR_ACT
This is a boolean input to the block that determines the action
of the controller. TRUE signifies direct action (A=1) and
FALSE signifies reverse action (A=-1).
EINL
This is the (PV) low value in engineering units used for
scaling.
EINH
This is the (PV) high value in engineering units used for
scaling.
EOUTL
This is the (OUT) low value in engineering units used for
scaling.
EOUTH
This is the (OUT) high value in engineering units used for
scaling.
ADAPTIVE_PG_INIT
This is the Boolean value that when FALSE, suppresses the
initialization of the block upon changes of the PG parameter,
which is necessary to implement a continuously adaptive gain
circuit. When TRUE, normal initialization occurs when the
PG softlist parameter value is modified.
3-8
Parameter
Units
Initial Value
Min Value
Max Value
PG
dimensionless
0.001
0.001
100.0
TI
Min/repeat
4000.0 (OFF)
0.001
4000.0
TD
Min
0.0 (OFF)
0.0
100.0
DG
dimensionless
10.00
2.0
20.0
DIR_ACT
BOOL
FALSE
FALSE
TRUE
EINL
Engr units
0.0
NA
NA
EINH
Engr units
100.0
NA
NA
August 2002
CG39-22
Dynamic Function Blocks
EOUTL
Engr units
0.0
NA
NA
EOUTH
Engr units
100.0
NA
NA
ADAPTIVE_PG_INIT
BOOL
TRUE
FALSE
TRUE
Where NA indicates not applicable.
3.3
Auto/Manual Function Block (AM)
AM
REAL
BOOL
REAL
BOOL
IN
AUTO
EXTV
STNDBY
OUT
IOUT
COUT
LL
HL
REAL
REAL
REAL
BOOL
BOOL
The symbol of the Auto/Manual (AM) function block is shown above. This block can be used to write
either the Input (IN) or the External Variable (EXTV) to its Internal Output (IOUT), depending on the
modes and options selected. (OUT) can be derived from either of two sources, Internal Output (IOUT)
and External Variable (EXTV). (OUT) is limited by both low and high limit (LOLIM and HILIM)
softlist parameters. The purpose of these output limits is to prevent the output from being inadvertently
driven beyond a process or hardware operating limit. The Internal Output value can be changed via the
(IOUT) output, the Computer Output (COUT), or the Auto/Manual function block itself (in track mode).
The Computer Output is typically written to by an operator command to change the Internal Output. The
function block assigns the (OUT) value to (COUT) as well, thus making the (COUT) the only variable to
which an external device needs to interface; however, it is preferred that an external device read the
(OUT) output and write to the (IOUT) output. All values are in Engineering Units.
An additional internal copy of the output (OUT) exists in the softlist (SLIST_OUT) to retain the (IOUT)
value for use after a download. During on-line execution, the softlist value is ONLY used when it has
been changed by command or softlist download.
August 2002
3-9
Dynamic Function Blocks
CG39-22
AM FUNCTION BLOCK DIAGRAM
IOUT
COUT CHANGE
OCCURRED
VIA COMMAND
(MOMENTARY) INTRK &
AUTO EXTTRK &
STNDBY
IOUT F
F
F
IOUT
T
COUT
T
T
.. .
.
..
.. .
IN
AUTO
STNDBY
. . .F
.T . .
T
LL
HL
F
OUT
COUT
LOLIM
EXTV
HILIM
The inputs and outputs of the AM block are defined as follows:
IN
This is an Input variable for internal output tracking. This input should be the PID
function block's output in a simple single loop control application.
AUTO
This is the Auto Mode input. When (STNDBY) is FALSE and (AUTO) is FALSE,
(OUT)=(IOUT) if (IOUT) does not exceed the limits LOLIM and HILIM. When
(STNDBY) is FALSE and (AUTO) is TRUE, (OUT)=(IN) if IN does not exceed the
limits LOLIM and HILIM.
EXTV
This is the External Variable input.
STNDBY
This is the Standby Mode input. When (STNDBY) is TRUE,
(OUT)=(EXTV) if (EXTV) does not exceed the limits LOLIM and HILIM.
OUT
This is the calculated output variable that has been limited.
IOUT
This is the Internal Output in the output array.
COUT
This is the Computer Output in the output array.
LL
This is a Boolean output which is TRUE when the algorithm is imposing a
low limit on (OUT), i.e. (EXTV) or (IOUT) is less than LOLIM.
HL
This is a Boolean output which is TRUE when the algorithm is imposing a
high limit on (OUT), i.e. (EXTV) or (IOUT) is greater than HILIM.
3-10
August 2002
CG39-22
Dynamic Function Blocks
Softlist Parameters
The remaining AM inputs are accessed via the softlist. The values of these inputs can be changed via
command from an operator interface or a Set Value (SET_VAL) function block, but they cannot be wired
to the block. Below is a description and initial value for each softlist parameter.
SLIST_OUT
This is the Internal Output placed in the softlist for storage purposes.
LOLIM
This is the (OUT) low limit input.
HILIM
This is the (OUT) high limit input.
INTRK
This is a Boolean parameter. Setting INTRK=TRUE causes the Internal
Output to track the (IN) when EXTTRK=FALSE, or when
(STNDBY)=FALSE and (AUTO)=TRUE.
EXTTRK
This is a Boolean parameter. Setting EXTTRK=TRUE causes the
Internal Output to track the External Variable when (STNDBY)=TRUE.
The following is a table of softlist parameters, their units, initial values, minimum values and maximum
values:
Input
Units
Initial Value
Min Value
Max Value
SLIST_OUT
Engr
0.0
NA
NA
LOLIM
Engr
-3.3
LOLIM must be less than
HILIM.
HILIM
Engr
103.3
HILIM must be greater than LOLIM
INTRK
BOOL
TRUE
FALSE
TRUE
EXTTRK
BOOL
TRUE
FALSE
TRUE
Where NA indicates not applicable.
August 2002
3-11
Dynamic Function Blocks
3.4
CG39-22
PD Function Block (PD)
PD
REAL
PV
OUT
REAL
REAL
SP
ERR
REAL
REAL
FDBK
BOOL
AUTO
BOOL
INIT
The symbol of the Proportional-Derivative (PD) Controller function block is shown above. This block
performs the function of a proportional-derivative (PD) controller with manual reset. It can be set as
tracking or non-tracking by the MRTRCK softlist value. Additionally, tt can be used as a proportionalonly controller by setting the derivative time equal to 0.0 min. Inputs and outputs use engineering units
that are user-selectable. Transitions of the (INIT) input cause execution of the initialization equations
which recalculate the reset component so that the (OUT) will not experience a bump due to proportional
action.
PD FUNCTION BLOCK DIAGRAM
AUTO
τ DS
PV
> τD
S+1
DG
+
>
Σ
+
>
+
Σ
-
>
+
> PG
A
>
..
.
F
T
Σ
+
+
-1
R
> OUT
SP
AUTO
MRTRCK
. . >.
T
.
F
..
F
T
MR
1
> τMR S+1
FDBK
+
PV
>
Σ
> ERR
SP
3-12
August 2002
CG39-22
Dynamic Function Blocks
The inputs and outputs of the PD block are defined as follows:
PV
This is the process input to the control algorithm.
SP
This is the setpoint input to the control algorithm.
FDBK
This is the tracking variable input to the control algorithm
AUTO
This is the track command input to the algorithm. When this input is
FALSE, the algorithm is in a tracking mode [(OUT)=(FDBK)]. In
addition, transitions of this input cause the initialization equations to
performed.
INIT
This is a second mode/status input to the algorithm. Transitions of the
(INIT) input cause the initialization equation to be performed, but do not
cause the mode of the algorithm to change. Initialization causes the reset
component to be recalculated so that (OUT) remains the same. This input
is typically used to cause initialization upon changes in the source of the
setpoint; i.e. Internal-to-External or External-to-Internal.
OUT
This is the calculated output.
ERR
This is the calculated error, [(PV) - (SP)].
Softlist Parameters
The tuning coefficients (PG, TD, DG) and the remaining PD inputs are accessed via the softlist. The
value of these inputs can be changed via command from an operator interfaceor the Set Value
(SET_VAL) function block, but they cannot be “wired” to the block. Below is a description and initial
value for each softlist parameter.
PG
This is the proportional gain input to the algorithm.
TD
This is the derivative time input to the algorithm.
DG
This is the derivative gain input to the algorithm.
DIR_ACT
This is a Boolean input to the algorithm which determines the
action of the controller. TRUE signifies direct action (A=1)
and FALSE signifies reverse action (A=-1).
MRTRCK
This is the boolean input to the algorithm which determines the
use of the manual reset tracking.
MR
This is the manual reset input.
MR_TLAG
This is the manual reset time constant.
EINL
This is the (PV) low value (in engineering units) used for
scaling.
August 2002
3-13
Dynamic Function Blocks
CG39-22
EINH
This is the (PV) high value (in engineering units) used for
scaling.
EOUTL
This is the output low value (in engineering units) used for
scaling.
EOUTH
This is the output high value (in engineering units) used for
scaling.
ADAPTIVE_PG_INIT
This is the Boolean value which, when FALSE, suppresses the
initialization of the controller algorithm upon changes of the PG
softlist value which is necessary to implement a continuously
adaptive gain circuit. When TRUE, normal initialization occurs
when the PG softlist value is modified.
Parameter
Units
Initial
Value
Min
Value
Max
Value
PG
dimensionless
0.001
0.001
100.0
TD
Min
0.0
(OFF)
0.0
100.0
DG
dimensionless
10.0
2.0
20.0
DIR_ACT
BOOL
FALSE
FALSE
TRUE
MRTRCK
BOOL
FALSE
FALSE
TRUE
MR
Engr
0.0
NA
NA
MR_TLAG
Min
1.0
0.001
4000.0
EINL
Engr
0.0
NA
NA
EINH
Engr
100.0
NA
NA
EOUTL
Engr
0.0
NA
NA
EOUTH
Engr
100.0
NA
NA
ADAPTIVE_PG_INIT
BOOL
TRUE
FALSE
TRUE
Where NA indicates not applicable.
3-14
August 2002
CG39-22
3.5
Dynamic Function Blocks
ID Function Block (ID)
ID
PV
SP
FDBK
AUTO
REAL
REAL
REAL
BOOL
OUT
ERR
REAL
REAL
The symbol of the Integral-Derivative (ID) Controller block is shown above. This block performs the
function of an Integral-Derivative (ID) controller. It uses external feedback to establish integral action.
The AUTO input, when FALSE, forces the output to track the feedback. Controller gain is fixed at a
value of 1.00. The block can also be used as an Integral-only (I) controller by setting the Derivative Time
(DT) softlist value to 0.00 minutes.
NOTE
Normal limits for the TI softlist value are from 0.001 to 4000.0. In the
special case of TI = 4000.0, all integral action is removed from the
output calculation.
ID FUNCTION BLOCK DIAGRAM
AUTO
τ DS
PV
> τD
S+1
DG
+
>
Σ
+
+
>
Σ
-
>
+
A
+
-1
>
1
> τ S+1
I
Σ
..
.
F
T
+
> OUT
R
SP
FDBK
+
PV
>
Σ
> ERR
SP
August 2002
3-15
Dynamic Function Blocks
CG39-22
The inputs and outputs in the ID block are defined as follows:
PV
This is the process input to the control algorithm.
SP
This is the setpoint input to the control algorithm
FDBK
This is the reset feedback to the control algorithm.
AUTO
This is the track command input to the algorithm. When this input is FALSE,
the algorithm is in tracking mode [(OUT)=(FDBK)]. In addition, transitions of
this input cause the initialization equations to be performed.
OUT
This is the calculated output limited to -3.3 to 103.3% of range EOUTL to
EOUTH.
ERR
This is the calculated error, [(PV) - (SP)].
Softlist Parameters
The tuning coefficients (TI, TD, DG) and the remaining ID inputs are accessed via the softlist. The value
of these inputs can be changed via command from an operator interfave or the Set Value (SET_VAL)
function block, but they cannot be “wired” to the block. Below is a description and initial value for each
softlist parameter.
TI
This is the integral time input (in minutes per repeat) to the algorithm.
TD
This is the derivative time input (in minutes) to the algorithm.
DG
This is the derivative gain input to the algorithm.
DIR_ACT
This is a boolean input to the algorithm which determines the action of the
controller. TRUE signifies direct action (A=1) and FALSE signifies reverse
action (A=-1).
EINL
This is the (PV) low value (in engineering units) used for scaling.
EINH
This is the (PV) high limit (in engineering units) used for scaling.
EOUTL
This is the output low value (in engineering units) used for scaling.
EOUTH
This is the output high limit (in engineering units) used for scaling.
3-16
August 2002
CG39-22
Dynamic Function Blocks
Parameter
Units
Initial Value
Min Value
Max Value
TI
Min/repeat
4000.0 (OFF)
0.001
4000.0
TD
Min
0.0 (OFF)
0.0
100.0
DG
dimensionless
10.0
2.0
20.0
DIR_ACT
BOOL
FALSE
FALSE
TRUE
EINL
Engr
0.0
NA
NA
EINH
Engr
100.0
NA
NA
EOUTL
Engr
0.0
NA
NA
EOUTH
Engr
100.0
NA
NA
Where NA indicates not applicable.
3.6
PID Incremental Output Function Blocks
(Non-interacting Modes)
GAIN
OUTPUT
REAL
REAL
PV - SP
REAL
INTEGRAL
INCRPOS
REAL
DERIVATIVE
The Gain, Integral, Derivative, and Increment-to-Position function blocks can be used to implement a
parallel or non-interacting form of the PID controller algorithm. By selecting the appropriate control
blocks, additional non-interacting controllers such as PI, P, PD, I, or ID can be implemented.
The controller blocks (Gain, Integral, and Derivative) described in the subsections to follow generate an
incremental output as opposed to an absolute position or value. These incremental values can be summed
together and/or converted to an absolute value (see Increment-to-Position block).
August 2002
3-17
Dynamic Function Blocks
3.6.1
CG39-22
Gain Function Block (GAIN)
GAIN
PERR
EN
INIT
REAL
BOOL
BOOL
DELTA
REAL
The symbol of the Gain function block is shown above. This block's algorithm executes the proportional
function of a PID controller based on an externally calculated error input (PERR). Transitions of the
(INIT) input cause execution of the initialization equations which recalculate the reset component so that
the (DELTA) does not experience a bump.
GAIN FUNCTION BLOCK DIAGRAM
EN
.
.
.
F
T
+
>
PERR
Σ
-
> A
> PG
+1
-
> DELTA
0.0
> Z -1
The inputs and output of the GAIN block are defined s follows:
PERR
This is the error used for calculating the proportional component.
EN
This is the execute command input to the algorithm. When this input is
FALSE, the algorithm is not executing [(DELTA) = (0.0)]. In addition,
transitions of this input cause the initialization equations to be performed.
INIT
This is a second mode/status input to the algorithm for initialization.
Transitions of the (INIT) input cause the initialization equation
(PERR1=(PERR)) to be performed, but does not cause the mode of the
algorithm to change. This input is typically used to cause initialization upon
changes in the source of the setpoint: i.e. Internal-to-External or External-toInternal.
DELTA
This is the calculated incremental change in output.
3-18
August 2002
CG39-22
Dynamic Function Blocks
Softlist Parameters
The remaining GAIN inputs are accessed via the softlist. The value of these inputs can be changed via
command from an operator interface or the Set Value (SET_VAL) function block, but they cannot be
“wired” to the block. Below is a description and initial value for each softlist parameter.
PG
This is the proportional gain input to the algorithm.
DIR_ACT
This is a Boolean input to the algorithm which determines the
action of the controller. TRUE signifies direct action (A=1)
and FALSE signifies reverse action (A=-1).
EINL
This is the (PV) low value (in engineering units) used for
scaling.
EINH
This is the (PV) high value (in engineering units) used for
scaling.
EOUTL
This is the output low value (in engineering units) used for
scaling.
EOUTH
This is the output high value (in engineering units) used for
scaling.
ADAPTIVE_PG_INIT
This is the boolean value which, when FALSE, suppresses the
initialization of the controller algorithm upon changes of the PG
softlist value, which is necessary to implement a continuously
adaptive gain circuit. When TRUE, normal initialization occurs
when the PG softlist value is modified.
Parameter
Units
Initial Value
Min Value
Max Value
PG
dimensionless
0.001
0.001
100.0
DIR_ACT
BOOL
FALSE
FALSE
TRUE
EINL
Engr
0.0
NA
NA
EINH
Engr
100.0
NA
NA
EOUTL
Engr
0.0
NA
NA
EOUTH
Engr
100.0
NA
NA
ADAPTIVE_PG_INIT
BOOL
TRUE
FALSE
TRUE
Where NA indicates not applicable.
August 2002
3-19
Dynamic Function Blocks
3.6.2
CG39-22
Integral Function Block (INTEGRL)
INTEGRL
IERR
EN
REAL
BOOL
DELTA
REAL
The symbol of the Integral function block is shown above. This block's algorithm performs the integration
function of a PID controller based on the error input (IERR), which has been calculated externally.
NOTE
Normal limits for the TI softlist value are from 0.001 to 4000.0 In the
case of TI = 4000.0, (DELTA) = 0.0.
INTEGRAL FUNCTION BLOCK DIAGRAM
EN
IERR
>
A
+
-1
> Ki
.
.
.
F
T
> DELTA
0.0
The inputs and output of the INTEGRAL block are defined as follows:
IERR
This is the error used for calculating the integral component.
EN
This is the execute command input to the algorithm. When this input is
FALSE, the algorithm is not executing [(DELTA) = (0.0)].
DELTA
This is the calculated incremental change in output.
3-20
August 2002
CG39-22
Dynamic Function Blocks
Softlist Parameters
The remaining INTEGRAL inputs are accessed via the softlist. The value of these inputs can be changed
via command from an operator interface or the Set Value (SET_VAL) function block, but they cannot be
“wired” to the block. Below is a description and initial value for each softlist parameter.
TI
This is the integral time input (in minutes per repeat) to the algorithm.
DIR_ACT
This is a Boolean input to the algorithm which determines the action of the
controller. TRUE signifies direct action (A=1) and FALSE signifies reverse
action (A=-1).
EINL
This is the (PV) low value (in engineering units) used for scaling.
EINH
This is the (PV) high value (in engineering units) used for scaling.
EOUTL
This is the output low value (in engineering units) used for scaling.
EOUTH
This is the output high value (in engineering units) used for scaling.
Parameter
Units
Initial Value
Min Value
Max Value
TI
Min/repeat
4000.0 (OFF)
0.001
4000.0
DIR_ACT
BOOL
FALSE
FALSE
TRUE
EINL
Engr
0.0
NA
NA
EINH
Engr
100.0
NA
NA
EOUTL
Engr
0.0
NA
NA
EOUTH
Engr
100.0
NA
NA
Where NA indicates not applicable.
3.6.3
Derivative Function Block (DERIV)
DERIV
REAL
BOOL
BOOL
August 2002
DERR
EN
INIT
DELTA
REAL
3-21
Dynamic Function Blocks
CG39-22
The symbol of the Derivative (DERIV) block is shown above. This block's algorithm performs the
derivative function of the PID controller based on an externally calculated error input (DERR).
Transitions of the (INIT) input cause execution of the initialization equations which recalculate the reset
component so that the (OUT) output remains the same.
DERIVATIVE FUNCTION BLOCK DIAGRAM
EN
+
Σ
DERR
-
K d1
+
Σ
+
Σ
-
+
A
+
-1
Z -1
Z -1
.
.
.
F
T
> DELTA
0.0
Kd2
The inputs and output of the DERIVATIVE block are defined as follows:
DERR
This is the error used for calculating the derivative component.
EN
This is the execute command input to the algorithm. When this input is
FALSE, the algorithm is not executing [(DELTA) = (0.0)]. In addition,
transitions of this input cause the initialization equations to be performed.
INIT
This is a second mode/status input to the algorithm. Transitions of the INIT
input cause the initialization equations [D1=0, DERR1=(DERR)] to be
performed, but do not cause the mode of the algorithm to change. This input is
typically used to cause initialization upon changes in the source of the setpoint
(Internal-to-External or External-to-Internal).
DELTA
3-22
This is the calculated incremental change in output.
August 2002
CG39-22
Dynamic Function Blocks
Softlist Parameters
The remaining DERIV inputs are accessed via the softlist. The value of these inputs can be changed via
command from an operator interface or the Set Value (SET_VAL) function block, but they cannot be
“wired” to the block. Below is a description and initial value for each softlist parameter.
TD
This is the derivative time input to the algorithm.
DG
This is the derivative gain input to the algorithm.
DIR_ACT
This is a Boolean input to the algorithm, which determines the action of the
controller. TRUE signifies direct action (A=1) and FALSE signifies reverse
action (A=-1).
EINL
This is the (PV) low value (in engineering units) used for scaling.
EINH
This is the (PV) high value (in engineering units) used for scaling.
EOUTL
This is the output low value (in engineering units) used for scaling.
EOUTH
This is the output high value (in engineering units) used for scaling.
Parameter
Units
Initial Value
Min Value
Max Value
TD
Min
0.0 (OFF)
0.0
100.0
DG
dimensionless
10.0
2.0
20.0
DIR_ACT
BOOL
FALSE
FALSE
TRUE
EINL
Engr
0.0
NA
NA
EINH
Engr
100.0
NA
NA
EOUTL
Engr
0.0
NA
NA
EOUTH
Engr
100.0
NA
NA
Where NA indicates not applicable.
August 2002
3-23
Dynamic Function Blocks
3.6.4
CG39-22
Increment-to-Position Function Block (INCRPOS)
INCRPOS
FDBK
PDELTA
IDELTA
DDELTA
AUTO
REAL
REAL
REAL
REAL
BOOL
POS
REAL
The symbol of the Increment-to-Position (INCRPOS) block is shown above. This block's algorithm
converts an incremental value (a change in output from the non-interacting PID or an error signal, PV-SP)
into a position. A positive incremental input value increases the position output. A negative incremental
input decreases the position output. This block calculates its values based on engineering values.
INCREMENT TO POSITION FUNCTION BLOCK DIAGRAM
AUTO
+
Σ
FDBK
+
+
Σ
+
+
Σ
.F .
.
T
POS
+
PDELTA
IDELTA
DDELTA
HILIM
LOLIM
The inputs and output of the INCRPOS block are defined as follows:
FDBK
This is an external variable, such as the output of an AM block or any
other external variable. It is a required input since it contains the
accumulated value of the sum of the incremental values.
PDELTA
This is the incremental input change due to proportional action.
IDELTA
This is the incremental input change due to integral action.
DDELTA
This is the incremental input change due to derivative action.
AUTO
This is the auto/manual input. When FALSE, (POS) = (FDBK).
POS
This is the calculated position of the output (in engineering units).
3-24
August 2002
CG39-22
Dynamic Function Blocks
Softlist Parameters
The remaining INCRPOS inputs are accessed via the softlist. The value of these inputs can be changed
via command from an operator interface or the Set Value (SET_VAL) function block, but they cannot be
“wired” to the block. Below is a description and initial value for each softlist parameter.
LOLIM
This is the lower limit of the output (in engineering units).
HILIM
This is the upper limit of the output (in engineering units).
3.7
Parameter
Units
Initial Value
Min Value / Max Value
LOLIM
Engr
-3.3
LOLIM must be less than HILIM
HILIM
Engr
103.3
HILIM must be greater than
LOLIM
PID Error Input Function Block (Non-Interacting) (PID_ERR)
PID_ERR
REAL
REAL
REAL
REAL
BOOL
BOOL
PERR
IERR
DERR
FDBK
AUTO
INIT
OUT
DELTA
LL
HL
REAL
REAL
BOOL
BOOL
The symbol of the Proportional-Integral-Derivative (PID) Error Input block is shown above. This block's
algorithm performs the function of a PID controller using error inputs. A separate error input is provided
for the proportional, integral, and derivative components, thus providing a mechanism to implement
advanced strategies such as delayed integral action. The velocity equations employed have no interaction
between the proportional, integral, and derivative sections. Derivative action occurs on setpoint changes
if the derivative error changes due to setpoint modifications. Transitions of the (INIT) input cause
execution of the initialization equations, which recalculate the reset component so that the (OUT) output
remains the same.
NOTE
Normal limits for integral time (TI) input are from 0.001 to 4000.0 (in
minutes per repeat). In the special case of TI = 4000.0, all integral action
is removed from the output calculation.
August 2002
3-25
Dynamic Function Blocks
CG39-22
PID_ERR FUNCTION BLOCK DIAGRAM
PERR
PG
DELTA
1
τ S
I
IERR
+
LL
HL
AUTO
+
Σ
+
.T . +
.F
0.0
τ DS
Σ
OUT
+
FDBK
LOLIM
HILIM
τD
S+1
DG
DERR
The inputs and outputs of the PID_ERR block are defined as follows:
PERR
This is the error used for calculating the proportional component.
IERR
This is the error used for calculating the integral component.
DERR
This is the error used for calculating the derivative component.
FDBK
This is the tracking variable input to the control algorithm.
AUTO
This is the track command input to the algorithm. When this input is FALSE,
the algorithm is in a tracking mode [(OUT)=(FDBK)]. In addition,
transitions of this input cause the initialization equations to be performed.
INIT
This is a second mode/status input to the algorithm. Transitions of the (INIT)
input cause the initialization equations to be performed but do not cause the
mode of the algorithm to change. This input is typically used to cause
initialization upon changes in the source of the setpoint (External to Internal
or Internal to External).
OUT
This is the calculated output.
DELTA
This is the calculated incremental change in output.
LL
This is a Boolean output that, when TRUE, indicates the output (OUT) is
being limited at the low limit (LOLIM).
HL
This is a Boolean output that, when TRUE, indicates the output (OUT) is
being limited at the high limit (HILIM).
Softlist Parameters
3-26
August 2002
CG39-22
Dynamic Function Blocks
The remaining PID_ERR inputs are accessed via the softlist. The value of these inputs can be changed
via command from an operator interface or the Set Value (SET_VAL) function block, but they cannot be
“wired” to the block. Below is a description and initial value for each softlist parameter.
PG
This is the proportional gain input to the algorithm.
TI
This is the integral time input (in minutes per repeat) to the
algorithm.
TD
This is the derivative time input to the algorithm.
DG
This is the derivative gain input to the algorithm.
DIR_ACT
This is a boolean input to the algorithm which determines the
action of the controller. TRUE signifies direct action (A=1)
and FALSE signifies reverse action (A=-1).
LOLIM
This is the low limit for the output (OUT).
HILIM
This is the high limit for the output (OUT).
EINL
This is the (PV) low value (in engineering units) used for
scaling.
EINH
This is the (PV) high value (in engineering units) used for
scaling.
EOUTL
This is the output low value (in engineering units) used for
scaling.
EOUTH
This is the output high value (in engineering units) used for
scaling.
ADAPTIVE_PG_INIT
This is the Boolean value which, when FALSE, suppresses the
initialization of the controller algorithm upon changes of the
PG softlist value, which is necessary to implement a
continuously adaptive gain circuit. When TRUE, normal
initialization occurs when the PG softlist value is modified.
August 2002
3-27
Dynamic Function Blocks
CG39-22
The following table lists softlist parameters, their units, initial, minimum and maximum values.
Parameter
Units
Initial Value
Min Value
Max Value
PG
Dimensionless
0.001
0.001
100.0
TI
Min/repeat
4000.0 (OFF)
0.001
4000.0
TD
Min
0.0 (OFF)
0.0
100.0
DG
Dimensionless
10.0
2.0
20.0
DIR_ACT
BOOL
FALSE
FALSE
TRUE
LOLIM
Engr units
-3.3
NA
NA
HILIM
Engr units
103.3
NA
NA
EINL
Engr units
0.0
NA
NA
EINH
Engr units
100.0
NA
NA
EOUTL
Engr units
0.0
NA
NA
EOUTH
Engr units
100.0
NA
NA
ADAPTIVE_PG_INIT
BOOL
TRUE
FALSE
TRUE
Where NA indicates not applicable.
3.8
On/Off with Derivative Controller (ON_OFF)
ON_OFF
REAL
PV
REAL
REAL
REAL
BOOL
SP
LDEV
HDEV
EN
OUT
OUTL
OUTH
ERR
BOOL
BOOL
BOOL
REAL
The symbol of the ON/OFF with Derivative Controller (ON_OFF) function block is shown above. This
block performs the function of an on/off controller with deviation function. If there is a positive deviation
between the process input and setpoint that reaches a preset limit (HDEV), a boolean output is turned on
(OUTH). If there is a negative deviation between the process input and setpoint that reaches another
preset limit (LDEV), a second boolean output (OUTL) is turned on. Derivative action can be added to the
process variable. The boolean output (OUT) is TRUE if either (OUTL) or (OUTH) is TRUE.
3-28
August 2002
CG39-22
Dynamic Function Blocks
NOTE
Inputs (LDEV) and (HDEV) must both be greater thanzero.
If single-ended use is desired (when (OUTL) or (OUTH) will be used alone, the (LDEV) or (HDEV)
values may be set for the desired limit (SPIDEV) and the deadband (DB) may be set for twice the (DEV)
value (e.g. (SP)=50, (LDEV)=10, (DB)=20, (OUTL) is TRUE when (PV)=40, (OUTL) is TRUE when
(PV)>60).
For double-ended use, the (DB) should be less than the (DEV).
August 2002
3-29
Dynamic Function Blocks
CG39-22
The inputs and outputs of the ON_OFF Controller are defined as follows:
PV
This is the current process input to the control algorithm.
SP
This is the current setpoint input to the control algorithm.
LDEV
This is the limit for a negative deviation from setpoint (in engineering units).
Must be greater than zero.
HDEV
This is the limit for a positive deviation from setpoint (in engineering units).
Must be greater than zero.
EN
This is the enable command input to the algorithm. When this input is FALSE,
the algorithm is stopped [(OUT), (OUTH), (OUTL) = FALSE)].
OUT
This is a boolean output that is TRUE whenever PVA (PV following a
derivative action) exceeds either specified limit (see block diagram).
OUTL
This is a Boolean output that is TRUE whenever PVA drops below the
specified low limit.
OUTH
This is a Boolean output that is TRUE whenever PVA exceeds the specified
high limit.
ERR
This is the calculated error output [(PV)-(SP)].
Softlist Parameters
The remaining ON_OFF inputs are accessed via the softlist. The value of these inputs can be changed via
command from an operator interface or the Set Value (SET_VAL) function block, but they cannot be
“wired” to the block. Below is a description and initial value for each softlist parameter.
The following inputs and their initial values make up the softlist for the On/Off function block:
DEADBAND
This is a threshold value. An error below this value does not cause a
change in output.
TD
This is the integral time input.
DG
This is the derivative gain input.
EINH
This is the (PV) high value (in engineering units) used for scaling.
EINL
This is the (PV) low value (in engineering units) used for scaling.
3-30
August 2002
CG39-22
Dynamic Function Blocks
Parameter
Units
Initial Value
Min Value
Max Value
TD
Min
0.0 (OFF)
0.0
100.0
DG
Dimensionless
10.0
2.0
20.0
DEADBAND
Engr
0.5
0.0
NA
EINL
Engr
0.0
NA
NA
EINH
Engr
100.0
NA
NA
Where NA indicates not applicable.
3.9
Programmer Function Block (PGRMR)
PGRMR
BOOL
EN
BOOL
BOOL
INT
BOOL
BOOL
REAL
BOOL
HOLD
GOTO
SEG
SEGINC
SEGDEC
IN
TRACK
OUT
TIMREM
OUTSEG
DONE
REAL
TIME
INT
BOOL
The symbol of the Programmer (PGRMR) block is shown above. This block is used to configure a
"setpoint profile" or programmed sequence of ramps, steps, and/or soaks, where individual sections are
called segments. The setpoint value at any time is available at the OUT output. Each segment is defined
by its endpoint and either a rate (units/minute) or duration (time data type), which are specified by softlist
parameters. The duration is used only if the configured rate is zero. If both rate and duration are zero, the
segment defines a step change to the configured endpoint.
NOTE
The Programmer Function Block Supersedes The Program (Program)
Function Block, Which Is Retained In Some Function Block Libraries
For Legacy Purposes Only. The Program Block Is Not For General Use.
Once enabled, the PGRMR block moves automatically through the defined segments until it completes
the last, when it stops and sets its done (DONE) output. A maximum of 20 segments may be defined in a
single block, but a string of blocks may be created by connecting (DONE) of one to the enable (EN) input
of the next to create a program of virtually unlimited size.
The enable (EN) input determines whether the block is active. While (EN) is FALSE, the block is reset
and its track (TRACK) input determines its output value. If (TRACK) is TRUE, (OUT) = (IN). If
(TRACK) is FALSE, (OUT) = DISABLED_OUT softlist value. While (EN) is FALSE, (OUTSEG) is 1,
August 2002
3-31
Dynamic Function Blocks
CG39-22
(TIMREM) is 0, and (DONE) is FALSE. When (EN) makes a transition from FALSE to TRUE, the
block starts at the first segment. While (EN) is TRUE, (OUTSEG) is the number of the currently
executing segment, and (TIMREM) is the number of milliseconds remaining in that segment. When the
block finishes its last segment, it sets (DONE) and halts until (EN) becomes FALSE.
The block can be paused and resumed by toggling its hold (HOLD) input. While (HOLD) is TRUE, the
(TRACK) input determines the block’s output value. If (TRACK) is TRUE, (OUT) = (IN). If (TRACK)
is FALSE, (OUT) retains the value it had when (HOLD) became TRUE.
The current segment can be altered by using the (GOTO), (SEGINC), and (SEGDEC) inputs, which are
activated by positive transitions. If the block is held when the current segment is altered, the new segment
will start from the current output value when the block is resumed. If the block is running when the
segment is altered, (OUT) jumps immediately to the output of the segment preceding the newly-selected
segment, and the new segment proceeds from there. Once the block has set (DONE), the hold and
segment inputs have no effect.
When (GOTO) makes a transition from FALSE to TRUE, the current segment is set to the value of the
segment number (SEG) input. When (SEGINC) makes a transition from FALSE to TRUE, the current
segment increments by one unless the block is executing the last segment. When (SEGDEC) makes a
transition from FALSE to TRUE, current segment decrements by one, unless the block is executing the
first segment. If multiple inputs make their transitions simultaneously, the precedence is that (GOTO)
supersedes (SEGINC), which in turn supersedes (SEGDEC).
If there is a need to reconfigure a segment while the block is executing, the recommended course is to
first pause the block using (HOLD). While the block is executing, changes to softlist parameter values of
the active segment do not affect its operation. However, a change to the endpoint of an active segment
affects the starting output for the following segment, causing (OUT) to jump to that value at the beginning
of that segment.
When the block is held, any softlist parameter changes made before or during the hold affect operation as
soon as the block resumes. If either the rate or the duration is changed, the block uses the new value when
it is restarted. Otherwise, the block resumes at the original rate for as long as it takes the output to reach
the endpoint. Either way, operation resumes from the current (held) output value.
3-32
August 2002
CG39-22
Dynamic Function Blocks
The inputs and outputs of the PGRMR block are defined as follows:
EN
This is the Boolean input that enables the block.
HOLD
This is a Boolean input that, when TRUE, pauses the execution of the current
segment.
GOTO
This is a Boolean input that, upon a transition from FALSE to TRUE, causes
the block to jump to the segment indicated by the value of the (SEG) input.
SEG
This is the integer input that indicates which segment the block jumps to if
(GOTO) transitions to TRUE. If this value is not a defined segment, the
(GOTO) input has no effect.
SEGINC
This is a Boolean input that, upon a transition from FALSE to TRUE,
increments the current segment by one, unless it is the last.
SEGDEC
This is a Boolean input that, upon a transition from FALSE to TRUE,
decrements the current segment by one, unless it is the first.
IN
This is the real input that determines the output value when the block is in
tracking
mode.
TRACK
This is the Boolean input that indicates tracking mode. When TRUE (and a
segment is not currently executing), (OUT) = (IN).
OUT
This is the calculated output of the block.
TIMREM
This is the time remaining in the current segment.
OUTSEG
This is the integer output indicating the current segment number.
DONE
This is a Boolean output which is TRUE when the block has completed the
execution of all configured segments.
August 2002
3-33
Dynamic Function Blocks
CG39-22
Softlist Parameters
The remaining PGRMR inputs are accessed via the softlist. The value of these inputs can be changed via
an operator interface or the Set Value (SET_VAL) function block, but they cannot be "wired" to the
block.
NUM_OF_SEGS
This is the number of segments to be programmed. Valid values are
from 1 to 20. Numbers entered beyond this range are clipped to
these limits.
DISABLED_OUT
This value becomes the block output when both (EN) and (TRACK)
are FALSE.
ENDPNT_SEG_n
This is the endpoint value of the nth segment.
RATE_SEG_n
This is the rate value (in engineering units per minute) for the nth
segment.
TIME_SEG_n
This is the duration value (in milliseconds) for the nth segment. It is
only used when RATE_SEG_n is zero.
Initial values of the softlist parameters are listed as follows:
Parameter
Initial Value
NUM_OF_SEGS
DISABLED_OUT
ENDPNT_SEG_n
RATE_SEG_n
TIME_SEG_n
1
0.0
0.0
0.0
0
3.10 Lead/Lag Function Block (LEADLAG)
LEADLAG
REAL
REAL
BOOL
IN
TRKV
EN
OUT
REAL
The symbol of the Lead/Lag (LEADLAG) function block is shown above. This block is used to provide
dynamic compensation to a user-specified input. It can be configured as a gain-only, lag-only, or lead/lag
function. The block's algorithm has an adjustable gain coefficient, lag coefficient, and lead coefficient.
The algorithm is normally used to implement feed-forward control schemes. It can be configured to stand
alone or to operate within a feedback controller.
3-34
August 2002
CG39-22
Dynamic Function Blocks
The inputs and outputs of the LEADLAG block are defined as follows:
IN
This is the current process input to the control algorithm.
TRKV
This is the tracking variable input to the algorithm.
EN
This is the enable/track command input to the algorithm. When FALSE, the
block is in tracking mode [(OUT)=(TRKV)] and the lead/lag function is
bypassed.
OUT
This is the calculated output.
Softlist Parameters
The remaining LEADLAG inputs are accessed via the softlist. The value of these inputs can be changed
via command from an operator interface or the Set Value (SET_VAL) function block, but they cannot be
“wired” to the block. Below is a description and initial value for each softlist parameter.
TLAG
This is the lag time input (in minutes).
TLEAD
This is the lead time (in minutes).
GAIN
This is the gain input to the algorithm.
DIR_ACT
This is a boolean input to the algorithm that determines the action of the
algorithm. When set to TRUE, it signifies direct action. When set to
FALSE, it signifies reverse action.
August 2002
3-35
Dynamic Function Blocks
CG39-22
Parameter
Units
Initial Value
Min Value
Max Value
TLAG
Min
0.01
0.01
NA
TLEAD
Min
0.0
0.0
NA
GAIN
dimensionless
1.0
NA
NA
DIR_ACT
BOOL
TRUE (Direct
Action)
FALSE
TRUE
Where NA indicates not applicable.
3.11 Rate Limiter Function Block (RATELIM)
RATELIM
REAL
BOOL
IN
EN
REAL
BOOL
BOOL
OUT
UP
DOWN
The symbol of the Rate Limiter (RATELIM) function block is shown above. This block is used to limit
the rate of change of its input signal. Separate up and down rates can be specified. These must be REAL
numbers specifying the rates (in engineering units per minute). Values for (IN) and (OUT) are expressed
in engineering units.
RATE LIMITER FUNCTION BLOCK DIAGRAM
EN
IN
3-36
>
T
.
.F .
> OUT
August 2002
CG39-22
Dynamic Function Blocks
The inputs and outputs of the RATELIM block are defined as follows:
IN
This is the input variable to be limited by the rate limiter function block.
EN
This is the enable command input to the algorithm. When the input is FALSE,
the algorithm is in a bypass mode (OUT=IN).
OUT
This is the calculated output variable that has been rate-limited.
UP
This is a Boolean output which is TRUE when the algorithm is limiting a rising
input.
DOWN
This is a Boolean output which is TRUE when the algorithm is limiting a
falling input.
Softlist Parameters
The remaining RATELIM inputs are accessed via the softlist. The value of these inputs can be changed
via command from an operator interface or the Set Value (SET_VAL) function block, but they cannot be
“wired” to the block. Below is a description and initial value for each softlist parameter.
UPRATE and DOWNRATE are the rising and falling rate inputs, respectively. They are entered in
engineering units per minute.
Parameter
Units
Initial Value
Min Value
Max Value
UPRATE
Engr/Min
0.0
0.0
NA
DOWNRATE
Engr/Min
0.0
0.0
NA
Where NA indicates not applicable.
3.12 Ramp Generator Function Block (RAMPGEN)
RAMPGEN
BOOL
BOOL
REAL
TIME
REAL
REAL
BOOL
EN
HOLD
TARGET
RTIME
RRATE
IN
TRACK
OUT
DONE
TIMREM
REAL
BOOL
TIME
The symbol of the Ramp Generator (RAMPGEN) function block is shown above. This block is used to
create a ramp signal using the starting value (IN), a target endpoint value (TARGET), and either a ramp
August 2002
3-37
Dynamic Function Blocks
CG39-22
time (RTIME) or a ramp rate (RRATE). The starting value depends on the status of the (TRACK) input.
If (TRACK) is TRUE, the starting point is (IN). If (TRACK) is FALSE, the starting point is the last
output value. If the (RTIME) input is configured, the block uses the (RTIME) duration input as the
length of the ramp time and calculates the ramp rate to use. If the (RRATE) is configured, the block uses
the (RRATE) input as the rate of the ramp (engineering units per minute) and calculates the time
remaining. If both are configured, the (RTIME) takes priority.
When (EN) makes a transition from FALSE to TRUE, the block initializes the ramp mode. Ramping
does not take place if any ramp parameters are invalid. As long as (EN) is TRUE, ramping is in effect.
The (OUT) output reflects the ramping of the block. When the ramp is complete, the (OUT)
=(TARGET), (DONE) is TRUE, and (TIMREM) is zero.
The (HOLD) input is used to pause the ramp and hold the last (TIMREM) value whenever the ramp is
active. In the hold mode or when (EN) is FALSE, (OUT) is either held at its last value or, when
(TRACK) is TRUE, it tracks the (IN). After a TRUE to FALSE transition of the (HOLD) input, the ramp
mode is continued in one of two ways: if none of the ramping parameters ((TARGET), (RTIME),
(RRATE)) have changed, the same ramp rate as previous to the hold mode are used, the current (IN)
value is used as the new starting setpoint, and the (TIMREM) is recalculated. If the ramping parameters
are altered, the block reinitializes using the new inputs.
When (EN) is FALSE, the block is inactive, (DONE) is set to FALSE, (TIMREM) is set to T#000ms, and
(OUT) depends on the value of (TRACK).
3-38
August 2002
CG39-22
Dynamic Function Blocks
The inputs and outputs of the RAMPGEN block are defined as follows:
EN
The Boolean input which enables the block.
HOLD
The Boolean input that pauses the calculations and holds the outputs in the
block.
TARGET
The endpoint to which the block is ramping.
RTIME
The ramp time input. It is a TIME data type. It is entered as a duration
variable in the following format: T#VdWhXmYsZms.
RRATE
The ramp rate input. It is a positive REAL value entered in engineering units
per minute.
IN
The tracking input that can be used as the starting point.
TRACK
The track switch input. If TRUE, (OUT) tracks (IN) when in (HOLD) or
when (EN) is FALSE. If FALSE, (OUT) = the last output.
August 2002
3-39
Dynamic Function Blocks
CG39-22
OUT
The calculated output of the block.
DONE
This output is TRUE when the target has been reached.
TIMREM
The amount of time remaining until the target is reached.
Softlist Parameters
There are no softlist parameters for the RAMPGEN function block.
3.13 Scaler Function Block (SCALER)
SCALER
REAL
EIN
EOUT
REAL
The symbol of the Scaler (SCALER) function block is shown above. This block provides the scaling and
dimensional consistency required in applications such as feed forward control where the output of an
Impulse (IMPULSE) function block or a Lead Lag (LEADLAG) function block must be converted from
process variable units to valve output units.
The block's input (EIN) and output (EOUT) are in engineering values. Engineering values are converted
using the input and output operating limits found on the process flowsheets or sensor/actuator ranges.
The input and output of the SCALER block are defined as follows:
EIN
This is the input (in engineering units).
EOUT
This is the calculated output (in engineering units).
3-40
August 2002
CG39-22
Dynamic Function Blocks
Softlist Parameters
The remaining SCALER inputs are accessed via the softlist. The value of these inputs can be changed via
command from an operator interface or the Set Value (SET_VAL) function block, but they cannot be
“wired” to the block. Below is a description and initial value for each softlist parameter.
EINL
This is the engineering low operating value for (EIN).
EINH
This is the engineering high operating value for (EIN).
EOUTL
This is the engineering low operating value for (EOUT).
EOUTH
This is the engineering high operating value for (EOUT).
Parameter
Units
Initial Value
Min Value
Max Value
EINL
Engr
0.0
NA
NA
EINH
Engr
100.0
NA
NA
EOUTL
Engr
0.0
NA
NA
EOUTH
Engr
100.0
NA
NA
Where NA indicates not applicable.
3.14 Filter Function Block (FILTER)
FILTER
REAL
IN
BOOL
EN
OUT
REAL
The symbol of the Filter (FILTER) function block is shown above. This block performs a first order lag
filter function. For example, in response to a step change on the (IN) input, the (OUT) output value
reaches 63.2% of the step amplitude in one time constant. It can be used as a digital filter for noisy
analog inputs or as a lag function in a complex control configuration.
August 2002
3-41
Dynamic Function Blocks
CG39-22
This block also includes logic to allow the filter function to be bypassed: (EN) = FALSE.
FILTER FUNCTION BLOCK DIAGRAM
EN
IN
1
> τ S+1
LAG
. .
.
F
T
> OUT
FILTER FUNCTION BLOCK RESPONSE
OUT
63.2%
IN
t
t = the time equal to one
time constant
3-42
August 2002
CG39-22
Dynamic Function Blocks
The inputs and output of the FILTER block are defined as follows:
IN
This is the process input to the algorithm.
EN
This is the track command input to the algorithm. When this input is FALSE, the
algorithm is in tracking mode (OUT=PV) and the filter function is bypassed.
OUT
This is the calculated output.
Softlist Parameters
The remaining input ise accessed via the softlist. The value of this input can be changed via command
from an operator interface or the Set Value (SET_VAL) function block, but it cannot be “wired” to the
block. Below is a description and initial value for this softlist parameter.
TLAG
This is the lag time in minutes.
Parameter
Units
Initial Value
Min Value
Max Value
TLAG
Min
0.001
0.0
NA
Where NA indicates not applicable.
3.15 Track and Hold Function Block (TRK_HLD)
BOOL
REAL
:
REAL
EN
IN01
:
IN15
TRK_HLD
TRACK
OUT01
:
OUT15
BOOL
REAL
:
REAL
The symbol of the Track and Hold (TRK_HLD) function block is shown above. This block is a general
purpose track and hold signal processor. It is extensible to handle up to 15 inputs. During each scan, the
softlist values for S1 through S15 are loaded into the outputs (OUT01) to (OUT15). For example, the
softlist value entered for S3 is used as output (OUT03).
When the (EN) input is TRUE, inputs (IN01) through (IN15) are loaded into softlist parameters S1
through S15, and the (TRACK) output will be TRUE (indicating that the outputs are tracking the inputs).
If (EN) is FALSE, the previous values are held in the softlist parameters, and the (TRACK) output is
FALSE. Also, an operator interface can write to the softlist parameters and, as a result, change the
outputs.
August 2002
3-43
Dynamic Function Blocks
CG39-22
TRACK AND HOLD FUNCTION BLOCK DIAGRAM
EN
>
TRACK
>
IN01
S1
>
OUT01
S2
>
OUT02
>
IN02
>
>
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
>
IN15
>
>
S15
OUT15
Softlist Parameters
The remaining TRK_HLD inputs are accessed via the softlist. The value of these inputs can be changed
via command from an operator interface or the Set Value (SET_VAL) function block, but they cannot be
“wired” to the block. Below is a description and initial value for each softlist parameter.
S(n)
These parameters track the inputs if (EN) is TRUE, or hold their last value if (EN) is FALSE.
Parameter
Units
Initial Value
Min Value
Max Value
S1
Engr
0.0
NA
NA
:
:
:
0.0
NA
NA
:
S15
Engr
Where NA indicates not applicable.
3.16 Impulse Function Block (IMPULSE)
IMPULSE
REAL
IN
BOOL
EN
OUT
REAL
The symbol of the Impulse (IMPULSE) function block is shown above. This block calculates the impulse
function of the value applied to the input (IN). Since the block functions nearly identically to the
derivative portion of the PID algorithm, similar terminology is used where applicable. The RESP softlist
3-44
August 2002
CG39-22
Dynamic Function Blocks
value sets the block to respond only to input values that increase (RESP=1), decrease (RESP=-1), or are
bi-directional (RESP=0). There are also configuration options for reverse action via the DIR_ACT
softlist parameter and absolute value output.
The inputs and output of the IMPULSE block are defined as follows:
IN
This is the process input to the algorithm.
EN
This is the enable track command input to the algorithm. When this input is
FALSE, the algorithm is in a tracking mode [(OUT)=0] and the impulse function
is inactive.
OUT
This is the calculated output.
Softlist Parameters
The remaining IMPULSE inputs are accessed via the softlist. The value of these inputs can be changed
via command from an operator interface or the Set Value (SET_VAL) function block, but they cannot be
“wired” to the block. Below is a description and initial value for each softlist parameter.
GAIN
This is the gain input to the algorithm.
TD
This is the derivative time input (in minutes) to the algorithm.
DG
This is the derivative time gain input to the algorithm.
DIR_ACT
This is a boolean input to the algorithm which determines the action of
the controller. TRUE signifies direct action (A=1) and FALSE signifies
reverse action (A=-1).
RESP
This is an enumerated input that specifies the responses of the algorithm.
The available selections are:
Enumerated Value
0
1
2
August 2002
Selection
DECREASING
BI-DIRECTIONAL
INCREASING
Description
Responds only to decreasing input values.
Responds to any input change.
Responds only to increasing input values.
3-45
Dynamic Function Blocks
CG39-22
NOTE
Use the associated integer value when writing to enumerated softlist
parameters from outside (operator interface) or inside the controller. For
example, to change the response type of the Impulse block to increasing,
a 2 should be written to the RESP softlist parameter.
ABSOUT
This is a Boolean input which, when TRUE, forces the algorithm to calculate
the output as an absolute value function. FALSE instructs the algorithm to
calculate the output normally.
Parameter
Units
Initial Value
Min Value
Max Value
GAIN
dimensionless
1.0
0.001
100.0
TD
Min
0.0 (OFF)
0.0
1000.0
DG
dimensionless
10.0
1.0
30.0
DIR_ACT
BOOL
TRUE (Direct Action)
FALSE
TRUE
RESP
RESPONSE_TYPE
BI-DIRECTIONAL (1)
0
2
ABSOUT
BOOL
FALSE (Normal Calculation)
FALSE
TRUE
3.17 Dead Time Table Function Block (DEADTIM)
DEADTIM
REAL
BOOL
TIME
IN
EN
ADT
OUT
REAL
The symbol of the Dead Time Table (DEADTIM) function block is shown above. This block provides a
dead time element for regulatory control strategies. Examples include Smith Predictor, Delayed Integral,
and Feed Forward applications. You must specify the maximum dead time (DT) value and the number of
registers (NUM_OF_REGISTERS) in the softlist.
Optionally, for cases where the dead time is variable, but less than the maximum dead time, you can
provide the actual dead time input (ADT) value.
The block's algorithm contains uses a table of registers, IN(1)...IN(NUM_OF_REGISTERS). The
NUM_OF_REGISTERS softlist value is used to determine the required memory allocation for each Dead
Time function block configured. The NUM_OF_REGISTERS softlist value should have a positive
integer value <= 300. The algorithm also includes a method for writing (updating new values) to and
reading (selecting the output value) from the table of registers. The current input (IN)n replaces INn-1
each time a write occurs. The output (OUT) value equals the (IN) value at the selected register.
3-46
August 2002
CG39-22
Dynamic Function Blocks
The total dead time (DT) is set via a softlist parameter. Data is written to the table at a time interval
determined by the ratio DT/NUM_OF_REGISTERS (the sampling time). DT determines how fast the
data travels through the table. Normally, the output is the oldest data in the table. If the ADT input value
is used, that value determines which table entry to use as the output. The fastest sample time cannot
exceed the control module scan time.
Use care in the selection of the DT and NUM_OF_REGISTERS values so that the number of samples
(DT/NUM_OF_REGISTERS) are an integer multiple of the execution period. Scan cycles are not
interruptable and cannot be split.
The inputs and output are defined as follows:
IN
This is the process input to the selected shift register.
EN
This is the block's enable input. When FALSE, the dead time function is
bypassed [(OUT)=(IN)].
ADT
This is the actual dead time input.
OUT
This is the blocks’s output. It is equal to the selected shift register.
Softlist Parameters
The remaining DEADTM inputs are accessed via the softlist. The value of these inputs can be changed
via command from an operator interface or the Set Value (SET_VAL) function block, but they cannot be
“wired” to the block. Below is a description and initial value for each softlist parameter.
DT
This is the maximum dead time (in minutes). DT is specified
during configuration.
NUM_OF_REGISTERS
This is the number of shift registers. It determines the
memory allocation for the block.
Parameter
Data Type
Initial Value
Min Value
Max Value
DT
TIME
T#0d0h0m0s0ms
T#0d0h0m0s0ms
NA
NUM_OF_REGISTERS
INT
20
1
300
August 2002
3-47
Dynamic Function Blocks
CG39-22
3.18 Delayed Error Function Block (DEL_ERR)
DEL_ERR
PV
SP
PVA
REAL
REAL
REAL
ERR
EI
D_ERR
REAL
REAL
REAL
The symbol of the Delayed Error (DEL_ERR) function block is shown above. This block is typically
used with a PID Error Input block and a Dead Time Table block to provide a control strategy
implementing delayed integral action.
The second process input to this block (PVA) is often configured as a delayed version of the primary
process (PV) via the output of a dead time algorithm.
The Delayed Error algorithm performs a standard error calculation (PV-SP) and a delayed error
calculation (PVA-SP). The actual error to integrate (EI) is selected by the block based upon the value
of the standard and delayed error components; if both errors have the same sign, the smaller absolute
error is selected otherwise (EI)=0.0.
This block’s selected error can be very useful in processes dominated by dead time.
DELAYED ERROR FUNCTION BLOCK DIAGRAM
+
PV
>
Σ
>
ERR
>
EI
>
D_ERR
-
SP
IF,THEN
PVA
3-48
+
>
Σ
August 2002
CG39-22
Dynamic Function Blocks
The inputs and outputs of the DEL_ERR block are defined as follows:
PV
This is the current process input to the control algorithm.
P
This is the current setpoint input to the control algorithm.
PVA
This is the delayed process input (normally from a dead time table).
ERR
This is the current error [(PV)-(SP)]output.
EI
This is the selected error (normally used as the (IERR) input to the PID Error Input function
block).
D_ERR
This is the delayed error [(PVA)-(SP)].
Softlist Parameters
There are no softlist parameters for this block.
3.19 Batch Switch Function Block (BAT_SW)
BAT_SW
REAL
IN
OUT
REAL
The symbol of the Batch Switch (BAT_SW) function block is shown above. In control loops where a
process value takes an extended period of time to reach setpoint, reset windup may cause unacceptable
results. This happens most commonly in batch processes, where the process value takes a long time to
reach the setpoint value during startup. In a process where overshoot is not tolerable, reset windup can be
eliminated with the Batch Switch bloack.
This block is normally used in the feedback path of a controller. When the input (IN) is within the
engineering unit range (EINL to EINH), the input value is passed normally to the controller feedback and
cause normal reset action.
If (IN), which is normally the controller output, goes beyond the engineering signal range ( < EINL or
>EINH), the feedback is modified to keep the controller output within range.
In some cases, as with a large gain error, the feedback can be reduced to zero. While this should
eliminate overshoot problems on startup, it could cause the opposite effect of a sluggish startup. To
overcome this, the BAT_SW block has a pre-load value (BPL) that limits the amount of change in the
feedback signal.
August 2002
3-49
Dynamic Function Blocks
CG39-22
BATCH SWITCH FUNCTION BLOCK DIAGRAM
IN
-
>
Σ
>
+
G
>
+
Σ
>
HI
SEL
>
LO
SEL
HI
> SEL
LO
SEL
+
BPL
EINH
-
Σ
>
+
>
+
G
>
Σ
>
> OUT
+
EINL
The input and output of the BAT_SW are defined as follows:
IN
This is the input to the block. It is ususally fed from the output from a controller or
Auto/Manual block.
OUT
This is the calculated output used as the feedback signal to a controller block.
3-50
August 2002
CG39-22
Dynamic Function Blocks
Softlist Parameters
The remaining BAT_SW inputs are accessed via the softlist. The value of these inputs can be changed via
command from an operator interface or the Set Value (SET_VAL) function block, but they cannot be
“wired” to the block. Below is a description and initial value for each softlist parameter.
EINL
This is the engineering low limit for the input.
EINH
This is the engineering high limit for the input.
BPL
This is the batch pre-load value (in engineering units).
GAIN This is the gain used for the high/low limit controllers (must be greater than zero).
Parameter
Units
Initial Value
Min Value
Max Value
EINL
Engr
0.0
NA
NA
EINH
Engr
100.0
NA
NA
BPL
Engr
50.0
NA
NA
GAIN
dimensionless
32.0
0.0
NA
Where NA indicates not applicable.
3.20 EAM Totalizer Function Block (EAM_TOT)
EAM_TOT
UDINT
BOOL
BOOL
REAL
REAL
IN
R
HOLD
TRIP1
TRIP2
TOTAL
ETOT
CYCLES
ALARM1
ALARM2
UDINT
REAL
INT
BOOL
BOOL
The symbol of the EAM (Enhanced Analog Module) Totalizer (EAM_TOT) function block is shown
above. It is designed to totalize signals generated by an Enhanced Analog Module's Voltage Pulse InTotal and Current Pulse In-Total channel types.
Totalization is partially accomplished by these channel types. but this block is used to coordinate
redundant EAMs and to provide reset, hold, alarming, and scaling features. These channel types provide
an integer that corresponds to the total number of pulses received since the EAM powered-up or since the
last redundancy switchover.
August 2002
3-51
Dynamic Function Blocks
CG39-22
This block compares the current value from the EAM totalizer channel with its value from the last scan to
determine the number of pulses which have occurred during the last scan. The total value from the EAM
channel begins at 0 upon start-up or upon a redundancy switchover and it counts up until it overflows.
Upon overflow of the unsigned 32-bit number, the most significant (MS) bit (bit-31) is set, effectively
forcing the values to wrap from FFFFFFFF (4.295E9) to 80000000 (2.148E9). This permits the block to
distinguish between a wrap-around, a condition of start-up, or a redundancy switchover.
The EAM Totalizer block converts the value from the EAM total channel (redundant or non-redundant)
into two separate outputs as follows:
TOTAL This is the total number of pulses accumulated since the last reset (R) or ROLLOVER (see
softlist).
ETOT
This is the (TOTAL) scaled to engineering units.
Alarm outputs 1 and 2 indicate when input trip totals (in engineering units) have been reached or
exceeded. When reset (R) is TRUE, the (TOTAL) output equals 0, ETOT = 0.0, CYCLES = 0, ALARM1
and ALARM2 outputs are FALSE.
When HOLD = TRUE, the TOTAL and ETOT outputs will not update. The block will ignore IN. The
CYCLES output is an integer that counts the number of times the TOTAL output has rolled over. The
TOTAL will rollover at 4294967295, or at the ROLLOVER_POINT softlist value.
The inputs and outputs of the EAM_TOT block are defined as follows:
IN
This is the input to the block from an EAM totalizer channel.
R
This is the reset input. When TRUE, it resets all outputs to a value of 0.0.
HOLD
This is the input that holds all outputs at their last value when TRUE.
TRIP1
This is an input trip limit value.
TRIP2
This is a second input trip limit value.
TOTAL
This is the totalized output value.
ETOT
This is the scaled totalized output value (in engineering units).
CYCLES
This is an integer that counts the number of times that the totalizer has rolled over.
ALARM1 This is a boolean flag indicating the first trip limit was reached.
ALARM2 This is a boolean flag indicating the second trip limit was reached.
3-52
August 2002
CG39-22
Dynamic Function Blocks
Softlist Parameters
The remaining EAM_TOT inputs are accessed via the softlist. The value of these inputs can be changed
via command from an operator interface or the Set Value (SET_VAL) function block, but they cannot be
“wired” to the block. Below is a description and initial value for each softlist parameter.
SCALE
Value (in pulses per engineering unit) that the TOTAL value is divided by to
calculate the ETOT value.
ROLLOVER_POINT
When TOTAL equals this UDINT value, TOTAL is set to 0 and CYCLES
increments by 1.
Parameter
Data Type
Initial Value
Min Value
Max Value
SCALE
REAL
1.0
NA
NA
ROLLOVER_POINT
UDINT
4294967295ud
0ud
4294967295ud
Where NA is not applicable.
3.21 Totalizer Function Block (TOTAL)
REAL
BOOL
REAL
REAL
TOTAL
TOTAL
IN
R
PULSE
ALARM1
TRIP1
ALARM2
TRIP2
REAL
BOOL
BOOL
BOOL
The symbol of the Totalizer (TOTAL) function block is shown above. This block is usually used for flow
applications where it converts an analog signal into two separate outputs as follows:
TOTAL This is a totaled value (real number) of the number of input units accumulated over time.
PULSE
This is a 50% duty cycle pulse whose frequency is proportional to the magnitude of the input.
It can be used to drive a counter or accumulator.
A DROPOUT feature causes the block to stop totaling and pulsing if the input falls below the DROPOUT
softlist value.
The full scale pulses (per time) is user-selectable. The output is selectable for hours, minutes, or seconds.
The output rate values are dependent on the block's scan rate. Therefore, the PULSE output rate cannot
be faster than twice the scan rate.
Alarm outputs 1 and 2 indicate when the input trip totals have been reached (or exceeded).
August 2002
3-53
Dynamic Function Blocks
CG39-22
When reset (R) is TRUE, the TOTAL output value equals 0.0 and the PULSE, ALARM1, and ALARM2
outputs are set to FALSE.
NOTE
If the (PULSE) output is not being used, only the OUTPUT_RATE
softlist value must be set.
TOTALIZER FUNCTION BLOCK DIAGRAM
..
.
F
T
IN
> PULSE
GEN.
> PULSE
R
R
A
> A
B
.
.
.
F
COUNTER
B
0.0
T
DROP OUT
TRIP1
TRIP2
3-54
> TOTAL
A
>A
>
B
B
A
>
>A
B
B
> ALARM1
R
> ALARM2
R
August 2002
CG39-22
Dynamic Function Blocks
The inputs and outputs of this block are defined as follows:
IN
This is the input to the block.
R
This is the reset input. When TRUE, it resets all outputs to 0.0, or FALSE.
TRIP1
This is the first trip limit value.
TRIP2
This is the second trip limit value.
TOTAL
This is the totaled output value.
PULSE
This is the pulse output.
ALARM1 This is a boolean flag indicating when the first trip limit is reached.
ALARM2 This is a boolean flag indicating when the second trip limit is reached.
Softlist Parameters
The remaining TOTAL inputs are accessed via the softlist. The value of these inputs can be changed via
command from an operator interface or the Set Value (SET_VAL) function block, but they cannot be
“wired” to the block. Below is a description and initial value for each softlist parameter.
FSCALE
This is the full scale number of pulses.
OUTPUT_RATE This is an enumerated value which selects the time base for the TOTAL and
PULSE output. The selections are:
Enumerated Value
Selection
Description
1
PULSES-PER-HOUR
The output rate is in pulses per hour.
2
PULSES-PER-MINUTE
The output rate is in pulses per min.
3
PULSES-PER-SECOND
The output rate is in pulses per sec.
NOTE
Use the associated integer value when writing to enumerated softlist
parameters from an operator interface or inside the controller. For
example, to change the output time base of the TOTAL block to pulses
per second, a 3 should be written to the OUTPUT_RATE softlist
parameter.
EINL
This is the 0% of scale input, used to determine the percent of scale of the input for proper
pulse creation.
EINH
This is the full-scale (100%) input, used to determine the percent of scale of the input for
proper pulse creation.
DROPOUT This is the limit on (IN) below which the block stops pulsing and totalizing.
August 2002
3-55
Dynamic Function Blocks
CG39-22
Parameter
Units
Initial Value
Min Value
Max Value
FSCALE
Pulses
100.0
0.0
NA
OUTPUT_RATE
RATE_TYPE
PULSES/MIN(2)
1
3
EINL
Engr
0.0
NA
NA
EINH
Engr
100.0
NA
NA
DROPOUT
Engr
0.0
NA
NA
Where NA indicates not applicable.
3.22 Accumulator Function Block (ACCUM)
ACCUM
PLSIN
ETOT
PULSE
R
BOOL
BOOL
REAL
BOOL
The symbol of the Accumulator (ACCUM) function block is shown above. This block is used to convert
a pulse input (e.g. from a contact on a roller) into engineering units. Upon receiving a pulse, this block
increments the Engineering Total (ETOT) value and converts the internal counter to a REAL number that
is scaled by the SCALE_FACTOR softlist value.
The PULSE output value is TRUE for one scan when ETOT advances past the next whole integer value.
The SCALE_FACTOR softlist value must be 1.0 or less (otherwise, the PULSE output is meaningless).
ACCUMULATOR FUNCTION BLOCK DIAGRAM
R
PLSIN
> COUNTER
0.0
. .>
SCALER
.
T
F
> ETOT
PULSE
GEN.
3-56
> PULSE
August 2002
CG39-22
Dynamic Function Blocks
The inputs and outputs of the ACCUM block are defined as follows:
PLSIN
This is the input pulse train.
R
This is the reset input. It accepts A BOOL value. When TRUE, all outputs are reset to zero.
ETOT
This output provides a REAL value representing total pulses converted to engineering units.
PULSE This is the calculated pulse output. It provides a BOOL value. It is set to TRUE for one scan
when the ETOT value advances past the next whole integer value.
NOTE
The fastest output pulse cycle time is twice the scan time.
Softlist Parameters
The remaining ACCUM input is accessed via the softlist. The value of this input can be changed via a
command from an operator interface or by the Set Value (SET_VAL) function block, but it cannot be
“wired” to the block. Below is a description and initial value for this softlist parameter.
SCALE_FACTOR
This is the conversion factor (in engineering units) per pulse.
Parameter
Units
Initial Value
Min Value
Max Value
SCALE_FACTOR
Engr Unit/Pulse
1.0
0.0
NA
Where NA indicates not applicable.
3.23 Loop Status Function Block (LP_STAT)
LP_STAT
BOOL
BOOL
BOOL
BOOL
BOOL
BOOL
BOOL
BOOL
BOOL
BOOL
AUTO
LOCAL
SS
EXTRNL
CONS
COMP
RAMP
OVERRD
EM
RHOLD
STATUS
CMD
INT
INT
The symbol of the Loop Status (LP_STAT) function block is shown above. This block is to be placed on
the same sheet as the control loop blocks when communications with the Hi-Level Link (HLL) is desired.
When implemented in this manner, it serves three purposes:
August 2002
3-57
Dynamic Function Blocks
CG39-22
1. It acts as a grouping mechanism for the loop status parameters. All the status parameters are
conveniently located in one block.
2. It is a documentation device. It it used to locate the control source for the loop status parameters on
the same sheet as the loop.
3. It aids in the communication between a Link Interface Module (LIM) and a control module.
The loop status (STATUS) output provides an integer value that represents the current state of the inputs
when converted to binary form.
The command (CMD) output provides a way for the loop status to be modified from an operator console.
The block analyses incoming commands (e.g. AUTO, LOCAL) and attempts to set the input values.
For example, if a command came through to change the auto status from TRUE to FALSE, the block
writes to the local variable connected to the AUTO input. If no local variable is wired (no storage is
allocated) to a particular input, that command is effectively locked-out.
The STATUS output always reflects the inputs. All unconnected input values default to FALSE, except
the console (CONS) input, which defaults to TRUE. The Console and Computer bits in the status word
are normally mutually exclusive. In any non-local mode, either the Console or Computer bits should be
set in (STATUS), so when one is toggled ON, the other is toggled OFF. In Local mode, the Console and
Computer bits may both be set. If the Console and Computer bits are both set when returning to a nonlocal mode, the mode will default to Console.
The STATUS output provides an INT value and follows the layout below:
Bit Number 1
Bit Number 2
Bit Number 3
Bit Number 4
Bit Number 5
Bit Number 6
Bit Number 7
Bit Number 8
Bit Number 9
Bit Number 10
Automatic Mode (AM)
Local Mode (Local)
Standby Sync Mode (S)
External Setpoint (E)
Console Mode (CONS)
Computer Mode (CE)
Ramping Setpoint Mode (R)
Override (O)
Emergency Manual Mode (EM)
Ramp Hold (H) status is interpreted by MYCRO or other operator consoles.
Table 3–1shows the logic states of status bits. The top row indicates the bit number that represents each
item in the status word. The last column indicates the mode the Siemens operator console displays upon
receiving the status word.
3-58
August 2002
CG39-22
Dynamic Function Blocks
Table 3–1 Loop Status Word Logic States
1
Bit
Location
Local
AM
Console
Mode
*
0
MAN (S)
1
1
AUTO (S)
X
0
0
MAN (EM)
X
X
0
1
AUTO (EM)
1
X
X
0
0
MAN (O)
0
1
X
X
0
1
AUTO (O)
X
0
0
X
1
0
0
MAN (E)
X
0
0
X
0
0
0
MAN
1
0
0
X
X
0
1
AUTO (H)
0
0
0
X
1
0
1
AUTO (E)
0
0
0
1
0
0
1
AUTO (R)
0
0
0
0
0
0
1
AUTO
10
9
8
7
6
5
4
3
H
EM
O
R
CE
CONS
E
S
X
X
X
X
*
*
X
1
X
X
X
X
X
X
1
X
X
X
1
X
X
0
X
2
Key:
1 = TRUE, 0 = FALSE, X = do not care
* = These bits change the source of control loop commands, but do not affect control loop
calculations.
"
August 2002
3-59
Dynamic Function Blocks
CG39-22
!Notes
3-60
August 2002
CG39-22
4.0
Compare and Select Function Blocks
Compare and Select Function Blocks
The Compare and Select function blocks are a subset of the standard function blocks. The Compare
blocks accept all data types as inputs, compares them, and generate a boolean output. The Select blocks
select one of the inputs as the output.
Refer to sections 11 and 12 in Using the ProcessSuite 4-mation Configuration Software (document
number CG39-20) for data type descriptions. For memory usage and ACM execution time information
on all standard configuration elements, see Appendix C in the same document.
A listing of Compare and Select function blocks is presented here. Individual blocks are detailed in the
subsections that follow.
•
•
•
•
•
•
•
•
•
•
•
•
•
4.1
Equal
Inequality
Greater Than
Greater or Equal
Less Than
Less or Equal
Binary Selector Switch
Low Selector
High Selector
Middle of Three Selector
Limiter
Multiplexer Switch
State
Equal Function Block (EQ)
EQ
ANY
ANY
:
IN01
IN02
:
ANY
IN16
OUT
BOOL
The symbol of the Equal function block is shown above. This block tests that the configured input values
are all equal from (IN01) to (INn).
The Boolean output (OUT) will be TRUE when all configured inputs are equal in value, and the output
will be FALSE at all other times.
This block is extensible to a maximum of 16 inputs.
August 2002
4-1
Compare and Select Function Blocks
CG39-22
The inputs and the output of the EQ block are defined as follows:
IN(n) These inputs will be compared to each other (must be the same data type).
OUT
This Boolean output will be TRUE if all inputs are equal.
Softlist Parameters
There are no softlist parameters for the EQ block.
4.2
Inequality Function Block (NE)
NE
ANY
ANY
IN1
IN2
OUT
BOOL
The symbol of the Inequality function block is shown above. This block will compare two configured
input values. The Boolean output will be TRUE when the input values are not equal, and the output will
be FALSE at all other times.
The inputs and output of the NE block are defined as follows:
IN1, IN2 The two inputs to be compared (must be the same data type).
OUT
This Boolean output will be TRUE if the two inputs are not equal.
Softlist Parameters
There are no softlist parameters for the NE block.
4.3
Greater Than Function Block (GT)
GT
ANY
ANY
:
ANY
IN01
IN02
:
IN16
OUT
BOOL
The symbol of the Greater Than (GT) function block is shown above. This block tests the configured
input values for a strictly decreasing sequence of values from (IN01) to (INn). The Boolean output
(OUT) will be TRUE when the configured inputs are in a decreasing sequence, and the output will be
FALSE at all other times.
This block is extensible to a maximum of 16 inputs.
4-2
August 2002
CG39-22
Compare and Select Function Blocks
The inputs and output of the GT block are defined as follows:
IN(n) The inputs that will be compared to each other (must be the same data type).
OUT
This Boolean output will be TRUE if each input is less than the one it follows.
Softlist Parameters
There are no softlist parameters for the GT block.
4.4
Greater or Equal Function Block (GE)
GE
ANY
ANY
:
IN01
IN02
:
ANY
IN16
OUT
BOOL
The symbol of the Greater or Equal function block is shown above. This block tests the configured input
values for a decreasing or equivalent sequence of values from (IN01) to (INn). This means the values can
decrease or be equal from one input to the next to cause the (OUT) output to be TRUE. The output will
be FALSE at all other times.
This block is extensible to a maximum of 16 inputs.
The inputs and the output of the GE block are defined as follows:
IN(n)
These inputs will be compared to each other (must be the same data type).
OUT
This output will be TRUE if each input value is equal to, or less than the one it
follows.
Softlist Parameters
There are no softlist parameters for the GE block.
4.5
Less Than Function Block (LT)
LT
ANY
ANY
:
ANY
IN01
IN02
:
IN16
OUT
BOOL
The symbol of the Less Than function block is shown above. This block tests the configured input values
for a strictly increasing sequence of values from (IN01) to (INn). The Boolean output (OUT) will be
August 2002
4-3
Compare and Select Function Blocks
CG39-22
TRUE when the configured inputs are in an increasing sequence and the output will be FALSE at all other
times.
This block is extensible to a maximum of 16 inputs.
The inputs and output of the LT block are defined as follows:
IN(n) The inputs which will be compared to each other (must be the same data type).
OUT
This Boolean output will be TRUE if each input is greater than the one it follows.
Softlist Parameters
There are no softlist parameters for the LT block.
4.6
Less or Equal Function Block (LE)
LE
ANY
ANY
:
ANY
IN01
IN02
:
IN16
OUT
BOOL
The symbol of the Less or Equal function block is shown above. This block tests the configured input
values for an increasing or equivalent sequence of values from (IN01) to (INn). This means the values
can increase or be equal from one input to the next to make the (OUT) be TRUE. The output will be
FALSE at all other times.
This block is extensible to a maximum of 16 inputs.
The inputs and output of the LE block are defined as follows:
IN(n) These inputs will be compared against each other (must be the same data type).
OUT
This Boolean output will be TRUE if each input is equal to or greater than the one it follows.
Softlist Parameters
There are no softlist parameters for the LE function block.
4-4
August 2002
CG39-22
4.7
Compare and Select Function Blocks
Binary Selector Switch Function Block (SEL)
BOOL
SEL
G
ANY
IN0
ANY
IN1
OUT
ANY
The symbol of the Binary Selector Switch block is shown above. This block acts as a single pole double
throw switch.
The output will be equal to the value of (IN0) when the Boolean switch input (G) is FALSE otherwise
the output will be equal to the value of (IN1) when the Boolean switch input (G) is TRUE.
Except for the Boolean switch input, this block accepts inputs of ANY data type. However, the input and
output must be of the same data type.
The inputs and outputs of the SEL block are defined as follows:
G
The Boolean switch input.
IN0
The input of the block which is passed to the output when (G) is FALSE.
IN1
The input to the block which is passed to the output when (G) is TRUE.
OUT The selected value output.
Softlist Parameters
There are no softlist parameters for the SEL function block.
4.8
Low Selector or Function Block (MIN)
MIN
*SEE NOTE
*SEE NOTE
:
*SEE NOTE
IN01
IN02
:
IN16
OUT
IN_NUM
IN1SEL
*SEE NOTE
INT
BOOL
The symbol of the Low Selector function block is shown above. This block compares all configured input
values in one scan. The output will be equal to the input with the lowest value for that scan cycle.
An additional output (IN_NUM) will indicate which input was selected; another output (IN1SEL) will be
set to TRUE when IN01 is selected and will be FALSE at all other times.
This block is extensible up to a maximum of 16 inputs.
August 2002
4-5
Compare and Select Function Blocks
CG39-22
NOTE
This Input/Output will accept all data types except BOOL.
The inputs and outputs of the MIN block are defined as follows:
IN(n)
The inputs which will be compared to each other (must be the same data type).
OUT
The chosen input (lowest) will be passed to this output.
IN_NUM This integer output indicates which number input was chosen. It will be between 1 and 16.
IN1SEL
This Boolean output will be TRUE if the first input (IN01) is chosen for the output.
Softlist Parameters
There are no softlist parameters for the MIN function block.
4.9
High Selector Function Block (MAX)
MAX
*SEE NOTE
*SEE NOTE
:
IN01
IN02
:
*SEE NOTE
IN16
OUT
IN_NUM
IN1SEL
*SEE NOTE
INT
BOOL
The symbol of the High Selector function block is shown above. This block compares all configured
input values in one scan. The output will equal the input with the greatest value for that scan cycle.
An additional output (IN_NUM) will indicate which input is selected; another output (IN1SEL) will be
set to TRUE when (IN01) is selected and will be FALSE at all other times.
This block is extensible to a maximum of 16 inputs.
NOTE
This Input/Output will accept all data types except BOOL.
The inputs and the outputs of the MAX block are defined as follows:
IN(n)
The inputs which will be compared to each other (must be the same data type).
OUT
The chosen input (highest) will be passed to this output.
IN_NUM This integer output indicates which input was chosen. It will be from 1 to 16.
IN1SEL
4-6
This Boolean output will be TRUE if the first input is chosen for the output.
August 2002
CG39-22
Compare and Select Function Blocks
Softlist Parameters
There are no softlist parameters for the MAX function block.
4.10 Middle of Three Selector Function Block (MID_SEL)
MID_SEL
*SEE NOTE
*SEE NOTE
*SEE NOTE
IN1
IN2
IN3
OUT
*SEE NOTE
The symbol of the High Selector function block is shown above. This block compares the three input
values in one scan. The output will be the same value as the input with the middle value for that scan
cycle.
NOTE
This Input/Output will accept all data types except BOOL and STRING.
The inputs and output of the MID_SEL block are defined as follows:
IN1, IN2 , IN3 The inputs to be compared to each other (must be the same data type).
OUT
The chosen input (middle value) will be passed to this output.
Softlist Parameters
There are no softlist parameters for the MID_SEL block.
4.11 Limiter Function Block (LIMIT)
LIMIT
*SEE NOTE
*SEE NOTE
*SEE NOTE
MN
IN
MX
OUT
LL
HL
*SEE NOTE
BOOL
BOOL
The symbol of the Limiter (LIMIT) function block is shown above. This block performs limiting action
on an input value to maintain the output between two specified limits.
When the IN input value is less than the configured minimum (MN) input value, the OUT value is equal
to the MN value and the low limit (LL) value is set to TRUE. When the IN input value is greater than the
configured maximum value (MX), the OUT value is equal to the MX value and the high limit (HL) output
value is set to TRUE.
August 2002
4-7
Compare and Select Function Blocks
CG39-22
MN must be less than or equal to MX for the block to operate meaningfully. If MN exceeds MX, OUT
will be set to MX, LL will be set FALSE, and HL will be set TRUE, regardless of the IN value.
NOTE
All data types except BOOL and STRING are supported for this block.
The data types of the input, output, and limits must all be the same for
the block to operate meaningfully.
The inputs and outputs of the LIMIT block are defined as follows:
MN
The lower limit (minimum).
IN
The input to be limited.
MX
The upper limit (maximum).
OUT The calculated output of the block, which will be one of the input values.
LL
This is the Low Limit output flag. It provides a BOOL value that is set to TRUE when the IN
value is less than MN value (unless MN exceeds MX).
HL
This is the High Limit output flag. It provides a BOOL value that is set to TRUE when the IN
value exceeds the MX value (or when MN exceeds MX).
Softlist Parameters
There are no softlist parameters for this block.
4.12 Multiplexer Switch Function Block (MUX)
MUX
INT
ANY
ANY
:
ANY
K
IN01
IN02
:
IN15
OUT
ANY
The symbol of the Multiplexer Switch function block is shown above. This block acts as a multi-contact
rotary switch. The output value will be determined by the value of the input switch (K).
The input which has the input number (IN01) through (IN15) that corresponds to the (K) input will be
passed through as the output. If the input switch (K) is less than 1 or greater than the number of inputs
configured, (OUT) will be set to zero.
This block is extensible up to a maximum of 15 inputs.
4-8
August 2002
CG39-22
Compare and Select Function Blocks
The inputs and output to the MUX block are defined as follows:
K
The integer input which determines which input is used as the output.
IN(n) The inputs from which the block selects the output (must be the same data type).
OUT
The input is passed to this output.
Softlist Parameters
There are no softlist parameters for the MUX block.
4.13 State Function Block (STATE)
The symbol of the State function block is shown above. This block accepts up to 16 BOOL inputs,
analyzes them to determine which input or inputs are TRUE, then provides an output identifying the
highest numbered TRUE input. For example, if inputs ST01, ST03, ST07, and ST11, are TRUE, the
block outputs a value of 11.0.
If none of the inputs are TRUE, the block outputs the value of the STATE0 softlist parameter. Its default
value is 0.0.
The block’s output is a REAL value obtained from its softlist. This means that each softlist value used as
the block’s output can be edited. For example, if the STATE11 parameter is edited to have a value of
50.0, then it is used as the output whenever ST11 is the highest numbered TRUE input.
This block is extensible up to 16 inputs.
The inputs and outputs of the STATE block are defined as follows:
ST(n)
These are the State inputs. Each input accepts a BOOL value. If its value is TRUE, it is
analyzed along with all other State inputs that are also TRUE.
STATE This State output is the block’s main output. It provides a REAL data value representing the
highest numbered ST(n) input which has a value of TRUE.
Softlist Parameters
STATE(n) These are the State parameters. Each is associated with a corresponding STATE input
(except STATE0). The block analyzes all TRUE inputs, then chooses the appropriate
STATE(n) softlist value to use as its output.
August 2002
4-9
Compare and Select Function Blocks
Parameter
Data
Type
Default
Value
STATE0
STATE1
STATE2
STATE3
STATE4
STATE5
STATE6
STATE7
STATE8
STATE9
STATE10
STATE11
STATE12
STATE13
STATE14
STATE15
STATE16
REAL
REAL
REAL
REAL
REAL
REAL
REAL
REAL
REAL
REAL
REAL
REAL
REAL
REAL
REAL
REAL
REAL
0.0
1.0
2.0
3.0
4.0
5.0
6.0
7.0
8.0
9.0
10.0
11.0
12.0
13.0
14.0
15.0
16.0
4-10
CG39-22
August 2002
CG39-22
5.0
Logic Function Blocks
Logic Function Blocks
The Logic function blocks are a subset of the standard function blocks. They provide standard boolean
functions. For memory usage and ACM execution time information on all standard configuration
elements, see Appendix C in Using the ProcessSuite 4-mation Configuration Software (document number
CG39-20).
A listing of Logic function blocks is presented here. Individual blocks are detailed in the subsections that
follow.
•
•
•
•
•
•
•
•
AND
OR
XOR
NOT
SR Flip-Flop
RS Flip-Flop
Rising Edge Detect Trigger
Falling Edge Detect Trigger
5.1
AND Function Block (AND)
AND
BOOL
BOOL
:
BOOL
IN01
IN02
:
IN16
OUT
BOOL
The symbol of the AND function block is shown above. This block applies the logical AND operation to
all configured inputs. The output is TRUE when all of the configured inputs are TRUE; otherwise, the
output is FALSE.
This block is extensible to a maximum of 16 inputs.
The inputs and outputs of the AND block are defined as follows:
IN(n) The boolean inputs to be ANDed together.
OUT
The boolean output of the block which is TRUE if all configured input values are TRUE.
Softlist Parameters
There are no softlist parameters for the AND block.
August 2002
5-1
Logic Function Blocks
5.2
CG39-22
OR Function Block (OR)
OR
BOOL
BOOL
:
BOOL
OUT
IN01
IN02
:
IN16
BOOL
The symbol of the OR function block is shown above. This block applies the logical OR operation to all
configured inputs. The output is TRUE whenever any of the configured input values are TRUE;
otherwise, the output is FALSE when all input values are FALSE.
This block is extensible to a maximum of 16 inputs.
The inputs and output of the OR block are defined as follows:
IN(n) The boolean inputs to be ORed together.
OUT
The boolean output of the block. It is TRUE if one or more configured input values are TRUE.
Softlist Parameters
There are no softlist parameters for the OR block.
5.3
Exclusive OR Function Block (XOR)
XOR
BOOL
BOOL
:
BOOL
IN01
IN02
:
IN16
OUT
BOOL
The symbol of the Exclusive OR function block is shown above. This block applies the logical Exclusive
OR operation to all configured inputs. The output is TRUE whenever any, but not all, of the configured
input values are TRUE. The output is FALSE when all input values are TRUE or when all input values
are FALSE.
This block is extensible to a maximum of 16 inputs.
The inputs and output of the XOR block are defined as follows:
IN(n) The Boolean inputs to be XORed together.
OUT
5-2
The Boolean output of the block which will be TRUE if any but not all configured inputs are
TRUE.
August 2002
CG39-22
Logic Function Blocks
Softlist Parameters
There are no softlist parameters for the XOR block.
5.4
NOT Function Block (NOT)
NOT
BOOL
IN
OUT
BOOL
The symbol of the NOT function block is shown above. This block provides the complement, or
inversion, of the configured input. The output is TRUE whenever the input value is FALSE. It is FALSE
whenever input value is TRUE.
The input and output of the NOT block are defined as follows:
IN
The boolean input to be NOTed.
OUT The boolean output of the block is TRUE if the input value is FALSE and vice versa.
Softlist Parameters
There are no softlist parameters for the NOT block.
5.5
SR Flip-Flop Function Block (SR)
SR
BOOL
S1
R
BOOL
S1
R
Q1
OUT
1
0
0
0
X
1
0
0
X
X
1
0
1
0
1
0
OUT
S1
Q1
OUT
X
R
BOOL
-
set input (dominant)
last output
output
don't care
reset input
The symbol of the SR (Set Reset) Flip-Flip function block and its supporting truth table is shown above.
This block performs a Set Dominant Flip-Flop function.
This block retains its previous cycle output which determines the output state when (S1) and (R) are both
FALSE.
August 2002
5-3
Logic Function Blocks
CG39-22
WARNING
This block retains its last output value, even through a Cold Restart.
Depending on configuration logic, this could result in an output channel
being unexpectantly energized when the controller restart occurs.
WARNING
This block retains its last output value, even through a Cold Restart.
Depending on configuration logic, this could result in an output channel
being unexpectantly energized when the controller restart occurs.
The inputs and output of the SR Flip Flop are defined as follows:
S1
The set input which when TRUE causes the output (OUT) to be TRUE.
R
The reset input which when TRUE causes the output (OUT) to be FALSE.
OUT The Boolean output of the block.
Softlist Parameters
There are no softlist parameters for this block.
5.6
RS Flip-Flop Function Block (RS)
RS
R1
S
BOOL
BOOL
R1
S
Q1
OUT
1
0
0
0
X
1
0
0
X
X
1
0
0
1
1
0
OUT
R1
S
Q1
OUT
X
BOOL
-
reset input (dominant)
set input
last output
block output
don't care
The symbol of the RS (Reset Set) Flip-Flip function block and its supporting truth table is shown above.
This block performs a Reset Dominant Flip-Flop function.
This block retains its previous cycle output which determines the output state when (S) and (R1) are both
FALSE.
5-4
August 2002
CG39-22
Logic Function Blocks
WARNING
This block retains its last output value, even through a Cold Restart.
Depending on configuration logic, this could result in an output channel
being unexpectantly energized when the controller restart occurs.
The inputs and output of the RS Flip Flop are defined as follows:
R1
The reset input which when TRUE causes the output (OUT) to be FALSE.
S
The set input which when TRUE causes the output (OUT) to be TRUE.
OUT The Boolean output of the block.
Softlist Parameters
There are no softlist parameters for this block.
5.7
Rising Edge Detect Trigger Function Block (R_TRIG)
R_TRIG
CLK
BOOL
CLK
OUT
BOOL
OUT
CLK LI OUT
0
1
1
X
0
1
0
1
0
CLK
LI
OUT
X
-
input
last cycle input
output
don't care
The symbol of the Rising Edge Detect Trigger block, along with its supporting timing diagram and truth
table, are shown above. This block detects a rising edge on the input signal.
For each positive Clock (CLK) input transition, the block output is single, positive pulse of one scan
duration. The last cycle input (LI) value of the (CLK) is retained internally to determine the block output.
The input and output of the R_TRIG block are defined as follows:
CLK
The input to be checked for a rising edge.
OUT
The boolean output of the block is TRUE for one scan if the input senses a
FALSE to TRUE transition.
Softlist Parameters
There are no softlist parameters for the R_TRIG block.
August 2002
5-5
Logic Function Blocks
5.8
CG39-22
Falling Edge Detect Trigger Function Block (F_TRIG)
F_TRIG
CLK
BOOL
CLK
OUT
BOOL
OUT
CLK LI OUT
0
0
1
0
1
X
0
1
0
CLK
LI
OUT
X
-
input
last cycle input
output
don't care
The symbol of the Falling Edge Detect Trigger function block along with its supporting timing diagram
and truth table are shown above. This block detects a falling edge on the input signal.
For each negative Clock (CLK) input transition, the block output is a single, positive pulse of one cycle
duration. The last cycle input (LI) value of the (CLK) is retained internally to determine the block output.
The input and output of the F_TRIG block are defined as follows:
CLK
The input to be checked for a falling edge.
OUT The boolean output of the block which is TRUE for one scan if the input senses a TRUE to
FALSE transition.
Softlist Parameters
There are no softlist parameters for the F_TRIG block.
NOTE
The Shift and Rotate function blocks, located in the logic sub menu of
the Icon Bar, are defined in section 6.
"
5-6
August 2002
CG39-22
6.0
Shift and Rotate Function Blocks
Shift and Rotate Function Blocks
The Shift and Rotate function blocks are a subset of the standard function blocks. These function blocks
provide shifting and rotating functions.
For memory usage and ACM execution time information on all standard configuration elements, refer to
Appendix C in Using the ProcessSuite 4-mation Configuration Software (document number CG39-20).
A listing of Shift and Rotate function blocks is presented here. Individual blocks are detailed in the
subsections that follow.
•
•
•
•
Shift Left
Shift Right
Rotate Left
Rotate Right
6.1
Shift Left Function Block (SHL)
bn
<-
b1
...
SHL
<- 0
ANY_INT
ANY_INT
IN
N
OUT
CARRY
ANY_INT
BOOL
< ----
A schematic diagram and the graphical symbol and of the Shift Left function block are shown above.
Refer to these items when reading the following description.
This block performs a bitwise shift left of the configured input. The input can be shifted a variable
number of places based on the value of the (N) input. The maximum value of (N) is limited to the
number of bits of the input argument. If left unconfigured or negative, the default value of the (N) input
is 0. As the bit positions in the input are shifted left, they will be zero-filled on the right. The last bit
shifted out will be saved in the (CARRY) output, but all previously shifted bits will be lost.
The shift variable input, (N), is of type ANY_INT.
The inputs and outputs of the SHL block are defined as follows:
IN
The integer input to be shifted.
N
The integer input determining the number of places (IN) is shifted.
OUT
The shifted input is passed to this output.
CARRY This Boolean saves the last shifted bit.
Softlist Parameters
There are no softlist parameters for the SHL block.
August 2002
6-1
Shift and Rotate Function Blocks
6.2
CG39-22
Shift Right Function Block (SHR)
bn
b1
IN
N
ANY_INT
ANY_INT
->
...
0 ->
SHR
OUT
CARRY
ANY INT
BOOL
---->
A schematic diagram and the graphical symbol and of the Shift Right function block are shown above.
Refer to these items when reading the following description.
This block performs a bit-wise shift right of the configured input. The input can be shifted a variable
number of places based on the (N) input. The maximum value of "N" is limited to the number of bits of
the input argument. If left unconfigured or if negative, the default value of the (N) input is 0. As the bit
positions in the input are shifted right, they will be zero filled on the left. The last bit shifted out will be
saved in the (CARRY) output, but all previously shifted bits will be lost.
The shift variable input, (N), is of type ANY_INT.
The inputs and outputs of the SHR block are defined as follows:
IN
The integer input to be shifted.
N
The integer input determining the number of places the (IN) is shifted.
OUT
The shifted input is passed out this output.
CARRY This Boolean saves the last shifted bit.
Softlist Parameters
There are no softlist parameters for the SHR block.
6.3
Rotate Left Function Block (ROL)
bn
<
b1
...
<
ROL
ANY_INT
ANY_INT
IN
N
OUT
CARRY
ANY_INT
BOOL
< ----
A schematic diagram and the graphical symbol and of the Rotate Left function block are shown above.
Refer to these items when reading the following description.
This block performs a bit-wise left rotation of the configured input. The input can be rotated a variable
number of places based on the (N) input. (N) is limited to the number of bits in the input. If
unconfigured or negative, the default value of the (N) input is 0. As the bit positions in the input are
rotated left, the last displaced bit on left the fills the vacancy (bit) at the right. No bits will be added or
lost. After all shifting is complete, the "b1" bit value will be placed in the (CARRY) output.
6-2
August 2002
CG39-22
Shift and Rotate Function Blocks
The shift variable input, (N), is of type ANY_INT.
The inputs and outputs of the ROL block are defined as follows:
IN
The integer input to be rotated.
N
The integer input determining the number of places the (IN) is rotated.
OUT
The rotated input is passed out this output.
CARRY This Boolean is a copy of the "b1" bit.
Softlist Parameters
There are no softlist parameters for the ROL block.
6.4
Rotate Right Function Block (ROR)
bn
>
b1
...
>
ROR
ANY_INT
ANY_INT
IN
N
OUT
CARRY
ANY_INT
BOOL
---- >
A schematic diagram and the graphical symbol and of the Rotate Right function block are shown above.
Refer to these items when reading the following description.
This block performs a bit-wise right rotation of the configured input. The input can be rotated a variable
number of places based on the (N) input. (N) is limited to the number of bits in the input. If
unconfigured or negative, the default value of the (N) input will be 0. As the bit positions in the input are
rotated right, the last displaced bit on the right fills the vacancy (bit) at the left. No bits will be added or
lost. After all shifting is complete, the "bn" bit value will be placed in the (CARRY) output.
The shift variable input, (N), is of type ANY_INT.
The inputs and outputs of the ROR block are defined as follows:
IN
The integer input to be rotated.
N
The integer input determining the number of places the (IN) is rotated.
OUT
The rotated input is passed out this output.
CARRY This Boolean is a copy of the "bn" bit.
Softlist Parameters
There are no softlist parameters for the ROR block.
"
August 2002
6-3
Shift and Rotate Function Blocks
CG39-22
!Notes
6-4
August 2002
CG39-22
7.0
Arithmetic Function Blocks
Arithmetic Function Blocks
The Arithmetic function blocks are a subset of the standard function blocks. Arithmetic function blocks
operate only on numbers, either real or integer. Some of these blocks have outputs of ANY_NUM
(meaning any numeric) data type.
Each of these blocks assumes that all of the ANY_NUM inputs and outputs are the same data type as the
first ANY_NUM input assigned. Note that the mixing of data types on the ANY_NUM inputs and
outputs of a block is not prevented, but it may lead to unpredictable results.
Refer to Using the ProcessSuite 4-mation Configuration Software (document number CG39-20) for
information about the ANY_NUM data type. For memory usage and ACM execution time information
on all standard configuration elements, see Appendix C in the same document.
A listing of Arithmetic function blocks is presented here. Individual blocks are detailed in the subsections
that follow.
• Addition
• Subtraction
• Multiplication
• Division
• Square Root
• Absolute Value
• Linear Characterizer
• Weighted Average
• Moving Average
• Logarithm Base 10
• Exponentiation
• Natural Logarithm
• Natural Exponential
• Trigonometric Functions
Sine
Cosine
Tangent
• Inverse Trigonometric Functions
Arcsine
Arccosine
Arctangent
• Convert
7.1
Addition Function Block (ADD)
OUT = IN01 + IN02 +...IN(n)
August 2002
7-1
Arithmetic Function Blocks
CG39-22
ADD
ANY_NUM
ANY_NUM
:
ANY_NUM
IN01
IN02
:
IN16
OUT
ANY_NUM
The equation and the graphical symbol of the Addition function block is shown above. This block
performs simple arithmetic addition. The output will be the sum of all configured input values.
This block is extensible to a maximum of 16 inputs.
The inputs and output of the ADD block are defined as follows:
IN(n) The inputs to be added together.
OUT
The sum of all configured inputs.
Softlist Parameters
There are no softlist parameters for the ADD block.
7.2
Subtraction Function Block (SUB)
OUT = IN1 - IN2
SUB
ANY_NUM
ANY_NUM
IN1
IN2
OUT
ANY_NUM
The equation and the graphical symbol of the Subtraction function block is shown above. This block
performs simple arithmetic subtraction. The output will be the difference of two configured input values
[(IN1) - (IN2)].
The inputs and output of the SUB block are defined as follows:
IN1
The input value from which (IN2) is to be subtracted.
IN2
The input value which is to be subtracted.
OUT The difference between the inputs.
Softlist Parameters
There are no softlist parameters for the SUB block.
7-2
August 2002
CG39-22
7.3
Arithmetic Function Blocks
Multiplication Function Block (MUL)
OUT = IN01 * IN02 *...IN(n)
MUL
ANY_NUM
ANY_NUM
:
ANY_NUM
IN01
IN02
:
IN16
OUT
ANY_NUM
The equation and the graphical symbol of the Multiplication function block is shown above. This block
performs simple arithmetic multiplication. The output will be the product of all configured input values.
This block is extensible to a maximum of 16 inputs.
The inputs and output of the MUL block are defined as follows:
IN(n) The inputs to be multiplied together.
OUT
The product of all configured inputs.
Softlist Parameters
There are no softlist parameters for this block.
7.4
Division Function Block (DIV)
OUT = IN1 / IN2
ANY_NUM
ANY_NUM
IN1
IN2
DIV
OUT
ANY_NUM
The equation and the graphical symbol of the Division (DIV) function block is shown above. The block
performs simple arithmetic division. The output value (OUT) is normally the quotient of the two
configured input values [(IN1)/(IN2)], and the output data quality value is normally GOOD. However, if
(IN2) is unconfigured or equal to zero, (OUT) is zero and its data quality value is BAD.
For the division of two integer data type values, the remainder is truncated, leaving only the quotient as
the integer output value.
The inputs and output of the DIV block are defined as follows:
IN1
Dividend value
IN2
Divisor value
OUT Quotient of the two inputs
August 2002
7-3
Arithmetic Function Blocks
CG39-22
Softlist Parameters
There are no softlist parameters for this block.
7.5
Square Root Function Block (SQRT)
OUT = IN ** 0.5
SQRT
ANY_REAL
IN
OUT
ANY_REAL
The equation and the graphical symbol of the Square Root function block is shown above. This block
performs the arithmetic square root function. The output will be the square root of the input value.
Negative values will generate an output of zero.
The input and output of the SQRT block are defined as follows:
IN
The REAL input of which the square root will be taken.
OUT The resultant square root of (IN).
Softlist Parameters
There are no softlist parameters for the SQRT block.
7.6
Absolute Value Function Block (ABS)
ABS
ANY_NUM
IN
OUT
ANY_NUM
OUT = | IN |
if IN >= 0, OUT = IN
if IN < 0, OUT = -IN
The graphical symbol of the Absolute Value function block and functional equation are shown above.
This block performs the absolute value function. The output will be the absolute value of the input value.
The input and output of the ABS block are defined as follows:
IN
The input of which the absolute value will be taken.
OUT
The resultant absolute value of (IN).
Softlist Parameters
There are no softlist parameters for this block.
7-4
August 2002
CG39-22
7.7
Arithmetic Function Blocks
Linear Characterizer Function Block (LINCHR)
LINCHR
REAL
IN_X
OUT_Y
REAL
The graphical symbol of the Linear Characterizer function block is shown above. This block provides X
and Y coordinate selections that can be used to form various input/output characterizations, similar to a
curve fitting function.
When the input is "X", the output is "Y". The NUM_OF_SEGS Softlist Parameter determines the
number of segments (maximum of 20) the algorithm uses. The input is checked to determine which
segment it "fits". The output is then determined by the point-slope method (y=mx+b). The slope of the
function depends on the "X" and "Y" configuration entries.
For the algorithm to function properly, the "X" and "Y" entries must be continuous with no breaks, and
the "X" entries cannot change direction but must be configured from low to high. This block is typed for
REAL data. All inputs, outputs and Softlist values are expressed in Engineering Units.
The input and output of the LINCHR block are defined as follows:
IN_X
is the input in engineering units.
OUT_Y is the calculated output in engineering units.
Softlist Parameters
The remaining LINCHR inputs are accessed via the softlist. The value of these inputs can be changed via
commands from an operator interface (or the Set Value function block) but they cannot be "wired" to the
block.
NUM_OF_SEGS is the number of segments (maximum of 20).
YL
is the output in engineering units when the input is less than X0
YH
is the output in engineering units when the input is greater than the X value at the last
configured segment.
X0
is the starting X coordinate.
Xn
the X coordinate of a pair of coordinates.
Y0
is the starting Y coordinate.
Yn
is the Y coordinate of a pair of coordinates.
August 2002
7-5
Arithmetic Function Blocks
CG39-22
Parameter
Units
Initial Value
Min Value
Max Value
NUM_OF_SEGS
INT
1
1
20
YL
Engr
0.0
NA
NA
YH
Engr
0.0
NA
NA
X0
Engr
0.0
NA
NA
:
:
:
:
:
Xn
Engr
0.0
NA
NA
Y0
Engr
0.0
NA
NA
:
:
:
:
:
Yn
Engr
0.0
NA
NA
Where NA indicates “not applicable.”
NOTE
The softlist of the LINCHR function block contains all 20 x and y
coordinate entries. However, any entries after the configured
NUM_OF_SEGS entry, will not be processed.
7.8
Weighted Average Function Block (WT_AVG)
WT_AVG
BOOL
ANY_NUM,TIME
ANY_NUM,TIME
:
ANY_NUM,TIME
EN
IN01
IN02
:
IN15
OUT
ANY_NUM,TIME
The graphical symbol of the Weighted Average function block is shown above. The algorithm of this
block computes a weighted average.
The sum of the weighted inputs will be divided by the sum of the weights (the weights are configured as
softlist parameters). If the block is not enabled, the output is zero. Integer results will be rounded: any
value with a decimal of one half or greater is rounded up to the next whole number, any value with a
decimal less than one half is rounded down to the next lower whole number.
The block is extensible for up to 15 inputs.
7-6
August 2002
CG39-22
Arithmetic Function Blocks
The inputs and output of the WT_AVG block are defined as follows:
EN
is the block enable. When TRUE the block performs the averaging operation, when FALSE the
(OUT) is zero.
IN(n) are the inputs to the block to be averaged.
OUT
is the calculated weighted average.
Softlist Parameters
The remaining Weighted Average inputs are accessed via the softlist. The value of these inputs can be
changed via commands from an operator interface (or the Set Value function block) but they cannot be
"wired" to the block.
WEIGHT(n) are the entered coefficients for each input; these weights should be zero or positive.
However, if all weights are zero, the (OUT) output will be nonsensical.
Parameter
Units
Initial Value
Min Value
Max Value
WEIGHT1
dimensionless
1.0
0.0
NA
WEIGHT2
dimensionless
1.0
0.0
NA
:
:
:
1.0
0.0
NA
:
:
WEIGHT15
dimensionless
Where NA indicates “not applicable.”
7.9
Moving Average Function Block (MOV_AVG)
MOV_AVG
ANY_NUM, TIME
ANY_NUM, TIME
BOOL
IN
PREV
OUT
IN11
ANY_NUM, TIME
ANY_NUM, TIME
EN
The graphical symbol of the Moving Average function block is shown above. The algorithm of this block
contains 10 shift registers.
The (IN) input will be held for a period of time and then each register's value will be transferred to the
next register. The output represents the moving average of 10 shift registers. The Sample Period is set via
a softlist parameter.
August 2002
7-7
Arithmetic Function Blocks
CG39-22
Integer results will be rounded. That is, any value with a decimal of one half or greater will be rounded up
to the next whole integer, any value with a decimal less than one half will be rounded down to the lower
whole integer.
This block can be chained to another MOV_AVG block to produce a moving average with more shift
registers. The OUT output of one block would be wired to the PREV input of the next block, and the
IN11 output of the first block would be wired to the IN input of the next block. The period of each
chained block would represent the fraction of the overall period that each individual block would
contribute so that the total of all of the PERIOD settings would equal the desired overall period. The gain
settings of each individual block would also be set to the fraction of the overall period that each block
contributes so that the total of all of the GAIN settings equals 1 For example, when chaining two blocks
together to achieve improved resolution for a one minute overall period, each block would have PERIOD
set to 30 seconds and GAIN set to 0.5 (the WEIGHT settings remain 1).
The inputs and outputs of the MOV_AVG block are defined as follows:
IN
This is the process input to the algorithm.
PREV This is the Previous Average input. It is used when chaining MOV_AVG blocks, where this
input would be wired to the OUT output of an upstream block.
EN
This is the command input to the algorithm. When this input is FALSE, the Averaging function
is bypassed [(OUT)=(IN)] and all registers are set equal to (IN).
OUT
This the output. It is equal to the average of the 10 samples. If data types other than those
specified are used as inputs, the output value will be 0.0.
IN11
This is the output equal to the 11th shift register (sample). This is the oldest sample and is not
used by the block's calculation. It is used when chaining MOV_AVG blocks, where this output
would be wired to the IN input of a downstream block.
Softlist Parameters
PERIOD
This is the Period of the average expressed as a TIME value. When chaining MOV_AVG
blocks, this setting represents the fraction of the overall period that this block contributes
such that the total of all of the PERIOD settings equals the overall period of the average.
GAIN
This is the overall block gain parameter. It allows the output to be scaled for proper
"chaining" of several MOV_AVG function blocks, where the total of all of the GAIN
settings equals 1.
WEIGHT(n) This is the weighting factor of each sample. Each sample can be individually weighted
before the average calculation is performed. These weights should be zero or positive.
However, if all weights are zero, the (OUT) output will be nonsensical.
Parameter
Units
Initial Value
Min Value
Max Value
PERIOD
TIME
T#0d0h1m0s0ms
T#0d0h0m0s0ms
NA
GAIN
dimensionless
1.0
0.0
NA
7-8
August 2002
CG39-22
Arithmetic Function Blocks
WEIGHT1
dimensionless
1.0
0.0
NA
WEIGHT2
dimensionless
1.0
0.0
NA
:
:
:
1.0
0.0
NA
:
:
WEIGHT10
dimensionless
Where NA indicates not applicable.
7.10 Logarithm Base 10 Function Block (LOG)
OUT = LOG( IN )
LOG
ANY_REAL
IN
OUT
ANY_REAL
The equation and the graphical symbol of the Logarithm Base 10 function block is shown above. This
block performs the common logarithm function, base "10". The output will be the common logarithm of
the input value. If (IN) is negative, (OUT) is zero.
The input and output of the LOG block are defined as follows:
IN
The input of which the base 10 logarithm is taken.
OUT The resultant base 10 log of (IN).
Softlist Parameters
There are no softlist parameters for this block.
7.11 Exponentiation Function Block (EXPT)
OUT = IN1 ** IN2
EXPT
ANY_REAL
ANY_NUM
IN1
IN2
OUT
ANY_REAL
The equation and the graphical symbol of the Exponentiation function block is shown above. This block
performs the power function. The output will be the first input value raised to the power of the second
input value as shown below.
OUT = IN1IN2
August 2002
7-9
Arithmetic Function Blocks
CG39-22
The inputs and output of the EXPT block are defined as follows:
IN1
The input that is to be raised to a power.
IN2
The input which is the power to which the (IN1) will be raised.
OUT The calculated output of the block.
Softlist Parameters
There are no softlist parameters for this block.
NOTE
If the IN1 value is negative and the IN2 value is not an integer value, the
output value is zero.
7.12 Natural Logarithm Function Block (LN)
OUT = LN( IN )
LN
ANY_REAL
IN
OUT
ANY_REAL
The equation and the graphical symbol of the Natural Logarithm function block is shown above. Refer to
these items when reading the following description.
This block performs the natural logarithm function, base "e". The output will be the natural logarithm of
the input value. If (IN) is negative, (OUT) is zero.
The input and output of the LN block are defined as follows:
IN
The REAL input of which the natural log will be taken.
OUT The resultant natural log of (IN).
Softlist Parameters
There are no softlist parameters for this block.
7.13 Natural Exponentiation Function Block (EXP)
OUT = e ** IN
EXP
ANY_REAL
7-10
IN
OUT
ANY_REAL
August 2002
CG39-22
Arithmetic Function Blocks
The equation and the graphical symbol of the Natural Exponentiation function block is shown above.
This block will perform the natural exponentiation function, base "e". The output will be the value "e"
raised to the power of the input value. This is the opposite of the Natural Logarithm (LN) function.
The input and output of the EXP block are defined as follows:
IN
The input that is the power to which "e" will be raised.
OUT The resultant of the natural Exponentiation of the (IN).
Softlist Parameters
There are no softlist parameters for this block.
7.14 Trigonometric Function Blocks
The blocks described in the following subsections are the trigonometric function blocks. These are:
• Sine
• Cosine
• Tangent
The output is the sine, cosine, or tangent of the input angle value. Note that the input value must be in
radians.
7.14.1 Sine Function Block (SIN)
OUT=SIN(IN)
SIN
IN
ANY_REAL
OUT
ANY_REAL
1
0
π
2π
-1
The symbol of the Sine function block is shown above. The SIN function block accepts a radian input
and outputs the sine of that angle.
The input and output of the SIN block are defined as follows:
IN
The input in radians of which the sine will be taken.
OUT The output which is the sine of the (IN) input.
August 2002
7-11
Arithmetic Function Blocks
CG39-22
Softlist Parameters
There are no softlist parameters for this block.
7.14.2 Cosine Function Block (COS)
OUT=COS(IN)
COS
ANY_REAL
IN
OUT
ANY_REAL
1
0
2π
π
-1
The symbol of the Cosine function block is shown above. The COS function block accepts a radian input
and outputs the cosine of that angle.
The input and output of the COS block are defined as follows:
IN
The input in radians of which the cosine will be taken.
OUT The output which is the cosine of the (IN) input.List Parameters
Softlist Parameters
There are no softlist parameters for this block.
7.14.3 Tangent Function Block (TAN)
OUT=TAN(IN)
TAN
ANY_REAL
7-12
IN
OUT
ANY_REAL
August 2002
CG39-22
Arithmetic Function Blocks
1
0
π
2
π
2π
-1
The symbol of the Tangent function block is shown above. The TAN function block accepts a radian
input and outputs the tangent of that angle.
The input and output of the TAN block are defined as follows:
IN
The input in radians of which the tangent will be taken.
OUT The output which is the tangent of the (IN) input.
Softlist Parameters
There are no softlist parameters for this block.
7.15 Inverse Trigonometric Function Blocks
The blocks described in the following subsections are the inverse trigonometric function blocks.
These are:
•
•
•
Arcsine
Arccosine
Arctangent
The output is the principal angle in radians that is representative of the input value, which is the sine,
cosine, or tangent of the angle.
The input values must be within the boundaries of +1 and -1 for ASIN and ACOS; any value is allowed
for ATAN. The output values are within +/-π/2 for ASIN and ATAN; the output range for ACOS is 0 to
π.
7.15.1 Arcsine Function Block (ASIN)
OUT=ASIN(IN)
ASIN
ANY_REAL
IN
OUT
ANY_REAL
The equation and graphical symbol of the ArcsSine function block is shown above. The ASIN function
block accepts a input between 1 and -1 and outputs the angle in radians of which the input is the sine.
August 2002
7-13
Arithmetic Function Blocks
CG39-22
The input and output of the ASIN block are defined as follows:
IN
The input which is the sine of some angle.
OUT The angle in radians of which the input is the sine.
Softlist Parameters
There are no softlist parameters for this block.
7.15.2 Arccosine Function Block (ACOS)
OUT=ACOS(IN)
ACOS
ANY_REAL
IN
OUT
ANY_REAL
The equation and graphical symbol of the Arccosine function block is shown above. Refer to these items
when reading the following description.
ACOS function block accepts an input between -1 and 1 and outputs the angle in radians of which the
input is the cosine.
The input and output of the ACOS block are defined as follows:
IN
The input which is the cosine of some angle.
OUT
The angle in radians of which the input is the cosine.
Softlist Parameters
There are no softlist parameters for this block.
7.15.3 Arctangent Function Block (ATAN)
OUT=ATAN(IN)
ATAN
ANY_REAL
IN
OUT
ANY_REAL
The equation and graphical symbol of the Arctangent function block is shown above. The ATAN
function block accepts an input and outputs the angle in radians of which the input is the tangent.
7-14
August 2002
CG39-22
Arithmetic Function Blocks
The input and output of the ATAN block are defined as follows:
IN
The input which is the tangent of some angle.
OUT
The angle in radians of which the input is the tangent.
Softlist Parameters
There are no softlist parameters for this block.
7.16 Conversion Function Block (CONVERT)
CONVERT
IN01
IN02
:
:
IN16
ANY
ANY
:
:
ANY
OUT01
OUT02
:
:
OUT16
ANY
ANY
:
:
ANY
The symbol of the Conversion (CONVERT) function block is shown above. This block converts the
value of the variable(s) connected to the block input(s) to the data type of the variable(s) connected to the
block output(s).
The inputs of this block can be of different data types, unlike other blocks (such as ADD, MUL...etc.). A
common use of this block is to convert TIME data type values to REAL or INT values for use in math
operations.
This block is extensible up to 16 inputs and outputs.
The inputs and outputs of the CONVERT block are defined as follows:
IN(n)
These inputs are to be converted to the corresponding output data type.
OUT(n) These outputs are the converted version of the input values.
Softlist Parameters
There are no softlist parameters for this block.
Table 7–1 Conversion Between Data Types (Part 1)
FROM \TO #
$
BOOL
TRUE
FALSE
August 2002
BOOL
STRING
REAL
xINT
TRUE
FALSE
-
-
"TRUE"
1.0
1
-
-
"FALSE"
0.0
0
7-15
Arithmetic Function Blocks
CG39-22
STRING
Not empty
Empty
-
REAL
Non zero
zero
"real value"
INT
Non zero
zero
"int value"
NA
NA
-
Rounded decimal
Same value
Different type
-
TIME
Non zero
zero
"time value"
Convert to # of ms
Convert to # of ms
DATE_AND_TIME
NA
NA
"date_&_time
value"
Convert to secs.ms
since 1-1-70
Convert to secs.
Since 1-1-70
TIME_OF_DAY
NA
NA
"time_of_day
value"
Convert to secs. since
midnight
Convert to secs. since
midnight
DATE
NA
NA
"date value"
Convert to secs. since
1-1-70
Convert to secs. since
1-1-70
Table 7–1 Conversion Between Data Types (Part 2)
TO
TIME
DATE
TIME_OF_DAY
DATE_AND_TIME
NA
NA
NA
NA
NA
NA
NA
NA
NA
NA
NA
NA
FROM
TRUE
BOOL
FALSE
STRING
REAL
convert ms to
Time format
convert secs
since 1-1-70
to DATE
format
convert secs
since
midnight to
TOD format
convert secs
since 1-1-70
to DATE &
TIME format
INT
convert ms to
Time format
convert secs
since 1-1-70
to DATE
format
convert secs
since
midnight to
DATE format
convert secs
since 1-1-70
to DATE &
TIME format
convert sec
since
midnight to
DATE format
convert secs
since 1-1-70
to DATE &
TIME format
NA
isolate DATE
format
NA
TIME
DATE
NA
convert to ms
TIME_OF_DAY
DATE_AND_TIME
NA
NA
isolate DATE
NA
isolate TOD
NOTES
7-16
1.
The conversion to STRING from all other data types is a direct
character-for-character copy.
2.
TIME_OF_DAY, the number of seconds since midnight, is
limited to 86399 (23:59:59). Numbers greater than this will have
86399 subtracted from them until less than 86399 remains for
conversion. For example, T#27h5m will convert to
TOD#03:05:00, and an integer value of 378,778,170 (DT#19821-1-00:09:30) will convert to TOD#00:09:30.
August 2002
CG39-22
Arithmetic Function Blocks
3.
A negative number being converted to any of the time or date
based data types (unsigned) will be limited to zero or the lowest
value. For example, -127 will be converted to T#0d0h0m0s0ms
and -111111111111 will be converted to D#1970-1-1.
4.
Conversion from a large xINT to a smaller xINT is limited to the
range of the smaller xINT. For example, 500d (DINT) will
convert to 127s (SINT), since the SINT has an upper limit of
127. Therefore, the conversion from DINT to INT, DINT to
SINT, or INT to SINT might be range limited.
5.
Note the difference between TIME and the other time based data
types. TIME converts to milliseconds and all other time data
types convert to seconds.
6.
There is no conversion required for the chart spaces that are
empty, (OUTn) = (INn).
7.
Conversion does not make sense in the chart spaces that are
marked NA, not applicable. For example, DATE to
TIME_OF_DAY.
8.
REAL values are rounded off when converted.
The following chart shows examples of conversions:
INPUT
OUTPUT DATA TYPES
DATA
TYPE
REAL
DINT
Value
SINT
INT
DINT
TIME
TOD#h:m:s
22.5
23
23
23
T#23ms
TOD#0:0:23
-131.5
-128
-132
-132
T#0ms
TOD#0:0:0
35000.0
127
32767
35000
T#35s
TOD#9:43:20
4.14E9
127
32767
2147483647
T#47d22h0m0s0ms
TOD#16:0:0
-132
-128
-132
-132
T#0ms
TOD#0:0:0
132
127
132
132
T#132ms
TOD#0:2:12
"
August 2002
7-17
Arithmetic Function Blocks
CG39-22
!Notes
7-18
August 2002
CG39-22
8.0
Move Function Blocks
Move Function Blocks
The MOVE function blocks are a subset of the standard function blocks. These blocks accept inputs of
ANY data type and have outputs of ANY data type. An ANY output takes on the data type of the
variable (or function block input) to which it is connected.
If an ANY type output of one block is connected to an ANY type input of another block, no data type is
assigned to the output. The output is defaulted to data type REAL. To change this default to the correct
data type, the output could be connected to any variable of the correct data type. After the function block
network is downloaded, the added variable can be deleted. The function block output retains the correct
data type.
The mixing of data types on the ANY inputs and outputs of a block is not prevented, but may lead to
unpredictable results.
For memory consumption and ACM execution time information on all standard configuration elements,
see Appendix C in Using the 4-mation Configuration Software (document number CG39-20).
The MOVE function blocks are listed as follows. Each individual block is described in detail in the
following subsections:
•
•
•
8.1
Data Move
Set Value
Set Bit
Data Move Function Block (MOVE)
MOVE
BOOL
ANY
ANY
:
ANY
EN
IN01
IN02
:
IN15
ENO
OUT01
OUT02
:
OUT15
BOOL
ANY
ANY
:
ANY
The symbol of the Data Move (MOVE) function block is shown above. This block assigns input values to
output values in pairs: (IN01) to (OUT01), (IN02) to (OUT02), etc. The input data types can be different,
but the paired input and output data types must match. This block is extensible, up to a maximun of 15
input/output pairings.
The enable output (ENO) is TRUE whenever the EN input value is TRUE. It is FALSE at all other times.
When the MOVE block is enabled, it transfers each INxx value to its corresponding OUTxx. When the
block is not enabled, its outputs retain their previous values.
The MOVE block also has the unique ability to prevent other configuration language elements from
accessing its outputs when it is not enabled. This allows multiple MOVE blocks (or MOVE blocks and
another data source) to be connected to the same variable without conflict.
August 2002
8-1
Move Function Blocks
CG39-22
If a variable is connected to multiple data sources, it is updated by all enabled sources in the order that
they execute. At the end of the scan, it contains the value written by the last enabled source to run. If no
source is enabled, the variable retains its value from the previous scan.
In general, only variables should be connected to MOVE block outputs, since non-variables do not retain
their values from the previous scan. The behavior of elements, other than variables, connected directly to
a disabled MOVE block is shown in Table 8–1.
Table 8–1 Behavior of Elements Directly Connected to a Disabled MOVE Block
ELEMENT
EXAMPLE OF USE
BEHAVIOR WHEN MOVE
FUNCTION BLOCK IS DISABLED
Array Subscript
A1[MOVE1.OUT01]
Out of bounds (returns zero value)
Action Input
MOVE1.OUT01
Evaluates as FALSE (may post-scan)
Case Expression
CASE MOVE1.OUT01
Evaluates as FALSE (all cases FALSE)
Ladder Logic Contact
MOVE1.OUT01
Uses MOVE output (see NOTE below table)
SFC Transition
:= MOVE1.OUT01
Evaluates as FALSE (does not evolve)
Variable Assignment
V1: = MOVE1.OUT01
Retains its previous value
NOTE: When a contact on a ladder logic sheet is connected to a MOVE block’s output, the contact
always obtains the output value, even when the MOVE block is disabled.
Inputs and Outputs
The inputs and outputs of the MOVE block are defined as follows:
EN
The enable input. The block transfers data only when this input is TRUE
IN(n)
The ANY data type inputs that are to be moved.
ENO
This Boolean output indicates when the block is enabled.
OUT(n) These outputs are connected to the receiving variables (IN01 to IN15) and are written to only
when EN is TRUE.
Softlist Parameters
There are no softlist parameters for this block.
8-2
August 2002
CG39-22
8.2
Move Function Blocks
Set Value Funtion Block (SET_VAL)
BOOL
STRING
ANY
EN
DEST
DATA
SET_VAL
ERROR
OUT
BOOL
ANY
The symbol of the Set Value function block is shown above. This block has two purposes:
1. It transfers data from one variable to another when the (EN) input is TRUE.
2. It displays the value of the variable addressed by the (DEST) input on the (OUT) output.
The data types of (DATA), (OUT) and the variable addressed by (DEST) must match. The (DEST) input
must be a string constant not a string variable. This block does not retain the data values, it merely
transfers them.
The SET_VAL block is limited to transferring and reading values within one resource (CCM). The
destination input, (DEST), uses the VARNAME notation. The VARNAME is a path to a variable in the
form:
'.DFB instance name. ... .DFB instance name.variable name'
The (DEST) path is assumed to start from the resource unless there is an ASCII "." at the beginning. An
ASCII "." signifies that the destination path is relative to the sheet on which the SET_VAL block resides.
The inputs and outputs of the SET_VAL block are defined as follows:
EN
The boolean enable input. The block transfers data only when this input is TRUE.
DEST
The static string input that is the path of the destination of the (DATA) input.
DATA
The ANY type input to be written to the variable identified in the (DEST) input. Note that if
this input is not connected it defaults to a value of 0.0 (zero).
ERROR The boolean output that is set to TRUE if the block cannot execute correctly.
OUT
The output that displays the value of the (DEST) input at all times, regardless of the (EN)
input. A local variable of the same data type as that of the variable addressed in the (DEST)
input must be connected to this output for the value to be displayed.
Softlist Parameters
There are no softlist parameters for this block.
August 2002
8-3
Move Function Blocks
8.3
CG39-22
Set Bit Function Block (SET_BIT)
SET_BIT
BOOL
STRING
BOOL
INT
EN
DEST
DATA
BIT_n
ERROR
W_OUT
B_OUT
BOOL
WORD
BOOL
The symbol of the Set Bit (SET_BIT) function block is shown above. This block may be used to write a
single bit of a destination variable of type WORD. The SET_BIT block also continuously reads both the
specified bit and the value of the specified WORD variable.
The Destination string must point to a WORD data type variable. The DATA input must be a BOOL. The
BIT_n input is an integer (INT) that selects which bit of the Destination WORD is to be read/written. The
W_OUT output is the current value of the Destination WORD variable. The Data Type is WORD. The
B_OUT output is the current value of the bit (determined by the BIT_n input) of the Destination WORD
variable. The Data Type is BOOL.
This block is limited to setting or reading bit states within one resource (ACM configuration). The DEST
input value uses the VARNAME notation. The VARNAME is a path to a variable in the form:
'.DFB instance name. ... .DFB instance name.variable name'
The path is assumed to start from the resource unless there is a leading period (.) character. The period
signifies that the destination path is relative to the sheet on which the SET_BIT block resides.
Inputs and Outputs
The inputs and outputs of the SET_BIT block are defined as follows:
EN
The boolean enable input. The block writes the specified bit to the destination variable only
when this input is TRUE.
DEST
The static string input that specifies the address path of the destination WORD variable. See
Address Paths for Remote Access to Variables
DATA
The BOOL input specifying the TRUE or FALSE value to be written to the specified bit of the
variable identified in the DEST input.
BIT_n
The integer (INT) value that selects which bit of the Destination WORD is to be read/written.
Use 1 to address the low-order bit and 16 to address the high-order bit.
ERROR
The boolean output that will be TRUE if the block cannot execute correctly.
W_OUT The current output value of the Destination WORD variable.
B_OUT
8-4
The current output value of the bit (determined by the BIT_n input) of the Destination WORD
August 2002
CG39-22
Move Function Blocks
variable.
Softlist Parameters
There are no softlist parameters for this block.
"
August 2002
8-5
Move Function Blocks
CG39-22
!Notes
8-6
August 2002
CG39-22
9.0
Communications Function Blocks
Communications Function Blocks
The Communications function blocks are a subset of the standard function blocks. They provide a means
of transferring data between resources (ACM, LIM). For memory consumption and ACM execution time
information on all standard configuration elements, see Appendix C in Using the ProcessSuite 4-mation
Configuration Software (document number CG39-20).
A listing of the Communications function blocks is presented here. Individual blocks are detailed in the
subsections that follow.
•
•
•
•
•
•
Send and Receive
Un-Interlocked Send and Un-Interlocked Receive
Read
Write
Broadcast-In and Broadcast-Out
Connect
The following guidelines are provided as an aid for selecting the appropriate communications blocks
during system configuration.
•
When one ACM is to be a data source and multiple ACMs are to be data users, use a Broadcast-Out
block in the source and a Broadcast-In block in each user.
•
For two-way communication, use the Read or Write blocks if possible since they are much simpler to
configure. Use these blocks for tagged data access, that is, if you know the name and address path
of each piece of data that is needed (e.g. ResourceName.ProgName.FBName.VarName ).
Additionally, these blocks provide the only means for an ACM to communicate with a LIM which
may not contain any communications function blocks.
•
If the tagged names are not appropriate to identify the source and destination of data, use a matched
pair of Send and Receive blocks (if data transfer is bi-directional), or Un-Interlocked Send and
Un-Interlocked Receive blocks (if the transfer is always in one direction). These blocks establish a
data channel of a given data type between the SD_x input of one block and the RD_x output of the
corresponding block in the other ACM. The actual variable which is the source or destination of the
data may be changing. For example, the values of each element of an array could be sent in
succession over one such channel.
•
Generally, each ACM must contain one Connect block for each of the other resources to which it is to
communicate. Note that the Read and Write blocks and the Broadcast blocks do not require the
“partner” resource to have a Connect block.
August 2002
9-1
Communications Function Blocks
9.1
CG39-22
Send and Receive Communication Blocks (SEND, RCV)
SEND
BOOL
BOOL
INT
STRING
ANY
:
ANY
REQ
R
ID
R ID
SD 01
:
SD 12
RD 12
BOOL
BOOL
INT
ANY
:
ANY
NDR
ERROR
STATUS
RD 01
:
RD 12
BOOL
BOOL
INT
ANY
:
ANY
NDR
ERROR
STATUS
RD 01
:
RCV
BOOL
BOOL
INT
STRING
ANY
:
ANY
EN
RESP
ID
R ID
SD 01
:
SD 12
The symbols of both the Send (SEND) and Receive (RCV) communications blocks are shown above.
These blocks must be used in pairs as they provide an interlocked exchange of information between
resources.
The term “interlocked exchange” means that data is transferred both ways and that the blocks wait for a
signal from each other as a trigger to send data.
One resource contains the SEND block and the other resource contains the RCV block.
The remote identification (R_ID) input to each block in the SEND/RCV pair must be identical, as it is this
input which links the blocks as a pair. Also, this R_ID input value must be different from the R_ID value
used for any other pair.
The SD_(n) inputs of the SEND block are transferred to the RD_(n) outputs of the RCV block, and the
SD_(n) inputs of the RCV block are transferred to the RD_(n) outputs of the SEND block.
These blocks are extensible so up to a total of 12 values can be sent in each direction with the
SEND/RCV pair. The order and the data types of the input values on the source block must be repeated
at the output of the destination block. The ID inputs of these blocks identify the communication channel
over which the data will be transferred and is obtained from the ID output of the CONNECT block (see
section 9.6 for a description of the CONNECT block).
9-2
August 2002
CG39-22
Communications Function Blocks
The SEND and RCV inputs and outputs are defined as follows:
EN
When TRUE, this Boolean input enables the RCV block to perform its function.
REQ
This Request input triggers the SEND block to do its function each time it changes from
FALSE to TRUE.
R
This boolean Reset input resets the SEND block (clears any error codes) and causes a search
for the RCV block with the matching R_ID value.
RESP
This RESPond input triggers the RCV block to do its function each time it changes from
FALSE to TRUE.
ID
This integer input identifies the communication channel between two resources (obtained
from the CONNECT block ID output value).
R_ID
Blocks that work in pairs are connected via this user-defined string input (Remote
Identification). This string is identical in each member of the pair, but otherwise unique.
SD_(n)
User data to be sent (Send Data).
NDR
New Data Ready boolean output is TRUE if at least one message has successfully been
received.
ERROR
Boolean output that is TRUE if there is a communication error.
STATUS Integer output that shows the last detected error code. See section 3.0 in 4-mation Software
Messages and Error Codes (document number CG39-21) for a description of all
communication block status codes.
RD_(n)
Shows the last received user data value (Receive Data).
Softlist Parameters
The remaining SEND and RCV inputs are accessed via the softlist. The values of these inputs can be
changed via commands by the user (or the Set Value function block) but they cannot be wired to a
block.
NDR_Timeout This parameter uses a TIME data type. The TIME value is used by a watchdog timer
function as it monitors the NDR output. If a state change (i.e. from FALSE to TRUE or
from TRUE to FALSE) does not occur within the time period set for the NDR_Timeout
value, the blocks automatically timeout and reset. A reset means the blocks cancel their
attempt of completing the current communications cycle. The default value is 10
seconds.
Version
August 2002
The version number of this function block. It is a read-only STRING value. Note that
this value does not represent the version level of the control module software.
9-3
Communications Function Blocks
9.2
CG39-22
Un-interlocked Send and Un-interlocked Receive Blocks (USEND, URCV)
USEND
BOOL
BOOL
INT
STRING
ANY
:
ANY
ERROR
STATUS
REQ
R
BOOL
INT
ID
R_ID
SD_01
:
SD_12
URCV
BOOL
INT
STRING
EN
ID
R_ID
NDR
ERROR
STATUS
RD_01
:
RD_12
BOOL
BOOL
INT
ANY
:
ANY
The symbols of the Un-interlocked Send (USEND) and Un-interlocked Receive (URCV) communications
blocks are shown above. These blocks are used in pairs to send information unidirectionally from one
resource to another.
The USEND and URCV function blocks provide un-interlocked data transfer. That is, there is not the
same degree of handshaking between these two blocks as with the SEND/RCV pair and data is
transmitted in one direction from the USEND block to the URCV block.
The source resource must contain a USEND block while the other resource must contain a URCV block.
These blocks are extensible so up to a total of 12 values can be transferred with each USEND/URCV pair.
The user-defined Remote Identification input (R_ID) to each block in a USEND/URCV pair must be
identical, as this is what links each pair together. Also, the R_ID input value must be different from the
R_ID input value used for any other pair. The ID inputs of these blocks identify the communication
channel over which the data is transferred and is obtained from the ID output of the CONNECT block
(see section 9.6 for a description of the CONNECT block). The order and the data type of each of the
RD_(n) outputs of the URCV block must be the same as the SD_(n) inputs of the USEND block.
Otherwise, an integer value of 4 (data type mismatch) is placed on the STATUS output.
NOTE
Although the RD_n outputs of the URCV block can extend to 13, only
12 variables can be passed from the USEND block because the USEND
block can only extend to 12. The USEND and URCV inputs and outputs
are defined as follows:
9-4
August 2002
CG39-22
Communications Function Blocks
EN
When TRUE, this Boolean input enables the URCV block to perform its function.
REQ
This REQuest input triggers the USEND block to do its function each time it changes from
FALSE to TRUE.
R
This boolean input resets the USEND block (clears any error codes) and causes a search for
the URCV block with the matching R_ID value.
ID
This integer input identifies the communication channel between two resources.
R_ID
Blocks that work in pairs are connected via this user-defined string input (Remote
Identification). This string is identical in each member of the pair, but otherwise unique.
SD_(n)
User data to be sent (Send Data).
NDR
New Data Ready Boolean output is TRUE if at least one message has successfully been
received.
ERROR
Boolean output that is be true if there is an error.
STATUS Integer output that shows the last detected error code. See section 3.0 in 4-mation Software
Messages and Error Codes (document number CG39-21) for a description of all
communication block status codes.
RD_(n)
Shows the last received user data value (Receive Data).
Softlist Parameters
There are no softlist parameters for the USEND or URCV blocks.
9.3
Read Function (READ)
READ
BOOL
INT
STRING
:
STRING
REQ
ID
VAR_01
:
VAR_13
NDR
ERROR
STATUS
RD_01
:
RD_13
BOOL
BOOL
INT
ANY
:
ANY
The symbol of the Read (READ) function block is shown above. This block is designed for
connectionless reading of tagged variables. Connectionless reading means that there is no block in the
remote resource to which this block is paired (although a CONNECT block is required in the resource
that contains the READ block, one is not required in the remote resource).
August 2002
9-5
Communications Function Blocks
CG39-22
Tagged variable access indicates that each input is entered as a path name in a STRING data type as
described by the VARNAME addressing nomenclature instead of wiring a value directly to the block.
See Address Paths for Remote Access to Variables in 4-mation help for addressing details.
The ID input identifies a communication channel which comes from the ID output of the CONNECT
block.
This block is extensible so up to 13 variables can be read from a remote resource at the same time.
When the REQ input of the READ block senses a transition from FALSE to TRUE, a tagged read of the
configured (VAR_(n) source tags are initiated. The received data values are stored in the corresponding
RD_(N) outputs and the NDR output is set to TRUE. If the entire read operation is not completed
successfully, the ERROR output is set to TRUE, and the appropriate error code is provided at the
STATUS output.
9-6
August 2002
CG39-22
Communications Function Blocks
The READ block's inputs and outputs are defined as follows:
REQ
This Request input accepts a BOOL value. When it senses a FALSE to TRUE transition, it
triggers the block to perform its function (reading tags)
ID
This Identification input accepts an INT value that identifies the communication channel
between two resources. It is obtained from the ID output of a CONNECT block.
Each of these Variable inputs accepts a STRING value that identifies the variable in the
VAR_(n) remote device using the VARNAME notation. The variable path always begins at the
resource sheet with a program block instance name. The resource name is supplied by the
CONNECT block establishing the communication link to the other module (ACM, CCM,
or LIM).
NDR
This New Data Ready output provides a BOOL value of TRUE if at least one message has
successfully been received.
ERROR
This Error output provides a BOOL value of TRUE if there is an error.
STATUS This Status output provides an INT value of the last detected error code. Refer to
Communication Block Errors in 4-mation help.
RD_(n)
Each of these Receive Data outputs provide the last received data value for the variable
identified at the corresponding VAR input.
Softlist Parameters
Timeout
If the block does not receive a response to a sent message within this timeout
value, it provides an error code representing a "Time Out" to its STATUS output.
The block will resend the message when its REQ input senses the next FALSE to
TRUE (rising edge) transition.
Continuous_REQ
If this value is set to TRUE and the REQ input is TRUE, the block continuously
performs its communication function (reading tags) each and every scan. The
default value is FALSE.
Version
The version number of this function block. It is a read-only STRING value. Note
that this value does not represent the version level of the control module software.
Use_ Comm_Port 8
This parameter accepts a BOOL value. When set to FALSE (the default value),
the block communicates with any other resource (control module or control
simulator) using logical communications port 1. Port 1 is shared with other
Siemens software products. When this parameter is set to TRUE, the block uses
logical communications port 8 which is otherwise idle in most systems. If the
data is to be passed between two Advanced Control Modules (ACMs), their
module to module communications can be isolated from the data traffic of the
operator interface. This may reduce communication latencies in a heavily loaded
system.
August 2002
9-7
Communications Function Blocks
CG39-22
NOTE
If port 8 is used, both the requesting and responding devices must be
ACMs. Do not use port 8 if either device is a Critical Control Module
(CCM) or a Control Simulator.
Logical communications ports are used for communications between software components on
MODULBUS (M-BUS). The use of this softlist parameter has no effect on the ACM serial
communication ports located on the termination strip.
9.4
Write Function Block (WRITE)
WRITE
BOOL
INT
STRING
ANY
STRING
ANY
STRING
ANY
STRING
ANY
REQ
ID
VAR_1
SD_1
DONE
ERROR
STATUS
BOOL
BOOL
INT
VAR_2
SD_2
VAR_3
SD_3
VAR_4
SD_4
The symbol of the Write (WRITE) function block is shown above. This block is designed for
connectionless writing of tagged variables. Connectionless writing means that there is no block in the
remote resource to which this block is paired (although a CONNECT block is required in the resource
which contains the WRITE block, one is not required in the remote resource).
Tagged variable access indicates that each input is entered as a path name in a STRING data type as
described by the VARNAME addressing nomenclature. See Address Paths for Remote Access to
Variables in 4-mation help for addressing details.
The ID input identifies the a communication channel which comes from the ID output of the CONNECT
block.
Up to four variables can be written to a remote resource using one WRITE block.
When the REQ input of the WRITE block senses a transition from FALSE to TRUE, the block initiates a
write operation to a remote resource. The VAR_(n) inputs contain the identifiers (or names), of the
variables in the remote device in VARNAME format.
The SD_(n) inputs accept values to which the corresponding variable identifiers are set. If the entire write
operation is not completed successfully, the ERROR output is set to TRUE and the appropriate error code
is placed on the STATUS output.
9-8
August 2002
CG39-22
Communications Function Blocks
NOTE
A noticable delay (up to several seconds) in data transmission may occur
if any of the VAR_(n) inputs change after the WRITE block has
initialized. For each changed input, the block requires one scan with no
data transmission while it verifies the integrity of the new path, and then
it must wait for a valid response from the new destination before data
transmission resumes. Other factors that contribute to the delay are the
scan times of both the sending and receiving controllers and the amount
of background time available for message handling in the receiving
controller.
The inputs and outputs of the WRITE block are defined as follows:
REQ
This Request input accepts a BOOL value. When it senses a FALSE to TRUE transition, it
triggers the block to do its function (writing tags).
ID
This Identification input accepts an INT value that identifies the communication channel
between two resources and is obtained from the ID output of a CONNECT block.
VAR_(n)
Each of these Variable inputs accepts a STRING value that identifies a variable in the remote
device using the VARNAME notation. The variable path always begins at the resource sheet
with a program block instance name. The resource name is supplied by the CONNECT block
establishing the communication link to the other module (ACM, CCM, or LIM).
SD_(n)
Each of these Send Data inputs accepts a data value to be sent.
DONE
This output provides a BOOL value of TRUE whenever a FALSE to TRUE transition (rising
edge) is sensed at the REQ input and the data has been transmitted.
ERROR
This Error output provides a BOOL value of TRUE if there is a communication error.
STATUS
This Status output provides an INT value of the last detected error code. Refer to
Communication Block Status Codes in 4-mation help.
August 2002
9-9
Communications Function Blocks
CG39-22
Softlist Parameters
Timeout
If the block does not receive a response to a sent message within this timeout
value, it provides an error code representing a "Time Out" to its STATUS output.
The block will re-send the message when its REQ input senses the next FALSE to
TRUE (rising edge) transition.
Continuous_REQ
If this value is set to TRUE and the REQ input is TRUE, the block continuously
performs its communication function (writing tags) each and every scan.
Continuous_REQ has a default value of FALSE.
Version
The version number of this function block. It is a read-only STRING value. Note
that this value does not represent the version level of the control module software.
Use_ Comm_Port 8
This parameter accepts a BOOL value. When set to FALSE (the default value),
the block communicates with any other resource (control module or control
simulator) using logical communications port 1. Port 1 is shared with other
Siemens software products. When this parameter is set to TRUE, the block uses
logical communications port 8 which is otherwise idle in most systems. If the
data is to be passed between two Advanced Control Modules (ACMs), their
module to module communications can be isolated from the data traffic of the
operator interface. This may reduce communication latencies in a heavily loaded
system.
NOTE
If port 8 is used, both the requesting and responding devices must be
ACMs. Do not use port 8 if either device is a Critical Control Module
(CCM) or a Control Simulator.
Logical communications ports are used for communications between software components on
MODULBUS (M-BUS). The use of this softlist parameter has no effect on the ACM serial
communication ports located on the termination strip.
9.5
Broadcast-in and Broadcast-out Function Blocks (BCSTIN, BCSTOUT)
BCSTIN
BOOL
TIME
INT
STRING
:
:
STRING
9-10
EN
T_LATE
GRP_ID
ERROR
STATUS
RD_01
BOOL
INT
ANY
VAR_01
:
:
VAR_13
:
:
RD_13
:
:
ANY
August 2002
CG39-22
Communications Function Blocks
BCSTOUT
BOOL
TIME
INT
STRING
ANY
STRING
ANY
STRING
ANY
STRING
ANY
STRING
ANY
STRING
ANY
EN
INTRVL
GRP_ID
VAR_1
SD_1
VAR_2
SD_2
VAR_3
SD_3
VAR_4
SD_4
VAR_5
SD_5
VAR_6
SD_6
ERROR
STATUS
BOOL
INT
The symbols of both the Broadcast In (BCSTIN) and Broadcast Out (BCSTOUT) communications blocks
are shown above. These blocks allow the creation of seven unique broadcast groups. The set of names
attached to one BCSTOUT block define a broadcast group of globally known identifiers.
These Broadcast names are different from the global variables created within the vertical bar delimiters.
The vertical bar globals are resource wide while the BCSTIN/BCSTOUT group variables are system
wide. That is, any device on the MODULBUS (M-BUS) or MODULNET (M-NET) can access this data.
The BCSTOUT block places the values and variable names in a particular broadcast group. The data
values and names in each broadcast group are kept separate and unique from the data values and names in
the other broadcast groups. A particular broadcast group is selected by applying an integer value from 1 to
7 to the Group ID (GRP_ID) input.
Each variable in the broadcast is given a variable name (this name can be different from the name in the
source ACM) and a value. The variable name is entered as a STRING value applied to the Var_(n) input
and the value to be assigned is wired to the SD_(n) input.
Up to six variables can be transmitted into a broadcast group with one BCSTOUT function block. Each
BCSTOUT function block will update its contribution to the broadcast group at the interval specified in
the (INTRVL) input.
The BCSTIN block reads from these broadcast groups and brings the data into the ACM requesting the
data.
The BCSTIN broadcast group (1-7) is selected via the GRP_ID input value. The variables from the
selected broadcast group are entered as strings in the (VAR_n) inputs. At the specified time interval
(INTRVL) the variables indicated will be read from the selected broadcast group.
The BCSTIN block is extensible up to 13 data inputs. This so it can be configured to receive data from
one or more BCSTOUT blocks.
August 2002
9-11
Communications Function Blocks
CG39-22
The BCSTIN and BCSTOUT inputs and outputs are defined as follows:
EN
When TRUE, this boolean input enables the block to perform its function.
T_LATE
This is the Tolerance Late input of the BCSTIN block. It sets the amount of time that data can
be received from a BCSTOUT block and still be accepted. If the time is exceeded, the
BCSTIN block s outputs are displayed in yellow (when viewed on-line).
INTRVL
This is the Interval input of the BCSTOUT block. It sets the amount of time that will pass
between each update or reading of the specified broadcast group.
GRP_ID
This is the Group Identification input. It selects the broadcast group to which the block is
interfacing. The value must be between 1 and 7.
VAR_(n) Used in the BSCTOUT block: Each is a STRING variable that assigns the name used in the
broadcast group to the value specified in SD_(1-6). For example, the input into VAR_1 is
assigned the value applied to the SD_1 input.
Used in the BCSTIN block: Each identifies a variable in a particular broadcast group used to request the
value of the variable. It must match one of the names used in the BCSTOUT block having the same
Group ID.
SD_(n)
Used in the BCSTOUT block: Each input assigns its value to the variable name to which it
corresponds. For example, the input into VAR_1 is assigned the value applied to the SD_1
input.
RD_(n)
Used in the BCSTIN block: These outputs provide the Receive Data values of the variables
requested in the VAR01-13 inputs of the block. For example, the broadcast variable
requested in the VAR_02 input has its value displayed at the RD_02 output.
ERROR
This output is TRUE if an error occurs while executing the block.
STATUS This output provides an integer value which corresponds to a code which details any error the
block is experiencing. See section 3.0 in Software Messages and Error Codes (document
number CG39-21) for a description of all communication block status codes.
Softlist Parameters
There are no softlist parameters for these blocks.
9-12
August 2002
CG39-22
9.6
Communications Function Blocks
Connect Function Block (CONNECT)
CONNECT
BOOL
BOOL
STRING
EN
REUSE
NAME
NDR
ERROR
STATUS
ID
DEVICE
BOOL
BOOL
INT
INT
INT
The symbol of the Connect (CONNECT) function block is shown above. This block is used to establish
communication channel ID between two resources (e.g. CCM to CCM). Each resource must contain one
CONNECT block for each of the other resources with which it is to communicate. The partner resource
will require a CONNECT block as well if the communication block used has an ID input. The name of
the resource with which it is desired to transfer data is to be connected to the NAME input. The
communication channel from this resource to the other is available at the ID output, and this value is
typically wired to the ID input of other communications function blocks.
All communication blocks that are transferring data between the same two resources must use the channel
(ID) output of the CONNECT block that is providing the connection between those resources.
NOTE
The prefix “CONFIG” required for the NAME input of the CONNECT
block in version 1.00 of 4-mation, is no longer required in version 2.00
and higher.
The inputs and outputs of the CONNECT block are defined as follows:
EN
This input is the block enable. When TRUE the block performs its function.
REUSE
Reserved for future use.
NAME
This input accepts the name of the other resource (e.g. CCM) to which it is desired to connect.
The NAME input is written in the form 'resource name'.
NDR
The New Data Ready output is TRUE if the connection is established.
ERROR
The error output displays a Boolean TRUE when a communication error exists.
STATUS This integer output displays the code of the last detected error. Refer to Communication
Block Status Codes in 4-mation help.
ID
This output is the communication channel between the two resources. This output is used as
the ID input to all other communication blocks.
DEVICE
Reserved for future use.
Softlist Parameters
There are no softlist parameters for this block.
August 2002
9-13
Communications Function Blocks
CG39-22
!Notes
9-14
August 2002
CG39-22
Timing Function Blocks
10.0 Timing Function Blocks
The Timing function blocks are a subset of the standard function blocks. These blocks perform various
timing functions. For memory usage and ACM execution time information on all standard configuration
elements, refer to Appendix C in Using the ProcessSuite 4-mation Configuration Software (document
number CG39-20).
A listing of Compare and Select function blocks is presented here. Individual blocks are detailed in the
subsections that follow.
•
•
•
•
•
ON-Delay Timer
OFF-Delay Timer
Retentive Timer
Timed Pulse
Repeat Cycle Timer
10.1 On-Delay Timer Function Block (TON)
TON
BOOL
TIME
IN
PT
Q
ET
BOOL
TIME
The symbol of the On-Delay Timer (TON) function block is shown above. This block provides an output
of TRUE after a preset time period if the input (IN) remains TRUE for a period of time greater than the
preset time (PT).
When the TON function block is enabled [(IN) = (TRUE)], the elapsed time (ET) will accumulate until it
is equal to the preset time (PT). When the (ET) = (PT), the (Q) output will be set to TRUE. The (Q)
output will remain TRUE until the (IN) input is FALSE. When the (IN) input changes to FALSE, the (Q)
output changes from TRUE to FALSE, and the (ET) output becomes T#00ms.
WARNING
When timers are activated in a section of configuration that may not be
executed every scan (i.e. when used in actions or selective structured text
statements), the timers will continue to time internally unless (IN) is
turned FALSE upon (Q) becoming TRUE.
August 2002
10-1
Timing Function Blocks
CG39-22
On-Delay Timer - Timing Diagram
TRUE--FALSE---
IN
t0
t1
t2 t3
t4
t5
TRUE--FALSE---
Q
t0+PT t1
t4+PT t5
PT-0---
ET
t0
t1
t2 t3
t4
t5
The inputs and outputs of this block are defined as follows:
IN
PT
The boolean input which, upon a transition from FALSE to TRUE, causes the block to begin
timing.
The TIME input which sets the duration of time that must elapse before the output (Q) will be
TRUE.
Q
When (IN) is TRUE and the (PT) time has elapsed, this Boolean output is TRUE. When (IN) is
FALSE, (Q) is FALSE.
ET
The TIME output indicating the elapsed time.
Softlist Parameters
There are no softlist parameters for this block.
10.2 Off-delay Timer Function Block (TOF)
TOF
BOOL
TIME
IN
PT
Q
ET
BOOL
TIME
The symbol of the Off-Delay (TOF) Timer function block is shown above. This block provides an output
of FALSE after a preset time period if the input (IN) remains FALSE for a period of time greater than the
preset time (PT).
When (IN) = FALSE, the elapsed time (ET) will accumulate until it is equal to the preset time (PT).
When the (ET) = (PT), the (Q) output will be set to FALSE. The (Q) output will remain FALSE until the
10-2
August 2002
CG39-22
Timing Function Blocks
(IN) input is TRUE. When the (IN) input is TRUE, the (Q) output will be TRUE and the (ET) output will
be T#00ms.
Off-Delay Timer - Timing Diagram
TRUE--FALSE---
IN
t0
t1
t2 t3 t4
t5
TRUE--FALSE---
Q
t0
t1+PT t2
t5+PT
PT-0---
ET
t1
t3
t5
The inputs and outputs of this block are defined as follows:
IN
The boolean input which upon a transition from TRUE to FALSE, causes the block to begin timing.
PT
The TIME input indicating the duration of time that must elapse before the output (Q) will be
FALSE.
Q
When (IN) is TRUE, (Q) is TRUE. When (IN) transitions from TRUE to FALSE and (ET) >= (PT),
(Q) is FALSE
ET The TIME output indicating the elapsed time.
Softlist Parameters
There are no softlist parameters for this block.
10.3 Retentive Timer Function Block (ROT)
ROT
BOOL
BOOL
TIME
ON_OFF
EN
PT
DN
NOTDN
ET
BOOL
BOOL
TIME
The symbol of the Retentive Timer (ROT) function block is shown above. This block provides an output
(DN) of TRUE after the inputs (ON_OFF) and (EN) have been TRUE for a predetermined period of time
(PT).
The (EN) input is the block enable switch. If the (EN) input is TRUE, the block timer can be turned on
and off. If (EN) is FALSE, the block is turned off and all outputs are reset - (ET) will be set to T#000ms
and (DN) and (NOTDN) will be FALSE.
August 2002
10-3
Timing Function Blocks
CG39-22
The (ON_OFF) input controls the timing action of the block but has no effect if (EN) is FALSE. While
(EN) is TRUE and (ON_OFF) is TRUE, (ET) accumulates. If the (ET) is less than the (PT), then the
(NOTDN) output will be TRUE. If the (EN) input is TRUE, the (ON_OFF) input is TRUE, and the (ET)
has reached the (PT), then the (DN) output will be TRUE. If (EN) is TRUE and the (ON_OFF) input
becomes FALSE, the (ET) will stop accumulating and hold its value (retentive). The (ET) will begin
accumulating from where it left off if (ON_OFF) becomes TRUE before (EN) is set to FALSE.
RETENTIVE ON TIMER - TIMING DIAGRAM
EN
ON_OFF
DN
NOTDN
PT
ET 0
The inputs and outputs of this block are defined as follows:
ON_OFF When TRUE, this boolean input tells the block to begin timing. The (EN) input must be
TRUE for this input to have an effect.
EN
This is the block enable input. When TRUE, the block is capable of performing its function.
When FALSE the (ET) is reset.
PT
This TIME input indicates the preset time duration that the block must reach for (DN) to go
TRUE.
DN
This Boolean output indicates when the timing is "done" and will be TRUE when all of the
following occur: (EN) is TRUE, (ON_OFF) is TRUE and (ET) >= (PT).
NOTDN
This boolean output is TRUE when (EN) is TRUE and (ET) < (PT).
ET
This TIME output indicates the elapsed time of the block.
Softlist Parameters
There are no softlist parameters for this block.
10-4
August 2002
CG39-22
Timing Function Blocks
10.4 Timed Pulse Function Block (TP)
TP
BOOL
TIME
IN
PT
Q
ET
BOOL
TIME
The symbol of the Timed Pulse (TP) function block is shown above. This block provides a BOOL pulse
output for a predetermined time period. The pulse timer starts when block input (IN) changes from
FALSE to TRUE. This causes block output (Q) to become TRUE for the duration of the pulse. Pulse
duration is set by the TIME value applied to the pulse time (PT) input. The (ET) output value represents
the elapsed time of the pulse since starting the timer.
When the pulse times out, the (Q) output changes from TRUE to FALSE. (IN) is already FALSE at this
time and (ET) will immediately be set to a value of zero (i.e. T#000ms). Otherwise, (ET) will equal (PT)
and will output a value of zero (i.e. T#000ms) when (IN) returns to FALSE.
Based on the above paragraph, the elapsed time value (ET) may not necessarily ever equal pulse time
(PT), depending on the (IN) signal at the end of the pulse. The logic that you develop when using this
block should use the (Q) output to determine the end of the pulse.
Once the pulse has been triggered, (Q)=TRUE, the block cannot be retriggered until the end of the timed
pulse. During power-up, the (Q) and (ET) outputs are initialized to values of FALSE and T#000ms,
respectively.
Timed Pulse - Timing Diagram
TRUE --FALSE ---
IN
t0
t1
t0
t0+PT
t0
t1
t2 t3
t4
t2 t2+PT
t4
t2
t4
t5
TRUE --FALSE ---
Q
t4+PT
PT -0 ---
ET
t5
The inputs and outputs of the TP block are defined as follows:
IN
This is the block input. It accepts a BOOL value; when TRUE, it starts the pulse timer.
PT
This is the Pulse Time input. It accepts a TIME data type value, which determines the duration of
the pulse.
Q
This is the Q output. It outputs a BOOL value. When (IN) turns TRUE, this Q output is TRUE for
the duration of the (PT), and then it switches to FALSE.
ET This is the Elapsed Time output. It provides a TIME value indicating the elapsed time.
August 2002
10-5
Timing Function Blocks
CG39-22
Softlist Parameters
There are no softlist parameters for this block.
10.5 Repeat Cycle Timer Function Block (RECYCL)
REPCYCL
BOOL
REAL
EN
PCTON
OUT
ET
TIMREM
BOOL
TIME
TIME
The symbol of the Repeat Cycle Timer (REPCYCL) function block is shown above. This block performs
the function of a repeat cycle timer.
When (EN) is FALSE, the (OUT) output is FALSE, the (ET) output is set to zero, the (TIMREM) output
is set to the period time and the internal elapsed timer is also set to zero.
The actual time that the (OUT) output is TRUE equals the Softlist Parameter ONTIME, and can be
modified by the input (PCTON).
The START_STATE softlist parameter allows the timer to start in the TRUE or FALSE state.
Elapsed Time (ET) and Time Remaining (TIMREM) are given as outputs. These outputs will always
reflect the current period parameters. (ET) will count up from zero and (TIMREM) will count down from
the period time. The start of a period will begin on a FALSE-to-TRUE transition of the (EN) input. The
start of subsequent periods will be determined by (OUT) output transitions and the (ET). A period will
start on the FALSE-to-TRUE output transition, if the START_STATE is TRUE, or on the TRUE-toFALSE output transition if the START_STATE is FALSE.
Either of two possible timing modes are selected by specifying either a zero or a non-zero value for
OFFTIME as follows:
1. When OFFTIME is greater than zero milliseconds, the Repeat Cycle Timer period is a variable equal
to [OFFTIME + ((PCTON) * ONTIME)]. (OUT) is FALSE for a fixed length of time (equal to
OFFTIME). (PCTON) is internally limited to non-negative values (>= 0%).
2. When OFFTIME is equal to zero milliseconds, the Repeat Cycle Timer period is fixed (equal to
ONTIME). (OUT) is FALSE for a variable length of time equal to [ONTIME - ((PCTON) *
ONTIME)]. (PCTON) is internally limited to non-negative values <= 100.0%.
The internal timer remains synchronized with real time while the (EN) input is TRUE, even when
(PCTON) is greater than or equal to 100.0% ((OUT) is held TRUE) or less than or equal to 0.0% ((OUT)
is held FALSE).
The actual (OUT) TRUE or FALSE state lasts at least as long as the configured scan time for the
program. On or off times that are not multiples of the scan time will cause the (OUT) state to last up to
one scan time longer or shorter than the configured on or off time. (Time will be longer for most cycles
until excess elapsed time causes a shorter cycle to re-synchronize with Real-Time.)
10-6
August 2002
CG39-22
Timing Function Blocks
(PCTON) is entered as a REAL number in the nominal percentage range 0-100%; it can be > 100% in the
variable period mode.
REPEAT CYCLE TIMER
EN
OUT
t0
t1
t2
t3
t4
t5
t6
PERIOD
ET
T#Oms
TIMEREM
PERIOD
(* Variable period mode *)
IF OFFTIME t > T#0ms
t1 = OFFTIME
t2 - t1 = ONTIME * (PCTON)
t3 - t2 = OFFTIME
t4 - t3 = ONTIME * (PCTON)
PERIOD = t2 - t0 = OFFTIME + (ONTIME * (PCTON))
(* Fixed period mode *)
IF OFFTIME = T#0ms
t1 - t0 = ONTIME - (ONTIME * (PCTON))
t2 - t1 = ONTIME * (PCTON)
t3 - t2 = ONTIME - (ONTIME * (PCTON))
t4 - t3 = ONTIME * (PCTON)
PERIOD = t2 - t0 = ONTIME
August 2002
10-7
Timing Function Blocks
CG39-22
The inputs and the outputs of this block are defined as follows:
EN
This is the Enable input, when TRUE the timer will begin.
OUT
This is the output of the function block.
PCTON
This is the input factor which modifies the ONTIME softlist value to provide the actual time
on. (PCTON) has percent units in the range of 0.0 to 100.0.
ET
This is the Elapsed Time output. It indicates the elapsed time of the period.
TIMREM This is the is the Time Remaining output. It indicates the time remaining of the period.
Softlist Parameters
START_STATE
This is the boolean start state of the timer cycle. When TRUE, the period starts on a
FALSE to TRUE output transition. When FALSE, the period starts on a TRUE to
FALSE output transition.
OFFTIME
This is the softlist parameter for specifying the time off.
ONTIME
This is the softlist parameter for specifying the time on.
Parameter
Data Type
Initial Value
Min Value
Max Value
OFFTIME
TIME
T#0d0h0m0s0ms
T#0d0h0m0s0ms
NA
ONTIME
TIME
T#0d0h1m0s0ms
T#0d0h0m0s0ms
NA
START_STATE
BOOL
TRUE
FALSE
TRUE
NOTE
The REPCYCL block may skip output pulses if the pulse times are less
than or equal to the controller scan time. To reduce the chance of missed
pulses, the time period used (for either the ONTIME or OFFTIME
softlist parameters) would be at least three times the scan time of the
controller; for better accuracy, a ratio of five times the scan time is
preferred.
10-8
August 2002
CG39-22
Counting Function Blocks
11.0 Counting Function Blocks
The Counting function blocks are a subset of the standard function blocks. These blocks perform counting
functions and operate on Boolean inputs.
All process variable (PV) inputs have an INT unit range of +32767 to -32768.
For memory usage and ACM execution time information on all standard configuration elements, see
Appendix C in Using the 4-mation Configuration Software (document number CG39-20).
A listing of Counting function blocks is presented here. Individual blocks are detailed in the subsections
that follow.
•
•
•
Up Counter
Down Counter
Up/Down Counter
11.1 Up Counter Function Block (CTU)
CTU
BOOL
BOOL
INT
CU
R
PV
Q
CV
BOOL
INT
The symbol of the Up Counter (CTU) function block is shown above. This block performs a count-up
function.
For each cycle that a FALSE-to-TRUE transition occurs at the (CU) input while (R) is FALSE, the (CV)
output will increment once, counting up from zero and stopping at the maximum integer value (+32767).
The (Q) output is TRUE when (CV) >= (PV). When reset (R) is TRUE, the counter value (CV) resets to
zero and the BOOL output (Q) is set to FALSE.
The inputs and outputs of the CTU block are defined as follows:
CU This boolean count-up input causes the counter's (CV) to increment when a FALSE to TRUE
transition is sensed.
R
This boolean is the reset input. When toggled from FALSE to TRUE, the (CV) input is set to 0 and
(Q) is reset.
PV
This integer input is the preset value. The current value (CV) must count up to this value in order
for (Q) to be TRUE.
Q
This boolean output is TRUE when (CV) >= (PV).
CV This integer output indicates the count amount (The number of times the (CU) has toggled during
which (R) has remained FALSE).
August 2002
11-1
Counting Function Blocks
CG39-22
Softlist Parameters
There are no softlist parameters for this block.
11.2 Down Counter Function Block (CTD)
CTD
BOOL
BOOL
INT
CD
LD
PV
Q
CV
BOOL
INT
The symbol of the Down Counter (CTD) function block is shown above. This block performs a countdown function.
For each cycle that a FALSE to TRUE transition occurs at the (CD) input while (LD) is FALSE, the (CV)
output will decrement once, counting down from (PV) and stopping at the minimum integer value
(-32768). The (Q) output will be TRUE when (CV) <=0. When load (LD) is TRUE, the counter value
(CV) will be reset to (PV) and the BOOL output (Q) will be FALSE.
The inputs and outputs of this block are defined as follows:
CD This boolean count-down input decrements the (CV) value by one, upon each transition from
FALSE to TRUE.
LD
This boolean input loads the timer (CV) = (PV) when TRUE. While FALSE, the (CD) input is
monitored for transitions.
PV
This integer input is the preset value. The counter block must count down from this value to zero in
order for (Q) to be TRUE.
Q
This boolean output is set to FALSE unless (CV) <=0.
CV This integer is the current value of the count. This value is first loaded with the preset value then
decremented with each transition of (CD).
Softlist Parameters
There are no softlist parameters for this block.
11-2
August 2002
CG39-22
Counting Function Blocks
11.3 Up/Down Counter Function Block (CTUD)
CTUD
BOOL
CU
QU
BOOL
BOOL
CD
QD
BOOL
BOOL
R
CV
INT
BOOL
LD
INT
PV
The symbol of the Up/Down Counter (CTUD) function block is shown above. This block performs a
count-up/count-down function.
When Reset (R) is TRUE, the Counter value (CV) will be reset to zero. When Load (LD) is TRUE, the
(CV) will be loaded with the preset value (PV). Reset (R) has a higher priority than (LD). The Up
Output (QU) will be TRUE whenever the (CV) is greater or equal to the (PV). The Down Output (QD)
will be TRUE whenever (CV) is less than or equal to zero. These outputs will be FALSE at all other
times.
While (R) and (LD) are FALSE, (CV) will increment or decrement once for each cycle that a transition
occurs at the (CU) or (CD) inputs, respectively. (CV) uses the following range: -32768 to +32767.
Simultaneous counting is not allowed, and UP counting has priority over DOWN counting.
The inputs and outputs of this block are defined as follows:
CU
This boolean input is checked for FALSE to TRUE transitions. If found, the (CV) output
increments by one.
CD
This boolean input is checked for FALSE to TRUE transitions. If found, the (CV) output
decrements by one.
R
When TRUE, this boolean input resets the (CV) output to zero.
LD
When this boolean input is TRUE, (CV) is loaded with the (PV) value.
PV
This integer value is loaded into the (CV) value when (LD) is TRUE and is used to trip (QU) when
(CV) = (PV).
QU
This boolean output is TRUE whenever (CV) is greater than (PV).
QD
This Boolean output is TRUE whenever (CV) is less than or equal to zero.
CV
This is the current value.
Softlist Parameters
There are no softlist parameters for this block.
"
August 2002
11-3
Counting Function Blocks
CG39-22
!Notes
11-4
August 2002
CG39-22
Alarm Function Blocks
12.0 Alarm Function Blocks
The Alarm function blocks are a subset of the standard function blocks. These blocks provide alarming
functions. For memory usage and control module execution time information on all standard
configuration elements, see Appendix C in Using the 4-mation Configuration Software (document
number CG39-20).
A listing of Alarm function blocks is presented here. Individual blocks are detailed in the subsections that
follow.
•
•
•
•
HLL Analog Alarm
HLL Analog Alarm 4
HLL Discrete Alarm
HLL Discrete Alarm 1
12.1 HLL Analog Alarm Function Block (HLLAALM)
HLLAALM
ANY_NUM
ANY_NUM
BOOL
BOOL
BOOL
BOOL
BOOL
BOOL
ALM1
NAK1
ALM2
NAK2
ALM3
BOOL
PV
DEV
EN1
EN2
EN3
EN4
NAK3
BOOL
BOOL
BOOL
BOOL
OOS
ALM4
NAK4
STATUS
CMD
BOOL
BOOL
INT
INT
The symbol of the Hi-Level Link (HLL) Analog Alarm (HLLAALM) function block is shown above.
This block detects abnormal data values. It is intended for MYCROÔ users as it maintains an Alarm
Status Word output (STATUS) in the MYCRO/MLC/HLL format.
The (STATUS) output reflects the block's enable, alarm, acknowledge, and out of service values.
The (CMD) output allows an HMI to issue commands change the (NAK), (EN) or (OOS) values.
The (OOS) input indicates to monitoring devices that the block's alarms have been put out of service and
can be ignored (even though the alarm processing still continues).
There are five different alarm types as follows:
•
•
•
•
•
Absolute
Deviation
Out Of Range
Quality
Rate Of Change
August 2002
12-1
Alarm Function Blocks
CG39-22
Absolute
The absolute alarm can be configured for high, high_high, low or low_low detection.
The second input (DEV) is not used when the alarm is configured for absolute. If the
enable input (EN) is TRUE and the (PV) input of an absolute alarm reaches the limit
in the direction selected (as high or higher than a high limit, or as low or lower than a
low limit) and remains in that state for longer than the configured delay time in, then
the [ALM(1 - 4)] output and the [NAK(1-4)] output are set TRUE.
Deviation
The deviation alarm checks the difference between the (PV) and the (DEV) inputs. If
the enable input (EN) is TRUE and the deviation reaches the deviation limit for the
entered delay time in, the [ALM(n)] and the [NAK(n] outputs are set TRUE.
Out of Range
The out of range alarm checks if the input value is within the entered range. If (PV) is
less than EINL or greater than EINH, the [ALM(n)] and the [NAK(n)] outputs are set
TRUE.
Quality
The quality alarm can be configured to detect whenever the quality of the PV is not
GOOD. If the PV value's quality is BAD, QUESTIONABLE, or UNAVAILABLE
the [ALM(n)] and [NAK(n)] outputs are set to TRUE.
Rate of Change
The rate of change alarm detects if the PV input value is changing at a rate greater
than the (limits per minute in engineering units) value established by the
ALARMn_LIMIT softlist parameter. If the condition continues beyond the time
period established by the ALARMn_DELAYIN softlist parameter, the [ALM(n)] and
[NAK(n)] outputs are set to TRUE. This alarm can be configured to trigger in any one
of three ways. The rate of change increase alarm triggers on an increasing PV input;
the rate of change decrease alarm triggers on a decreasing PV input, and the rate of
change absolute alarm triggers on a PV input changing in either direction.
The annunciation and acknowledgment of the absolute, deviation, out of range, and quality alarms are the
same. When an alarm condition occurs, the alarm continues to be annunciated until the alarm has been
acknowledged [until the (NAK) bit has been reset]. Once acknowledged, the alarm is not annunciated
again until the alarm condition clears and returns. The (ALM) output remains TRUE until the alarm
condition is cleared. If ringback is enabled, the (NAK) output is set to TRUE when the alarm condition
clears, requiring acknowledgment of the cleared condition.
All (ALM) outputs are FALSE only if the process value (or deviation) is within the alarm limit by at least
the amount of the deadband and remains in that state for the required amount of delay time out.
12-2
August 2002
CG39-22
Alarm Function Blocks
The inputs and outputs of the HLLAALM block are defined as follows:
PV
This input is the value to be monitored for alarms.
DEV
This input is the deviation input. The difference between this input and the (PV) input is
monitored when a deviation alarm is selected.
EN(n)
These inputs are the enable inputs for alarms one to four. When TRUE, the corresponding
alarm is enabled.
OOS
This input indicates that the alarm is out of service.
ALM(n)
This output is TRUE if the corresponding alarm is detected and enabled.
NAK(n)
This output is be TRUE if the corresponding alarm is tripped but has not been
acknowledged.
STATUS This integer output is the Alarm Status Word in decimal. It is provided for use by a HumanMachine Interface (HMI).
CMD
This output is used by an operator interface to allow access to the input values. That is, a
console can modify the outputs [NAK(n)] and the input variables [EN(n)] via this output.
See Table 12–1
.
August 2002
12-3
Alarm Function Blocks
CG39-22
Table 12–1 Status and CMD Output Values
PARAMETER
STATUS
VALUE
CMD
BINARY STATUS AND
CMD RESET VALUE
BINARY CMD SET
VALUE
ACK/
ENABLE
DISABLE
ALM1
1
NA
NA 2#0000_0000_0000_0001
NA
NAK1
2
2
2 2#0000_0000_0000_0010
NA
EN1
4
4
4 2#0000_0000_0000_0100
2#1000_0000_0000_0100
ALM2
8
NA
NA 2#0000_0000_0000_1000
NA
NAK2
16
16
16 2#0000_0000_0001_0000
NA
EN2
32
32
32 2#0000_0000_0010_0000
2#1000_0000_0010_0000
ALM3
64
NA
NA 2#0000_0000_0100_0000
NA
NAK3
128
128
128 2#0000_0000_1000_0000
NA
EN3
256
256
256 2#0000_0001_0000_0000
2#1000_0001_0000_0000
ALM4
512
NA
NA 2#0000_0010_0000_0000
NA
NAK4
1,024
1,024
1,024 2#0000_0100_0000_0000
NA
EN4
2,048
2,048
2,048 2#0000_1000_0000_0000
2#1000_1000_0000_0000
OOS
4,096
4,096
4,096 2#0001_0000_0000_0000
2#1001_0000_0000_0000
Softlist Parameters
The remaining HLLAALM inputs are accessed via the softlist. The values of these inputs can be changed
via commands issued from an operator interface or another function block (i.e. the Set Value block) but
they cannot be “wired” to a block. A description and initial value for each softlist parameter is provided
as follows:
12-4
August 2002
CG39-22
Alarm Function Blocks
ALARMn_TYPE The enumerated input that determines the type of alarm configured. The available
selections are listed as follows.
Enumerated
Value
Selections
Description
0
NONE
No Alarm
1
HIGH
High Absolute Alarm
2
LOW
Low Absolute Alarm
3
HIGH_DEV
High Deviation Alarm
4
LOW_DEV
Low Deviation Alarm
5
ABSOLUTE_DEV
Absolute Deviation Alarm
6
OUT_OF_RANGE
Out of Range Alarm
7
QUALITY_NOT_GOOD
Quality Alarm
8
HIGH_HIGH
High high Alarm
9
LOW_LOW
Low low Alarm
10
INC_ROC
Rate of Change Increase Alarm
11
DEC_ROC
Rate of Change Decrease Alarm
12
ABS_ROC
Rate of Change Absolute Alarm
NOTE
When using 4-mation to configure this block, select the desired
enumerated type by name from the Selections area of the block's Softlist
dialog box. When writing to an enumerated softlist parameter from
outside the controller (from an operator interface) or from inside the
controller (using a Set Value function block), use the associated integer
value. For example, to change the alarm type to a high absolute alarm, a
"1" should be written to the ALARMn_TYPE softlist parameter.
August 2002
12-5
Alarm Function Blocks
ALARMn_LIMIT
CG39-22
The value (in engineering units) to which the (PV) input is compared. For
rate of change alarm applications, this is the value (in engineering units per
minute) to which the (PV) input is compared.
ALARMn_DEADBAND The amount of engineering units by which (PV) must be within the limit for
an alarm to clear.
ALARMn_DELAYIN
The amount of time the input must reach or exceed the limit to trip an alarm.
ALARMn_DELAYOUT
The amount of time the input must be within the limit and deadband to cause
the alarm to clear.
ALARMn_RINGBACK
The Boolean switch which when TRUE will alarm [set the (NAK) output]
when an alarm clears as well as when it trips.
DISABLE_ON_OOS
This Disable On Out-of-Service parameter accepts a Boolean value of TRUE
or FALSE. When set to TRUE, the block is disabled if the Out-Of-Service
(OOS) input is also TRUE. When set to FALSE, this parameter has no affect
on block operation.
EINL
The PV low value, in engineering units, used for the out of range alarm.
EINH
The PV high value, in engineering units, used for the out of range alarm.
12-6
August 2002
CG39-22
Alarm Function Blocks
Parameter
Units
Initial Value
Min Value
Max Value
ALARM1_TYPE
ALARM_TYPE
NONE
NA
NA
ALARM1_LIMIT
Engr
0.0
NA
NA
ALARM1_DEADBAND
Engr
0.5
0.0
NA
ALARM1_DELAYIN
TIME
T#0d0h0m0s0ms
T#0d0h0m0s0ms
NA
ALARM1_DELAYOUT
TIME
T#0d0h0m0s0ms
T#0d0h0m0s0ms
NA
ALARM1_RINGBACK
BOOL
FALSE
FALSE
TRUE
ALARM2_TYPE
ALARM_TYPE
NONE
NA
NA
ALARM2_LIMIT
Engr
0.0
NA
NA
ALARM2_DEADBAND
Engr
0.5
0.0
NA
ALARM2_DELAYIN
TIME
T#0d0h0m0s0ms
T#0d0h0m0s0ms
NA
ALARM2_DELAYOUT
TIME
T#0d0h0m0s0ms
T#0d0h0m0s0ms
NA
ALARM2_RINGBACK
BOOL
FALSE
FALSE
TRUE
ALARM3_TYPE
ALARM_TYPE
NONE
NA
NA
ALARM3_LIMIT
Engr
0.0
NA
NA
ALARM3_DEADBAND
Engr
0.5
0.0
NA
ALARM3_DELAYIN
TIME
T#0d0h0m0s0ms
T#0d0h0m0s0ms
NA
ALARM3_DELAYOUT
TIME
T#0d0h0m0s0ms
T#0d0h0m0s0ms
NA
ALARM3_RINGBACK
BOOL
FALSE
FALSE
TRUE
ALARM4_TYPE
ALARM_TYPE
NONE
NA
NA
ALARM4_LIMIT
Engr
0.0
NA
NA
ALARM4_DEADBAND
Engr
0.5
0.0
NA
August 2002
12-7
Alarm Function Blocks
CG39-22
ALARM4_DELAYIN
TIME
T#0d0h0m0s0ms
T#0d0h0m0s0ms
NA
ALARM4_DELAYOUT
TIME
T#0d0h0m0s0ms
T#0d0h0m0s0ms
NA
ALARM4_RINGBACK
BOOL
FALSE
FALSE
TRUE
EINL
Engr
0.0
NA
NA
EINH
Engr
100.0
NA
NA
DISABLE_ON_OOS
BOOL
FALSE
FALSE
TRUE
Where NA indicates not applicable
12.2 HLL Analog Alarm 4 Function Block (HLLAA4)
HLLAA4
ANY_NUM
PV
STATUS
INT
The symbol of the Hi-Level Link (HLL) Analog Alarm 4 (HLLAA4) function block is shown above.
This block is used to detect abnormal data values in the control system. This block is a derivation of the
HLLAALM block and intended for MYCROä users. This block is used as an analog indicator with
alarms in situations where an alarm block must occupy less area on a sheet than the HLLAALM block.
To reduce the number of inputs and outputs, the EN(n), ALM(n), NAK(n) and OOS functions are
implemented as softlist parameters. In addition, this block does not support deviation alarms.
The HLL Analog Alarm Function Block has two functions. It is used to detect abnormal data values in
the control system. It also outputs an Alarm Status Word, STATUS, in the MYCRO/MLC/HLL format.
The STATUS output details the block's enable, alarm, acknowledge and out of service values. This
allows existing MYCRO consoles to communicate with the HLLAA4 block through the LIM and
Presentation block connection and Human-Machine Interface (HMI), to communicate directly to the
STATUS Word. The CMD softlist parameter is the command port used to change the NAK or EN values
from the HLL.
12-8
August 2002
CG39-22
Alarm Function Blocks
There are four different alarms types:
•
•
•
•
Absolute
Out of Range
Quality
Rate of Change
Absolute
The absolute alarm can be configured for either high, high-high, low, or low-low detection.
If the Enable input (EN) is TRUE and the PV input of an absolute alarm exceeds the limit in
the direction selected (i.e. higher than a high limit or lower than a low limit) and remains in
that state for longer than the entered delay time in, then the [ALM(n)] and the [NAK(n)]
outputs are set to TRUE.
Out of
Range
The out of range alarm checks if the input value is within the entered range (EINL - EINH).
If PV is less than 0.0% of or greater than 100.0% of the range, the [ALM(n)] and [NAK(n)]
outputs are set to TRUE.
Quality
The quality alarm can be configured to detect whenever the quality of the PV is not GOOD.
If the PV value's quality is BAD, QUESTIONABLE, or UNAVAILABLE, the [ALM(n)]
and [NAK(n)] outputs are set to TRUE.
Rate of
Change
The rate of change alarm detects if the PV input value is changing at a rate greater than the
(limits per minute in engineering units) value established by the ALARMn_LIMIT softlist
parameter. If the condition continues beyond the time period established by the
ALARMn_DELAYIN softlist parameter, the [ALM(n)] and [NAK(n)] outputs are set to
TRUE. This alarm can be configured to trigger in any one of three ways. The rate of change
increase alarm triggers on an increasing PV input; the rate of change decrease alarm triggers
on a decreasing PV input, and the rate of change absolute alarm triggers on a PV input
changing in either direction.
The annunciation and acknowledgement of all four alarm types are the same. When an alarm condition
occurs, the alarm continues to be annunciated until it is acknowledged (the NAK bit is reset). Once
acknowledged, the alarm is not be annunciated again until the alarm condition clears and returns. The
ALM output remains TRUE until the alarm condition is cleared. If the ringback is enabled, the NAK
output is TRUE when the alarm condition clears, requiring acknowledgement of the cleared condition.
The ALM output is FALSE only if the process value is within the alarm limits by at least the amount of
the deadband and remains in that state for the required amount of delay time out.
The input and output of the HLLAA4 block are as follows:
PV
This is the Process Variable input. It is the value to be monitored.
STATUS This is the Status output. It provides the alarm status word in decimal.
August 2002
12-9
Alarm Function Blocks
CG39-22
Softlist Parameters
ALARMn_TYPE The enumerated input which determines the type of alarm configured. The available
selections are listed below.
Enumerated Selections
Value
Description
0
NONE
No Alarm
1
HIGH
High Absolute Alarm
2
LOW
Low Absolute Alarm
6
OUT_OF_RANGE
Out of Range Alarm
7
QUALITY_NOT_GOOD
Quality Alarm
8
HIGH_HIGH
High high Alarm
9
LOW_LOW
Low low Alarm
10
INC_ROC
Rate of Change Increase
Alarm
11
DEC_ROC
Rate of Change Decrease
Alarm
12
ABS_ROC
Rate of Change Absolute
Alarm
NOTE
When using 4-mation to configure this block, select the desired
enumerated type by name from the Selections area of the block's Softlist
dialog box. When writing to an enumerated softlist parameter from
outside the controller (from an operator interface) or from inside the
controller (using a Set Value function block), use the associated integer
value. For example, to change the alarm type to a high absolute alarm, a
"1" should be written to the ALARMn_TYPE softlist parameter.
12-10
August 2002
CG39-22
ALARMn_LIMIT
Alarm Function Blocks
The value (in engineering units) to which the (PV) input is compared. For rate
of change alarm applications, this is the value (in engineering units per
minute) to which the (PV) input is compared.
ALARMn_DEADBAND
The amount of engineering units by which (PV) must be within the limit for
an alarm to clear.
ALARMn_DELAYIN
The amount of time the input must reach or exceed the limit to trip an alarm.
ALARMn_DELAYOUT
The amount of time the input must be within the limit and deadband to cause
the alarm to clear.
ALARMn_RINGBACK
The Boolean switch which, when TRUE, will alarm [set the (NAK) output]
when an alarm clears as well as when it trips.
OOS
The Boolean switch which, when TRUE, indicates to monitoring devices that
the block's alarms have been put out-of-service (OOS) and can be ignored
(even though the alarm processing still continues).
DISABLE_ON_OOS
This Disable On Out-of-Service parameter accepts a boolean value of TRUE
or FALSE. When set to TRUE, the block is disabled if the Out-Of-Service
(OOS) parameter is also TRUE. When set to FALSE, this parameter has no
affect on block operation.
EINL
The PV low value (in engineering units) used for the out of range alarm.
EINH
The PV high value (in engineering units) used for the out of range alarm.
EN(n)
These parameters are the Enable inputs for alarms one to four. When TRUE,
the corresponding alarm is enabled.
ALM(n)
These parameters are the Alarm outputs. An output is TRUE if the
corresponding alarm is detected and enabled.
NAK(n)
These parameters are the Not Acknowledged outputs. An output is TRUE if
the corresponding alarm is tripped but has not been acknowledged.
CMD
This parameter is used by an operator interface to allow access to the input
values. That is, the operator console can modify the [NAK(n)] outputs, and
the input variables [EN(n)]. See
.
August 2002
12-11
Alarm Function Blocks
CG39-22
Table 12–2 CMD Values
PARAMETER
STATUS
VALUE
CMD
BINARY STATUS AND
CMD RESET VALUE
BINARY CMD SET
VALUE
ACK/
ENABLE
DISABLE
ALM1
1
NA
NA 2#0000_0000_0000_0001
NA
MAL1
2
2
2 2#0000_0000_0000_0010
NA
EN1
4
4
4 2#0000_0000_0000_0100
2#1000_0000_0000_0100
ALM2
8
NA
NA 2#0000_0000_0000_1000
NA
NAK2
16
16
16 2#0000_0000_0001_0000
NA
EN2
32
32
32 2#0000_0000_0010_0000
2#1000_0000_0010_0000
ALM3
64
NA
NA 2#0000_0000_0100_0000
NA
NAK3
128
128
128 2#0000_0000_1000_0000
NA
EN3
256
256
256 2#0000_0001_0000_0000
2#1000_0001_0000_0000
ALM4
512
NA
NA 2#0000_0010_0000_0000
NA
NAK4
1,024
1,024
1,024 2#0000_0100_0000_0000
NA
EN4
2,048
2,048
2,048 2#0000_1000_0000_0000
2#1000_1000_0000_0000
OOS
4,096
4,096
4,096 2#0001_0000_0000_0000
2#1001_0000_0000_0000
12-12
Parameter
Units
ALARM1_TYPE
Initial Value
Min Value
Max
Value
ALARM_TYPE NONE
NA
NA
ALARM1_LIMIT
Engr
0.0
NA
NA
ALARM1_DEADBAND
Engr
0.5
0.0
1.0
ALARM1_DELAYIN
TIME
T#0d0h0m0s0ms T#0d0h0m0s0ms NA
ALARM1_DELAYOUT
TIME
T#0d0h0m0s0ms T#0d0h0m0s0ms NA
ALARM1_RINGBACK
BOOL
FALSE
FALSE
TRUE
EN1
BOOL
TRUE
FALSE
TRUE
ALM1
BOOL
FALSE
FALSE
TRUE
NAK1
BOOL
FALSE
FALSE
TRUE
ALARM2_TYPE
ALARM_TYPE NONE
NA
NA
August 2002
CG39-22
Alarm Function Blocks
ALARM2_LIMIT
Engr
0.0
NA
NA
ALARM2_DEADBAND
Engr
0.5
0.0
1.0
ALARM2_DELAYIN
TIME
T#0d0h0m0s0ms T#0d0h0m0s0ms NA
ALARM2_DELAYOUT
TIME
T#0d0h0m0s0ms T#0d0h0m0s0ms NA
ALARM2_RINGBACK
BOOL
FALSE
FALSE
TRUE
EN2
BOOL
TRUE
FALSE
TRUE
ALM2
BOOL
FALSE
FALSE
TRUE
NAK2
BOOL
FALSE
FALSE
TRUE
ALARM3_TYPE
ALARM_TYPE NONE
NA
NA
ALARM3_LIMIT
Engr
0.0
NA
NA
ALARM3_DEADBAND
Engr
0.5
0.0
1.0
ALARM3_DELAYIN
TIME
T#0d0h0m0s0ms T#0d0h0m0s0ms NA
ALARM3_DELAYOUT
TIME
T#0d0h0m0s0ms T#0d0h0m0s0ms NA
ALARM3_RINGBACK
BOOL
FALSE
FALSE
TRUE
EN3
BOOL
TRUE
FALSE
TRUE
ALM3
BOOL
FALSE
FALSE
TRUE
NAK3
BOOL
FALSE
FALSE
TRUE
ALARM4_TYPE
ALARM_TYPE NONE
NA
NA
ALARM4_LIMIT
Engr
0.0
NA
NA
ALARM4_DEADBAND
Engr
0.5
0.0
1.0
ALARM4_DELAYIN
TIME
T#0d0h0m0s0ms T#0d0h0m0s0ms NA
ALARM4_DELAYOUT
TIME
T#0d0h0m0s0ms T#0d0h0m0s0ms NA
ALARM4_RINGBACK
BOOL
FALSE
FALSE
TRUE
EN4
BOOL
TRUE
FALSE
TRUE
ALM4
BOOL
FALSE
FALSE
TRUE
NAK4
BOOL
FALSE
FALSE
TRUE
EINL
REAL
0.0
NA
NA
EINH
REAL
100.0
NA
NA
CMD
INT
0
NA
NA
August 2002
12-13
Alarm Function Blocks
CG39-22
Units
Parameter
Initial
Value
Min
Value
Max
Value
DISABLE_ON_OOS BOOL FALSE FALSE TRUE
OOS
BOOL FALSE FALSE TRUE
Where NA indicates not applicable.
12.3 HLL Discrete Alarm Function Block (HLLDALM)
HLLDALM
BOOL
BOOL
BOOL
BOOL
BOOL
IN1
EN1
IN2
EN2
IN3
ALM1
NAK1
ALM2
NAK2
ALM3
BOOL
BOOL
BOOL
BOOL
BOOL
BOOL
BOOL
EN3
IN4
NAK3
ALM4
BOOL
BOOL
BOOL
EN4
NAK4
BOOL
BOOL
OOS
STATUS
CMD
INT
INT
The symbol of the Hi-Level Link (HLL) Discrete Alarm function block is shown above. This block is
used to detect the discrete states of up to four inputs (TRUE or FALSE state detection is selectable for
each alarm).
The block outputs the current value of the HLL Alarm Status Word and also allows for Siemens operator
station communication.
When the selected alarm state is detected, the (ALM) output and the (NAK) output are set TRUE. Once
the alarm has been acknowledged, the (NAK) output is set FALSE. The (ALM) output is the only
FALSE value if the alarm state does not equal the input (IN).
The Out of Service output, (OOS), indicates to monitoring devices when the alarm block has been put in
the Out of Service state.
The inputs and outputs of the HLLDALM are defined as follows:
IN(n)
These inputs are to be checked for the alarm state.
EN(n)
These inputs enable alarms one to four.
OOS
This input indicates if the alarm block is out of service.
ALM(n)
This output is TRUE if the corresponding alarm is tripped.
12-14
August 2002
CG39-22
Alarm Function Blocks
NAK(n)
This output is TRUE if the corresponding alarm is active and is not
acknowledged.
STATUS
This integer output is the HLL Alarm Status Word in decimal. It is used for
troubleshooting only.
CMD
This output is used by Siemens operator stations to allow access to the block
values. That is, the console can modify the outputs (NAK(n)), and the inputs
(EN(n)) via this output.
Table 12–3 CMD Values
PARAMETER
STATUS
VALUE
CMD
ACK/
DISABLE
BINARY STATUS AND
CMD RESET VALUE
BINARY CMD SET
VALUE
ENABLE
ALM1
1
NA
NA 2#0000_0000_0000_0001
NA
MAL1
2
2
2 2#0000_0000_0000_0010
NA
EN1
4
4
4 2#0000_0000_0000_0100
2#1000_0000_0000_0100
ALM2
8
NA
NA 2#0000_0000_0000_1000
NA
NAK2
16
16
16 2#0000_0000_0001_0000
NA
EN2
32
32
32 2#0000_0000_0010_0000
2#1000_0000_0010_0000
ALM3
64
NA
NA 2#0000_0000_0100_0000
NA
NAK3
128
128
128 2#0000_0000_1000_0000
NA
EN3
256
256
256 2#0000_0001_0000_0000
2#1000_0001_0000_0000
ALM4
512
NA
NA 2#0000_0010_0000_0000
NA
NAK4
1,024
1,024
1,024 2#0000_0100_0000_0000
NA
EN4
2,048
2,048
2,048 2#0000_1000_0000_0000
2#1000_1000_0000_0000
OOS
4,096
4,096
4,096 2#0001_0000_0000_0000
2#1001_0000_0000_0000
Softlist Parameters
The remaining HLLDALM inputs are accessed via the softlist. The values of these inputs can be changed
via commands from an operator interface or another function block (i.e. the Set Value block) but they
cannot be “wired” to a block. Below is a description and initial value for each softlist parameter.
August 2002
12-15
Alarm Function Blocks
CG39-22
ALARMn_LIMIT
The BOOL value to which IN1 input value is compared.
ALARMn_RINGBACK
The Boolean switch, which when TRUE will alarm [set the (NAK) output]
when an alarm clears as well as when it trips.
ALARMn_DELAYIN
The amount of time the input must remain at the limit to cause an alarm.
ALARMn_DELAYOUT
The amount of time the input must remain at the limit to cause the alarm to
clear.
DISABLE_ON_OOS
This Disable On Out-of-Service parameter accepts a Boolean value of TRUE
or FALSE. When set to TRUE, the block is disabled if the Out-Of-Service
(OOS) input is also TRUE. When set to FALSE, this parameter has no affect
on block operation.
12-16
Parameter
Data
Type
Initial Value
Min Value
Max Value
ALARM1_LIMIT
BOOL
FALSE
FALSE
TRUE
ALARM1_RINGBACK
BOOL
FALSE
FALSE
TRUE
ALARM1_DELAYIN
TIME
T#0d0h0m0s0ms
T#0d0h0m0s0ms
NA
ALARM1_DELAYOUT
TIME
T#0d0h0m0s0ms
T#0d0h0m0s0ms
NA
ALARM2_LIMIT
BOOL
FALSE
FALSE
TRUE
ALARM2_RINGBACK
BOOL
FALSE
FALSE
TRUE
ALARM2_DELAYIN
TIME
T#0d0h0m0s0ms
T#0d0h0m0s0ms
NA
ALARM2_DELAYOUT
TIME
T#0d0h0m0s0ms
T#0d0h0m0s0ms
NA
ALARM3_LIMIT
BOOL
FALSE
FALSE
TRUE
ALARM3_RINGBACK
BOOL
FALSE
ALARM3_DELAYIN
TIME
T#0d0h0m0s0ms
T#0d0h0m0s0ms
NA
ALARM3_DELAYOUT
TIME
T#0d0h0m0s0ms
T#0d0h0m0s0ms
NA
FALSE
TRUE
August 2002
CG39-22
Alarm Function Blocks
ALARM4_LIMIT
BOOL
FALSE
FALSE
TRUE
ALARM4_RINGBACK
BOOL
FALSE
FALSE
TRUE
ALARM4_DELAYIN
TIME
T#0d0h0m0s0ms
T#0d0h0m0s0ms
NA
ALARM4_DELAYOUT
TIME
T#0d0h0m0s0ms
T#0d0h0m0s0ms
NA
DISABLE_ON_OOS
BOOL
FALSE
FALSE
TRUE
OOS
BOOL
FALSE
FALSE
TRUE
12.4 HLL Discrete Alarm 1 Function Block (HLLDA1)
HL LDA1
IN 1
EN 1
AL M1
BO OL
BO OL
NA K1
BO OL
BO OL
OO S
ST ATUS
IN T
CM D
IN T
BO OL
The symbol of the Hi-Level Link (HLL) Discrete Alarm 1(HLLDA1) function block is shown above.
This block is used to detect the discrete state of an input (TRUE or FALSE state detection is selectable for
the alarm).
The block outputs the current value of the HLL Alarm Status Word and also allows for communication
with a Siemens operator station (console).
When the selected alarm state is detected, the (ALM1) output and the (NAK1) output are set TRUE.
Once the alarm is acknowledged, the (NAK1) output is set FALSE. The (ALM1) output is FALSE only if
the alarm state does not equal the input (IN1).
The Out Of Service output (OOS) indicates to monitoring devices when the alarm block has been put in
the Out of Service state.
The inputs and outputs of the HLLDA1 block are defined as follows:
IN1
This input is to be checked for the alarm state.
EN1
This is the Enable input. It enables the alarm.
OOS
This is the Out Of Service input. It indicates if the alarm block is out of service.
ALM1
This is the Alarm output. It is TRUE if the alarm is tripped.
NAK1
This the Not Acknowleged output. It is TRUE if the alarm is active and is not acknowledged.
August 2002
12-17
Alarm Function Blocks
CG39-22
STATUS This is the alarm Status output. It is a decimal integer value representing the HLL Alarm
Status Word. It is used for troubleshooting only.
CMD
This is the Command output. It is used by Siemens operator stations to allow access to the
block values. That is, the operator station can use this output to modify the (NAK1) output,
and the (EN1) input. See Table 12–4.
Table 12–4 CMD Values
PARAMETER
STATUS
VALUE
CMD
BINARY STATUS AND
CMD RESET VALUE
BINARY CMD SET
VALUE
ACK/
ENABLE
DISABLE
ALM1
1
NA
NA 2#0000_0000_0000_0001
NA
MAL1
2
2
2 2#0000_0000_0000_0010
NA
EN1
4
4
4 2#0000_0000_0000_0100
2#1000_0000_0000_0100
OOS
4,096
4,096
4,096 2#0001_0000_0000_0000
2#1001_0000_0000_0000
Softlist Parameters
The remaining HLLDA1 inputs are accessed via the softlist. The values of these inputs can be changed
via commands by the user (or the Set Value function block, see section 8) but they cannot be wired to
a block. Below is a description and initial value for each softlist parameter.
ALARM1_LIMIT
The BOOL value to which the IN1 input is compared.
ALARM1_RINGBACK
The Boolean switch which, when TRUE, will alarm (set the (NAK1 output)
when an alarm clears as well as when it trips.
ALARM1_DELAYIN
The amount of time the input must remain at the limit to cause an alarm.
ALARM1_DELAYOUT
The amount of time the input must remain at the limit to cause the alarm to
clear.
DISABLE_ON_OOS
This Disable On Out-of-Service parameter accepts a boolean value of TRUE
or FALSE. When set to TRUE, the block is disabled if the Out-Of-Service
(OOS) input is also TRUE. When set to FALSE, this parameter has no affect
on block operation.
12-18
August 2002
CG39-22
Alarm Function Blocks
Parameter
Data
Type
Initial Value
Min Value
Max Value
ALARM1_LIMIT
BOOL
FALSE
FALSE
TRUE
ALARM1_RINGBACK
BOOL
FALSE
FALSE
TRUE
ALARM1_DELAYIN
TIME
T#0d0h0m0s0ms
T#0d0h0m0s0ms
NA
ALARM1_DELAYOUT
TIME
T#0d0h0m0s0ms
T#0d0h0m0s0ms
NA
DISABLE_ON_OOS
BOOL
FALSE
FALSE
TRUE
Where NA indicates not applicable.
"
August 2002
12-19
Alarm Function Blocks
CG39-22
!Notes
12-20
August 2002
CG39-22
Array Function Blocks
13.0 Array Function Blocks
The Array function blocks are a subset of the standard function blocks. These blocks provide array
functions. An array is a variable containing a matrix (or array) of values. For memory usage and ACM
execution time information on all standard configuration elements, see Appendix C in Using the
ProcessSuite 4-mation Configuration Software (document number CG39-20).
The operation of these function blocks is tailored to the use of matrices or tables for batch control
strategies. While arrays may be of any valid data type, the Array function blocks are intended for use
with particular data types. This is because, for example, there may be little use for operations on arrays of
DATE or STRING.
A listing of Array function blocks is presented here. Individual blocks are detailed in the subsections that
follow.
Matrix Dimensions Function Blocks
•
•
•
•
•
•
•
•
Find Matrix Dimension Function Block
Matrix Bounds Function Block
Matrix Move Function Blocks
Matrix Load Function Block
Matrix Unload Function Block
FIFO Function Block
LIFO Function Block
Matrix Copy Function Block
Arithmetic Matrix Blocks
•
•
•
•
•
•
•
Matrix Add, Subtract, Multiply, Divide Function Blocks
Matrix Bias Function Block
Matrix Scaler Function Block
Matrix Square Root Function Block
Logic Matrix Function Blocks
Matrix AND, OR, XOR Function Blocks
Matrix NOT Function Block
Fan In/Out Function Blocks
•
•
•
•
Boolean Fan-In Function Block
Array Fan-In Function Block
Matrix Fan-Out Function Block
Index Check Function Block
13.1 Matrix Dimensions Function Blocks
The Matrix Dimensions function blocks are used to reveal the size definition of an array. These blocks are
detailed in the subsections to follow:
August 2002
13-1
Array Function Blocks
CG39-22
13.1.1 Find Matrix Dimension Function Block (MAT_DIM)
MAT_DIM
ARRAY
IN
OUT
UINT
The symbol of the Find Matrix Dimension function block is shown above. This block is used to find the
number of dimensions of the input array.
The inputs and outputs of the MAT_DIM function block are defined below.
IN
This is the array input of which the number of dimensions will be found.
OUT This is the number of dimensions of the input array. If (IN) is not configured, (NDIM)=0.
Softlist Parameters
There are no softlist parameters in the MAT_DIM block.
13.1.2 Matrix Bounds Function Block (MAT_BND)
MAT_BND
ARRAY
UINT
IN
DIM
UBND
LBND
INT
INT
The symbol of the Matrix Bounds function block is shown above. This block is used to find the upper and
lower bounds of a specific dimension of the single or multi dimensional array input.
The inputs and outputs of the MAT_BND function block are defined as follows.
IN
This is the array input of which the bounds will be found.
DIM
This input is the dimension of the array of which the bound will be found. Assumes the lowest
dimension if unconfigured or out of range.
UBND This is the upper index (boundary) of the specified input array dimension.
LBND
This is the lower index (boundary) of the specified input array dimension.
Softlist Parameters
There are no softlist parameters in the MAT_BND block.
13-2
August 2002
CG39-22
Array Function Blocks
13.2 Matrix Move Function Blocks
The Matrix Move function blocks provide a mechanism to move array elements into and out of a single
dimensional array. These blocks are detailed in the subsections to follow.
13.2.1 Matrix Load Function Block (MATLOAD)
MATLOAD
BOOL
ANY
ANY_ARRAY
INT
UINT
EN
IN
OUT
INDX
L
ENO
DONE
ERROR
NI
BOOL
BOOL
BOOL
INT
The symbol of the Matrix Load function block is shown above. This block takes a variable and loads it
into an array starting at a specified position.
The block can operate in one of three modes:
1. ALL, in which the entire length of the array is loaded with the (IN) value in one scan when the (EN)
input experiences a rising edge transition;
2. NUM_PER_SCAN, in which a specified number of array elements will be loaded per scan when the
(EN) input experiences a rising edge transition;
3. ON_R_EDGE, in which one value is loaded into the array each time the (EN) input experiences a
rising edge transition.
The Next Index (NI) output should be wired into the block as the (INDX) input when in the ON_R_DGE
mode so that the next load will be placed in the next array position. The (DONE) output is TRUE when
the (L) amount of elements have been manipulated. When the end of the array is met, the (NI) output
reflects the last position in the array.
Figure 13-1 shows the matrix load operation.
Variable
Array
With each execution
the index is
increased.
Figure 13–1 Matrix Load Operation
The inputs and outputs of the MATLOAD function block are defined below.
August 2002
13-3
Array Function Blocks
CG39-22
EN
The rising edge input which enables the block to begin operation (in which ever mode is set).
Once triggered, the block will continue the operation for the number of scans it takes until
completion (one cycle).
IN
This input is the variable which will be loaded.
OUT
This is the single dimensional array to which the variable will be loaded.
INDX
This is the position of the array where the (INPUT) value will be loaded. The first element in
the array is the default when left unconfigured.
L
This value indicates the number of elements to be loaded with the (IN) value. When left
unconfigured, it defaults to the entire array length.
ENO
This Boolean output is TRUE while the block is executing the required function. It turns
FALSE when the block is done or when in error.
DONE
This Boolean output indicates that the block performed its function on the (L) amount of
elements. It is TRUE for one scan if (EN) is FALSE or, if (EN) is TRUE, (DONE) remains
TRUE until (EN) becomes FALSE.
ERROR This Boolean output is TRUE when the (L) or (INDX) inputs are invalid (exceeds bounds,
wrong data type...).
NI
This output indicates the next position of the array pointer. To be wired back to the (INDX)
input when in the ON_R_EDGE mode.
Softlist Parameters
Parameter
Type
Default
MODE
enum
ON_R_EDGE(2) 2
NUM_ELEMENTS UDINT 1
MODE
Min
Max
Value Value
1
N/A
This enumerated value determines the way in which the block executes. The selections
are listed below.
Value
Selection
Description
0
ALL
1
NUM_PER_SCAN The NUM_ELEMENTS amount of length will be manipulated in one
scan.
2
ON_R_EDGE
13-4
Entire length is manipulated in one scan
One array element is manipulated each time the (EN) input sees a rising
edge.
August 2002
CG39-22
Array Function Blocks
NUM_ELEMENTS Specifies the number of elements per scan to be manipulated when in the
NUM_PER_SCAN mode. It is ignored otherwise.
13.2.2 Matrix Unload Function Block (MATUNLD)
MATUNLD
BOOL
ANY_ARRAY
ANY
INT
UINT
EN
INPUT
OUT
INDX
L
BOOL
BOOL
BOOL
INT
ENO
DONE
ERROR
NI
The symbol of the Matrix Unload function block is shown above. This block takes an array and unloads it
into a variable.
Upon the (EN) input experiencing a rising edge transition the Matrix Unload Function Block removes the
(INDX) indexed element from the array, places it into the variable indicated in the (OUT) input and
increments the Next Index (NI) output. When a value is removed, zero is put in its place.
Figure 13–2 shows the matrix unload operation.
Array
Variable
With each execution,
the index is
increased.
Figure 13–2 Matrix Unload Operation
August 2002
13-5
Array Function Blocks
CG39-22
The inputs and outputs of the MATUNLD function block are defined below.
EN
The input which enables the block to perform its function upon experiencing a
rising edge transition.
IN
This is the array from which an element will be unloaded.
OUT
This is the variable to which the array element will be unloaded. The array
must have one dimension.
INDX
This is the position of the array from where the value will be unloaded. The
first element in the array is the default when left unconfigured.
L
This value indicates the number of (IN) array values to be unloaded to the
(OUT) variable. When left unconfigured, it defaults to the entire array length.
ENO
This Boolean output is TRUE while the block is executing the required
function. It turns FALSE when the block is done.
DONE
This Boolean output indicates that the block performed its function on the (L)
amount of elements. It is TRUE for one scan if (EN) is FALSE or, if (EN) is
TRUE, (DONE) remains TRUE until (EN) becomes FALSE.
ERROR
This Boolean output is TRUE when the (L) or (INDX) inputs are invalid
(exceeds bounds, wrong data type...)
NI
This output indicates the next position of the array pointer. It should be wired
into the (INDX) input.
Softlist Parameters
There are no softlist parameters in the MATUNLD block.
13.2.3 FIFO Function Block (FIFO)
FIFO
BOOL
BOOL
ANY_ARRAY
ANY
BOOL
PUSH
PULL
MATRIX
IN
CLEAR
OUT
FULL
EMPTY
ERROR
SIZE
ANY
BOOL
BOOL
BOOL
UINT
The symbol of the First-In, First-Out (FIFO) block is shown above. This block pushes values into a usersupplied array and pulls them out on a first-in, first-out basis.
13-6
August 2002
CG39-22
Array Function Blocks
The block requires a one-dimensional array to be connected to the MATRIX input. The block uses the
array as a circular buffer, over-writing earlier pushed values when the last array element has been pushed
into. Internally, the block tracks push and pull operations, which initially point to the first array element.
When the PUSH input senses a rising edge transition, the block places the value at the IN input into the
next available MATRIX array element. The SIZE output is incremented, unless it was already at the array
size limit.
When the PULL input senses a rising edge transition, the block reads the oldest available value in the
MATRIX array and copies it to the OUT output, then decrements the SIZE output unless it has reached 0.
In that case, the block sets the OUT value to the default value for its data type. The array contents are
unchanged.
The FULL value becomes TRUE when the SIZE value equals the size of the array attached to the
MATRIX input. When the FULL value is TRUE, the block will not prevent another value from being
pushed into the array and overwriting the oldest array element. Separate logic must be configured to
prevent this occurrence.
The EMPTY value becomes TRUE when the SIZE value is 0 (zero). When the EMPTY value is TRUE,
the block will not prevent another pull operation. Separate logic must be configured to prevent this
occurrence. If the EMPTY value is TRUE and a pull operation is performed, the block sets the OUT
value to the default value for its data type.
When the CLEAR input senses a rising edge transition, it forces the SIZE value to 0 and sets the OUT
value to the default value for its data type. The array contents are unchanged.
The following figure shows the state of the MATRIX array after pushing values 1, 2, 3, 4, and pulling
once.
Push
Array
Existing elements are
pushed down into the
array.
Pushed into the first
position.
Pull
Pulled from the bottom
position.
Figure 13–3 First In First Out Operation
August 2002
13-7
Array Function Blocks
CG39-22
The inputs and outputs of the FIFO function block are defined below.
PUSH
This rising edge sensitive input causes the IN value to be pushed into the array connected to
the MATRIX input.
PULL
This rising edge sensitive input causes the oldest element pushed into the MATRIX array to
be placed in the OUT output, and makes the next oldest element ready for the next pull.
MATRIX This is the array input. It accepts a single dimensional array that the block uses to store
pushed values and establish the maximum number of elements to be managed by the FIFO
function.
IN
This input holds the value that will be pushed next.
CLEAR
This rising edge sensitive input sets the SIZE value to 0, sets the EMPTY value to TRUE,
and sets OUT value to the default value for its data type.
OUT
This is the block output. It provides the value from the last pull operation. If no pull operation
has occurred or EMPTY was TRUE at the last pull operation, this output will provide the
default value for the its data type.
FULL
This output is TRUE when the SIZE output equals the number of elements in the MATRIX
array. It is FALSE otherwise.
EMPTY
This output is TRUE when SIZE is zero. It is FALSE otherwise.
ERROR
This output is TRUE whenever there is a data type mismatch between the MATRIX input,
the OUT output, or the IN input. It is FALSE otherwise.
SIZE
This output value indicates the number of pushes minus the number of pulls, limited by zero
and the array size.
Softlist Parameters
There are no softlist parameters in the FIFO block.
13-8
August 2002
CG39-22
Array Function Blocks
13.2.4 LIFO Function Block (LIFO)
BOOL
BOOL
ANY_ARRAY
ANY
BOOL
LIFO
PUSH
OUT
PULL
FULL
MATRIX
EMPTY
IN
ERROR
CLEAR
SIZE
ANY
BOOL
BOOL
BOOL
UINT
The symbol of the Last-In First-Out (LIFO) function block is shown above. This block pushes values into
a user-supplied array and pulls them out on a last-in, first-out basis.
The block requires a one-dimensional array to be connected to the MATRIX input. The block uses the
array as a circular buffer, over-writing earlier pushed values when the last array element has been pushed
into. Internally, the block tracks push and pull operations, which initially point to the first array element.
When the PUSH input senses a rising edge transition, the block places the value at the IN input into the
next available MATRIX array element. The SIZE output is incremented, unless it was already at the array
size limit.
When the PULL input senses a rising edge transition, the block reads the most recent value in the
MATRIX array and places it in the OUT output, then decrements the SIZE output unless it has reached 0.
In that case, the block sets the OUT output to the default value for its data type. The array contents are
unchanged.
The FULL value becomes TRUE when the SIZE value equals the size of the array attached to the
MATRIX input. When the FULL value is TRUE, the block will not prevent another value from being
pushed into the array and overwriting the oldest array element. Separate logic must be configured to
prevent this occurrence.
The EMPTY value becomes TRUE when the SIZE value is 0 (zero). When the EMPTY value is TRUE,
the block will not prevent another pull operation. Separate logic must be configured to prevent this
occurrence. If the EMPTY value is TRUE and a pull operation is performed, the block sets the OUT
value to the default value for its data type.
When the CLEAR input senses a rising edge transition, it forces the SIZE value to 0 and sets the OUT
value to the default value for its data type. The array contents are unchanged.
Figure 13–4 shows the state of the MATRIX array after pushing values 1, 2, 3, 4, and pulling once.
August 2002
13-9
Array Function Blocks
CG39-22
LIFO
MATRIX
Array
IN
OUT
1
4
2
3
Next Pull
4
Next Push
(Wraps to top)
00001155.DS4
Figure 13–4 Last In First Out Operation
The inputs and outputs of the LIFO function block are defined below.
PUSH
This rising edge sensitive input causes the IN value to be pushed into the array connected to
the MATRIX input.
PULL
This rising edge sensitive input causes the newest element pushed into the MATRIX array
to be placed in the OUT output, and makes the next newest element ready for the next pull.
MATRIX This is the array input. It accepts a single dimensional array that the block uses to store
pushed values and establish the maximum number of elements to be managed by the LIFO
function.
IN
This input is the variable which will be pushed.
CLEAR
This rising edge sensitive input sets the SIZE value to 0, sets the EMPTY value to TRUE,
and sets OUT value to the default value for its data type.
OUT
This is the block output. It provides the value from the last pull operation. If no pull
operation has occurred or EMPTY was TRUE at the last pull operation, this output will
provide the default value for its data type.
FULL
This output is TRUE when the (SIZE) output equals the size of the input array. It is FALSE
at all other times.
EMPTY
This output is TRUE when SIZE is zero. It is FALSE otherwise.
ERROR
This output is TRUE whenever there is a data type mismatch between the MATRIX input,
the OUT output, or the IN input. It is FALSE otherwise.
SIZE
This output value indicates the number of pushes minus the number of pulls, limited by zero
and the array size.
13-10
August 2002
CG39-22
Array Function Blocks
Softlist Parameters
There are no softlist parameters in the LIFO block.
13.2.5 Matrix Copy Function Block (MATCOPY)
BOOL
ANY_ARRAY
INT
UINT
ANY_ARRAY
INT
MATCOPY
EN
ENO
IN
DONE
INDX_I
ERROR
L
NI_I
OUT
NI_O
INDX_O
BOOL
BOOL
BOOL
INT
INT
The symbol of the Matrix Copy function Block is shown above. This block copies the identified contents
of one array into another array (the values in the input array are maintained).
The block can operate in one of three modes:
1. ALL, in which the entire length of the (IN) array is copied to the (OUT) array in one scan when the
(EN) input experiences a rising edge transition.
2. NUM_PER_SCAN, in which a specified number of array elements are copied per scan starting when
the (EN) input experiences a rising edge transition.
3. ON_R_EDGE, in which one value is copied into the array and the (NI) output is incremented each
time the (EN) input experiences a rising edge transition.
When in the ON_R_EDGE mode, the Next Index of the input (NI_I) output should be wired into the
block as the (INDX_I) input, and the Result Next Index (NI_O) should be wired into the (INDX_O) so
that the next copy will be placed in the next array position.
August 2002
13-11
Array Function Blocks
CG39-22
The inputs and outputs of the MATCOPY function block are defined below.
EN
This Boolean input enables the block to perform its function upon experiencing a rising edge
transition.
IN
This is the input array to be copied. The array must have one dimension.
INDX_I
This is the position of the (IN) array from where the elements will be copied. The first
element in the array is the default when left unconfigured.
L
This value indicates the number of elements in the (IN) array to be copied. When left
unconfigured, it defaults to the entire (IN) array length.
OUT
This is the array to which the values will be copied. The array must have one dimension.
INDX_O This is the position of the array where the (IN) array values will be copied. The first element
in the array is the default when left unconfigured.
ENO
This Boolean output is TRUE while the block is executing the required function. It turns
FALSE when the block is done.
DONE
This Boolean output indicates that the block performed its function on the (L) amount of
elements. It is TRUE for one scan if (EN) is FALSE or, if (EN) is TRUE, (DONE) remains
TRUE until (EN) becomes FALSE.
ERROR
This Boolean output is TRUE when the (L) or (INDX) inputs are invalid (exceeds bounds,
wrong data type...).
NI_I
This output indicates the next position of the (IN) array pointer. When in the ON_R_EDGE
mode, it should be wired to the (INDX_I) input. This output does not indicate the next
position when the end of the array is reached; it reflects the last array position.
NI_O
This output indicates the next position of the (OUT) array pointer. When in the
ON_R_EDGE mode, it should be wired to the (INDX_O) input. This output does not indicate
the next position when the end of the array is reached; it reflects the last array position.
Softlist Parameters
Parameter
Type
Default Min
Max
Value Value
MODE
enum
ALL(0)
NUM_ELEMENTS UDINT 1
13-12
0
2
1
N/A
August 2002
CG39-22
Array Function Blocks
MODE
This enumerated value determines the way in which the block executes. The selections are
listed below.
Value
Selection
Description
0
ALL
Entire length operated on in one scan
1
NUM_PER_SCAN
The NUM_ELEMENTS amount of length (L) that is manipulated in one
scan.
2
ON_R_EDGE
One array element is manipulated each time the (EN) input sees a rising
edge.
NUM_ELEMENTS Specifies the number of elements per scan that should be manipulated when in the
NUM_PER_SCAN mode. It is ignored otherwise.
13.3 Arithmetic Matrix Blocks
The Arithmetic Function Blocks allow the user to perform arithmetic operations on arrays of numeric
(ANY_NUM) data types. These blocks are detailed in the subsections to follow. Each array must have
one dimension.
13.3.1 Matrix Add, Subtract, Multiply , Divide Function Blocks
(MAT_ADD, MAT_SUB, MAT_MUL, MAT_DIV)
BOOL
ANY_ARRAY
INT
ANY_ARRAY
INT
UINT
ANY_ARRAY
INT
MAT_***
EN
ENO
IN01
DONE
INDX_1
ERROR
IN02
NI_1
INDX_2
NI_2
L
NI_O
OUT
INDX_O
BOOL
BOOL
BOOL
INT
INT
INT
The symbol for the Matrix Arithmetic function blocks is shown above. These blocks perform
mathematical functions on two array inputs. The arithmetic functions include:
•
•
•
•
Addition
Subtraction
Multiplication
Division.
August 2002
13-13
Array Function Blocks
CG39-22
For example:
If the MAT_ADD block is chosen, the two matrices are added together. The (L) input determines
how many values in the (IN01) array and (IN02) arrays are to be involved in the operation. One of
the input arrays can be the (OUT) array.
These blocks can operate in one of three modes:
1. ALL, in which the entire (L) of the (IN01) array is operated on the (IN02) array in one scan when the
(EN) input experiences a rising edge transition
2. NUM_PER_SCAN, in which a specified number of array elements will be operated on per scan
starting when the (EN) input experiences a rising edge transition
3. ON_R_EDGE, in which one array element value is operated on the other array element value and the
next index outputs are incremented each time the (EN) input experiences a rising edge transition.
When in the ON_R_EDGE mode, the first Next Index (NI_1) output should be wired into the block as the
(INDX_1) input, the second Next index (NI_2) should be wired into the (INDX_2) and (NI_O) should be
wired back into (INDX_O) so that the next calculation will be at the next array position.
The inputs and outputs of the MAT_*** function blocks are defined below.
EN
The input that enables the block to perform its function upon experiencing a rising edge
transition.
IN01
This is the first array to be involved in the calculation. The array must have one dimension.
INDX_1
This is the starting position of the first input array from where the elements will be added,
subtracted, divided or multiplied. The first element in the array is the default when left
unconfigured. The array must have one dimension.
IN02
This is the second array involved in the calculation. The array must have one dimension.
INDX_2
This is the starting position of the (IN02) array to which the (IN01) array values will be
added, subtracted, divided or multiplied. The first element in the array is the default when
left unconfigured. The array must have one dimension.
L
This value indicates the number of elements in the (IN) array to be mathematically altered.
When left unconfigured it defaults to the entire (IN) array length. If this value is longer than
the (OUT) or either input array size the operation will stop at the shortest length. This array
must have one dimension.
OUT
This is the array where the resultant array is stored. The array must have one dimension.
INDX_O This is the starting position of the array where the result is stored. The first element in the
array is the default when left unconfigured.
ENO
13-14
This Boolean output is TRUE while the block is executing the required function. It turns
FALSE when the block is done.
August 2002
CG39-22
Array Function Blocks
DONE
This Boolean output indicates that the block performed its function on the (L) amount of
elements. It is TRUE for one scan if (EN) is FALSE or, if (EN) is TRUE, (DONE) remains
TRUE until (EN) becomes FALSE.
ERROR
This Boolean output is TRUE when the (L) or (INDX) inputs are invalid (exceeds bounds,
wrong data type...).
NI_1
This output indicates the next position of the (IN01) array pointer. When in the
ON_R_EDGE mode, it should be wired to the (INDX_1) input. This output does not
indicate the next position when the end of the array is reached; it reflects the last array
position.
NI_2
This output indicates the next position of the (IN02) array pointer. When in the
ON_R_EDGE mode, it should be wired to the (INDX_2) input. This output does not
indicate the next position when the end of the array is reached; it reflects the last array
position.
NI_O
This output indicates the next position of the (OUT) array pointer. When in the
ON_R_EDGE mode, it should be wired into the (INDX_O) input. This output does not
indicate the next position when the end of the array is reached; it reflects the last array
position.
Softlist Parameters
Parameter
Type
Default
MODE
enum
NUM_PER_SCAN(1) 0
NUM_ELEMENTS UDINT 1
MODE
Min
Max
Value Value
1
2
N/A
This enumerated value determines the way in which the block executes. The
selections are listed below.
Value
Selection
Description
0
ALL
Entire length operated on in one scan.
1
NUM_PER_SCAN
The NUM_ELEMENTS amount of length (L) that is manipulated in one
scan.
2
ON_R_EDGE
One array element is manipulated each time the (EN) input sees a rising
edge.
NUM_ELEMENTS Specifies the number of elements per scan to be manipulated when in the
NUM_PER_SCAN mode. It is ignored otherwise.
August 2002
13-15
Array Function Blocks
CG39-22
13.3.2 Matrix Bias Function Block (MATBIAS)
BOOL
ANY_ARRAY
INT
UINT
ANY_NUM
ANY_ARRAY
INT
MATBIAS
EN
ENO
IN
DONE
INDX_I
ERROR
L
NI_I
BIAS
NI_O
OUT
INDX_O
BOOL
BOOL
BOOL
INT
INT
The symbol for the Matrix Bias function block is shown above. This block is used to add a single value
to the identified members of the input matrix.
The block can operate in one of three modes:
1. ALL, in which the entire length (L) of the array is biased when the (EN) input experiences a rising
edge transition.
2. NUM_PER_SCAN, in which a specified number of array elements will be biased per scan starting
when the (EN) experiences a rising edge transition
3. ON_R_EDGE, in which one value is biased and the next index outputs are incremented each time the
(EN) input experiences a rising edge transition.
When in the ON_R_EDGE mode, the Next Index (NI_I) output should be wired into the block as the
(INDX_I) input and the Result index (NI_O) output should be wired into the block as the (INDX_O) so
that the next array value will be biased on the next scan.
The inputs and outputs of the MATBIAS function block are defined below.
EN
The input that enables the block to perform its function upon experiencing a rising edge
transition.
IN
This is the input array to be biased. The array must have one dimension.
INDX_I
This is the position of the input array where the operation will begin. The first element in the
array is the default when left unconfigured. The array must have one dimension.
L
This value indicates the number of elements in the input array to be biased. When left
unconfigured, it defaults to the entire input array length. The array must have one dimension.
OUT
This is the array where the biased resultant array is stored. The array must have one
dimension.
BIAS
This is the value by which the identified array elements are to be biased.
INDX_O This is the beginning position in the (OUT) array where the biased values will be stored. The
first element in the array is the default when left unconfigured.
13-16
August 2002
CG39-22
Array Function Blocks
ENO
This Boolean output is TRUE while the block is executing the required function. It turns
FALSE when the block is done.
DONE
This Boolean output indicates that the block performed its function on the (L) amount of
elements. It is TRUE for one scan if (EN) is FALSE or, if (EN) is TRUE, (DONE) remains
TRUE until (EN) becomes FALSE.
ERROR
This Boolean output is TRUE when the (L) or (INDX) inputs are invalid (exceeds bounds,
wrong data type, etc.).
NI_I
This output indicates the next position of the (IN) array pointer. When in the ON_R_EDGE
mode, it should be wired to the (INDX_I) input. This output does not indicate the next
position when the end of the array is reached; it reflects the last array position.
NI_O
This output indicates the next position of the (RESULT) array pointer. When in the
ON_R_EDGE mode, it will be wired into the (INDX_O) input. This output does not indicate
the next position when the end of the array is reached; it reflects the last array position.
Softlist Parameters
Parameter
Type
Default
Min
Value
Max
Value
MODE
enum
NUM_PER_SCAN(1)
0
2
NUM_ELEMENTS
UDINT
1
1
N/A
MODE
This enumerated value determines the way in which the block executes. The
selections are listed below.
Value
Selection
Description
0
ALL
Entire length operated on in one scan
1
NUM_PER_SCAN The NUM_ELEMENTS amount of length (L) that is
manipulated in one scan.
2
ON_R_EDGE
NUM_ELEMENTS
August 2002
One array element is manipulated each time the (EN) input
sees a rising edge.
Specifies the number of elements per scan to be manipulated when in
the NUM_PER_SCAN mode. It is ignored otherwise.
13-17
Array Function Blocks
CG39-22
13.3.3 Matrix Scaler Function Block (MATSCLR)
BOOL
ANY_ARRAY
INT
UINT
ANY_NUM
ANY_ARRAY
INT
MATSCLR
EN
ENO
IN
DONE
INDX_I
ERROR
L
NI_I
FACTOR
NI_O
OUT
INDX_O
BOOL
BOOL
BOOL
INT
INT
The symbol of the Matrix Scaler function block is shown above. This block multiplies the identified
members of the input matrix by a single input value (FACTOR).
The block can operate in one of three modes:
1. ALL, in which the entire length of the array is scaled in one scan when the (EN) input experiences a
rising edge transition.
2. NUM_PER_SCAN, in which a specified number of array elements are scaled per scan starting when
the (EN) input experiences a rising edge transition.
3. ON_R_EDGE, in which one value is scaled and the next index outputs are incremented each time the
(EN) input experiences a rising edge transition.
When in the ON_R_EDGE mode, the Next Index (NI_I) output should be wired into the block as the
(INDX_I) input and the (NI_O) output should be wired into the (INDX_O) input so that the next array
value will be scaled and placed into the correct result position.
The inputs and outputs of the MATSCLR function block are defined below.
EN
The input which enables the block to perform its function upon sensing a rising edge
transition.
IN
This is the input array to be scaled. The array must have one dimension.
INDX_I
This is the position of the input array where the operation will begin. The first element in the
array is the default when left unconfigured. The array must have one dimension.
L
This value indicates the number of elements in the input array to be scaled. When left
unconfigured, it defaults to the entire input array length. The array must have one dimension.
FACTOR The input value by which each identified element will be multiplied.
OUT
This is the array where the scaled resultant array is stored. The array must have one
dimension.
INDX_O
This is the starting position of the resultant array.
ENO
This Boolean output is TRUE while the block is executing the required function. It turns
13-18
August 2002
CG39-22
Array Function Blocks
FALSE when the block is done.
DONE
This Boolean output indicates that the block performed its function on the (L) amount of
elements. It is TRUE for one scan if (EN) is FALSE or, if (EN) is TRUE, (DONE) remains
TRUE until (EN) becomes FALSE.
ERROR
This Boolean output is TRUE when the (L) or (INDX) inputs are invalid (exceeds bounds,
wrong data type...).
NI_I
This output indicates the next position of the (IN) array pointer. When in the ON_R_EDGE
mode, should be wired to the (INDX_I) input. This output does not indicate the next position
when the end of the array is reached; it reflects the last array position.
NI_O
This output indicates the next position of the (OUT) array pointer. When in the
ON_R_EDGE mode, it should be wired into the (INDX_O) input. This output does not
indicate the next position when the end of the array is reached; it reflects the last array
position.
Softlist Parameters
Parameter
Type
Default
MODE
NUM_ELEMENTS
enum
UDINT
NUM_PER_SCAN(1)
1
Min
Value
0
1
Max
Value
2
N/A
MODE
This enumerated value determines the way in which the block executes. The selections are
listed below.
Value
Selection
Description
0
ALL
Entire (LENGTH) manipulated in one scan.
1
NUM_PER_SCAN
The NUM_ELEMENTS amount of length (L) that is manipulated in
one scan.
2
ON_R_EDGE
One array element is manipulated each time the (EN) input sees a
rising edge.
NUM_ELEMENTS
August 2002
Specifies the number of elements per scan to be manipulated when in the
NUM_PER_SCAN mode. It is ignored otherwise.
13-19
Array Function Blocks
CG39-22
13.3.4 Matrix Square Root Function Block (MATSQRT)
BOOL
ANY_ARRAY
INT
UINT
ANY_ARRAY
INT
MATSQRT
EN
ENO
IN
DONE
INDX_I
ERROR
L
NI_I
OUT
NI_O
INDX_O
BOOL
BOOL
BOOL
INT
INT
The symbol of the Matrix Square Root function block is shown above. This block takes the square root
of each element of the array input.
The block can operate in one of three modes:
1. ALL, in which the entire length of the array is square rooted in one scan when the (EN) input
experiences a rising edge transition.
2. NUM_PER_SCAN, in which a specified number of array elements are square rooted per scan starting
when the (EN) input experiences a rising edge transition.
3. ON_R_EDGE, in which one value is square rooted and the next index outputs are incremented each
time the (EN) input experiences a rising edge transition.
When in the ON_R_EDGE mode, the Next Index (NI_I) output should be wired into the block as the
(INDX_I) and (NI_O) should be wired into the (INDX_O) input so that the next array value will be
square rooted.
The inputs and outputs of the MATSQRT function block are defined below.
EN
The input which enables the block to perform its function upon the (EN) input experiencing a
rising edge transition.
IN
This is the input array to be square rooted. The array must have one dimension.
INDX_I
This is the position of the input array where the operation will begin. The first element in the
array is the default when left unconfigured. The array must have one dimension.
L
This value indicates the number of elements in the input array to be square rooted. When left
unconfigured, it defaults to the entire input array length. The array must have one dimension.
OUT
This is the array where the square rooted resultant array is stored. The array must have one
dimension.
INDX_O This is the starting position of the resultant array.
ENO
13-20
This Boolean output is TRUE while the block is executing the required function. It turns
FALSE when the block is done.
August 2002
CG39-22
Array Function Blocks
DONE
This Boolean output indicates that the block performed its function on the (L) amount of
elements. It is TRUE for one scan if (EN) is FALSE or, if (EN) is TRUE, (DONE) remains
TRUE until (EN) becomes FALSE.
ERROR
This Boolean output is TRUE when the (L) or (INDX) inputs are invalid (exceeds bounds,
wrong data type, etc.).
NI_I
This output indicates the next position of the (IN) array pointer. When in the ON_R_EDGE
mode, it should be wired to the (INDX_I) input. This output does not indicate the next
position when the end of the array is reached; it reflects the last array position.
NI_O
This output indicates the next position of the (OUT) array pointer. When in the
ON_R_EDGE mode, it should be wired into the (INDX_O) input. This output does not
indicate the next position when the end of the array is reached; it reflects the last array
position.
Softlist Parameters
Parameter
Type
Default
Min
Value
Max
Value
MODE
enum
NUM_PER_SCAN(1)
0
2
NUM_ELEMENTS
UDINT
11
N/A
MODE
This enumerated value determines the way in which the block executes. The selections are
listed below.
Value
Selection
Description
0
ALL
Entire length (L) manipulated in one scan.
1
NUM_PER_SCAN
The NUM_ELEMENTS amount of length (L) that is manipulated in
one scan.
2
ON_R_EDGE
One array element is manipulated each time the (EN) input sees a
rising edge.
NUM_ELEMENTS
Specifies the number of elements per scan to be manipulated when in the
NUM_PER_SCAN mode. It is ignored otherwise.
13.4 Logic Matrix Function Blocks
The Logic Matrix function blocks are used to perform logical operations on arrays of Boolean (BOOL) or
16-bit unsigned integer data types (WORD, or UINT). Each array must have one dimension. These
blocks are detailed in the subsections to follow.
August 2002
13-21
Array Function Blocks
CG39-22
13.4.1 Matrix AND, OR, XOR Function Blocks (MAT_AND, MAT_OR, MAT_XOR)
BOOL
ANY_ARRAY
INT
ANY_ARRAY
INT
UINT
ANY_ARRAY
INT
MAT_***
EN
ENO
IN01
DONE
INDX_1
ERROR
IN02
NI_1
INDX_2
NI_2
L
NI_O
OUT
INDX_O
BOOL
BOOL
BOOL
INT
INT
INT
The symbol of the Matrix Logic function blocks is shown above. These blocks logically manipulate the
bits or BOOLs in the input arrays. This block is used for arrays of unsigned integers, Booleans, and Bit
Strings (see ANY_BIT and WORD data types) only.
The Logic Blocks include:
•
Matrix AND
•
Matrix OR
•
Matrix XOR
Note that Matrix NOT is a separate block
For example:
If the MAT_AND is selected the elements of the two input arrays will be ANDed and the result placed in
the (OUT) array.
One of the input arrays may be the (OUT) array.
The block can operate in one of three modes:
1. ALL, in which the (L) of the array is manipulated in one scan when the (EN) input experiences a
rising edge transition.
2. NUM_PER_SCAN, in which a specified number of array elements are manipulated per scan when
the (EN) input experiences a rising edge transition.
3. ON_R_EDGE in which one value is manipulated and the next index outputs are incremented each
time the (EN) input experiences a rising edge transition.
The inputs and outputs of the MAT_*** function blocks are defined below.
EN
The input which enables the block to perform its function upon the (EN) input experiencing a
rising edge transition.
IN01
This is one array input to be logically manipulated. This array must have one dimension.
INDX_1
This is the starting position of the first input array. The first element in the array is the default
13-22
August 2002
CG39-22
Array Function Blocks
when left unconfigured. This array must have one dimension.
IN02
This is the array with which the (IN01) array values will be ANDed. This array must have one
dimension.
INDX_2
This is the starting position of the second input array. The first element in the array is the
default when left unconfigured. This array must have one dimension.
L
This value indicates the number of elements in the (IN01) array to be manipulated. When left
unconfigured it defaults to the entire (IN01) array length. If this value is longer than the
(IN02) or (OUT) length the operation will stop at the shorter length. This array must have one
dimension.
OUT
This is the array where the resultant array is stored. This array must have one dimension.
INDX_O This is the starting position of the (OUT) array to which the manipulated values will be
stored. The first element in the array is the default when left unconfigured.
ENO
This boolean output is TRUE while the block is executing the required function. It turns
FALSE when the block is done.
DONE
This boolean output indicates that the block performed its function on the (L) amount of
elements. It is TRUE for one scan if (EN) is FALSE or, if (EN) is TRUE, (DONE) remains
TRUE until (EN) becomes FALSE.
ERROR
This boolean output is TRUE when the (L) or (INDX) inputs are invalid (exceeds bounds,
wrong data type, ...).
NI_1
This output indicates the next position of the (IN01) array pointer. When in the
ON_R_EDGE mode, should be wired to the (INDX_1) input. This output does not indicate
the next position when the end of the array is reached; it reflects the last array position.
NI_2
This output indicates the next position of the (IN02) array pointer. When in the
ON_R_EDGE mode, should be wired to the (INDX_2) input. This output does not indicate
the next position when the end of the array is reached; it reflects the last array position.
NI_O
This output indicated the next position of the (OUT) array pointer. When in the
ON_R_EDGE mode, should be wired into the (INDX_R) input. This output does not indicate
the next position when the end of the array is reached; it reflects the last array position.
Softlist Parameters
Parameter
Type
Default
Min
Value
Max
Value
MODE
enum
ALL (0)
0
2
NUM_ELEMENTS
UDINT
1
1
N/A
MODE
This enumerated value determines the way in which the block executes. The
August 2002
13-23
Array Function Blocks
CG39-22
selections are listed below.
Value
Selection
Description
0
ALL
Entire length (L) manipulated in one scan.
1
NUM_PER_SCAN The NUM_ELEMENTS amount of length (L) that is
manipulated in one scan.
2
ON_R_EDGE
NUM_ELEMENTS
One array element is manipulated each time the (EN) input
sees a rising edge.
Specifies the number of elements per scan to be manipulated when in
the NUM_PER_SCAN mode. It is ignored otherwise.
13.4.2 Matrix NOT Function Block (MAT_NOT)
BOOL
ANY_ARRAY
INT
UINT
ANY_ARRAY
INT
MAT_NOT
EN
ENO
IN
DONE
INDX_I
ERROR
L
NI_I
OUT
NI_O
INDX_O
BOOL
BOOL
BOOL
INT
INT
The symbol of the Matrix NOT function block is shown above. This block logically NOTs (inverts) the
bits or BOOLs in the input arrays. It is useful for an array of unsigned integers, booleans and bit strings
(see the ANY_BIT and WORD data types).
One of the input arrays may be the (OUT) array.
The block can operate in one of three modes:
1. ALL, in which the length of the array is NOTed in one scan when the (EN) input experiences a rising
edge transition.
2. NUM_PER_SCAN, in which a specified number of array elements are NOTed per scan starting when
the (EN) input experiences a rising edge transition.
3. ON_R_EDGE, in which one value is NOTed and the next index outputs are incremented each time
the (EN) input experiences a rising edge transition.
The inputs and outputs of the MAT_NOT function block are defined below.
EN
The input which enables the block to perform its function upon experiencing a rising edge
transition.
IN
This is the array to be NOTed. The array must have one dimension.
13-24
August 2002
CG39-22
Array Function Blocks
INDX_I
This is the starting position of the first input array. The first element in the array is the default
when left unconfigured. The array must have one dimension.
L
This value indicates the number of elements in the (IN01) array to be manipulated. When left
unconfigured, it defaults to the entire (IN01) array length. The array must have one
dimension.
OUT
This is the array where the resultant array is stored. The array must have one dimension.
INDX_O This is the starting position of the (OUT) array to which the manipulated values will be
stored. The first element in the array is the default when left unconfigured.
ENO
This Boolean output is TRUE while the block is executing the required function. It turns
FALSE when the block is done.
DONE
This Boolean output indicates that the block performed its function on the (L) amount of
elements. It is TRUE for one scan if (EN) is FALSE or, if (EN) is TRUE, (DONE) remains
TRUE until (EN) becomes FALSE.
ERROR
This Boolean output is TRUE when the (L) or (INDX) inputs are invalid (exceeds bounds,
wrong data type, etc.).
NI_I
This output indicates the next position of the (IN) array pointer. When in the ON_R_EDGE
mode, it should be wired to the (INDX_I) input. This output does not indicate the next
position when the end of the array is reached; it reflects the last array position.
NI_O
This output indicated the next position of the (OUT) array pointer. When in the
ON_R_EDGE mode, it should be wired into the (INDX_O) input. This output does not
indicate the next position when the end of the array is reached; it reflects the last array
position.
August 2002
13-25
Array Function Blocks
CG39-22
Softlist Parameters
Parameter
Type
Default Min
Max
Value Value
MODE
enum
ALL(0)
NUM_ELEMENTS UDINT 1
0
2
1
N/A
MODE This enumerated value determines the way in which the block executes. The selections are
listed below.
Value Selection
Description
0
ALL
Entire length (L) manipulated in one scan.
1
NUM_PER_SCAN The NUM_ELEMENTS amount of length (L) that is manipulated in
one scan.
2
ON_R_EDGE
One array element is manipulated each time the (EN) input sees a rising
edge.
NUM_ELEMENTS Specifies the number of elements per scan to be manipulated when in the
NUM_PER_SCAN mode. It is ignored otherwise.
13.5 Fan In/Out Function Blocks
The Fan-In and Fan-Out function blocks are used to connect between BOOL and WORD data types, and
between arrays of BOOL and WORD data types. These blocks are detailed in the subsections to follow.
13.5.1 Boolean Fan-In Function Block (BFAN_IN)
BFAN_IN
BOOL
BOOL
:
BOOL
IN01
IN02
:
IN16
OUT
UINT or WORD
The symbol of the Boolean Fan-In function block is shown above. This block inputs Boolean values and
packs them into one unsigned integer. It is extensible up to 16 inputs.
The BFAN_IN inputs and output are defined below.
13-26
August 2002
CG39-22
Array Function Blocks
IN(n) The Boolean inputs to be packed.
OUT
The fanned-in inputs in the form of a 16-bit unsigned integer.
Softlist Parameters
There are no softlist parameters for the BFAN_IN block.
13.5.2 Array Fan-In Function Block (AFAN_IN)
AFAN_IN
BOOL_ARRAY
INT
UINT
IN
INDX
L
ERROR
ERROR
UINT or WORD
BOOL
The symbol of the Array Fan-In function block is shown above. This block inputs a single dimensional
array of Booleans and packs them into an unsigned integer.
The length (L) input can be between 1 and 16.
Element=(INDX) is placed in bit 0, element=(INDX)+1 is placed in bit 1, etc.
The Array fan-in inputs and outputs are defined below.
IN
The Boolean array input to be fanned-in to an unsigned integer or bit string. The array must
have one dimension.
INDX
The starting point of the input array.
L
The length of the array to be fanned-in. Limited from 1 to 16.
OUT
The packed UINT or BIT_STRING.
ERROR This Boolean output is TRUE when the (L) or (INDX) inputs are invalid (exceeds bounds,
wrong data type, etc).
Softlist Parameters
There are no softlist parameters in the AFAN_IN block.
August 2002
13-27
Array Function Blocks
CG39-22
13.5.3 Matrix Fan-Out Function Block (FAN_OUT)
FAN_OUT
WORD OR UNIT
INT
BOOL_ARRAY
IN
INDX
OUT
OUT01
OUT02
:
OUT16
BOOL
BOOL
BOOL
The symbol of the Fan-Out function block is shown above. This block inputs an unsigned integer or
WORD and unpacks it into both an array of BOOLs and 16 Boolean outputs.
NOTE
To accommodate 16 outputs, this block does not have an ERROR output.
The inputs and outputs of the FAN_OUT block are defined below.
IN
The Word or Unsigned integer input to be unpacked. The array must have one dimension.
INDX
The starting position in the (OUT) array where the fanned-out BOOLs are to be placed.
OUT
The resulting unpacked array of 16 Booleans.
OUTn The 16 fanned-out Boolean outputs.
Softlist Parameters
There are no softlist parameters in the FAN_OUT function block.
13.6 Index Check Function Block (INDXCHK)
INDXCHK
ARRAY
ANY NUM
:
:
ANY NUM
IN
INDX01
:
:
INDX08
OUT
CLIP
HOLD
ERROR
ANY
BOOL
BOOL
BOOL
The symbol of the Index Check function block is shown above. This block provides two different choices
for dealing with out of bounds array indices.
In normal operation, when an array index exceeds the boundary of the array definition the array value
returned will be zero.
For example:
If an array A is defined as having dimensions [1..2, 1..2] and an index reference A[i,j] exists with the
following values:
13-28
August 2002
CG39-22
Array Function Blocks
j1 j2
i1 11 12
i2 21 22
Where:
I or j are less than 1 or greater than 2, the value of the array for that scan will be zero.
If this behavior is not desired, the INDXCHK function block provides two alternatives selectable by a
softlist parameter.
The first alternative is to use the previous valid value of the index which was exceeded. This means that
the value of the array output would remain the same (see note below).
For example:
If last scan I=1 and j=1, and this scan I=2 and j=4, then the previous scan's (or whichever was the last
valid) set of indices (I and j) will be used to determine the value of the array. In this case value of the
array would remain at 11.
The second alternative is to clip the array index which exceeded the boundary at the maximum or
minimum value allowed.
For example:
If last scan array A's indices I=2 and j=2, and this scan I=2 and j=0, then the j index would be clipped
at 1 (the minimum) and the array value would be 11.
The inputs and outputs of the INDXCHK function block are defined below.
IN
The multi- or single-dimensional input array whose indices are the be checked.
INDXn
The variable indices of the array. Maximum number of dimensions in any one array is limited
to 8.
OUT
The calculated value of the array.
CLIP
This Boolean output is TRUE whenever any array index is clipped and the CLIP_INDEX
softlist parameter is TRUE.
HOLD
This Boolean output is TRUE for one scan whenever the last valid array indices are used.
ERROR This Boolean output is TRUE whenever there is an error in the configuration of the block.
Errors include:
Number of (INDXn) inputs does not match the number of dimensions in the array input
• Datatype of (OUT) does not match the datatype of the array input
• The (IN) input is not an array
August 2002
13-29
Array Function Blocks
CG39-22
NOTE
Use of the previous valid indices implies using the same indices again,
which MAY NOT coincide with the same array value if the array value
changed during the scan.
Softlist Parameters
Parameter
Type
Default Min/Max
CLIP_INDEX BOOL TRUE
NA
CLIP_INDEX When TRUE, this Boolean parameter will cause the index of the array to be clipped the
minimum or maximum when the boundary of the index is exceed. When FALSE, the last
valid set of indices will be held.
13-30
August 2002
CG39-22
Data Quality Function Blocks
14.0 Data Quality Function Blocks
The Data Quality function blocks are a subset of the standard function blocks. These blocks provide
information regarding to the quality status of data. For memory usage and ACM execution time
information on all standard configuration elements, see Appendix C in Using the 4-mation Configuration
Software (document number CG39-20).
A listing of the Data Quality function blocks is presented here. Individual blocks are detailed in the
subsections that follow.
Quality Check
• Basic Quality
• Set Quality
These blocks are used to automatically extract data quality information from data elements. Note that data
type and value information is ignored. Quality refers to attributes that have been assigned to describe the
data. Quality information is the same for and is located in the same order for both BOOL and non-BOOL
data types. However, BOOL data types consist of only one packed byte while non-BOOL data types
consist of multi-byte information. The following attributes have been assigned to Basic Quality:
Word
Bit #
Description
Basic Quality
6
Is Questionable
7
Is Unavailable
14.1 Quality Check Function Block (QUAL_CK)
ANY
ANY
:
:
ANY
QUAL_CK
IN01
OUT
IN02
:
:
IN16
BOOL
The symbol of the Quality Check (QUAL_CK) function block is shown above. This block checks the
data quality of each input.
If the quality word of any input is not GOOD, then OUT is TRUE.
This block is extensible up to 16 inputs.
August 2002
14-1
Data Quality Function Blocks
CG39-22
The inputs and the outputs of the QUAL_CK block are defined as follows:
IN(n) The ANY type inputs that are to have their quality checked.
OUT
This boolean output is TRUE if any of the inputs has a non-GOOD quality.
Softlist Parameters
There are no softlist parameters for this block.
NOTE
Physical inputs and outputs are the only type of variables to which
quality has been assigned at this time.
14.2 Basic Quality Function Block (QUALBAS)
QUALBAS
ANY
IN
GOOD
QUES
UNAV
BAD
BOOL
BOOL
BOOL
BOOL
The symbol of the Basic Quality (QUALBAS) function block is shown above. This block inputs the
quality word of any variable with Basic Quality and determines the quality rating:
Quality ratings are the following:
•
•
•
•
Good
Questionable
Unavailable
Bad
The input and outputs of this block are defined as follows:
IN
Any variable can be placed in this ANY type input to have its Basic Quality rating displayed.
GOOD This output is TRUE when bit 6 and bit 7 of the quality word are FALSE.
QUES
This output is TRUE when bit 6 of the quality word is TRUE and bit 7 is FALSE.
UNAV This output is TRUE when bit 7 of the quality word is TRUE and bit 6 is TRUE.
BAD
14-2
This output is TRUE when both bit 6 and bit 7 of the quality word are TRUE.
August 2002
CG39-22
Data Quality Function Blocks
Softlist Parameters
There are no softlist parameters for this block.
NOTE
Physical inputs and outputs are the only type of variables to which
Quality has been assigned at this time.
14.3 Set Quality Function Block (SETQUAL)
STRING
ANY
:
:
ANY
SETQUAL
ERROR
OUTVAR
VAR01
:
BOOL
:
VAR15
The symbol for the Set Quality (SETQUAL) function block is shown above. This block monitors the
data quality of a set of variables (typically I/O variables) and sets the data quality of a target variable to
the worst quality from those monitored.
Since the data quality is not passed from variable to variable in assignment statements or from input nubs
to output nubs in function blocks in APACS+ and QUADLOG controllers, this block provides a userconfigurable means of transferring this attribute. It is especially useful when the data quality of a variable
should appear BAD if any of the variables it is dependent upon has BAD quality. Note that APACS+ and
QUADLOG controllers currently only apply data quality to physical I/O variables (I/O channels), though
other variables have this attribute also.
The SETQUAL function block uses the following quality attributes, listed from best to worst:
•
•
•
•
Good
Questionable
Unavailable
Bad
The worst quality from all the INxx inputs is transferred to the variable specified at the OUTVAR input.
The inputs and outputs of the SETQUAL block are defined as follows:
OUTVAR
This input specifies the target variable whose quality attribute will be changed by this block.
It is in the form of a STRING literal using the Address Path notation. For example, an input
channel could be '%TempInput12', a function block output nub could be
'Program1.DerivedBlock2.FBInstance3.OUT', or a global variable could be '|Global1|'. See
also the 4-mation help topic: Address Paths for Remote Access to Variables under the
subheading of Addressing a Variable Within the Same Resource. Recall that the block has
scope local to the controller it resides in, so that the resource name is not required within this
STRING literal.
August 2002
14-3
Data Quality Function Blocks
CG39-22
IN01 to
IN15
These inputs are the variables (typically input channels) whose data quality is being
monitored. The one with the worst quality in the sequence: Good, Questionable,
Unavailable, and Bad, will be selected as the one whose quality is applied to the target
variable specified in OUTVAR.
ERROR
This is the Error output. It provides a BOOL data value which is FALSE if the specified
string at the OUTVAR input is valid. When TRUE, it indicates that the string at OUTVAR
specifies a variable that does not exist or is otherwise invalid.
Softlist Parameters
There are no softlist parameters for this block.
"
14-4
August 2002
CG39-22
Chart Function Blocks
15.0 Chart Function Blocks
The Chart blocks are a subset of the standard function blocks. These function blocks provide
control capabilities and diagnostic information about sequential function charts (SFC). SFCs configure a
sequential process with a series of steps to which actions can be attached. The chart function blocks
control selected charts by changing their configuration mode or resetting them. The blocks can also
provide information about a particular chart, such as the sequence of chart steps and amount of time a step
has been running.
This section provides a detailed description of the following blocks:
•
•
Chart Mode Function Block
Chart Data Function Block
15.1 Chart Mode Function Block (CHRTMOD
The symbol of the Chart Mode function block is shown above. This block is used to change the mode
or reset all of the charts that are connected to the block's inputs.
The CHRT(n) inputs are assumed to begin from the resource sheet unless the string begins with a
period (.) character which signifies that the path is relative to the sheet on which the CHRTMOD
block resides. For example, if chart A_BATCH exists in a derived function block (DFB) with an
instance name of SFC_1, and SFC_1 is located on another DFB called FBD_1 and the CHRTMOD
block was also placed on FBD_1, the CHRT(n) input for the A_BATCH chart is
‘.SFC_1.A_BATCH’. If the CHRMOD block is not located on FBD_1, the string input would not
begin with a period (.) character but the first common DFB's or Program's instance name (common to
the CHRTMOD block and the chart) as shown in Figure 15–1.
August 2002
15-1
Chart Function Blocks
CG39-22
Figure 15–1 CHRTMOD Function Block
The inputs and outputs of the CHRTMOD block are defined as follows:
The inputs and outputs of the CHRTMOD block are defined as follows:
EN
This is the Enable input. It accepts a BOOL value that, when TRUE, the block changes
the mode and/or resets the charts connected to the CHART(n) inputs.
R
This is the Reset input. It accepts a BOOL value that, when TRUE, resets all of the charts
MODE
This integer input allows you to select the desired chart mode:
0 = OFF
1 = AUTO
2 = MANUAL
3 = HOLD
4 = TRACE
ADVNCE
15-2
This is the Advance input. It accepts a BOOL value. Upon sensing a rising-edge, it
advances an SFC through any enabled transitions. SFCs, while in either Manual or Trace
modes, advance one transition upon each FALSE to TRUE cycle of the input, except
when the (ADVCEN) output is FALSE.
August 2002
CG39-22
CHRT(n)
Chart Function Blocks
These are the CHART inputs, which specify the chart(s) to be controlled. These should
be entered as string literals in the address path format described in Address Path for
Remote Access to Variables in 4-mation help.
Example strings are:
'.SFC_BLK1.CHART000' (Where the SFC chart named CHART000 is contained within
the DFB instance 'SFC_BLK1', which is placed on the same sheet as the CHRTMOD
block itself)
'DFB1.DFB2.CHART001' (Where DFB1 is the first DFB common to both the chart and
to the CHRTMOD block)
NOTE
Be sure to use string literals (actual strings enclosed in single quotes) and
not string variables for these inputs. No error is reported by 4-mation if
string variables are used, but the string value used at any one time may
not be correct.
ENO
This is the Enable Output. It is TRUE whenever (EN) is TRUE.
ROUT
This is the Reset output. It provides a BOOL value that is TRUE whenever the (R) input is
TRUE.
ERROR
This is the Error output. It is an integer that outputs a value of 99 if the mode input is invalid;
or the number corresponding to the first input (01 to 12) whose tag is unresolved. The value
is zero (0) if there are no errors.
ADVCEN
This is the Advance Enable output. It indicates when the Advance input is usable. In cases
where the CHRTMOD block is extended (that is, where more than one chart is input to the
block), the ADVNCE input is not supported, and the ADVCEN output is FALSE. In the
case where only one chart is input to the block, the ADVCEN output is TRUE.
MODE(n)
These are the Chart Mode outputs. Each output is of data type integer and constantly
provides the mode of the chart listed at the corresponding input regardless of the (EN) input.
For example, MODE(04) will display the mode of the chart connected to input CHRT(04).
Softlist Parameter
RESET_S_ACTIONS When TRUE, this parameter causes all the stored actions in the charts that are
input to the block to be reset when R is TRUE.
Parameter
Type
Default Min
Value
RESET_S_ACTIONS BOOL FALSE
August 2002
Max
Value
FALSE TRUE
15-3
Chart Function Blocks
CG39-22
15.2 Chart Data Function Block (CHRTDTA)
CHRTDTA
STRING
CHART
ERROR
LSTEPN
CSTEPN
CSTEPT
ACTION
NSTEPN
INT
STRING
STRING
TIME
STRING
STRING
The symbol of the Chart Data (CHRTDTA) function block is shown above. The block provides
information about the current state of the sequential function chart (SFC) that is attached as the block's
input. This information includes step names and how long the step has run. A query is initiated by typing
the full path name of the chart at the input. The PARA_STEP(n) softlist parameters indicate additional
active steps if any are running simultaneously with a selected step.
The inputs and outputs of the CHRTDTA block are defined as follows:
CHART
The CHART input is the full path to an SFC. It accepts a STRING data value up to 254
characters.
ERROR
The Error output indicates whether or not an error has occurred when the block attempts to
obtain output information. It provides an INT value as follows:
0 = No error
1 = The input CHART cannot be found
99 or higher = An internal error has occurred while the block was trying to obtain
information (database corrupted).
LSTEPN
The Last Step Name output indicates the name of the step previously executed. It provides
STRING data value up to 16 characters.
CSTEPN
The Current Step Name output indicates the name of the step that is currently active. It
provides STRING data value up to 16 characters.
CSTEPT
The Current Step Time output indicates the amount of time that CSTEPN and been active.
ACTION The Action output indicates the name of the first action that is attached to the currently active
step. It provides STRING data value up to 16 characters.
NSTEPN The Next Step Name output indicates the name of the step that will be executed next. It
provides STRING data value up to 16 characters.
15-4
August 2002
CG39-22
Chart Function Blocks
Softlist Parameters
ACTION_NAME1 to
ACTION_NAME8
PARA_STEP1 to
PARA_STEP4
PARA_STEP1T to
PARA_STEP4T
These 16-character STRING values are the names of additional actions
that are attached to the currently active step. The first action attached to
the current step is the ACTION output of the block.
These 16-character STRING values are the names of additional active
steps (if any are running simultaneously with the selected step). The
CSTEPN output also displays an active step name.
These parameters provide a TIME value that indicates the amount of
time that the steps identified by the PARA_STEP1 to PARA_STEP4
softlist values have been active.
"
August 2002
15-5
Chart Function Blocks
CG39-22
!Notes
15-6
August 2002
CG39-22
Resource Blocks
16.0 Resource Blocks
The Resource function blocks are a subset of the standard function blocks. These blocks control
parameters that affect an entire resource (Advanced Control Module). The portion of these blocks that
are required for a non-redundant system are configured automatically. A program is created with the
instance name of RESOURCE_BLOCKS and the individual blocks are configured in the body of that
program. To view the body of the RESOURCE_BLOCKS program, see Appendix A in Using the
ProcessSuite 4-mation Configuration Software (document number CG39-20). For memory usage and
ACM execution time information on all standard configuration elements, see Appendix C in the same
document.
A listing of Resource function blocks is presented here. Individual blocks are detailed in the subsections
that follow.
•
•
•
•
•
•
•
•
•
•
•
•
•
•
Error Log
Error Status
Memory Statistics
Partial I/O Scan
Real Time Clock
Redundancy Control
Resource Status
Security Control
Time Synchronization
Total I/O Scan
Module Information Block
System Information Block
Resource Alarm Block
Clock Block
16.1 Error Log Function Block (ERR_LOG)
BOOL
BOOL
August 2002
ERR_LOG
NEXT_E
NEW_ER
ADDR
PURGE
TIME
E_TYPE
CLASS
SS_CD
ERR_CD
USER_A
SCOPE
CHAN
GROUP
NUM_ER
ERR_ID
BOOL
STRING
STRING
STRING
UINT
UINT
UINT
STRING
STRING
UINT
STRING
UINT
UINT
16-1
Resource Blocks
CG39-22
The symbol for the Error Log (ERR_LOG) function block is shown above. This block provides access to
the information in the Error History List. Use this block to step through the Error History List either in
time mode (based on UPDATE_TIME softlist parameter) or in manual mode (based on a FALSE to
TRUE transition of the NEXT_E (next event) input.
If the PURGE input senses a FALSE to TRUE transition, the system's Error History List is emptied of all
past events and the block outputs are either cleared or set to default values.
The outputs are only be updated when a new error is being displayed. Only the NEW_ER and NUM_ER
outputs are updated every scan.
No attempt to write to the outputs via external methods (data services or variable control box) should be
made.
As long as the history list is not empty, and the timed mode or the manual mode has not passed the last
listed event, the block outputs display information of some event in the list. If there is no new error after
the "next" one is requested, the outputs will be set to the initial default values (zero or blanks). This
means when there are no newer events remaining [(NUM_ER)=0)], the last event in the list will continue
to be displayed only if automatic update is inactive and NEXT_E is not tripped.
The block continues to poll the error history list to detect any new entries. If the default output values are
being displayed, a new entry to the list will cause an immediate update of all block outputs. The block
will usually display some event information on its first scan unless the history list is empty.
Redundancy and the ERR_LOG block
In 4-mation, the ERR-LOG block is used to display the Error History List of the calculate (primary)
control module. Although the Error History List of the verify (backup) control module is not available in
4-mation, it is available via a human-machine interface (HMI).
The data is accessed by appending an “#A” and a “#B” to the resource name when referring to the
ERR_LOG block variables. The “#A” and “#B” notation represents physical location, therefore, both the
A and B tags must be configured to ensure access to both the primary and backup date.
For example:
If the primary and backup values of the ERR_LOG variable ERR_CD were desired the HMI tag
names would be:
“ResourceName #A.RESOURCEBLOCKS.ERROR_LOG.ERR_CD”
“ResourceName #B.RESOURCEBLOCKS.ERROR_LOG.ERR_CD”
where:
ResourceName
is the name assigned to the control module when a New resource configuration
was opened
RESOURCEBLOCKS
is the default instance name given to the program containing the ERR_LOG and
other resource effecting blocks
ERROR_LOG
is the default instance name given to the ERR_LOG block
16-2
August 2002
CG39-22
ERR_CD
Resource Blocks
is the output nub name.
The inputs and outputs of the ERR_LOG block are defined as follows:
CLASS
This INT output indicates the error class of the reported event. It is valid between 0 and 4
where 0 indicates no error and class 1 to class 4 increase in severity.
SS_CD
This INT output is the System Service Code. Since error codes are duplicated throughout the
system, each hardware and software module has a unique System Service Code used to
differentiate the error codes for each module.
For example:
An event reporting SS_CD 6 and ERR_CD 4 is an open circuit on an SAM module (the
ADDR output would indicate which SAM module) but SS_CD 7 ERR_CD 4 is the channel
failed off on a SDM module.
ERR_CD
The INT output indicating the error code of the reported event.
USER_A
The STRING output (up to 64 characters) provides a User Action message for a given error
code. For example, '16- Replace Module Immediately' is a user action string.
SCOPE
This up to 8 character string output identifies the scope of the reported error. The four current
scopes are:
System - An error is one that effects multiple modules such as a redundancy error.
Module - An error that effects more than one channel or group of channels on a module.
Group- An error that effects one or more channels in a group (some I/O modules have
channels collected in groups for isolation purposes).
Channel - An error that effects one channel.
CHAN
The INT output which indicates the channel number of the error if the (SCOPE) is channel.
GROUP
The STRING output which indicates the group (A to G) if the SCOPE is group.
NUM_ER The INT output that indicates the number of errors in the log which have not been displayed.
ERR_ID
The INT output which assigns a unique identifier to each reported error event.
Remaining ERR_LOG inputs are accessed via the softlist. The values of these inputs can be changed via
command by the user (or the Set Value function block) but they cannot be "wired" to the block.
UPDATE_TIME The duration softlist parameter that determines how long the block outputs are held
before being overwritten by the information of the next error event. If parameter is
zero, you must manually toggle the NEXT_E input to view the next logged event.
X_INFO
August 2002
This 16 character string allows you to place additional information in the block.
16-3
Resource Blocks
CG39-22
Parameter
Data Type
Initial Value
Min Value
Max Value
UPDATE_TIME
TIME
T#0d0h0m0s0ms
T#0d0h0m0s0ms
NA
X_INFO
STRING
NA
NA
NA = Not Applicable
16.2 Error Status Function Block (ERRSTAT)
ERRSTAT
BOOL
STRING
MAN_CL
NRS_AD
NEW_ER
ADDR
CLASS
SS_CD
ERR_CD
USER_A
SCOPE
CHAN
GROUP
MAN_OK
LOOPOK
CLASS4
CLASS3
CLASS2
CLASS1
BOOL
STRING
INT
INT
INT
STRING
STRING
INT
STRING
BOOL
BOOL
DINT
DINT
DINT
DINT
The symbol of the Error Status (ERRSTAT) function block is shown above. This block provides a
summary of the current status for the resource module and all of its I/O modules. It displays the highest
priority error, along with the counts of errors in each error class for the resource module and its I/O
combined.
The inputs and outputs of this block are defined as follows:
MAN_CL
This is the Manual Clear input. It accepts a BOOL data value. A transition from FALSE to
TRUE on this input causes the resource to perform a manual clear of the currently displayed
error.
NRS_AD
This is the Node Rack Slot Address input. It accepts a STRING data value in the node-rackslot format “N00R00S00”, which represent the node, rack, slot address of the resource
module of which the status is being displayed. If this string is empty, the block shows
information for the resource module and all of its I/O modules.
NEW_ER
This is the New Error ouput. It provides a BOOL data value that is TRUE if an error is
present. Otherwise, it is FALSE.
ADDR
This is the Module Address output. It provides a 12-character STRING data value that
16-4
August 2002
CG39-22
Resource Blocks
identifies the node, rack, slot, and module type name of the module that reported the error.
The 12 characters are in the following format:
‘NnnRrrSssSDM’
where:
nn
rr
ss
SDM
is the node number
is the rack number
is the slot number
is a three character module identifier (e.g. SDM=Standard Discrete Module Plus)
CLASS
This is the Error Class output. It provides an INT value from 0 to 4 that indicates the error
class of the reported event. A value of 0 indicates no error. Remaining values indicate
error severity from 1 (lowest) to 4 (highest).
SS_CD
This is the System Service Code Output. It provides an INT value that represents the module
where the error occured. Since error codes are duplicated throughout the system, each
hardware and software module has a unique system service code. This output is to be used in
conjunction with the Error Code (ERR_CD) output.
For example, an event reporting SS_CD 6 and ERR_CD 4 is an open circuit on an SAM
(Standard Analog Module). The ADDR output indicates which SAM. SS_CD 7 and
ERR_CD 4 means the channel failed off within an SDM+ (Standard Discrete Module Plus).
ERR_CD
This is the Error Code output. It provides an INT data value that indicates the specific error
code of the reported event. This output is to be used in conjunction with the System Service
Code (SS_CD) output.
USER_A
This is the User Action output. It provides a STRING data value (up to 64 characters) that
describes what you should do to resolve the error identified by the SS_CD and ERR_CD
outputs. For example, ‘16- Replace Module’ is a user action string.
SCOPE
This is the Error Scope output. It provides a STRING data value (up to eight characters) that
identifies the scope of the reported error. The four current scopes are:
System -
An error that affects multiple modules such as a redundancy error.
Module -
An error that affects more than one channel or group on a module.
Group -
An error that affects one or more channels in a group (some I/O modules have
channels collected in groups for isolation purposes).
Channel -
An error that affects one channel.
CHAN
This is the Error Channel Identification output. It provides an UINT data value that identifies
the channel number of the error if the SCOPE output string is ‘channel’.
GROUP
This is the Channel Group Identification output. It provides a STRING data value that
identifies the channel group containing the error (‘A’ to ‘G’) if the SCOPE output string is
‘Group’.
MAN_OK This the Manual Clear OK output. It provides a BOOL value that is TRUE if it is permissible
to clear errors manually via the MAN_CL input.
August 2002
16-5
Resource Blocks
CG39-22
LOOPOK
This is the I/O Loop OK output. It provides a BOOL value that is TRUE if the I/O OKLOOP
signal is OK (meaning all I/O modules are running without errors). It is FALSE if any class
2, 3, or 4 error exists or if a module is removed from the rack.
CLASS4
This is the CLASS 4 error output. It provides a DINT value representing the total number of
class 4 errors of either the module indicated by the NRS_AD input or the resource and all its
I/O modules if the NRS_AD input is 0 (empty string). Class 4 errors are the most severe type
of error.
CLASS3
This is the CLASS 3 error output. It provides a DINT value representing the total number of
class 3 errors of either the module indicated by the NRS_AD input or the resource and all its
I/O modules if the NRS_AD input is 0 (empty string). Class 3 errors are more severe than
class 2 errors but less severe than Class 4 errors.
CLASS2
This is the CLASS 2 error output. It provides a DINT value representing the total number of
class 2 errors of either the module indicated by the NRS_AD input or the resource and all its
I/O modules if the NRS_AD input is 0 (empty string). Class 2 errors are more severe than
class 1 errors but less severe than class 3 errors.
CLASS1
This is the CLASS 1 error output. It provides a DINT value representing the total number of
class 1 errors of either the module indicated by the NRS_AD input or the resource and all its
I/O modules if the NRS_AD input is 0 (empty string). Class 1 errors are the least severe type
of error.
Softlist Parameters
There are no softlist parameters for this block.
16.3 Memory Statistics Function Block (MEMSTAT)
MEMSTAT
BOOL
EN
USR_FR
USR_CN
USR_PK
GEN_FR
GEN_CN
GEN_PK
COM_FR
COM_CN
COM_PK
DINT
DINT
DINT
DINT
DINT
DINT
DINT
DINT
DINT
The symbol of the Memory Statistics (MEMSTAT) function block is shown above. This block provides
information concerning the available memory in your control system. If control module memory is a
concern, you can place this block on a sheet then provide the output information to Siemens service
personnel for detailed evaluation.
16-6
August 2002
CG39-22
Resource Blocks
This block gathers information from the control module (CCM) concerning the free (FR), contiguous
(CN), and peak (PK) memory usage for each of the following areas:
•
•
•
User configuration memory (SAT)
General purpose heap memory (HEAP)
Communications heap memory (LLHEAP)
All outputs are updated whenever the (EN) input is TRUE. All outputs are in bytes.
The input and outputs of the MEMSTAT block are defined as follows:
EN
This is the Enable input. It accepts a BOOL data type value. When TRUE, all block outputs
are updated with current memory statistics.
USR_FR
This is the User Free memory output. It provides a DINT data value, in bytes, that represents
the amount of free user configuration memory (SAT).
USR_CN
This is the User Contiguous memory output. It provides a DINT data value, in bytes, that
represents the amount of free contiguous user configuration memory (SAT).
USR_PK
This is the User Peak memory output. It provides a DINT data value, in bytes, that represents
the peak usage of user configuration memory (SAT).
GEN_FR
This is the General Free memory output. It provides a DINT data value, in bytes, that
represents the amount of free general purpose heap memory (HEAP).
GEN_CN
This is the General Contiguous memory output. It provides a DINT data value, in bytes, that
represents the amount of free contiguous general purpose heap memory (HEAP).
GEN_PK
This is the General Peak memory output. It provides a DINT data value, in bytes, that
represents the peak usage of general purpose memory (HEAP).
COM_FR
This is the Communications Free memory output. It provides a DINT data value, in bytes,
that represents the amount of free communications heap memory (LLHEAP).
COM_CN This is the Communications Contiguous memory output. It provides a DINT data value, in
bytes, that represents the amount of free contiguous communications heap memory
(LLHEAP).
COM_PK
This is the Communications Peak memory output. It provides a DINT data value, in bytes,
that represents the peak usage of communications heap memory (LLHEAP).
Softlist Parameters
There are no softlist parameters for this block.
August 2002
16-7
Resource Blocks
CG39-22
16.4 Partial I/O Scan Function Block (PART_IO)
PART_IO
BOOL
SCANEN
SCANTM
TIME
BOOL
OUTPEN
ERRCOD
INT
The symbol for the Partial I/O Scan (PART_IO) block is shown above. This block is used to define a
partial list of I/O modules which will be scanned upon each execution. When executed, this block causes
all the specified I/O modules to be read/updated. This includes updating specified inputs and outputs
whether they be on-board, local, distributed, or remote. However, upon the first execution of this block,
no output modules or channels are updated.
One I/O Scan block (i.e. Total I/O Scan block, Total I/O Hold Scan block, or the Partial I/O Scan block)
must be present in the configuration, otherwise no I/O updating will occur.
NOTE
An I/O scan block must be located on the resource sheet before any
program blocks.
The inputs and outputs of the Partial I/O Scan block are defined as follows:
SCANEN
This is the Scan Enable input. It accepts a BOOL value. When TRUE, the block causes the
inputs to be scanned.
OUTPEN
This is the Outputs Enable input. It accepts a BOOL value. When TRUE, the block causes
the outputs to be updated.
SCANTM This is the Scan Time output. It provides a TIME value that indicates the execution time
duration of the I/O scan.
ERRCOD
This is the Error Code output. It provides an INT value that indicates the code of any
detected error. The possible error codes are as follows:
0 = No error.
1 =One or more modules are not responding to the scan commands.
2 =One or more I/O module addresses in the softlist are invalid.
3 =Not used
4 =One or more modules are configured incorrectly.
Note:
Error 1 takes precedence over error 2, etc. so that if more than one error is present, only one
error is displayed.
Softlist Parameters
The remaining PART_IO input is accessed via the softlist.
16-8
August 2002
CG39-22
Resource Blocks
IO_ADDRESS_n The value is the address of the I/O module in the following string format:
‘%RrrSss’
Where:
rr = rack number
ss = slot number for the module
Parameter
Data Type
Initial Value
Privilege
IO_ADDRESS_n
String
“ ” (Blank)
R/W
Where:
n
= 1 to 39 in the parameter list
R/W = Read/Write
16.5 Real-time Clock Block (RTC)
RTC
BOOL
DATE_AND_TIME
EN
PDT
Q
CDT
BOOL
DATE_AND_TIME
The symbol of the Real-Time Clock (RTC) function block is shown above. This block is used to set
and/or read the real-time clock (chip) of the control module (e.g., CCM). There are two ways to use this
block to set the time. The first way is to enter a DATE_AND_TIME value into the SetTime softlist
parameter. The second way is to use the block's inputs by connecting a DATE_AND_TIME value to the
PDT (Present Date/Time) input then enabling the block.
The allowable range of setting is Jan 1, 1970 thru Jan 19, 2038. Values outside this range are ignored, but
cause an error to be posted by the Time Synchronization (TIMESYNC) block within the same resource.
The inputs and outputs of the RTC block are defined as follows:
EN
This is the Enable input. It accepts a BOOL data value. When a FALSE to TRUE transition is
detected on this input, the Present Date/Time (PDT) input value is used to set the time in the
control module.
PDT
This is the Present Date/Time input. It accepts a DATE_AND_TIME data value. The control
module time gets set to the DATE_AND_TIME value when the EN input is toggled from FALSE
to TRUE.
Q
This is the Q output. It outputs a BOOL value that is a copy of the EN input value.
CDT This is the Current Date/Time output. It outputs a DATE_AND_TIME value that is the current
date and time of the control module.
August 2002
16-9
Resource Blocks
CG39-22
Softlist Parameter
SetTime
This parameter uses the DATE_AND_TIME data type. Its value is used to set the date and
time in the control module (e.g. CCM).
16.6 Redundancy Control Block (REDCTRL)
BOOL
BOOL
REDCTRL
REDUN
REQ
DIS_SW
ACTIVE
LCABLE
A_B
A_ADDR
A_STAT
A_LOOP
B_ADDR
B_STAT
B_LOOP
BOOL
BOOL
BOOL
STRING
STRING
BOOL
BOOL
STRING
BOOL
BOOL
The symbol for the Redundancy Control (REDCTRL) function block is shown above. This block is used
to indicate that the control module (ACM) is part of a redundant pair, and provides redundancy status
information.
The inputs and outputs of the REDCTRL block are defined as follows:
REQ
This is the Switch Over Request input. It accepts a BOOL data value. When a FALSE to
TRUE transition is detected, the block forces a control switchover between the redundant
control modules.
DIS_SW
This is the Disable Switch input. It accepts a BOOL value that, when TRUE, disables the
block so no switchovers can occur, unless otherwise forced to do so via the REQ input.
REDUN
This is the Redundancy output. It provides a BOOL value that is TRUE if redundancy exists.
Otherwise, it is FALSE to indicate no redundancy.
ACTIVE
This is the Active Module output. It provides a BOOL value that is TRUE if the module is
the primary control module in the redundant pair. This mirrors the LED indication on the
front of the module. Note that the value displayed on a sheet will always be TRUE since
4-mation sheets display the contents of the active (primary) resource. But the actual value
may be obtained through an operator interface or the Variable control dialog box by
addressing the specific resource in the redundant pair (preceding the resource name with A:
or B:). For Example, to query this nub value in the B: resource, use the address path:
B:ResourceName:RESOURCE_BLOCKS.RedCtl1.[ACTIVE]
LCABLE
This is the Redundancy Link Cable output. It provides a BOOL value that is TRUE when the
redundancy cable is OK.
A_B
This is the A/B Identification output. It provides a STRING value of “A” if the block is
located in the A resource module or “B” if the block is located in the B resource module.
16-10
August 2002
CG39-22
Resource Blocks
The A resource module always has the lower of the two addresses.
A_ADDR This is the A Module Address output. It provides a STRING value that contains the address
of the A module. The address is in the node, rack, slot format of “N00R00S00”.
A_STAT
This is the A Module Status output. It provides a BOOL value that indicates the status of the
A module s OKOUT hardware signal. When TRUE, it indicates to the B module that the A
module is operating properly.
A_LOOP
This is the A Module Loop Status output. It provides a BOOL value that indicates the status
of the A module’s I/O OKLOOP hardware signal. When TRUE, it indicates that all I/O is
running without errors.
B_ADDR
This is the B Module Address output. It provides a STRING value that contains the address
of the B module. The address is in the node, rack, slot format of ‘N00R00S00’.
B_STAT
This is the B Module Status output. It provides a BOOL value that indicates the status of the
B module’s OKOUT hardware signal. When TRUE, it indicates to the A module that the B
module is operating properly.
B_LOOP
This is the B Module Loop Status output. It provides a BOOL value that indicates the status
of the B module’s I/O OKLOOP hardware signal. When TRUE, it indicates that all I/O is
running without errors.
Softlist Parameters
There are no softlist parameters for this block.
16.7 Resource Status Block (RSCSTAT)
RSCSTAT
TIME
BOOL
BOOL
BOOL
BOOL
SCAN
CLEAR
HSTART
WSTART
CSTART
PROG_T
MAX_T
PCTPRG
MAXPRG
PCTCOM
MAXCOM
PCTSCN
MAXSCN
S_OVER
MTOTAL
M_FREE
HFLAG
WFLAG
CFLAG
TIME
TIME
REAL
REAL
REAL
REAL
REAL
REAL
BOOL
REAL
REAL
BOOL
BOOL
BOOL
The symbol of the Resource Status (RSCSTAT) function block is shown above. This block is used to
provide status information regarding the performance of the control module (e.g. ACM). This block can
be used to determine the most efficient use of the module s processing power.
August 2002
16-11
Resource Blocks
CG39-22
A resource configuration is defined as the database resident in a resource module that was transferred
there using 4-mation. System and communication tasks are defined as the overhead in the control module
plus the communication block and presentation block messages.
The inputs and outputs of the RSCSTAT block are defined as follows:
SCAN This is the Scan Time input. It accepts a TIME data value for setting the periodic scan times
allocated to execute the resource configuration and other system tasks. For further information regarding
scan rates, refer to Section 24 Optimizing a Configuration of Using the 4-mation Configuration
Software (document CG39-20).
CLEAR
This is the Clear input. It accepts a BOOL data value. When a FALSE to TRUE transition is
detected, all MAX values are cleared.
HSTART
This is the Hot Restart input. It accepts a BOOL data value. When a FALSE to TRUE
transition is detected, it forces a hot restart.
WSTART
This is the Warm Restart input. It accepts a BOOL data value. When a FALSE to TRUE
transition is detected, it forces a warm restart.
CSTART
This is the Cold Restart input. It accepts a BOOL data value. When a FALSE to TRUE
transition is detected, it forces a cold restart.
PROG_T
This is the Program Time output. It provides a TIME data value that indicates the amount
of time it takes to execute the resource configuration.
MAX_T
This is the Maximum Time output. It provides a TIME data value that indicates the
maximum amount of time it takes to execute the resource configuration.
PCTPRG
This is the Percentage of Program output. It provides a REAL data value that indicates the
percentage of the SCAN input value used for processing the resource configuration.
MAXPRG
This is the Maximum Percentage of Program output. It provides a REAL data value that
indicates the maximum percentage of the SCAN input value used for processing the
resource configuration.
PCTCOM
This is the Percentage of Communication output. It provides a REAL data value that
indicates the percentage of the SCAN input value used for processing system and
communications tasks.
MAXCOM This is the Maximum Percentage of Communication output. It provides a REAL data value
that indicates the maximum percentage of the SCAN input value used for processing system
and communications tasks.
PCTSCN
This is the Percentage of Scan output. It provides a REAL data value that indicates the
percentage of the SCAN input value the processor is working (not idle).
MAXSCN
This is the Maximum Percentage of Scan output. It provides a REAL data value that
indicates the maximum percentage of the SCAN input value the processor is working (not
idle).
16-12
August 2002
CG39-22
Resource Blocks
S_OVER
This the Scan Over output. It provides a BOOL data value that is pulsed TRUE if the total
scan time exceeds the SCAN input value. If this output is pulsing TRUE, the SCAN input
value should be increased, communications between resources should be compacted or
minimized, or logic should be moved to another resource.
MTOTAL
This is the Total Memory output. It provides a REAL data value that indicates the total
memory (in bytes) available for the resource configuration.
M_FREE
This is the Memory Free output. It provides a REAL data value that indicates the total
amount of free memory (in bytes). To find the percentage of available memory remaining
in a control module, open the control module on-line and divide the M_FREE output by the
MTOTAL output.
HFLAG
This is the Hot Restart Flag output. It provides a BOOL value that is TRUE for the
FLAG_TIME amount of time if the system is powered down for less than the
WARM_TIME value or if the HSTART input experiences a FALSE to TRUE transition.
WFLAG
This is the Warm Restart Flag output. It provides a BOOL value that is TRUE for the
FLAG_TIME amount of time if the system is powered down for longer than the
WARM_TIME value but less than the COLD_TIME value, or if the WSTART input
experiences a FALSE to TRUE transition.
CFLAG
This is the Cold Restart Flag. It provides a BOOL data value that is TRUE for the
FLAG_TIME amount of time when the system is powered down for longer than the
COLD_TIME length of time.
Softlist Parameters
The remaining RSCSTAT inputs to the Resource Status function block are accessed via the softlist. The
value of these inputs can be changed via commands from an operator interface or by using a Set Value
(SET_VAL) function block. Below is a description and initial value for each softlist parameter.
SCAN_COUNT
This is the Scan Counting Parameter. It is a DINT data value that increments
every scan.
FLAG_TIME
This is the Flag Time parameter. It accepts a TIME value that sets the amount
of time the HFLAG, WFLAG, and CFLAG outputs stay TRUE.
WARM_TIME
This is the Warm Time parameter. It accepts a TIME value that sets the amount
of time a control module can be powered down before a hot start becomes a
warm start.
COLD_TIME
This is the Cold Time parameter. It accepts a TIME value that sets the amount
of time a control module can be powered down before a warm start becomes a
cold start.
POWER_UP_STOP_W This is the Warm Restart Power Up After Stop parameter. It accepts a BOOL
value that determines the power up state of the control module in a warm
restart. When TRUE, it will power up in the Stopped mode. When FALSE, it
August 2002
16-13
Resource Blocks
CG39-22
will power up in the last state.
POWER_UP_STOP_C
This is the Cold Restart Power Up After Stop parameter. It accepts a BOOL
value that determines the power up state of the control module in a cold restart.
When TRUE, it will power up in the Stopped mode. When FALSE, it will
power up in the last state.
Parameter
Data Type
Initial Value
Min Value
Max Value
SCAN_COUNT
DINT
0
0
NA
FLAG_TIME
TIME
T#0d0h0m0s0ms
NA
T#0d0h0m0s0ms
NA
T#0d0h0m0s0ms
NA
T#0d0h0m1s0ms
WARM_TIME
TIME
T#0d0h0m1s0ms
COLD_TIME
TIME
T#0d0h1m0s0ms
POWER_UP_STOP_W
BOOL
FALSE
FALSE
TRUE
POWER_UP_STOP_C
BOOL
FALSE
FALSE
TRUE
16.8 Security Control Block (SECURTY)
SECURTY
BOOL
BOOL
BOOL
EN
CWE
DWE
ENO
SEC
BOOL
BOOL
The symbol of the Security Control (SECURTY) function block is shown above. This block is used to control
access to both on-line data and the resource configuration. This block operates in conjunction with the
SECURITY ENABLE (hardware) switch located behind the front panel of the control module (ACM).
For security to be enabled in a resource configuration database, the hardware switch must be in the ENABLED
position and the EN input on the Security Control function block must be TRUE. If security is enabled, the
LED on the front of the module is illuminated and the CWE and DWE block inputs determine the permitted
action as follows:
If the Configuration Write Enable (CWE) input is TRUE, configuration writes are permitted.
If the Data Write Enable (DWE) input is TRUE, on-line writes to data values are permitted.
If neither CWE or DWE are TRUE and security is enabled, the only way to gain access (including initializing a
resource and transferring a new resource configuration) is to toggle the SECURITY ENABLE switch to the
disabled position.
16-14
August 2002
CG39-22
Resource Blocks
NOTE
The 4-mation program also has built-in password protection that
disallows the opening of a protected resource configuration database.
Refer to the “Password Protection for Resource Configuration” section
of Using the 4-mation Configuration Software (document CG39-20) for
more information.
The inputs and outputs of the Security Control block are defined as follows:
EN
This is the Security Enable input. It accepts a BOOL data value. When it is TRUE and the
hardware switch is in the ENABLED position, the block limits access to a control module’s
database as defined by the state of the CWE and DWE inputs. When EN is FALSE, any device
on the MODULBUS can alter any portion of the control module’s database regardless of the state
of the hardware switch. Essentially, EN overrides the hardware switch.
CWE
This is the Configuration Write Enable input. It accepts a BOOL data value. When it is TRUE,
the EN input is TRUE, and the hardware switch is in the ENABLED position, read/write access
to the control module s database is permitted. If CWE is FALSE, the EN input is TRUE, and
hardware switch is in the ENABLED position, read-only access to the control module s database
is permitted. If EN is FALSE, the configuration can be modified regardless of the state of CWE.
DWE This is the Data Write Enable input. It accepts a BOOL value. When it is TRUE and EN is
TRUE and the hardware switch is in the ENABLED position, Read/Write access to data elements
within the control module is granted. When it is FALSE, EN is TRUE, and the hardware switch is
in the ENABLED position, then read-only access to the variables in the control module is
granted. If EN is FALSE, the data can be modified regardless of the state of CWE.
ENO
This is the Security Enabled Output. It provides a BOOL data value. It is TRUE when EN is
TRUE and the hardware switch is in the ENABLED position. Otherwise, it is FALSE.
SEC
This is the Security Enable (hardware) switch position output. It provides a BOOL data value that
is TRUE when the switch is in the ENABLED position and FALSE when the switch is in the
DISABLED position.
The following chart details the switch settings and resultant user accessibility.
Security
Enable
Switch
EN
DWE
CWE
Data
Configuration
Edits
ENO
SEC
ENABLED
FALSE
x
x
YES
YES
FALSE
TRUE
ENABLED
TRUE
FALSE
FALSE
NO
NO
TRUE
TRUE
ENABLED
TRUE
TRUE
FALSE
YES
NO
TRUE
TRUE
ENABLED
TRUE
FALSE
TRUE
NO
YES
TRUE
TRUE
ENABLED
TRUE
TRUE
TRUE
YES
YES
TRUE
TRUE
August 2002
16-15
Resource Blocks
CG39-22
DISABLED
TRUE
x
x
YES
YES
TRUE
FALSE
DISABLED
FALSE
x
x
YES
YES
FALSE
FALSE
Where:
x = Any state
NO = Editing is not permitted
YES = Editing is permitted
Softlist Parameters
There are no softlist parameters for this block.
16.9 Time Synchronization Function Block (TIMESYNC)
TIMESYNC
BOOL
EN
ERROR
STATUS
TRACK
SYNCED
OFFSET
TICADJ
BOOL
STRING
STRING
BOOL
DINT
DINT
The symbol of the Time Synchronization (TIMESYNC) function block is shown above. This block is
used to synchronize the clocks of all controllers on a given MODULNET. This synchronization is
accurate to within 1 millisecond. Each controller must have one enabled TIMESYNC block in order to
participate in time synchronization. This block is included in the default controller database. No
additional configuration is required.
The enabled TIMESYNC blocks of all controllers on the MODULNET automatically work together to
select a "time master" controller. Once established, the time master broadcasts periodic commands over
the MODULNET to keep the other controllers synchronized with its clock. Selection of the time master
occurs automatically, based on the resource names and scan rates of the participating controllers. Each
controller has the ability to be the time master, allowing controllers to be added to or removed from the
MODULNET without disrupting time synchronization. Time is synchronized by making minuscule
adjustments to the speed of each non-master's clock so that all non-masters on the MODULNET
gradually approach the master's clock setting.
The time master of the MODULNET can also be synchronized with an external application or operator
interface, and adjusts its own clock speed to track that time. An external application may either
periodically broadcast its time, or periodically write to a softlist parameter of the TIMESYNC function
block as described below. If no external time is received, the time master uses its internal Real Time
Clock (RTC) hardware as its time base.
16-16
August 2002
CG39-22
Resource Blocks
After startup, at least one controller's time must be set before any will participate in time synchronization.
Once any controller has been set, all others on the MODULNET with enabled TIMESYNC blocks will
obtain that time automatically. Time may be set by an external application, or may be set manually using
the Real Time Clock (RTC) function block. Time should be set only on startup, or on large changes in
system time, such as a change from Standard Time to Daylight Savings Time.
The input and outputs of the TIMESYNC block are defined as follows:
EN
This is the Enable input. It accepts a BOOL data type. When EN is TRUE, the block
participates in system time synchronization. The time setting of its controller is shared
with all controllers on the same MODULNET that have an enabled TIMESYNC block.
When EN is FALSE, the block does not perform its function, and the time setting of its
controller does not track the others.
ERROR
This is the Error output. It provides a BOOL data value that is TRUE whenever a
problem is detected with the time synchronization function. The STATUS output
(described below) simultaneously provides information describing the problem. The
ERROR output is FALSE when no problem is detected.
STATUS This is the Status output. It provides a STRING data value containing a diagnostic
message. The messages are listed below. This output is intended to be used as a
troubleshooting aid. During normal operation, a ‘NoError’ message is output.
Status Messages and Descriptions:
August 2002
NoError
There are no errors being reported by the
TIMESYNC block. This is the normal value. No
user action is required.
TimeSyncIsOutOfTolerance
This controller's time differs from system time by
more than the configured limit. The limit value used
depends upon whether the controller is the time
master of its group or is tracking another controller's
time (see descriptions of the
EXTERN_TOLERANCE and
GROUP_TOLERANCE softlist parameters below).
This condition normally occurs only after startup or
a change in system configuration, and usually clears
on its own.
TimeSetThroughEvolution
This controller changed its time abruptly to match
another controller's time, after detecting that the
other controller's time had been set more recently.
This condition normally occurs after startup, and
usually persists for only one scan.
TimeSetBelowSysTime
An attempt to set time and date was unsuccessful
because the specified date was prior to the earliest
date the controller can represent (e.g., before January
1, 1970).
16-17
Resource Blocks
CG39-22
TimeSyncServicesError
An internal error occurred during initialization. This
condition should never occur. If it does, please
notify the Technical Information Center as soon as
possible.
OldTimeSampleRemoved
An incomplete set of time synchronization messages
was received. This condition may occur following a
communication error, and usually persists for only
one scan.
TimeSampleNotFound
This controller did not receive an expected periodic
synchronization update. This condition occurs if the
time master is reset, and persists only until a new
master is established automatically. It may also
occur after a prolonged sequence of communication
errors.
RTCChipFailed
This controller's Real Time Clock (RTC) hardware
has failed. Although the controller is still capable of
control, it should be repaired or replaced at the next
convenient opportunity.
TRACK The Track output provides a STRING data value describing this controller's time tracking
status. When this controller is tracking another module's time, the output string contains that
module's resource name. When this controller is not tracking another module's time, the output
string contains one of the messages listed below.
Tracking Messages and Descriptions:
16-18
ResourceName
This controller is tracking periodic
synchronization messages from the named
resource, which may be another controller, a
workstation, or a PC.
TrackingTIMESYNCTagWrite
This controller is tracking periodic time
updates being received via writes to the
EXTERNAL_SYNC softlist parameter of its
TIMESYNC block. The resource name of the
writer is not displayed since it is not available
to the controller.
TrackingRTCChip
This controller is using its own Real Time
Clock (RTC) hardware as its time reference.
This occurs when the controller is not
receiving synchronization messages from an
external source.
TimeIsDrifting
This controller is not tracking any time
reference. This occurs at startup before the
time has been set or received from another
controller, or whenever the TIMESYNC block
August 2002
CG39-22
Resource Blocks
is disabled. It also occurs during a transition
when the controller is no longer receiving
expected synchronization messages, until a
new time master is established.
SYNCED The Synchronized output provides a BOOL data value that is TRUE when this controller is
successfully tracking time within the expected tolerance. It is FALSE if tracking is outside of
this value, as described above for the TimeSyncIsOutOfTolerance status message.
OFFSET
The Offset output provides a DINT data value that represents the difference in microseconds
between this controller's time and the time that it is tracking. A positive value means this
controller is running ahead (fast); a negative value means it is running behind (slow). During
normal operation this value varies slightly from scan to scan.
TICADJ
The Timer Tic Adjustment output provides a DINT value that represents the signed
hundredths of a percent by which this controller's clock is being slowed down (positive) or
sped up (negative) in order to approach the time it is tracking. During normal operation this
value varies slightly from scan to scan; its sign matches the sign of the OFFSET output.
August 2002
16-19
Resource Blocks
CG39-22
Table 16–1 Status Output Diagnostic Messages
16-20
Diagnostic Message
Description
Arbitrating
ACM modules are contending for time master status.
This is initiated when a TIMESYNC block is
enabled. Generally, this message only lasts for about
two ACM scans (of the largest scan rate). Time
master status is granted to the module having the
shortest scan period and, as a second criteria, having
the lexicographically greatest resource name. No
user action is required.
NoError
There are no errors being reported by the
TIMESYNC block. This is the normal value. No user
action is required.
TimeSyncIsOutOfTolerance
This ACM s time differs from the greater system
time by more than the value of the TOLERANCE
softlist parameter. This may occur immediately after
an initial time setting but should not persist.
TimeSetThroughEvolution
If this ACM undergoes a warm start or a
TIMESYNC block is initially enabled at a time when
arbitration has settled among existing ACMs on the
same MODULNET, this ACM first sets its time to
the current MODULNET time prior to participating
in system time synchronization tasks. No user action
is required.
BadTimeSample
A communications error has occurred. This is a
tolerable condition, providing that it does not persist.
No user action is required.
OldTimeSampleRemoved
As a result of a communications error, the current
time sample shall be discarded. No user action is
required.
MultipleTimeMasters
The names of two resource modules (i.e. ACMs) are
identical and are lexicographically the greatest in the
system. In addition, they both have the same scan
rate. You must rename one of them.
August 2002
CG39-22
Resource Blocks
Table 16–1 Status Output Diagnostic Messages (Continued)
Diagnostic Message
Description
TimeSampleNotFound
Previously, time synchronization samples have been
arriving on time; now they are not. This may be due
to the loss of the current time master. The ACMs
will now arbitrate and a new time master shall be
decided. You should investigate the operational
status of the ACM that has lost its time master status.
RTCChipFailed
The Real Time Clock chip has failed on the ACM
acting as the time master. That ACM is operating as
a time slave. No immediate action is required;
however, at the earliest possible convenience, this
module should be replaced.
MessageCreationFailure
The ACM is out of memory or there is a problem
with lower level communications support. If this
error persists, contact the Siemens Technical
Information Center (TIC). Refer to the “Product
Support” section of Using the 4-mation
Configuration Software (document CG39-20).
MessageSendFailure
There is a problem with lower level communications
support. If any of these errors persist, contact the
SiemensTechnical Information Center (TIC). Refer
to the “Product Support” section of Using the 4mation Configuration Software (document CG3920).
CommandNotRecognized
CommLinkLayerError
TimeSyncServicesError
OutOfBoundsAccess
InvalidStateCode
August 2002
16-21
Resource Blocks
CG39-22
Table 16–2 Track Output Messages
Track Message
Description
TrackingRTCChip
This message indicates this ACM is currently using
its own Real Time Clock chip as the time reference
for tracking purposes. This is the default case for
the time master when no external time
synchronization commands are being received
from a greater time source.
TrackingTIMESYNCTagWrite
This message indicates this ACM is using the
EXTERNAL_TIME softlist parameter of the
TIMESYNC block as a time reference for tracking
purposes. This tracking status occurs when
periodic tag writes to EXTERNAL_TIME are
being received. The expected period for receiving
time synchronization commands is determined by
the EXTERNAL_PERIOD softlist parameter.
ResourceName
This message consists of the actual resource name
of an ACM that is using an API application as a
time reference for tracking purposes. This tracking
status occurs when periodic time synchronization
messages, broadcasted by an API application, are
received. The expected period of these time
synchronization commands are
application-dependent.
TimeIsDrifting
This status message indicates this ACM is not
tracking any time reference. This occurs during
initial arbitration and or if external time
synchronization commands have stopped arriving.
Softlist Parameters
EXTERNAL_SYNC
The External Synchronization parameter accepts a DATE_AND_TIME
data value representing present time. Each write to this parameter is
treated as a time synchronization command. Only one controller in a
group need be sent this information. If the receiving controller is not the
time master, it relays the information to the time master automatically.
EXTERNAL_PERIOD
The External Sync Period parameter accepts a TIME data value defining
the expected period in milliseconds of writes to EXTERNAL_SYNC. The
default value is 1000 (1 second). If writes stop, the time master first sets
16-22
August 2002
CG39-22
Resource Blocks
its status to TimeIsDrifting, then to TrackingRTCChip. If writes resume,
the time master again sets its status to TrackingTIMESYNCTagWrite.
EXTERNAL_TOLERANCE
The External Tolerance parameter accepts a UDINT value defining the
maximum allowable difference in microseconds between this controller's
time and the time written to EXTERNAL_SYNC. The default value is
3,000,000 (3 seconds). If the absolute value of the difference exceeds
this, the block sets its SYNCED output to FALSE and sends the
appropriate diagnostic message to the STATUS output.
GROUP_TOLERANCE
The Group Tolerance parameter accepts a UDINT value defining the
maximum allowable difference in microseconds between this controller's
time and the time sent by the controller serving as time master on its
MODULNET. The default value is 10,000 microseconds (10
milliseconds). If the absolute value of the difference exceeds this, the
block sets the SYNCED output FALSE and sends the appropriate
diagnostic message to the STATUS output.
TIME_SET_BY
The Time Set By (Resource) parameter provides a read-only STRING
value containing the name of the resource that last sent a command
causing this controller to set its time. The event that is posted when the
time is set also includes this resource name.
VERSION
The Version parameter provides a constant STRING value containing the
revision level of the block (e.g., '4.42').
Events and Class 1 errors that may be posted by the TIMESYNC block are described in the APACS+
Error Documentation and the errors.hlp file. They are summarized below:
26:15
26:20
26:14
26:16
26:19
This controller's time was set (event)
This controller began tracking its RTC (event)
Synchronization is out of tolerance (error)
This controller's time has never been set (error)
Evolution number has reached maximum (error)
16.10 Total I/O Scan Function Block (TOT_IO)
TOT_IO
BOOL
SCANEN
SCANTM
TIME
BOOL
OUTPEN
ERRCOD
INT
The symbol for the Total I/O Scan (TOT_IO) block is shown above. This I/O scan block causes the entire
controller I/O system to be scanned. This includes updating all inputs and outputs whether they be
onboard, local, distributed, or remote. When executed, this TOT_IO block causes all I/O modules to be
August 2002
16-23
Resource Blocks
CG39-22
read/updated. One of the I/O Scan blocks (i.e. Total I/O Scan block, Total I/O Hold Scan block, or the
Partial I/O Scan block) must be present in the configuration or no I/O updating will occur. When creating
a configuration, the I/O Scan block must be located on the resource sheet before any program blocks.
NOTE
When the Total I/O Scan block is used and the controller is stopped or or
IOBUS communications are interrupted, inputs are automatically zeroed.
This differs from using the Total I/O Hold Scan block which hold inputs
under these conditions.
The inputs and outputs of the TOT_IO block are defined as follows:
SCANEN
This is the Scan Enable input. It accepts a BOOL value. When TRUE, the block causes the
inputs to be scanned.
OUTPEN
This is the Output Enable input. It accepts a BOOL value. When TRUE, the block causes the
outputs to be updated.
SCANTM This is the Scan Time output. It delivers a TIME duration value that indicates the execution
time of the I/O scan.
ERRCOD
This is the Error Code output. It delivers an INT value that indicates the code of any detected
error. The possible error codes are as follows:
0 = No error
1 = One or more modules are not responding to the scan commands
Softlist Parameter:
DisableIOBSwitch
When TRUE, this parameter permits you to disable the Redundant IOBUS cable
feature if only one IOBUS cable is used or connected.
Parameter
Data Type
Initial Value
Privilege
Disable IOBSwitch
BOOL
FALSE
R/W
Hold_Inputs
BOOL
TRUE
R/W
R/W = Read/Write
16-24
August 2002
CG39-22
Resource Blocks
16.11 Module Information Function Block (MODINFO)
BOOL
BOOL
STRING
INT
MODINFO
NEXT_E NEW_ER
MAN_CL
ADDR
IOBRD
CLASS
SS_CD
E_MASK
ERR_CD
USER_A
SCOPE
CHAN
MAN_OK
NUMACT
ERRNUM
MASKED
CLASS4
CLASS3
CLASS2
CLASS1
BOOL
STRING
INT
INT
INT
STRING
STRING
INT
BOOL
INT
INT
BOOL
DINT
DINT
DINT
DINT
The symbol for the Module Information (MODINFO) block is shown above. This block allows you to
monitor the five highest priority errors for a module one at a time. It also allows you to optionally mask
(i.e. suppress) unwanted errors of a designated error class and lower in I/O modules only.
The address of the desired I/O module is to be applied as a STRING variable to the IOBRD (I/O Board)
input. If no address is applied, the control module’s errors are monitored.
Errors are reported by pulsing the NEXT_E (Next Error) input. This causes the ERRNUM (Error
Number) output to output the specific number of the error being reported.
A reported error can be manually cleared by applying a TRUE value to the MAN_CL (Manual Clear)
input whenever the MAN_OK (Manual Clear OK) output is also TRUE.
The inputs and outputs of the Module Information block are defined as follows:
NEXT_E
This is the Next Error input. It accepts a BOOL value. When a FALSE to TRUE transition is
sensed the block reports the next highest priority error. Up to five of the highest priority
errors can be observed. The block rotates through the errors by priority level. Each time the
input is pulsed the block shifts one priority level starting from priority 5 (lowest) towards a
priority 1 (highest).
MAN_CL This is the Manual Clear input. It accepts a BOOL value. When a FALSE to TRUE transition
is sensed, the block attempts to clear the currently referenced error.
NOTE
If multiple MODINFO blocks are used, make sure each input is
connected to a unique variable. Also, do not clear errors on all of them at
once (within the same scan). To assure all errors are cleared, design
configuration logic to stagger clear operations.
August 2002
16-25
Resource Blocks
CG39-22
IOBRD
This is the I/O Board input. It accepts a STRING value in the ‘%RxxSyy’ (rack-slot) module
address format. The address identifies the module for which you are seeking to display error
information. If no address is provided, the control module is monitored.
E_MASK
This is the Error Mask input for I/O modules. It accepts an INT (integer) value which
represents the highest error class (1, 2, 3, or 4) of errors to be suppressed. This means that
while errors in that class may exist, they are not reported. The error class designated by the
E_MASK value, and those below it, are suppressed.
Several E_MASK examples are:
1. If E_MASK = 2, then errors of classes 2 and 1 are suppressed.
2. If E_MASK is left unconfigured, or has a value of 0, then no masking is
implemented.
3. If E_MASK > 4, then a value of 0 is assumed and no masking is
implemented.
NEW_ER This is the New Error output. It provides a BOOL value. It is TRUE whenever an error is
active in the module being monitored.
ADDR
This is the Address output. It provides a STRING value in the node-rack-slot module
address format, shown here, that identifies the module whose error is currently being
reported by the block.
'NnnRrrSssCAM'
where:
nn
rr
ss
is the node number
is the rack number
is the slot number
CAM
is the three character module identifier (e.g. CAM = Critical Analog Module)
CLASS
This is the Class output. It provides an INT (integer) value which is the class (1, 2, 3, or 4)
of the error being reported by the block. Class 1 errors are the least severe and class 4 errors
are the most severe.
SS_CD
This is the System Service Code output. It provides an INT (integer) value that is the system
service code (category) number of the error being reported by the block. For example, all
Critical Analog Module (CAM) specific errors have the same system service code of 46.
ERR_CD
This is the Error Code output. It provides an INT (integer) value which is the error code
number of the error being reported by the block.
USER_A
This is the User Action output. It provides a STRING value that describes the user action
(possible remedy) for the error being reported by the block. An example user action would
be to check field wiring.
16-26
August 2002
CG39-22
Resource Blocks
SCOPE
This is the Scope output. It provides a STRING value that describes the scope (extent) of
the error being reported by the block. The scope can range from local (e.g. limited to a
specific channel) to system wide.
CHAN
This is the Channel output. It provides an INT (integer) value which identifies the specific
channel, if any, associated with the error being reported by the block. A value of 0 indicates
no channel is involved.
MAN_OK
This is the Manual Clear OK output. It provides a BOOL value. When TRUE it is
permissible to manually clear the error being reported by the block by using the MAN_CL
input.
NUMACT This is the Number of Active Errors output. It provides an INT (integer) value which
identifies the number of active, displayable errors in the module up to a maximum of five.
ERRNUM
This is the Error Number output. It provides an INT (integer) value which is the number of
the error being reported by the block. The range is 1 to 5 with 1 being the highest priority.
MASKED
This is the Masked output. It provides a BOOL value. It is TRUE whenever an error
belongs to a class that is being masked. See E-MASK.
CLASS4
This is the Class 4 output. It provides a DINT (double integer) value which identifies the
number of class 4 errors being reported. Class 4 errors are the most severe error.
CLASS3
This is the Class 3 output. It provides a DINT (double integer) value which identifies the
number of class 3 errors being reported. Class 3 errors are more severe than class 2 errors
but less severe than Class 4 errors.
CLASS2
This is the Class 2 output. It provides a DINT (double integer) value which identifies the
number of class 2 errors being reported. Class 2 errors are more severe than class 1 errors
but less severe than class 3 errors.
CLASS1
This is the Class 1 output. It provides a DINT (double integer) value which identifies the
number of class 1 errors being reported. Class 1 errors are the least severe error.
Softlist Parameters
There are no softlist parameters for this block.
August 2002
16-27
Resource Blocks
CG39-22
16.12 System Information Block (SYSINFO)
SYSINFO
BOOL
STRING
MAN_CL
A_B
REDUN
ACTIVE
NRS_AD
NEW_ER
BOOL
BOOL
STRING
BOOL
ADDR
CLASS
SS_CD
STRING
INT
INT
ERR_CD
USER_A
SCOPE
CHAN
MAN_OK
INT
STRING
CLASS4
CLASS3
CLASS2
CLASS1
DINT
DINT
DINT
STRING
INT
BOOL
DINT
The Symbol for the System Information (SYSINFO) block is shown above. This block is used to monitor
the highest priority error message of a control module (e.g. ACM or CCM) and all of its associated I/O
modules.
For redundant systems, either of the control modules can be selected via the block's A-B input for
monitoring errors. This way, the highest priority error message for the calculate control module and the
verify control module can be observed.
The Manual Clear (MAN_CL) input is used to manually clear a displayed error if the Manual Clear OK
(MAN_OK) output is TRUE.
The inputs and outputs of the SYSINFO block are as follows:
MAN_CL
This is the Manual Clear Input. It accepts a BOOL data type. When TRUE, it clears the
currently displayed error.
A_B
This is the A/B Selector input. It accepts a STRING data type. The string value is to
specify which control module (A side or B side) in a redundant system is to be monitored
for errors.
REDUN
This is the Redundant output. It delivers a BOOL variable. It is TRUE whenever the
system is redundant.
ACTIVE
This is the control module Activity output. It delivers a BOOL variable. It is TRUE
whenever the control module is active.
16-28
August 2002
CG39-22
NRS_AD
NEW_ER
Resource Blocks
This is the Resource Address output. It delivers a STRING variable that is the address of
the control module. The address is in the node-rack-slot format.
This is the New Error output. It delivers a BOOL value that is TRUE whenever an error
is active in the control module or any of its I/O modules.
ADDR
This is the Address output . It delivers a STRING value that is the address of the module
(in node-rack-slot format) with the error being reported in the block.
CLASS
This is the Class input. It delivers an INT value that represent the class of the error being
reported in the block.
SS_CD
This is the System Service Code output. It delivers an INT value which is the System
Service Code of the error being reported in the block.
ERR_CD
This is the Error Code output. It delivers an INT value which is the Error Code of the
error being reported in the block.
USER_A
This is the User Action message output. It delivers a STRING value that describes the
user action prescribed for the error being reported in the block.
SCOPE
This is the Scope output. It delivers a STRING value representing the scope of the error
being reported in the block.
CHAN
This is the Channel Output. It delivers an INT value representing the channel number, if
any, associated with the error being reported in the block. The value is 0 if no channel
number is reported.
This the Manual Clear Ok output. It delivers a BOOL value that is TRUE whenever it is
MAN_OK permissible to manually clear the error being reported.
CLASS4
This is the Class 4 Error output. It delivers an DINT value representing the number of
class 4 errors in the control module and any of its I/O modules.
CLASS3
This is the Class 3 Error output. It delivers an DINT value representing the number of
class 3 errors in the control module and any of its I/O modules.
CLASS2
This is the Class 2 Error output. It delivers an DINT value representing the number of
class 2 errors in the control module and any of its I/O modules.
CLASS1
This is the Class 1 Error output. It delivers an DINT value representing the number of
class 1 errors in the control module and any of its I/O modules.
Softlist Parameters
There are no softlist parameters for this block.
August 2002
16-29
Resource Blocks
CG39-22
16.13 Resource Alarm Block (RSCALRM)
The symbol of the Resource Alarm (RSCALRM) function block is shown above. This block is used to
configure resource alarm processing in the Advanced Control Module (ACM). There are presently 20
alarms defined, as shown in Table 16-3. Alarms may be individually enabled or disabled using the
softlist parameters of this block. Various other parameters (e.g. limits) may also be configured. Resource
alarming continues even if no RSCALRM block is configured, using the softlist parameter defaults.
Resource alarm states may be accessed via the embedded global variable #AlarmState, which is a 32-bit
(DINT) word containing one bit per state. The least-significant bit corresponds to the first alarm, the next
to the second, etc. These states are also available on the two 16-bit outputs of the RSCALRM function
block, with the least-significant bits (1 to 16) on the STATE1 output, and the remaining bits (17 to 20) on
STATE2. If an alarm is not enabled, its output bit is always zero.
Table 16–3 Resource Alarms
#ALARMSTATE
BIT NUMBER*
NAME
1
Informational Diagnostic
Class 1 error occurred in system.
2
Channel Fault
Class 2 error occurred in system.
3
Module Fault
Class 3 error occurred in system.
4
System Fault
Class 4 error occurred in system.
5
Percent Scan High
% scan consistently exceeding limit as defined by
ScanHiLimit softlist parameter (default 70%)
6
Scan Rate Exceeded
Scan rate consistently overrunning
7
Free Memory Low
Available memory in the controller less than limit as
defined by MemoryLoLimit softlist parameter (default
25%)
8
Security Disabled
System security is disabled.
9
Time Out of Synch
System time out of synchronization with time master
10
Redundancy Degraded
Redundancy is not functioning.
11
MBUS Redundancy
Disabled
Maintenance override to lock M-BUS to a side
12
IOBUS Redundancy
Disabled
Maintenance override to lock IOBUS to a side
13
MBUS Comm Faults
M-BUS fault anywhere in system
14
IOBUS Comm Faults
IOBUS fault anywhere in system
15
Forced Data Present
Forced variables or I/O tags exist in the system.
16-30
MEANING
August 2002
CG39-22
Resource Blocks
16
Diagnostic Masking
Active
Module error masking is enabled.
17
(future)
(future)
18
Outputs Disabled
Active controller instructed an I/O module to disable
outputs.
19
Battery Fault
Battery low/failed on either side of the system
20
Power Supply Fault
One or more of the power supplies identified by the
PowerXRequired softlist parameters has failed.
* Bit numbers are 1-based.
The MASK1 (1-16) and MASK2 (17-20) inputs provide a way to suppress individual alarms without
modifying the softlist parameters. The mask values affect both the #AlarmState embedded global
variable and the function block outputs. The input bit positions correspond to the bit positions on the
alarm state outputs. A “1” input bit causes the corresponding output bit to be set to zero, regardless of the
actual alarm state. A “0” (zero) allows the output to reflect the actual alarm state if the alarm is enabled.
The purpose of the function block inputs and outputs is to allow the user to configure alarm recurrence
logic if it is needed. For example, an output going TRUE could start a delay timer that would later pulse
the corresponding input, causing the alarm to disappear briefly and then be re-posted.
The inputs and outputs of the RSCALRM block are defined as follows:
MASK1
This input masks alarms 1-16, as described previously. The MASK1 input accepts a 16-bit
UINT data value. The least-significant bit corresponds to the alarm 1, the next to alarm 2, etc.
MASK2
This input masks alarms 17-20, as described previously. The MASK2 input accepts a 16-bit
UINT data value. The least-significant bit corresponds to the alarm 17, the next to alarm 18,
etc.
STATE1 This output reflects the states of alarms 1-16. The STATE1 output provides a 16-bit UINT
data value. The least-significant bit corresponds to the alarm 1, the next to alarm 2, etc.
STATE2 This output reflects the states of alarms 17-20. The STATE2 output provides a 16-bit UINT
data value. The least-significant bit corresponds to the alarm 17, the next to alarm 18, etc.
MASK1 and STATE1:
16
15
14
13
12
11
10
9
8
7
6
5
-
-
-
-
-
-
-
-
4
3
2
1
MASK2 and STATE2:
-
August 2002
-
-
-
20 19 18 17
16-31
Resource Blocks
CG39-22
Softlist Parameters
The softlist parameters are used to individually enable the resource alarms. Each accepts a BOOL data
value. The corresponding alarm numbers and default values are as shown in Table 16–4 .
Table 16–4 Resource Alarm Block Softlist Parameters
ALARM NUMBER
16-32
PARAMETER NAME
DEFAULT VALUE
1
EnInfoDiag
FALSE
2
EnIOChannelFault
TRUE
3
EnModuleFault
TRUE
4
EnCriticalFault
TRUE
5
EnPctScanHigh
TRUE
6
EnScanOverrun
TRUE
7
EnMemoryLow
TRUE
8
EnSecurityDsbl
FALSE
9
EnTimeOutOfSync
TRUE
10
EnRedunDegrade
TRUE
11
EnMBusRedunDsbl
TRUE
12
EnIOBusRedunDsbl
TRUE
13
EnMBusFault
TRUE
14
EnIOBusFault
TRUE
15
EnForcdDataPrsnt
TRUE
16
EnDiagMaskPrsnt
TRUE
17
EnIOChanDecomm
FALSE
18
EnOutputsDisabld
TRUE
19
EnBatteryFault
TRUE
20
EnPwrSupplyFault
TRUE
August 2002
CG39-22
Resource Blocks
The following softlist parameters are used to configure specific alarms:
PowerARequired This parameter defines whether a Power Supply Fault alarm (20) should occur if
power supply A is not present. PowerARequired accepts a BOOL data value, and its
default is FALSE.
PowerBRequired
This parameter defines whether a Power Supply Fault alarm (20) should occur if
power supply B is not present. PowerBRequired accepts a BOOL data value, and its
default is FALSE.
PowerCRequired
This parameter defines whether a Power Supply Fault alarm (20) should occur if
power supply C is not present. PowerCRequired accepts a BOOL data value, and its
default is FALSE.
ScanHiLimit
This parameter defines the scan percentage above which a Percent Scan High alarm
(5) should be raised. ScanHiLimit accepts an INT data value, and its default is 70.
MemoryLoLimit
This parameter defines the scan percentage, below which a Memory Low alarm (7)
should be raised. MemoryLoLimit accepts an INT data value, and its default is 25.
16.14 Clock Block (CLOCK)
CLOCK
BOOL
INT
INT
INT
INT
INT
INT
EN
YEAR
MONTH
DAY
HOUR
MINUTE
SECOND
Q
YR
MO
DY
HR
MN
SC
BOOL
INT
INT
INT
INT
INT
INT
The symbol of the Clock (CLOCK) function block is shown above. This block provides integer values of
the time and date currently in the controller's clock (system clock). Previously, the inputs of this block
were used to set the system clock, this use is now discouraged. Use the Real Time Clock (RTC) block for
this purpose.
The block outputs are updated every scan. The block provides controller date and time data as integer
(INT) values.
August 2002
16-33
Resource Blocks
CG39-22
The inputs and outputs of the CLOCK block are defined as follows:
EN
This is the Enable input. It accepts a BOOL value. Upon sensing a FALSE-to-TRUE
transition, the block reads its inputs and sets the controller date and time using the inputs'
values. Note: Do not set this input to TRUE, or connect anything to it to avoid mistakenly
setting the controller's clock, which should only be done via the RTC block.
YEAR
This is the Year input. It accepts an INT value representing the current year.
MONTH
This is the Month input. It accepts an INT value representing the current month.
DAY
This is the Day input. It accepts an INT value representing the current day.
HOUR
This is the Hour input. It accepts an INT value representing the current hour.
MINUTE
This is the Minute input. It accepts an INT value representing the current minute.
SECOND This is the Second input. It accepts an INT value representing the current second.
Q
This is the Q output. It provides a BOOL value that mirrors the EN input.
YR
This is the Year output. It provides an INT value used as the current year.
MO
This is the Month output. It provides an INT value used as the current month.
DY
This is the Day output. It provides an INT value used as the current day.
MN
This is the Month output. It provides an INT value used as the current month.
SC
This is the Second output. It provides an INT value used as the current second.
Softlist Parameters
RTCTimeSource
This parameter accepts a BOOL value that determines the source of the time data
provided by the outputs. When set to FALSE (default), the block outputs are sourced
from the system time counter. When set to TRUE, the output are sourced from the the
RTC chip. This parameter is useful for determining the amount of drift between two
time sources.
There is no softlist parameter for this block when used with APACS+ controllers.
"
16-34
August 2002
CG39-22
Hold Function Blocks (HLD****)
17.0 Hold Function Blocks (HLD****)
HLD****
OUT
DATA TYPE
HLD****
The two basic symbols of the Hold blocks are shown above. The top symbol is used for Hold blocks that
have an output (OUT) while the bottom symbol is for those that do not. Hold blocks are used to store
instance specific information in a User-Defined Function Block (UDFB). Prior to the introduction of
Hold blocks, all variables and function block I/O could not be unique for a specific instance of a UDFB.
These items had to be the same for each instance. Softlists provided the only unique storage in a UDFB.
Each of the Hold blocks provides a softlist parameter of a certain data type allowing storage in a UDFB.
The Hold blocks can also be used to store tuning-type information when backing up an on-line database
(i.e. transferring a database from on-line to off-line). Previously, only softlist parameters and initial values
of variables were stored within a database. Present variable values were not stored. Now, these important
values can be stored in Hold blocks’ softlists so they can be saved with the database.
There is a Hold block for each data type available within 4-mation. For example, the HLDBOOL block is
used to hold a BOOL value; the HLDREAL block is used to hold a REAL value.
The listing of Hold blocks is as follows:
HLDBOOL
HLDINT
HLDUINT
HLDDINT
HLDUSIN
HLDUDIN
HLDSINT
HLDREAL
HLDWORD
HLDTIME
HLDDATE
HLDDT
HLDTOD
HLDSTR
HLDST28
HLDST92
HLDST16
HLDST32
HLDST96
August 2002
17-1
Hold Function Blocks (HLD****)
CG39-22
Hold blocks do not have inputs, however, each block’s softlist parameter can be edited using any of the
following tools:
•
•
•
•
A Set Value (SET_VAL) function block
An HMI
The Variable Control dialog box
The blocks’s Softlist dialog box
Most Hold blocks have an output. The output (OUT) delivers the value stored in the block’s VALUE
softlist parameter.
A subset of the Hold blocks is used specifically for storing STRING type data. These are the Hold String
blocks as listed here:
HLDSTR
HLDST16
HLDST28
HLDST32
HLDST92
HLDST96
The first listed Hold String block is the HLDSTR block. Its VALUE softlist parameter holds a STRING
data type value from 0 up to 254 characters. Similarly, the number specified within the name of the
remaining Hold String blocks (i.e. HLDSTxx) represents the maximum string length that can be
accommodated by each block’s VALUE softlist parameter. For example, The HLDST96 block can
accommodate a string length of 96 characters.
The following Hold String blocks do not have outputs.
HLDST16
HLDST32
HLDST96
When several Hold String blocks are needed for storing string data, use these blocks to conserve control
module memory.
The output and softlist parameter of the various Hold Blocks are defined as follows:
OUT
For Hold blocks that have an output, OUT is the block’s output. It delivers the same value as that
being held in the VALUE softlist parameter.
Softlist Parameter:
VALUE This softlist parameter is applicable to all Hold blocks. It contains one value of the data type
specified by the block name. For example, the VALUE parameter of the HLDBOOL block
holds a BOOL value. The default initial value is that of the data type designated by the block’s
name.
"
17-2
August 2002
CG39-22
String Function Blocks
18.0 String Function Blocks
The String function blocks are used to control parameters that effect string data. These blocks are not
oriented toward control strategy, but are very useful in manipulating strings in structured text and other
applications.
For detailed information about the STRING data type, see Using the ProcessSuite 4-mation
Configuration Software (document number CG39-20). Refer to the section on “Basic Configuration
Elements” and the subsection on “Data Types.”
A listing of string blocks is presented here. Reference information pertaining to individual blocks is
detailed in the subsections that follow.
•
•
•
•
•
•
•
•
•
•
•
String Length
Leftmost Characters
Rightmost Characters
Middle Characters
Concatenate String Characters
Insert String Characters
Delete String Characters
Replace String Characters
Find String Characters
Make APACS Path
Split APACS Path
18.1 String Length Block (LEN)
LEN
STRING
IN
OUT
IN
INT
The symbol of the String Length (LEN) block is shown above. This block is used to find the length of an
input character string. The output will be the exact number of characters in the string, excluding the null
terminator.
For example: If IN = ‘ASTR’, then OUT = 4
The input and output of the LEN block are defined as follows:
IN
This input accepts the string of which the length is to be found.
OUT This output provides an integer value that represents the length of the input string.
August 2002
18-1
String Function Blocks
CG39-22
Softlist Parameters
There are no softlist parameters for this block.
18.2 Leftmost Characters of String (LEFT)
The symbol of the Leftmost Characters (LEFT) block is shown above. This block is used to find the leftmost characters of an input string. The output will be a string of length (L), beginning with the left-most
character of the input string.
For example: If IN = ‘ASTR’, and L = 3, OUT = ‘AST’
If (L) is greater than the length of the input string, the output will be limited to the entire input string. If
(L) is less than or equal to zero, the result is a null string being output.
The inputs and output of the LEFT block are defined as follows:
IN
This input accepts the character string from which the left most characters are to be found.
L
This is the length input. The value can be any integer. This value determines the length of the
left most portion of the input character string that the block is to find.
OUT
This output delivers the output string. The output string consists of the (L) number of the left
most characters from the input string.
Softlist Parameters
There are no softlist parameters for this block.
18-2
August 2002
CG39-22
String Function Blocks
18.3 Rightmost Characters of String (RIGHT)
RIGHT
STRING
IN
ANY_INT
L
OUT
STRING
The symbol of the Rightmost Characters (RIGHT) block is shown above. This block will find the rightmost characters of an input string. The output will be a string of length (L), beginning with the ‘length L’ character of the input string.
For example: If IN = ‘ASTR’, and L = 3, OUT = ‘STR’
If (L) is greater than the length of the input string, the output will be limited to the entire input string. If
(L) is less than or equal to zero, the result is a null string being output.
The inputs and output of the RIGHT block are defined as follows:
IN
This input accepts the character string from which the right most characters are to be found.
L
This is the length input. The value can be any integer. This value determines the length of the
left most portion of the input character string that the block is to find.
OUT
This output delivers the output string. The output string consists of (L) number of the right most
characters from the input string.
Softlist Parameters
There are no softlist parameters for this block.
18.4 Middle Characters of String (MID)
MID
STRING
IN
ANY_INT
L
ANY_INT
P
OUT
STRING
The symbol for the Middle Characters (MID) block is shown above. This block will find the middle
characters of an input character string. The output will be a string of length (L), beginning with the (P)
character position of the input string.
August 2002
18-3
String Function Blocks
For example:
CG39-22
If IN = ‘ASTR’ and L = 2, P = 2 then OUT = ‘ST’
If (P) is greater than the length of the input string, or if it is less than or equal to zero, the output will be
zero (null terminator). If (L) is greater than the length of the input string, the output will be limited to the
remaining (P) characters.
The inputs and output of the MID block are defined as follows:
IN
This input accepts the character string from which some set of middle characters are to be found.
L
This is the length input. The value can be any integer. This value determines the length of the set
of middle characters that the block is to find.
P
This is the position input. The value can be any integer. This value determines the character
position, within the input string, at which the middle find is to begin.
OUT This output delivers the output string. The output string consists of the found middle characters
from the input string.
Softlist Parameters
There are no softlist parameters for this block.
18.5 Concatenate String Characters (CONCAT)
CONCAT
STRING
IN1
STRING
IN2
:
:
STRING
OUT
IN
STRING
IN16
The symbol for the Concatenate String Characters (CONCAT) block is shown above. This block will
concatenate multiple string inputs into one string output. The characters of the strings will be joined
together, without intervening spaces, in order of input precedence (IN2, IN2, .... INn). Note that the
maximum length of the output string is 254 characters.
For example: If IN1 = ‘AB’, IN2 = ‘CD’, IN3 = ‘E’, then OUT = ‘ABCDE’
This block is extensible up to 16 inputs.
18-4
August 2002
CG39-22
String Function Blocks
The inputs and output of the CONCAT block are defined as follows:
IN1
These string inputs accept the strings that are to be concatenated.
to
IN16
OUT This output delivers the output string. The output string consists of the concatenated input strings
in order of input precedence (IN2, IN2, .... INn) without spaces.
Softlist Parameters
There are no softlist parameters for this block.
18.6 Insert Characters into String Block (INSERT)
INSERT
STRING
IN1
STRING
IN2
ANY_INT
P
OUT
IN
STRING
The symbol for the Insert Characters block is shown above. This block will insert one string into another
at a specified position. The output string will be the first string (IN1) with the second string (IN2)
inserted at the (P) character position.
For example:
If IN1 = ‘ABC’, IN2 = ‘XY’, P = 2, then OUT = ‘AXYBC’
If (P) is greater than the length of the first input string, the output will be the concatenation of the two
strings (IN1 followed by IN2). If (P) is less than or equal to zero, (IN2) will be inserted before the start of
(IN1).
The inputs and output of the INSERT block are as follows:
IN1
This input accepts the character string in which another character string is to be inserted.
IN2
This input accepts the character string which is to be inserted into (IN1).
P
This is the position input. The value can be any integer. This value determines the character
position within the input string (IN1) at which the insert is to begin.
OUT This output delivers the resultant output string.
August 2002
18-5
String Function Blocks
CG39-22
Softlist Parameters
There are no softlist parameters for this block.
18.7 Delete Characters in a String (DELETE)
DELETE
STRING
ANY_INT
ANY_INT
IN
L
OUT
IN
STRING
P
The symbol for the Delete Characters (DELETE) block is shown above. This block will delete characters
from the input string. The output string of this block will be the input string with (L) characters deleted
after the (P) character position.
For example:
If IN = ‘ABXYC’, L = 2, P = 3, then OUT = ‘ABC’
If (P) is greater than the length of the input string, or if it is less than or equal to zero, the output string
will be the unchanged input string. If (L) is greater than the length of the input string, the remaining
characters of the string from (P) will be deleted. If (L) is less than or equal to zero, the input string is
unchanged.
The inputs and output of the DELETE block are defined as follows:
IN
This input accepts the character string from which characters are to be deleted.
L
This is the length input. The value can be any integer. This value determines the length of the
set of characters to be deleted.
P
This is the position input. The value can be any integer. This value determines the character
position within the input string (IN) at which the delete is to begin.
OUT
This output delivers the resultant output string.
Softlist Parameters
There are no softlist parameters for this block.
18-6
August 2002
CG39-22
String Function Blocks
18.8 Replace String Characters Block (REPLACE)
REPLACE
STRING
STRING
IN1
IN2
ANY_INT
L
ANY_INT
P
OUT
IN
STRING
The symbol for the Replace String Characters (REPLACE) block is shown above. This block will
perform a character replace function for input strings. The output of this block will be the first input
string (IN1) with (L) characters replaced by the characters of the second input string (IN2) at position (P)
of the first string.
For example:
If IN1 = ‘ABCDE’, IN2 = ‘X’, L = 2, P = 3, then OUT = ‘ABXE’
If (P) is greater than the length of the first input string, or if it is less than or equal to zero, or if (L) is
greater than the string’s length, the output string will be the unchanged input string. If (L) is greater than
the length of the first input string, the remaining characters of the string from position (P) will be
replaced.
The inputs and output of the REPLACE block are defined as follows:
IN1
This input accepts the character string in which characters are to be replaced.
IN2
This input accepts the character string which is to be placed into (IN1).
L
This is the length input. The value can be any integer. This value determines the length of the set
of characters to be replaced.
P
This is the position input. The value can be any integer. This value determines the character
position within the input string (IN) at which replacement is to begin.
OUT
This output delivers the resultant output string.
Softlist Parameters
There are no softlist parameters for this block.
August 2002
18-7
String Function Blocks
CG39-22
18.9 Find String Characters Block (FIND)
FIND
STRING
STRING
OUT
IN
IN1
IN2
L
INT
The symbol for the Find String Characters (FIND) block is shown above. This block will find the position
of the beginning of the first occurrence of one string in another. The output of this block will be a number
representing the position of the first occurrence of the second string (IN2) inside the first string (IN1).
For example:
If IN1 = ‘ABCBC’, IN2 = ‘BC’, then OUT = 2
If the string is not found, then OUT will be zero. If either input string is null, the output string will be
null.
The inputs and output of the FIND block are defined as follows:
IN1
This input accepts the character string in which characters are to be found.
IN2
This input accepts the character string which is to be found in (IN1).
OUT
This output is an integer value. It represents the starting character position within string (IN1), of
the first occurrence of the character string (IN2).
Softlist Parameters
There are no softlist parameters for this block.
18.10 Make APACS Path Block (PATHMAK)
PATHMAK
BOOL
STRING[]
EN
DREV
FPATH
ERR
STRING
BOOL
The symbol for the Make APACS Path (PATHMAK) block is shown above. This block is used to create
an APACS path name from the contents of the (DREV) input array. When the block is enabled, (EN) =
TRUE, FPATH will be the concatenation of each element of (DREV) separated by periods.
For example: If DREV[1] = ‘ABC’, DREV[2] = ‘DEF’, DREV[3] = ‘GHI’, then FPATH =
‘ABC.DEF.GHI’
18-8
August 2002
CG39-22
String Function Blocks
The error output (ERR) will be TRUE in the following cases:
•
DREV is not a single dimension string array
•
An element of DREV is longer than 18 characters
•
The total size of FPATH exceeds 254 characters
The inputs and outputs of the PATHMAK block are defined as follows:
EN
This enable input accepts BOOL values. When TRUE, the block is enabled.
DREV
This input accepts a single dimension string array from which the output path name is built.
FPATH This output provides the resultant string which is to be used as an APACS path name.
ERR
This is the error output which outputs BOOL values. This output is TRUE whenever any of
the conditions listed above occur.
Softlist Parameters
There are no softlist parameters for this block.
18.11 APACS Path Split Block (PATHSPL)
PATHSPL
BOOL
STRING
STRING
EN
FPATH
DREV
N
ERR
INT
BOOL
The symbol for the APACS Path Split (PATHSPL) block is shown above. This block is used to split an
APACS path name into its component parts. When the block is enabled, (EN) = TRUE, each section of
(FPATH) will be placed into an element of (DREV).
For example:
‘DEF’
If FPATH= ‘AB.C.DEF’, then DREV[n] = ‘AB’, DREV[n+1] = ‘C’, DREV[n+2] =
Where: n is the lower bound of DREV[]
The value of output (N) is the number of levels in the path name. The error output (ERR) will be TRUE in
the following situations:
•
•
•
•
•
There is nothing connected to (FPATH) or (DREV)
(DREV) is not a single dimension string array
(DREV) does not contain enough elements for the current (FPATH)
The string length of (DREV) is too small for one of the level names in the current (FPATH)
One of the levels of (FPATH) is greater than 18 characters
August 2002
18-9
String Function Blocks
CG39-22
Whenever (ERR) is TRUE, N will indicate the number of levels which were successfully stored prior to
encountering the error.
The inputs and outputs of the PATHSPL block are defined as follows:
EN
This enable input accepts BOOL values. When TRUE, the block is enabled.
FPATH
This input accepts the APACS path name string. The string must be arranged in a
delimited form as this example: ABC.DEF.GHI
DREV[ ]
This output places the component levels of FPATH into a single dimension string array.
N
The integer value of this output represents the number of levels successfully stored from
FPATH to DREV[ ].
ERR
This is the error output which outputs BOOL values. This output is TRUE whenever any
of the conditions listed above occur.
Softlist Parameters
There are no softlist parameters for this block.
"
18-10
August 2002
CG39-22
Diagnostic Function Blocks
19.0 Diagnostic Function Blocks
The Diagnostic function blocks are used for troubleshooting and testing configurations.
The Diagnostic blocks are listed as follows. Detailed specific information pertaining to each individual
block is provided in the following subsections.
•
Get Time (GTTIME) Block
•
Memory Read (MEM_READ) Block
•
Memory Statistic (MEM_STAT) Block
19.1 Get Time Block (GTTIME)
GTTIME
CTIME
DINT
The symbol of the Get Time (GTTIME) block is shown above. This block gives a current timestamp in
microseconds. Two of these blocks can be used in conjunction with a Subtraction (SUB) block to
determine the execution time of a section of logic (configuration). Place one block before the logic being
tested and one block after the logic being tested. Then take the outputs and subtract the CTIME after the
logic from the CTIME that is before the logic. The output of the SUB block gives the execution time of
the logic in between in microseconds.
The output of the GTTIME block is defined as follows:
CTIME
This DINT output holds the current timestamp in microseconds. This output is used to
calculate the execution time of logic.
Softlist Parameters
There are no softlist parameters for this block.
19.2 Memory Read Block (MEM_READ)
The Memory Read (MEM_READ) block is used for advanced troubleshooting under the direction of a
Siemens field service or technical support engineer. This function block is not for general use.
19.3 Memory Statistic Block (MEM_STAT)
The Memory Statistic (MEM_STAT) block is used for advanced troubleshooting under the direction of a
Siemens field service or technical support engineer. This function block is not for general use.
August 2002
19-1