You are on page 1of 16

Siemens Moore

Process Automation, Inc. CONFIGURATION GUIDE

CG39-22A
Rev: 7
June 2000

APACS+™
Advanced Control Module (ACM)
Standard Function Blocks
Version 4.40 or Higher

Addendum: MOVE Function Blocks


CG39-22A CONTENTS

TABLE OF CONTENTS
SECTION AND TITLE PAGE

1.0 INTRODUCTION ...................................................................................................................................1-1


1.1 DESCRIPTION..................................................................................................................................1-2
1.2 RELATED LITERATURE................................................................................................................1-2

2.0 STANDARD FUNCTION BLOCKS.....................................................................................................2-1

3.0 DYNAMIC FUNCTION BLOCKS .......................................................................................................3-1


3.1 SETPOINT FUNCTION BLOCK (SETPNT)..................................................................................3-2
3.2 PID FUNCTION BLOCK (PID) .......................................................................................................3-6
3.3 AUTO/MANUAL FUNCTION BLOCK (AM) ...............................................................................3-9
3.4 PD FUNCTION BLOCK (PD)........................................................................................................3-12
3.5 ID FUNCTION BLOCK (ID)..........................................................................................................3-15
3.6 PID INCREMENTAL OUTPUT FUNCTION BLOCKS..............................................................3-18
3.6.1 Gain Function Block (GAIN)..................................................................................................3-19
3.6.2 Integral Function Block (INTEGRL)......................................................................................3-21
3.6.3 Derivative Function Block (DERIV) ......................................................................................3-23
3.6.4 Increment-to-Position Function Block (INCRPOS) ...............................................................3-25
3.7 PID ERROR INPUT FUNCTION BLOCK (NON-INTERACTING) (PID_ERR) ......................3-27
3.8 ON/OFF WITH DERIVATIVE CONTROLLER (ON_OFF) .......................................................3-31
3.9 PROGRAMMER FUNCTION BLOCK (PGRMR).......................................................................3-34
3.10 LEAD/LAG FUNCTION BLOCK (LEADLAG).........................................................................3-39
3.11 RATE LIMITER FUNCTION BLOCK (RATELIM) ..................................................................3-41
3.12 RAMP GENERATOR FUNCTION BLOCK (RAMPGEN).......................................................3-43
3.13 SCALER FUNCTION BLOCK (SCALER).................................................................................3-46
3.14 FILTER FUNCTION BLOCK (FILTER).....................................................................................3-48
3.15 TRACK AND HOLD FUNCTION BLOCK (TRK_HLD)..........................................................3-50
3.16 IMPULSE FUNCTION BLOCK (IMPULSE) .............................................................................3-52
3.17 DEAD TIME TABLE FUNCTION BLOCK (DEADTIM) .........................................................3-54
3.18 DELAYED ERROR FUNCTION BLOCK (DEL_ERR).............................................................3-56
3.19 BATCH SWITCH FUNCTION BLOCK (BAT_SW) .................................................................3-58
3.20 EAM TOTALIZER FUNCTION BLOCK (EAM_TOT) ............................................................3-61
3.21 TOTALIZER FUNCTION BLOCK (TOTAL) ............................................................................3-63
3.22 ACCUMULATOR FUNCTION BLOCK (ACCUM)..................................................................3-66
3.23 LOOP STATUS FUNCTION BLOCK (LP_STAT)....................................................................3-68

4.0 COMPARE AND SELECT FUNCTION BLOCKS............................................................................4-1


4.1 EQUAL FUNCTION BLOCK (EQ).................................................................................................4-2
4.2 INEQUALITY FUNCTION BLOCK (NE) ......................................................................................4-3
4.3 GREATER THAN FUNCTION BLOCK (GT) ...............................................................................4-4
4.4 GREATER OR EQUAL FUNCTION BLOCK (GE) ......................................................................4-5
4.5 LESS THAN FUNCTION BLOCK (LT) .........................................................................................4-6
4.6 LESS OR EQUAL FUNCTION BLOCK (LE) ................................................................................4-7
4.7 BINARY SELECTOR SWITCH FUNCTION BLOCK (SEL) ......................................................4-8
4.8 LOW SELECTOR FUNCTION BLOCK (MIN) .............................................................................4-9
4.9 HIGH SELECTOR FUNCTION BLOCK (MAX).........................................................................4-10

June 2000 i
CONTENTS CG39-22A

TABLE OF CONTENTS
(Continued)

SECTION AND TITLE PAGE

4.10 MIDDLE OF THREE SELECTOR FUNCTION BLOCK (MID_SEL) .....................................4-11


4.11 LIMITER FUNCTION BLOCK (LIMIT) ....................................................................................4-12
4.12 MULTIPLEXER SWITCH FUNCTION BLOCK (MUX)..........................................................4-13
4.13 STATE FUNCTION BLOCK (STATE).......................................................................................4-14

5.0 LOGIC FUNCTION BLOCKS..............................................................................................................5-1


5.1 AND FUNCTION BLOCK (AND)...................................................................................................5-2
5.2 OR FUNCTION BLOCK (OR).........................................................................................................5-3
5.3 EXCLUSIVE OR FUNCTION BLOCK (XOR) ..............................................................................5-4
5.4 NOT FUNCTION BLOCK (NOT) ...................................................................................................5-5
5.5 SR FLIP-FLOP FUNCTION BLOCK (SR) .....................................................................................5-6
5.6 RS FLIP-FLOP FUNCTION BLOCK (RS) .....................................................................................5-7
5.7 RISING EDGE DETECT TRIGGER FUNCTION BLOCK (R_TRIG) .........................................5-8
5.8 FALLING EDGE DETECT TRIGGER FUNCTION BLOCK (F_TRIG)......................................5-9

6.0 SHIFT AND ROTATE FUNCTION BLOCKS ..................................................................................6-1


6.1 SHIFT LEFT FUNCTION BLOCK (SHL) ......................................................................................6-2
6.2 SHIFT RIGHT FUNCTION BLOCK (SHR) ...................................................................................6-3
6.3 ROTATE LEFT FUNCTION BLOCK (ROL) .................................................................................6-4
6.4 ROTATE RIGHT FUNCTION BLOCK (ROR) ..............................................................................6-5

7.0 ARITHMETIC FUNCTION BLOCKS ...............................................................................................7-1


7.1 ADDITION FUNCTION BLOCK (ADD)........................................................................................7-2
7.2 SUBTRACTION FUNCTION BLOCK (SUB)................................................................................7-3
7.3 MULTIPLICATION FUNCTION BLOCK (MUL).........................................................................7-4
7.4 DIVISION FUNCTION BLOCK (DIV) ...........................................................................................7-5
7.5 SQUARE ROOT FUNCTION BLOCK (SQRT) .............................................................................7-6
7.6 ABSOLUTE VALUE FUNCTION BLOCK (ABS) ........................................................................7-7
7.7 LINEAR CHARACTERIZER FUNCTION BLOCK (LINCHR)....................................................7-8
7.8 WEIGHTED AVERAGE FUNCTION BLOCK (WT_AVG) .......................................................7-10
7.9 MOVING AVERAGE FUNCTION BLOCK (MOV_AVG).........................................................7-11
7.10 LOGARITHM BASE 10 FUNCTION BLOCK (LOG)...............................................................7-13
7.11 EXPONENTIATION FUNCTION BLOCK (EXPT) ..................................................................7-14
7.12 NATURAL LOGARITHM FUNCTION BLOCK (LN)..............................................................7-15
7.13 NATURAL EXPONENTIATION FUNCTION BLOCK (EXP).................................................7-16
7.14 TRIGONOMETRIC FUNCTION BLOCKS................................................................................7-17
7.14.1 Sine Function Block (SIN) ...................................................................................................7-17
7.14.2 Cosine Function Block (COS) .............................................................................................7-18
7.14.3 Tangent Function Block (TAN)...........................................................................................7-19
7.15 INVERSE TRIGONOMETRIC FUNCTION BLOCKS..............................................................7-20
7.15.1 Arcsine Function Block (ASIN)...........................................................................................7-20
7.15.2 Arccosine Function Block (ACOS) .....................................................................................7-21
7.15.3 Arctangent Function Block (ATAN) ...................................................................................7-22
7.16 CONVERSION FUNCTION BLOCK (CONVERT)...................................................................7-23

ii June 2000
CG39-22A CONTENTS

TABLE OF CONTENTS
(Continued)

SECTION AND TITLE PAGE

8.0 MOVE FUNCTION BLOCKS..............................................................................................................8-1


8.1 DATA MOVE FUNCTION BLOCK (MOVE)................................................................................8-2
8.2 SET VALUE FUNCTION BLOCK (SET_VAL)............................................................................8-4
8.3 SET BIT FUNCTION BLOCK (SET_BIT) ....................................................................................8-6

9.0 COMMUNICATIONS FUNCTION BLOCKS....................................................................................9-1


9.1 SEND AND RECEIVE COMMUNICATION BLOCKS (SEND, RCV)........................................9-2
9.2 UN-INTERLOCKED SEND AND UN-INTERLOCKED RECEIVE BLOCKS (USEND,
URCV) ................................................................................................................................................9-4
9.3 READ FUNCTION BLOCK (READ) ..............................................................................................9-6
9.4 WRITE FUNCTION BLOCK (WRITE) ..........................................................................................9-8
9.5 BROADCAST-IN AND BROADCAST-OUT FUNCTION BLOCKS (BCSTIN,
BCSTOUT) .......................................................................................................................................9-10
9.6 CONNECT FUNCTION BLOCK (CONNECT)............................................................................9-13

10.0 TIMING FUNCTION BLOCKS .......................................................................................................10-1


10.1 ON-DELAY TIMER FUNCTION BLOCK (TON) .....................................................................10-2
10.2 OFF-DELAY TIMER FUNCTION BLOCK (TOF) ....................................................................10-4
10.3 RETENTIVE TIMER FUNCTION BLOCK (ROT)....................................................................10-6
10.4 TIMED PULSE FUNCTION BLOCK (TP) .................................................................................10-8
10.5 REPEAT CYCLE TIMER FUNCTION BLOCK (RECYCL)...................................................10-10

11.0 COUNTING FUNCTION BLOCKS.................................................................................................11-1


11.1 UP COUNTER FUNCTION BLOCK (CTU) ..............................................................................11-2
11.2 DOWN COUNTER FUNCTION BLOCK (CTD).......................................................................11-3
11.3 UP/DOWN COUNTER FUNCTION BLOCK (CTUD)..............................................................11-4

12.0 ALARM FUNCTION BLOCKS.......................................................................................................12-1


12.1 HLL ANALOG ALARM FUNCTION BLOCK (HLLAALM)...................................................12-2
12.2 HLL ANALOG ALARM 4 FUNCTION BLOCK (HLLAA4)....................................................12-6
12.3 HLL DISCRETE ALARM FUNCTION BLOCK (HLLDALM) ..............................................12-10
12.4 HLL DISCRETE ALARM 1 FUNCTION BLOCK (HLLDA1) ...............................................12-12

13.0 ARRAY FUNCTION BLOCKS........................................................................................................13-1


13.1 MATRIX DIMENSIONS FUNCTION BLOCKS........................................................................13-2
13.1.1 Find Matrix Dimension Function Block (MAT_DIM) .......................................................13-2
13.1.2 Matrix Bounds Function Block (MAT_BND) ....................................................................13-3
13.2 MATRIX MOVE FUNCTION BLOCKS ....................................................................................13-4
13.2.1 Matrix Load Function Block (MATLOAD)........................................................................13-4
13.2.2 Matrix Unload Function Block (MATUNLD) ....................................................................13-7
13.2.3 FIFO Function Block (FIFO)...............................................................................................13-9
13.2.4 LIFO Function Block (LIFO).............................................................................................13-11
13.2.5 Matrix Copy Function Block (MATCOPY)......................................................................13-13

June 2000 iii


CONTENTS CG39-22A

TABLE OF CONTENTS
(Continued)

SECTION AND TITLE PAGE

13.3 ARITHMETIC MATRIX BLOCKS ...........................................................................................13-15


13.3.1 Matrix Add, Subtract, Multiply, and Divide Function Blocks ....................................................
(MAT_ADD, MAT_SUB, MAT_MUL, MAT_DIV) ...................................................................13-15
13.3.2 Matrix Bias Function Block (MATBIAS).........................................................................13-18
13.3.3 Matrix Scaler Function Block (MATSCLR) .....................................................................13-20
13.3.4 Matrix Square Root Function Block (MATSQRT)...........................................................13-22
13.4 LOGIC MATRIX FUNCTION BLOCKS ..................................................................................13-24
13.4.1 Matrix AND, OR, XOR Function Blocks (MAT_AND, MAT_OR, MAT_XOR) .........13-24
13.4.2 Matrix NOT Function Block (MAT_NOT) ......................................................................13-27
13.5 FAN IN/OUT FUNCTION BLOCKS.........................................................................................13-29
13.5.1 Boolean Fan-In Function Block (BFAN_IN) ....................................................................13-29
13.5.2 Array Fan-In Function Block (AFAN_IN) ........................................................................13-30
13.5.3 Matrix Fan-Out Function Block (FAN_OUT) ..................................................................13-31
13.6 INDEX CHECK FUNCTION BLOCK (INDXCHK) ................................................................13-32

14.0 DATA QUALITY FUNCTION BLOCKS.......................................................................................14-1


14.1 QUALITY CHECK FUNCTION BLOCK (QUAL_CK) ............................................................14-2
14.2 BASIC QUALITY FUNCTION BLOCK (QUALBAS)..............................................................14-3
14.3 SET QUALITY FUNCTION BLOCK (SET_QUAL) .................................................................14-4

15.0 CHART FUNCTION BLOCKS........................................................................................................15-1


15.1 CHART MODE FUNCTION BLOCK (CHRTMOD).................................................................15-2
15.2 CHART DATA FUNCTION BLOCK (CHRTDTA)...................................................................15-6

16.0 RESOURCE BLOCKS ......................................................................................................................16-1


16.1 ERROR LOG FUNCTION BLOCK (ERR_LOG) ......................................................................16-2
16.2 ERROR STATUS FUNCTION BLOCK (ERRSTAT)................................................................16-6
16.3 MEMORY STATISTICS FUNCTION BLOCK (MEMSTAT) ..................................................16-9
16.4 PARTIAL I/O SCAN FUNCTION BLOCK (PART_IO)..........................................................16-11
16.5 REAL-TIME CLOCK BLOCK (RTC) .......................................................................................16-13
16.6 REDUNDANCY CONTROL BLOCK (REDCTRL) ................................................................16-14
16.7 RESOURCE STATUS BLOCK (RSCSTAT)............................................................................16-16
16.8 SECURITY CONTROL BLOCK (SECURTY).........................................................................16-19
16.9 TIME SYNCHRONIZATION FUNCTION BLOCK (TIMESYNC)........................................16-21
16.10 TOTAL I/O SCAN FUNCTION BLOCK (TOT_IO)................................................................16-27
16.11 MODULE INFORMATION FUNCTION BLOCK (MODINFO) ............................................16-32
16.12 SYSTEM INFORMATION FUNCTION BLOCK (SYSINFO) ..............................................16-36
16.13 RESOURCE ALARM FUNCTION BLOCK (RSCALRM).....................................................16-38
16.14 CLOCK FUNCTION BLOCK (CLOCK) .................................................................................16-40

17.0 HOLD FUNCTION BLOCKS (HLD****) ...................................................................................17-1

iv June 2000
CG39-22A CONTENTS

TABLE OF CONTENTS
(Continued)

SECTION AND TITLE PAGE

18.0 STRING FUNCTION BLOCKS.......................................................................................................18-1


18.1 STRING LENGTH BLOCK (LEN)..............................................................................................18-2
18.2 LEFTMOST CHARACTERS OF STRING BLOCK (LEFT).....................................................18-3
18.3 RIGHTMOST CHARACTERS OF STRING BLOCK (RIGHT) ...............................................18-4
18.4 MIDDLE CHARACTERS OF STRING BLOCK (MID) ............................................................18-5
18.5 CONCATENATE STRING CHARACTERS BLOCK (CONCAT) ...........................................18-6
18.6 INSERT CHARACTERS INTO STRING BLOCK (INSERT)...................................................18-7
18.7 DELETE CHARACTERS IN A STRING BLOCK (DELETE) ..................................................18-8
18.8 REPLACE STRING CHARACTERS BLOCK (REPLACE)......................................................18-9
18.9 FIND STRING CHARACTERS BLOCK (FIND) .....................................................................18-10
18.10 MAKE APACS PATH BLOCK (PATHMAK)..........................................................................18-11
18.11 APACS PATH SPLIT BLOCK (PATHSPL) .............................................................................18-12

19.0 DIAGNOSTIC FUNCTION BLOCKS............................................................................................19-1


19.1 GTTIME BLOCK (GTTIME).......................................................................................................19-2
19.2 MEMREAD BLOCK (MEM_READ) ..........................................................................................19-3
19.3 MEMSTAT BLOCK (MEM_STAT) ...........................................................................................19-4

LIST OF FIGURES

FIGURE AND TITLE PAGE

2-1 Typical Function Block .......................................................................................................................2-1


2-2 Data Type Assignment Example.........................................................................................................2-2

13-1 Matrix Load Operation......................................................................................................................13-5


13-2 Matrix Unload Operation ..................................................................................................................13-7
13-3 First-In First-Out Operation............................................................................................................13-10
13-4 Last-In First-Out Operation ............................................................................................................13-12

15-1 CHRTMOD Function Block .............................................................................................................15-3

LIST OF TABLES

TABLE AND TITLE PAGE

1-1 TIC Contact Information .....................................................................................................................1-5

3-1 Programmer Function Block Switch States.......................................................................................3-37


3-2 Loop Status Word Logic States.........................................................................................................3-74

June 2000 v
CONTENTS CG39-22A

LIST OF TABLES
(Continued)

TABLE AND TITLE PAGE

7-1 Conversion Between Data Types (Part 1).........................................................................................7-24


7-1 Conversion Between Data Types (Part 2).........................................................................................7-25

8-1 Behavior of Elements Directly Connected to a Disabled MOVE Block.............................................8-3

12-1 Status and CMD Table ......................................................................................................................12-5

16-1 Status Output Diagnostic Messages................................................................................................16-23


16-2 Track Output Messages ..................................................................................................................16-25
16-3 Resource Alarms..............................................................................................................................16-39
16-4 Resource Alarm Block Soft List Parameters ..................................................................................16-41

SIGNIFICANT CHANGES FOR REV: 7

The significant changes for revision 7 of this document are listed as follows. Changes are indicated by change
bars located in the page margins adjacent to changed text.

SECTION AND DESCRIPTION

8.0 MOVE FUNCTION BLOCKS – The descriptions of the MOVE function blocks, Data Move
(MOVE), Set Value (SET_VAL), and Set Bit (SET_BIT) blocks, have been updated.

Siemens Moore Process 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.

APACS+ and QUADLOG are trademarks of Siemens Moore Process Automation, Inc. All other trademarks are the property of
the respective owners.

8 Copyright 2000 Siemens Moore Process Automation, Inc. All rights reserved.

vi June 2000
CG39-22A MOVE FUNCTION BLOCKS

8.0 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:

C Data Move
C Set Value
C Set Bit

June 2000 8-1


MOVE FUNCTION BLOCKS CG39-22A

8.1 DATA MOVE FUNCTION BLOCK (MOVE)

MOVE
BOOL EN ENO BOOL
ANY IN01 OUT01 ANY
ANY IN02 OUT02 ANY
: : : :
ANY IN15 OUT15 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 maximum of 15
input/output pairings.

The enable output (ENO) is TRUE whenever the EN input value is TRUE. The enable output (ENO) 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.

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, because 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.

8-2 June 2000


CG39-22A MOVE FUNCTION BLOCKS

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.

Soft List Parameters

There are no soft list parameters for this block.

June 2000 8-3


MOVE FUNCTION BLOCKS CG39-22A

8.2 SET VALUE FUNCTION BLOCK (SET_VAL)

SET_VAL
BOOL EN ERROR BOOL
STRING DEST OUT ANY
ANY DATA

The symbol of the Set Value (SET_VAL) function block is shown above. This block has the following
purposes:

• Transfers data from one variable to another when the EN input value is TRUE.

• Forwards the value of the variable addressed by the DEST input value to the output.

The data types of the DATA value and OUT value, and the variable addressed by DEST value, must match.
The DEST input value must be a string constant, not a string variable. The SET_VAL block does not retain
the data values, merely transfers them.

This block is limited to transferring and reading values 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_VAL block resides.

Inputs and Outputs

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 value.

DATA The ANY type input to be written to the variable identified in the DEST input.

NOTE

If this input is not connected, it defaults to a value of zero.

ERROR The boolean output that is TRUE if the block cannot execute correctly.

8-4 June 2000


CG39-22A MOVE FUNCTION BLOCKS

OUT The output that provides the value of the defined at the input at all times, regardless of the
EN input value. 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.

Soft List Parameters

There are no soft list parameters for this block.

June 2000 8-5


MOVE FUNCTION BLOCKS CG39-22A

8.3 SET BIT FUNCTION BLOCK (SET_BIT)

SET_BIT

BOOL EN ERROR BOOL


STRING DEST W_OUT WORD
BOOL DATA B_OUT BOOL
INT BIT_n

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.

8-6 June 2000


CG39-22A MOVE FUNCTION BLOCKS

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 The current output value of the bit (determined by the BIT_n input) of the Destination
WORD variable.

Soft List Parameters

There are no soft list parameters for this block.

June 2000 8-7


MOVE FUNCTION BLOCKS CG39-22A

8-8 June 2000

You might also like