1755-RM002A-EN-P, RSLogix Guard 1200 and 2000

RSLogix Guard 1200
and 2000
Programming
Software
1754-PCS, 1755-PCS
Function Block Reference
Manual
Important User Information
Because of the variety of uses for the products described in this
publication, those responsible for the application and use of this
control equipment must satisfy themselves that all necessary steps
have been taken to assure that each application and use meets all
performance and safety requirements, including any applicable laws,
regulations, codes and standards.
The illustrations, charts, sample programs and layout examples shown
in this guide are intended solely for purposes of example. Since there
are many variables and requirements associated with any particular
installation, Allen-Bradley does not assume responsibility or liability
(to include intellectual property liability) for actual use based upon
the examples shown in this publication.
Allen-Bradley publication SGI-1.1, Safety Guidelines for the
Application, Installation and Maintenance of Solid-State Control
(available from your local Allen-Bradley office), describes some
important differences between solid-state equipment and
electromechanical devices that should be taken into consideration
when applying products such as those described in this publication.
Reproduction of the contents of this copyrighted publication, in whole
or part, without written permission of Rockwell Automation, is
prohibited.
Throughout this manual we use notes to make you aware of safety
considerations:
ATTENTION
!
Identifies information about practices or
circumstances that can lead to personal injury or
death, property damage or economic loss
Attention statements help you to:
• identify a hazard
• avoid a hazard
• recognize the consequences
IMPORTANT
Identifies information that is critical for successful
application and understanding of the product.
Allen-Bradley, GuardPLC and RSLogix Guard are trademarks of Rockwell Automation.
Rockwell Automation
Support
Rockwell Automation offers support services worldwide, with over 75
sales/support offices, 512 authorized distributors and 260 authorized
systems integrators located throughout the United States alone, as
well as Rockwell Automation representatives in every major country
in the world.
Local Product Support
Contact your local Rockwell Automation representative for:
• sales and order support
• product technical training
• warranty support
• support service agreements
Technical Product Assistance
If you need to contact Rockwell Automation for technical assistance,
please review the troubleshooting information first. If the problem
persists, then call your local Rockwell Automation representative.
Your Questions or Comments on this Manual
If you find a problem with this manual, please notify us of it on the
enclosed How Are We Doing? form.
Notes:
Preface
Introduction
This manual is one of several GuardPLCTM instruction documents.
Task/Goal:
Documents:
Publication No.:
Install the GuardPLC 1200 Controller
GuardPLC 1200 Installation Instructions
1754-IN001A-EN-P
Install the GuardPLC 2000 Controller
GuardPLC 2000 Controller Installation Instructions
1755-IN002A-EN-P
Install the GuardPLC 2000 I/O Chassis
GuardPLC 2000 Chassis Installation Instructions
1755-IN001A-EN-P
Install the GuardPLC 2000 Power Supply
GuardPLC 2000 Power Supply Installation
Instructions
1755-IN007A-EN-P
Install GuardPLC 2000 I/O Modules
GuardPLC 2000 Digital I/O Module Installation
Instructions
1755-IN003A-EN-P
GuardPLC 2000 Analog Input Module Installation
Instructions
1755-IN004A-EN-P
GuardPLC 2000 Analog Output Module Installation 1755-IN005A-EN-P
Instructions
GuardPLC 2000 High Speed Counter Module
Installation Instructions
1755-IN006A-EN-P
Program GuardPLC controllers using RSLogix
Guard Programming Software
GuardPLC 1200 and 2000 Controller User Manual
1755-UM001A-EN-P
Reference details about the function blocks
available in RSLogixTM Guard Programming
Software
RSLogix Guard 1200 and 2000 Function Block
Reference Manual
1755-RM002A-EN-P
GuardPLC Safety Reference Manual
1755-RM001A-EN-P
You are here
Reference safety information on GuardPLC
controllers
1
Publication 1755-RM002A-EN-P - July 2001
Preface
2
Purpose of This Manual
This manual provides a programmer with details about each available
function block for a GuardPLC controller:
•
•
•
•
•
Description of each function block
Input(s) for the block
Data type assigned to each input
Output for the block
Data type assigned to the output
When using extendable function blocks, please be aware of the
locations and priority of the inputs, as shown in the following
example:
Input 1
Output
Input 2
Input 3
Input 4
Input 5
Input 6
General conversion rules that apply in RSLogix Guard are explained in
Appendix A. Information about the enable-out (ENO) behavior of
each block is contained in Appendix B.
You should already be familiar with how the GuardPLC controller
stores and processes data. See GuardPLC 1200 and 2000 Controller
User Manual, publication 1755-UM001A-EN-P for this information.
Conventions Used in this
Manual
Set and clear
This manual uses set and clear to define the status of bits (booleans)
and values (non-booleans):
Publication 1755-RM002A-EN-P - July 2001
This term:
Means:
set
the bit is set to 1 (ON)
a value is set to any non-zero number
clear
the bit is set to 0 (OFF)
all the bits in a value are cleared to zero
Preface
Function Block Locator
3
Use this locator to find the reference details about these function
blocks.
Block:
Type:
Location:
ABS
Numeric block
5-1
ADD
Numeric block
5-2
AND
Bit block
1-1
AtoBOOL
Convert block
6-2
AtoBYTE
Convert block
6-3
AtoDINT
Convert block
6-3
AtoDWORD
Convert block
6-3
AtoINT
Convert block
6-4
AtoREAL
Convert block
6-4
AtoSINT
Convert block
6-4
AtoUDINT
Convert block
6-5
AtoUINT
Convert block
6-5
AtoUSINT
Convert block
6-5
AtoWORD
Convert block
6-6
CHS
Numeric block
5-2
CTD
Counter block
3-2
CTU
Counter block
3-2
CTUD
Counter block
3-3
DIV
Numeric block
5-2
EQ
Compare block
4-1
F_TRIG
Bistable block
2-2
GE
Compare block
4-2
GT
Compare block
4-2
LE
Compare block
4-2
LT
Compare block
4-3
LIMIT
Select block
3-3
MAX
Select block
3-4
MIN
Select block
3-4
MOD
Numeric block
5-3
MUL
Numeric block
5-3
continued on next page
Publication 1755-RM002A-EN-P - July 2001
Preface
4
Publication 1755-RM002A-EN-P - July 2001
Block:
Type:
Location:
MUX_DI
Select block
3-4
MUX_I
Select block
3-5
MUX_SI
Select block
3-5
MUX_UD
Select block
3-6
MUX_UI
Select block
3-6
MUX_US
Select block
3-7
NE
Compare block
4-3
NOT
Bit block
1-2
OR
Bit block
1-2
R_TRIG
Bistable block
2-2
ROL
Bit block
1-2
ROR
Bit block
1-3
RS
Bistable block
2-2
SEL
Select block
3-7
SEMA
Bistable block
2-3
SHL
Bit block
1-3
SQRT
Numeric block
5-3
SHR
Bit block
1-3
SUB
Numeric block
5-4
SR
Bistable block
2-3
TOF
Timer block
2-4
TON
Timer block
2-4
TP
Timer block
2-5
XOR
Bit block
1-4
Table of Contents
Chapter 1
Bit Blocks
(AND, NOT, OR, ROL, ROR, SHL,
SHR, XOR)
Introduction . . . . . . . . . . . .
Bitwise AND (AND) . . . . . .
Bitwise NOT (NOT) . . . . . .
Bitwise OR (OR) . . . . . . . . .
Bit Rotate Left (ROL) . . . . . .
Bit Rotate Right (ROR). . . . .
Bit Shift Left (SHL) . . . . . . .
Bit Shift Right (SHR) . . . . . .
Bitwise Exclusive OR (XOR)
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
1-1
1-1
1-2
1-2
1-2
1-3
1-3
1-3
1-4
Introduction . . . . . . . . . . . . . . .
Bistable Blocks . . . . . . . . . .
Timer Blocks . . . . . . . . . . . .
Falling Edge Detector (F_TRIG) .
Rising Edge Detector (R_TRIG) .
Reset/Set (RS) . . . . . . . . . . . . . .
SEMA . . . . . . . . . . . . . . . . . . . .
Set/Reset (SR) . . . . . . . . . . . . . .
Timer Off Delay (TOF) . . . . . . .
Timer On Delay (TON) . . . . . . .
Pulse Generator (TP). . . . . . . . .
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
2-1
2-1
2-1
2-2
2-2
2-2
2-3
2-3
2-4
2-4
2-5
Counter/Select Blocks
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Counter Blocks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
(CTD, CTU, CTUD, LIMIT, MAX,
Select Blocks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
MIN, MUX_DI, MUX_I, MUX_SI,
MUX_UD, MUX_UI, MUX_US, SEL) Count Down (CTD). . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3-1
3-1
3-1
3-2
3-2
3-3
3-3
3-4
3-4
3-4
3-5
3-5
3-6
3-6
3-7
3-7
Chapter 2
Bistable/Timer Blocks
(F_TRIG, R_TRIG, RS, SEMA, SR,
TOF, TON, TP)
Chapter 3
Count Up (CTU) . . . . . . .
Count Up/Down (CTUD)
Limit (LIMIT). . . . . . . . . .
Maximum (MAX). . . . . . .
Minimum (MIN) . . . . . . .
Multiplexer (MUX_DI). . .
Multiplexer (MUX_I) . . . .
Multiplexer (MUX_SI) . . .
Multiplexer (MUX_UD) . .
Multiplexer (MUX_UI) . . .
Multiplexer (MUX_US) . .
Select (SEL). . . . . . . . . . .
i
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
Publication 1755-RM002A-EN-P - July 2001
Table of Contents
ii
Chapter 4
Compare Blocks
(EQ, GE, GT, LE, LT, NE)
Introduction . . . . . . . . . . . . .
Equal to (EQ) . . . . . . . . . . . .
Greater than or Equal to (GE)
Greater than (GT) . . . . . . . . .
Less than or Equal to (LE) . . .
Less than (LT) . . . . . . . . . . . .
Not Equal (NE) . . . . . . . . . . .
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
4-1
4-1
4-2
4-2
4-2
4-3
4-3
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
5-1
5-1
5-2
5-2
5-2
5-3
5-3
5-3
5-4
Introduction . . . . . . . . . . . . . . . . .
Convert to BOOL (AtoBOOL) . . . .
Convert to BYTE (AtoBYTE) . . . . .
Convert to DINT (AtoDINT) . . . . .
Convert to DWORD (AtoDWORD).
Convert to INT (AtoINT) . . . . . . . .
Convert to REAL (AtoREAL) . . . . . .
Convert to SINT (AtoSINT) . . . . . .
Convert to UDINT (AtoUDINT) . . .
Convert to UINT (AtoUINT). . . . . .
Convert to USINT (AtoUSINT) . . . .
Convert to WORD (AtoWORD) . . .
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
6-1
6-2
6-3
6-3
6-3
6-4
6-4
6-4
6-5
6-5
6-5
6-6
Chapter 5
Numeric Blocks
(ABS, ADD, CHS, DIV, MOD, MUL,
SQRT, SUB)
Introduction . . . . . . .
Absolute Value (ABS)
Add (ADD) . . . . . . . .
Change Sign (CHS) . .
Divide (DIV). . . . . . .
Modulo (MOD) . . . . .
Multiply (MUL) . . . . .
Square Root (SQRT) .
Subtract (SUB) . . . . .
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
Chapter 6
Convert Blocks
(AtoBOOL, AtoBYTE, AtoDINT,
AtoDWORD, AtoINT, AtoREAL,
AtoSINT, AtoUDINT, AtoUINT,
AtoUSINT, AtoWORD)
Appendix A
Data Conversion Rules
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A-1
Data Conversion Rules . . . . . . . . . . . . . . . . . . . . . . . . . . . A-1
Appendix B
ENO Behavior of Blocks
Publication 1755-RM002A-EN-P - July 2001
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . B-1
ENO Behavior of Blocks . . . . . . . . . . . . . . . . . . . . . . . . . . B-1
Chapter
1
Bit Blocks
(AND, NOT, OR, ROL, ROR, SHL, SHR, XOR)
Introduction
Bitwise AND (AND)
Use the bit blocks to perform logical operations on bits or to move
bits. For information on the ENO behavior of these blocks see
Appendix B, ENO Behavior of Blocks.
If you want to:
Use this block:
See page:
Perform a bitwise AND operation
AND
1-1
Perform a bitwise NOT operation
NOT
1-2
Perform a bitwise OR operation
OR
1-2
Rotate bits to the left
ROL
1-2
Rotate bits to the right
ROR
1-3
Shift bits to the left
SHL
1-3
Shift bits to the right
SHR
1-3
Perform a bitwise exclusive OR operation
XOR
1-4
The AND block performs a bitwise AND operation using all values
connected to the inputs and places the result in the output. The AND
block can be extended down to support 2 throughn inputs (wheren
<= 16).
Function
Parameter
Data Type
Description
Input
IN1
ANY_BIT
Value to AND with all other inputs
IN2
ANY_BIT
Value to AND with all other inputs
INn
ANY_BIT
Value to AND with all other inputs
OUT1
ANY_BIT
Result of the operation
Output
1
Publication 1755-RM002A-EN-P - July 2001
1-2
Bit Blocks (AND, NOT, OR, ROL, ROR, SHL, SHR, XOR)
Bitwise NOT (NOT)
Bitwise OR (OR)
The NOT block forms a bitwise complement of the input and places
the result in the output.
Function
Parameter
Data Type
Description
Input
IN1
ANY_BIT
Value to NOT
Output
OUT1
ANY_BIT
Result of the operation
The OR block performs a bitwise OR operation using all values
connected to the inputs and places the result in the output. The OR
block can be extended down to support 2 throughn inputs (wheren
is <= 16).
Function
Parameter
Data Type
Description
Input
IN1
ANY_BIT
Value to OR with all other inputs
IN2
ANY_BIT
Value to OR with all other inputs
INn
ANY_BIT
Value to OR with all other inputs
OUT1
ANY_BIT
Result of the operation
Output
Bit Rotate Left (ROL)
The ROL block rotates the bits in input value IN bitwise to the left by
the value set in N. The bits that are shifted out at the left edge are
dragged in at the right edge. The result of the shift is placed in OUT1.
Function
Parameter
Data Type
Description
Input
IN
ANY_BIT
Value containing the bits to rotate
N
INT
Number of bits to rotate to the left
OUT1
ANY_BIT
Value containing rotated bits
Output
Publication 1755-RM002A-EN-P - July 2001
Bit Blocks (AND, NOT, OR, ROL, ROR, SHL, SHR, XOR)
Bit Rotate Right (ROR)
The ROR block rotates the bits in input value IN bitwise to the right by
the value set in N. The bits that are shifted out at the right edge are
dragged in at the left edge. The result of the shift is placed in OUT1.
Function
Parameter
Data Type
Description
Input
IN
ANY_BIT
Value containing the bits to rotate
N
INT
Number of bits to rotate to the right
OUT1
ANY_BIT
Value containing rotated bits
Output
Bit Shift Left (SHL)
The SHL block shifts the bits in input value IN bitwise to the left by
the value set in N, then places the result in the output. The cleared
bits are filled with 0.
Function
Parameter
Data Type
Description
Input
IN
ANY_BIT
Value containing the bits to shift
N
INT
Number of bits to shift to the left
OUT1
ANY_BIT
Value containing shifted bits
Output
Bit Shift Right (SHR)
1-3
The SHR block shifts the bits in input value IN bitwise to the right by
the value set in N, then places the result in the output. The cleared
bits are filled with 0.
Function
Parameter
Data Type
Description
Input
IN
ANY_BIT
Value containing the bits to shift
N
INT
Number of bits to shift to the right
OUT1
ANY_BIT
Value containing shifted bits
Output
Publication 1755-RM002A-EN-P - July 2001
1-4
Bit Blocks (AND, NOT, OR, ROL, ROR, SHL, SHR, XOR)
Bitwise Exclusive OR (XOR)
The XOR block performs a bitwise Exclusive OR operation using all
values connected to the inputs and places the result in the output. The
XOR block can be extended down to support 2 throughn inputs
(wheren <= 16).
Function
Parameter
Data Type
Description
Input
IN1
ANY_BIT
Value to XOR with all other inputs
IN2
ANY_BIT
Value to XOR with all other inputs
INn
ANY_BIT
Value to XOR with all other inputs
OUT1
ANY_BIT
Result of the operation
Output
Publication 1755-RM002A-EN-P - July 2001
Chapter
2
Bistable/Timer Blocks
(F_TRIG, R_TRIG, RS, SEMA, SR, TOF, TON, TP)
Introduction
Use bistable blocks to control the status of bits (e.g., edge detection,
seal-in). For information on the ENO behavior of these blocks see
Appendix B, ENO Behavior of Blocks.
Bistable Blocks
If you want to:
Use this block: See page:
Set a bit for one cycle each time the input bit is cleared
(one shot falling)
F_TRIG
2-2
Set a bit for one cycle each time the input bit is set
(one shot rising)
R_TRIG
2-2
Set/reset a bit with the RESET input dominant
RS
2-2
Set/reset witht one cycle delay before setting output
SEMA
2-3
Set/reset a bit with the SET input dominant
SR
2-3
Use timer blocks to control operations based on time. For information
on the ENO behavior of these blocks see Appendix B, ENO Behavior
of Blocks.
Timer Blocks
1
If you want to:
Use this block: See page:
Set a timer off delay
TOF
2-4
Set a timer on delay
TON
2-4
Generate a pulse to set a bit for a preset time
TP
2-5
Publication 1755-RM002A-EN-P - July 2001
2-2
Bistable/Timer Blocks (F_TRIG, R_TRIG, RS, SEMA, SR, TOF, TON, TP)
Falling Edge Detector
(F_TRIG)
Rising Edge Detector
(R_TRIG)
Reset/Set (RS)
The F_TRIG block sets output Q for one cycle when input CLK
toggles from set to cleared (i.e., a falling edge is detected at input
CLK).
Function
Parameter
Data Type
Description
Input
CLK
BOOL
Input bit
Output
Q
BOOL
Output bit
The R_TRIG block sets output Q for one cycle when input CLK
toggles from cleared to set (i.e., a rising edge is detected at input
CLK).
Function
Parameter
Data Type
Description
Input
CLK
BOOL
Input bit
Output
Q
BOOL
Output bit
The RS block uses input S to set the value of output Q1. Input R1
resets output Q1. R1 indicates that the RESET-input is dominant. See
also SR block.
Function
Parameter
Data Type
Description
Input
S
BOOL
Bit that sets the output
R1
BOOL
Bit that resets the output
This input is dominant
Q1
BOOL
Output bit
Output
Publication 1755-RM002A-EN-P - July 2001
Bistable/Timer Blocks (F_TRIG, R_TRIG, RS, SEMA, SR, TOF, TON, TP)
2-3
SEMA
If the input CLAIM is set, in the next cycle the output BUSY is set. If
the input RELEASE is eventually set, output BUSY is reset to 0.
Function
Parameter
Data Type
Input
CLAIM
BOOL
RELEASE
BOOL
BUSY
BOOL
Output
Set/Reset (SR)
The SR block uses input S1 to set the value of output Q1. Input R
resets output Q1. S1 indicates that the SET-input is dominant. See also
RS block.
Function
Parameter
Data Type
Description
Input
S1
BOOL
Bit that sets the output
This input is dominant
R
BOOL
Bit that resets the output
Q1
BOOL
Output bit
Output
Publication 1755-RM002A-EN-P - July 2001
2-4
Bistable/Timer Blocks (F_TRIG, R_TRIG, RS, SEMA, SR, TOF, TON, TP)
Timer Off Delay (TOF)
This is a Timer Off Delay. Output Q is cleared after turning off input
IN, only after the delay period set at input PT elapses.
Function
Parameter
Data Type
Description
Input
IN
BOOL
Input that when cleared starts the
timer
PT
TIME
Delay period
Specifies the value which ET must
reach before clearing the output bit
Q
BOOL
This bit is cleared after the delay
period elapses
ET
TIME
Elapsed time
Output
Timer On Delay (TON)
This is a Timer On Delay. Output Q is set after turning on input IN,
only after the delay period set at input PT elapses.
Function
Parameter
Data Type
Description
Input
IN
BOOL
Input that when set starts the timer
PT
TIME
Delay period
Specifies the value which ET must
reach before putting through the
output bit
Q
BOOL
This bit is set after the delay period
elapses
ET
TIME
Elapsed time
Output
Publication 1755-RM002A-EN-P - July 2001
Bistable/Timer Blocks (F_TRIG, R_TRIG, RS, SEMA, SR, TOF, TON, TP)
Pulse Generator (TP)
2-5
The TP block generates a pulse when input IN is set. Input PT
specifies the length of the pulse. When input IN is set, output Q is set
for the time period defined by PT. The value in ET is kept as long as
input IN is set.
Function
Parameter
Data Type
Description
Input
IN
BOOL
Generates a pulse and sets the
output bit for the time specified in PT
PT
TIME
Specifies the length of the pulse
Q
BOOL
This bit is set for the length of the
pulse
ET
TIME
Counts the time as long as input IN
is set
Output
Publication 1755-RM002A-EN-P - July 2001
2-6
Bistable/Timer Blocks (F_TRIG, R_TRIG, RS, SEMA, SR, TOF, TON, TP)
Notes:
Publication 1755-RM002A-EN-P - July 2001
Chapter
3
Counter/Select Blocks
(CTD, CTU, CTUD, LIMIT, MAX, MIN, MUX_DI,
MUX_I, MUX_SI, MUX_UD, MUX_UI, MUX_US,
SEL)
Introduction
Counter blocks control operations based on the number of events.
Counter Blocks
If you want to:
Use this block:
See page:
Count down
CTD
3-2
Count up
CTU
3-2
Count up and down
CTUD
3-3
Select blocks select from a number of inputs.
Select Blocks
If you want to:
Use this block:
See page:
Limit the value of an input
LIMIT
3-3
Select the maximum of inputs
MAX
3-4
Select the minimum of inputs
MIN
3-4
Select from three or more inputs using a DINT value
MUX_DI
3-4
Select from three or more inputs using a INT value
MUX_I
3-5
Select from three or more inputs using a SINT value
MUX_SI
3-5
Select from three or more inputs using a UDINT
value
MUX_UD
3-6
Select from three or more inputs using a UINT value
MUX_UI
3-6
Select from three or more inputs using a USINT
value
MUX_US
3-7
Select one of two inputs
SEL
3-7
For information on the ENO behavior of counter or select blocks see
Appendix B, ENO Behavior of Blocks.
1
Publication 1755-RM002A-EN-P - July 2001
3-2
Counter/Select Blocks (CTD, CTU, CTUD, LIMIT, MAX, MIN, MUX_DI, MUX_I, MUX_SI, MUX_UD, MUX_UI, MUX_US, SEL)
Count Down (CTD)
The CTD block counts downward. Input >CD decrements the counter
by one. Output Q is set when the counter value reaches or falls below
the preset value. Output CV is the current counter value of the block.
Input LD can set the counter to the preset value.
Function
Parameter
Data Type
Description
Input
>CD
BOOL
Counts down in increments of one
LD
BOOL
Sets counter (CV) to the preset value
PV
PV
INT
How low to count (preset value)
Q
BOOL
Bit set when counter reaches or falls
below PV
CV
INT
Current counter value
Output
Count Up (CTU)
The CTU block counts upward. Input >CU increments the counter by
one. Output Q is set when the counter reaches or exceeds the preset
value. Input R resets the counter (CV) to 0.
Function
Parameter
Data Type
Description
Input
>CU
BOOL
Counts up in increments of one
R
BOOL
Resets counter to 0
PV
INT
How high to count (preset value)
Q
BOOL
Bit set when counter reaches or
exceeds PV
CV
INT
Current counter value
Output
Publication 1755-RM002A-EN-P - July 2001
Counter/Select Blocks (CTD, CTU, CTUD, LIMIT, MAX, MIN, MUX_DI, MUX_I, MUX_SI, MUX_UD, MUX_UI, MUX_US, SEL)
Count Up/Down (CTUD)
The CTUD block counts up and down. Input >CD decrements the
counter by one and input >CU increments by one. Output QU is set
when the counter reaches or exceeds the preset value. Output QD is
set when the counter reaches or falls below 0. Input R resets the
counter value to 0. Input LD sets the counter to the preset value.
Function
Parameter
Data Type
Description
Input
>CU
BOOL
Counts up in increments of one
>CD
BOOL
Counts down in increments of one
R
BOOL
Resets counter to 0
LD
BOOL
Sets counter to preset value (PV)
PV
INT
How high to count (preset value)
QU
BOOL
Set when counter reaches or exceeds
preset value
QD
BOOL
Set when counter reaches or falls
below 0
CV
INT
Current counter value
Output
Limit (LIMIT)
3-3
The LIMIT block limits an input between two values. If IN is higher
than the high limit, the high limit is placed in the output. If IN is lower
than low limit, the low limit is placed in the output. IN is placed in the
output if it is between the high and low limits.
Function
Parameter
Data Type
Description
Input
MN
ANY
Low limit for the input
IN
ANY
Value to test against limits
MX
ANY
High limit for the input
OUT1
ANY
Output
Output
Publication 1755-RM002A-EN-P - July 2001
3-4
Counter/Select Blocks (CTD, CTU, CTUD, LIMIT, MAX, MIN, MUX_DI, MUX_I, MUX_SI, MUX_UD, MUX_UI, MUX_US, SEL)
Maximum (MAX)
The MAX block takes the maximum of all values connected to the
inputs and places it in the output. The MAX block can be extended
down to support 2 throughn inputs (wheren <= 16).
Function
Parameter
Data Type
Description
Input
IN1
ANY
Input value
IN2
ANY
Input value
INn
ANY
Input value
OUT1
ANY
Maximum of all input values
Output
Minimum (MIN)
The MIN block takes the minimum of all values connected to the
inputs and places it in the output. The MIN block can be extended
down to support 2 throughn inputs (wheren <= 16).
Function
Parameter
Data Type
Description
Input
IN1
ANY
Input value
IN2
ANY
Input value
INn
ANY
Input value
OUT1
ANYNUM
Minimum of all input values
Output
Multiplexer (MUX_DI)
The MUX_DI block selects an input from all connected inputs based
on the DINT value of input K. If K=0, IN1 is placed in the output. If
K=1, IN2 is placed in the output. If K=2, IN3 is placed in the output,
etc. The MUX_DI block can be extended down to support 2 through
n inputs (wheren <= 16).
Function
Parameter
Data Type
Description
Input
K
DINT
Value used to select the input
IN1
ANY
Input value
IN2
ANY
Input value
INn
ANY
Input value
OUT1
ANY
Selected input
Output
Publication 1755-RM002A-EN-P - July 2001
Counter/Select Blocks (CTD, CTU, CTUD, LIMIT, MAX, MIN, MUX_DI, MUX_I, MUX_SI, MUX_UD, MUX_UI, MUX_US, SEL)
Multiplexer (MUX_I)
The MUX_I block selects an input from all connected inputs based on
the INT value of input K. If K=0, IN1 is placed in the output. If K=1,
IN2 is placed in the output. If K=2, IN3 is placed in the output, etc.
The MUX_I block can be extended down to support 2 throughn
inputs (wheren <= 16).
Function
Parameter
Data Type
Description
Input
K
INT
Value used to select the input
IN1
ANY
Input value
IN2
ANY
Input value
INn
ANY
Input value
OUT1
ANY
Selected input
Output
Multiplexer (MUX_SI)
3-5
The MUX_SI block selects an input from all connected inputs based
on the SINT value of input K. If K=0, IN1 is placed in the output. If
K=1, IN2 is placed in the output. If K=2, IN3 is placed in the output,
etc. The MUX_SI block can be extended down to support 2 throughn
inputs (wheren <= 16).
Function
Parameter
Data Type
Description
Input
K
SINT
Value used to select the input
IN1
ANY
Input value
IN2
ANY
Input value
INn
ANY
Input value
OUT1
ANY
Selected input
Output
Publication 1755-RM002A-EN-P - July 2001
3-6
Counter/Select Blocks (CTD, CTU, CTUD, LIMIT, MAX, MIN, MUX_DI, MUX_I, MUX_SI, MUX_UD, MUX_UI, MUX_US, SEL)
Multiplexer (MUX_UD)
The MUX_UD block selects an input from all connected inputs based
on the UDINT value of input K. If K=0, IN1 is placed in the output. If
K=1, IN2 is placed in the output. If K=2, IN3 is placed in the output,
etc. The MUX_UD block can be extended down to support 2 through
n inputs (wheren <= 16).
Function
Parameter
Data Type
Description
Input
K
UDINT
Value used to select the input
IN1
ANY
Input value
IN2
ANY
Input value
INn
ANY
Input value
OUT1
ANY
Selected input
Output
Multiplexer (MUX_UI)
The MUX_UI block selects an input from all connected inputs based
on the UINT value of input K. If K=0, IN1 is placed in the output. If
K=1, IN2 is placed in the output. If K=2, IN3 is placed in the output,
etc. The MUX_UI block can be extended down to support 2 through
n inputs (wheren <= 16).
Function
Parameter
Data Type
Description
Input
K
UINT
Value used to select the input
IN1
ANY
Input value
IN2
ANY
Input value
INn
ANY
Input value
OUT1
ANY
Selected input
Output
Publication 1755-RM002A-EN-P - July 2001
Counter/Select Blocks (CTD, CTU, CTUD, LIMIT, MAX, MIN, MUX_DI, MUX_I, MUX_SI, MUX_UD, MUX_UI, MUX_US, SEL)
Multiplexer (MUX_US)
The MUX_US block selects an input from all connected inputs based
on the USINT value of input K. If K=0, IN1 is placed in the output. If
K=1, IN2 is placed in the output. If K=2, IN3 is placed in the output,
etc. The MUX_US block can be extended down to support 2 through
n inputs (wheren <= 16).
Function
Parameter
Data Type
Description
Input
K
USINT
Value used to select the input
IN1
ANY
Input value
IN2
ANY
Input value
INn
ANY
Input value
OUT1
ANY
Selected input
Output
Select (SEL)
3-7
The SEL block uses the value of input G to select one of two inputs. If
G=0, IN0 is placed in the output. If G=1, IN1 is placed in the output.
Function
Parameter
Data Type
Description
Input
G
BOOL
Value used to select the input
IN0
ANY
Input value
IN1
ANY
Input value
OUT1
ANY
Selected input
Output
Publication 1755-RM002A-EN-P - July 2001
3-8
Counter/Select Blocks (CTD, CTU, CTUD, LIMIT, MAX, MIN, MUX_DI, MUX_I, MUX_SI, MUX_UD, MUX_UI, MUX_US, SEL)
Notes:
Publication 1755-RM002A-EN-P - July 2001
Chapter
4
Compare Blocks
(EQ, GE, GT, LE, LT, NE)
Introduction
Equal to (EQ)
The compare blocks let you compare values. For information on the
ENO behavior of these blocks see Appendix B, ENO Behavior of
Blocks.
If you want to:
Use this block: See page:
Test whether two or more values are equal
EQ
4-1
Test in succession whether one value is greater than or
equal to a second value
GE
4-2
Test in succession whether one value is greater than a
second value
GT
4-2
Test in succession whether one value is less than or equal LE
to a second value
4-2
Test in succession whether one value is less than a
second value
LT
4-3
Test whether one value is not equal to a second value
NE
4-3
The EQ block tests whether all values connected to the inputs are
equal. The output is set if IN1=IN2 and IN2=IN3 and IN3=IN4 and so
on through INn-1=INn. The EQ block can be extended down to
support 2 through n inputs (where n≤16).
Function
Parameter
Data Type
Description
Input
IN1
ANY
Value to test against IN2
IN2
ANY
Value to test against INn
(next input)
INn
ANY
Last value to test
OUT1
BOOL
Output
Output
1
Publication 1755-RM002A-EN-P - July 2001
4-2
Compare Blocks (EQ, GE, GT, LE, LT, NE)
Greater than or Equal to
(GE)
The GE block tests whether IN1 is greater than or equal to IN2; IN2 is
greater than or equal to IN3; IN3 is greater than or equal to IN4. The
output is set if IN1≥IN2 and IN2≥IN3 and IN3≥IN4 and so on through
INn-1≥INn. The GE block can be extended down to support 2
through n inputs (where n≤16).
Function
Parameter
Data Type
Description
Input
IN1
ANY
Value to test against IN2
IN2
ANY
Value to test against INn
(next input)
INn
ANY
Last value to test
OUT1
BOOL
Output
Output
Greater than (GT)
The GT block tests whether IN1 is greater than IN2; IN2 is greater than
IN3; IN3 is greater than IN4. The output is set if IN1>IN2 and IN2>IN3
and IN3>IN4 and so on through INn-1>INn. The GT block can be
extended down to support 2 through n inputs (where n≤16).
Function
Parameter
Data Type
Description
Input
IN1
ANY
Value to test against IN2
IN2
ANY
Value to test against INn
(next input)
INn
ANY
Last value to text
OUT1
BOOL
Output
Output
Less than or Equal to (LE)
The LE block tests whether IN1 is less than or equal to IN2; IN2 is less
than or equal to IN3; IN3 is less than or equal to IN4. The output is set
if IN1≤IN2 and IN2≤IN3 and IN3≤IN4 and so on through INn-1≤INn.
The LE block can be extended down to support 2 through n inputs
(where n≤16).
Function
Parameter
Data Type
Description
Input
IN1
ANY
Value to test against IN2
IN2
ANY
Value to test against INn
(next input)
INn
ANY
Last value to test
OUT1
BOOL
Output
Output
Publication 1755-RM002A-EN-P - July 2001
Compare Blocks (EQ, GE, GT, LE, LT, NE)
Less than (LT)
The LT block tests whether IN1 is less than IN2; IN2 is less than IN3;
IN3 is less than INn. The output is set if IN1<IN2 and IN2<IN3 and
IN3<IN4 and so on through INn-1<INn. The LT block can be
extended down to support 2 through n inputs (where n≤16).
Function
Parameter
Data Type
Description
Input
IN1
ANY
Value to test against IN2
IN2
ANY
Value to test against INn (next
input)
INn
ANY
Last value to test
OUT1
BOOL
Output
Output
Not Equal (NE)
4-3
The NE block tests whether one value is not equal to a second value.
The output is set if IN1 is not equal (≠) to IN2. Only two values can be
compared.
Function
Parameter
Data Type
Description
Input
IN1
ANY
Value to test against IN2
IN2
ANY
Value to test against IN1
OUT1
BOOL
Output
Output
Publication 1755-RM002A-EN-P - July 2001
4-4
Compare Blocks (EQ, GE, GT, LE, LT, NE)
Notes:
Publication 1755-RM002A-EN-P - July 2001
Chapter
5
Numeric Blocks
(ABS, ADD, CHS, DIV, MOD, MUL, SQRT, SUB)
Introduction
Absolute Value (ABS)
1
The numeric blocks evaluate arithmetic operations using an
expression or a specific arithmetic block. For information on the ENO
behavior of these blocks see Appendix B, ENO Behavior of Blocks.
If you want to:
Use this block: See page:
Take the absolute value of a value
ABS
5-1
Add two or more values
ADD
5-2
Change the sign of the value
CHS
5-2
Divide two values
DIV
5-2
Determine the remainder after one value is divided by
another
MOD
5-3
Multiply two or more values
MUL
5-3
Calculate the square root of a value
SQRT
5-3
Subtract two values
SUB
5-4
The ABS block takes the absolute value of the input and places the
result in the output.
Function
Parameter
Data Type
Description
Input
IN1
ANY_NUM
Value of which to take the absolute
value
Output
OUT1
ANY_NUM
Absolute value of IN1
Publication 1755-RM002A-EN-P - July 2001
5-2
Numeric Blocks (ABS, ADD, CHS, DIV, MOD, MUL, SQRT, SUB)
Add (ADD)
The ADD block adds all connected input values and places the sum in
the output. The ADD block can be extended down to support 2
throughn inputs (wheren <= 16).
Function
Parameter
Data Type
Description
Input
IN1
ANY_NUM
Value to add
IN2
ANY_NUM
Value to add
INn
ANY_NUM
Value to add
OUT1
ANY_NUM
Sum of all inputs
Output
Change Sign (CHS)
Divide (DIV)
The CHS block changes the sign of the input and places the result in
the output.
Function
Parameter
Data Type
Description
Input
IN1
ANY_NUM
Value of which to change the sign
Output
OUT1
ANY_NUM
Result of the operation
The DIV block divides IN1 by IN 2 and places the result in OUT1.
Function
Parameter
Data Type
Description
Input
IN1
ANY_INT
Value of the dividend
IN2
ANY_INT
Value of the divisor
OUT1
ANY_INT
Result of the operation
Output
Publication 1755-RM002A-EN-P - July 2001
Numeric Blocks (ABS, ADD, CHS, DIV, MOD, MUL, SQRT, SUB)
Modulo (MOD)
The MOD block divides IN 1 by IN 2 and places the remainder in the
OUT1.
Function
Parameter
Data Type
Description
Input
IN1
ANY_NUM
Value of the dividend
IN2
ANY_NUM
Value of the divisor
OUT1
ANY_NUM
Remainder
Output
Multiply (MUL)
The MUL block multiplies all connected input values and places the
result in the output. The MUL block can be extended down to support
2 throughn inputs (wheren <= 16).
Function
Parameter
Data Type
Description
Input
IN1
ANY_NUM
Value to be multiplied
IN2
ANY_NUM
Value to be multiplied
INn
ANY_NUM
Value to be multiplied
OUT1
ANY_NUM
Result of the operation
Output
Square Root (SQRT)
5-3
The SQRT block computes the square root of the input and places the
result in the output.
Function
Parameter
Data Type
Description
Input
IN1
ANY_REAL
Value of which to find the square root
Output
OUT1
ANY_REAL
Square root of IN1
Publication 1755-RM002A-EN-P - July 2001
5-4
Numeric Blocks (ABS, ADD, CHS, DIV, MOD, MUL, SQRT, SUB)
Subtract (SUB)
The SUB block subtracts IN 2 from IN 1 and places the result in the
OUT1.
Function
Parameter
Data Type
Description
Input
IN1
ANY_NUM
Value from which to subtract IN2
IN2
ANY_NUM
Value to be subtracted from IN1
OUT1
ANY_NUM
Result of the operation
Output
Publication 1755-RM002A-EN-P - July 2001
Chapter
6
Convert Blocks
(AtoBOOL, AtoBYTE, AtoDINT, AtoDWORD, AtoINT,
AtoREAL, AtoSINT, AtoUDINT, AtoUINT, AtoUSINT,
AtoWORD)
Introduction
1
Use the convert blocks to convert values of one data type to another.
For a description of how the controller converts the data see Data
Conversion Rules, Appendix A. For information on the ENO behavior
of these blocks see Appendix B, ENO Behavior of Blocks.
If you want to:
Use this block: See page:
Convert a value to a BOOL data type
AtoBOOL
6-2
Convert a value to a BYTE data type
AtoBYTE
6-3
Convert a value to a DINT data type
AtoDINT
6-3
Convert a value to a DWORD data type
AtoDWORD
6-3
Convert a value to a INT data type
AtoINT
6-4
Convert a value to a REAL data type
AtoREAL
6-4
Convert a value to a SINT data type
AtoSINT
6-4
Convert a value to a UDINT data type
AtoUDINT
6-5
Convert a value to a UINT data type
AtoUINT
6-5
Convert a value to a USINT data type
AtoUSINT
6-5
Convert a value to a WORD data type
AtoWORD
6-6
Publication 1755-RM002A-EN-P - July 2001
6-2
Convert Blocks (AtoBOOL, AtoBYTE, AtoDINT, AtoDWORD, AtoINT, AtoREAL, AtoSINT, AtoUDINT, AtoUINT, AtoUSINT, AtoWORD)
Convert to BOOL (AtoBOOL)
The AtoBOOL block converts the input to a BOOL data type and
places the result in the output.
Function
Parameter
Data Type
Description
Input
IN1
ANY
Value to be converted
Output
OUT1
BOOL_REAL
Result of the conversion
The following table provides conversion information for each data
type.
Publication 1755-RM002A-EN-P - July 2001
Data Type Connected
to the Input:
This Input Value Clears
the Output:
This Input Value Sets the
Output:
BOOL
FALSE
TRUE
BYTE
0
every value other than 0
WORD
0
every value other than 0
DWORD
0
every value other than 0
LWORD
not supported
not supported
SINT
0
every value other than 0
INT
0
every value other than 0
DINT
0
every value other than 0
LINT
not supported
not supported
USINT
0
every value other than 0
UINT
0
every value other than 0
UDINT
0
every value other than 0
ULINT
not supported
not supported
REAL
0.0
every value other than 0.0
LREAL
not supported
not supported
TIME
T#0s
every value other than T#0s
TOD
TOD#0:0:0
every value other than
TOD#0:0:0(1)
DATE
DATE#0001-01-01
every value other than
DATE#0001-01-01(1)
DT
DT#0001-01-01-0:0:0
every value other than
DT#0001-01-0:0:0(1)
STRING
‘0’, ‘FALSE’
every value other than ‘0’,
‘FALSE’(1) (2)
(1)
Initial default value of this data type. As the default values of all other value types have been converted to
FALSE, these have also been converted.
(2)
“FALSE”, etc. is converted to TRUE.
Convert Blocks (AtoBOOL, AtoBYTE, AtoDINT, AtoDWORD, AtoINT, AtoREAL, AtoSINT, AtoUDINT, AtoUINT, AtoUSINT, AtoWORD)
Convert to BYTE (AtoBYTE)
6-3
The AtoBYTE block converts the input to a BYTE data type and places
the result in the output.
Function
Parameter
Data Type
Description
Input
IN1
ANY
Value to be converted
Output
OUT1
BYTE
Result of the conversion
If the data type connected to the input is BOOL and:
• its value is FALSE, 0 is placed in the output
• its value is TRUE, 1 is placed in the output
Convert to DINT (AtoDINT)
The AtoDINT block converts the input to a DINT data type and places
the result in the output.
Function
Parameter
Data Type
Description
Input
IN1
ANY
Value to be converted
Output
OUT1
DINT
Result of the conversion
If the data type connected to the input is BOOL and:
• its value is FALSE, 0 is placed in the output
• its value is TRUE, 1 is placed in the output
Convert to DWORD
(AtoDWORD)
The AtoDWORD block converts the input to a DWORD data type and
places the result in the output.
Function
Parameter
Data Type
Description
Input
IN1
ANY
Value to be converted
Output
OUT1
DWORD
Result of the conversion
If the data type connected to the input is BOOL and:
• its value is FALSE, 0 is placed in the output
• its value is TRUE, 1 is placed in the output
Publication 1755-RM002A-EN-P - July 2001
6-4
Convert Blocks (AtoBOOL, AtoBYTE, AtoDINT, AtoDWORD, AtoINT, AtoREAL, AtoSINT, AtoUDINT, AtoUINT, AtoUSINT, AtoWORD)
Convert to INT (AtoINT)
The AtoINT block converts the input to a INT data type and places the
result in the output.
Function
Parameter
Data Type
Description
Input
IN1
ANY
Value to be converted
Output
OUT1
INT
Result of the conversion
If the data type connected to the input is BOOL and:
• its value is FALSE, 0 is placed in the output
• its value is TRUE, 1 is placed in the output
Convert to REAL (AtoREAL)
The AtoREAL block converts the input to a REAL data type and places
the result in the output.
Function
Parameter
Data Type
Description
Input
IN1
ANY
Value to be converted
Output
OUT1
REAL
Result of the conversion
If the data type connected to the input is BOOL and:
• its value is FALSE, 0.0 is placed in the output
• its value is TRUE, 1.0 is placed in the output
Convert to SINT (AtoSINT)
The AtoSINT block converts the input to a SINT data type and places
the result in the output.
Function
Parameter
Data Type
Description
Input
IN1
ANY
Value to be converted
Output
OUT1
SINT
Result of the conversion
If the data type connected to the input is BOOL and:
• its value is FALSE, 0 is placed in the output
• its value is TRUE, 1 is placed in the output
Publication 1755-RM002A-EN-P - July 2001
Convert Blocks (AtoBOOL, AtoBYTE, AtoDINT, AtoDWORD, AtoINT, AtoREAL, AtoSINT, AtoUDINT, AtoUINT, AtoUSINT, AtoWORD)
Convert to UDINT
(AtoUDINT)
6-5
The AtoUDINT block converts the input to a UDINT data type and
places the result in the output.
Function
Parameter
Data Type
Description
Input
IN1
ANY
Value to be converted
Output
OUT1
UDINT
Result of the conversion
If the data type connected to the input is BOOL and:
• its value is FALSE, 0 is placed in the output
• its value is TRUE, 1 is placed in the output
Convert to UINT (AtoUINT)
The AtoUINT block converts the input to a UINT data type and places
the result in the output.
Function
Parameter
Data Type
Description
Input
IN1
ANY
Value to be converted
Output
OUT1
UINT
Result of the conversion
If the data type connected to the input is BOOL and:
• its value is FALSE, 0 is placed in the output
• its value is TRUE, 1 is placed in the output
Convert to USINT
(AtoUSINT)
The AtoUSINT block converts the input to a USINT data type and
places the result in the output.
Function
Parameter
Data Type
Description
Input
IN1
ANY
Value to be converted
Output
OUT1
USINT
Result of the conversion
If the data type connected to the input is BOOL and:
• its value is FALSE, 0 is placed in the output
• its value is TRUE, 1 is placed in the output
Publication 1755-RM002A-EN-P - July 2001
6-6
Convert Blocks (AtoBOOL, AtoBYTE, AtoDINT, AtoDWORD, AtoINT, AtoREAL, AtoSINT, AtoUDINT, AtoUINT, AtoUSINT, AtoWORD)
Convert to WORD
(AtoWORD)
The AtoWORD block converts the input to a WORD data type and
places the result in the output.
Function
Parameter
Data Type
Description
Input
IN1
ANY
Value to be converted
Output
OUT1
WORD
Result of the conversion
If the data type connected to the input is BOOL and:
• its value is FALSE, 0 is placed in the output
• its value is TRUE, 1 is placed in the output
Publication 1755-RM002A-EN-P - July 2001
Appendix
A
Data Conversion Rules
Introduction
Data conversions occur when you mix data types in your function
block programming, such as when you connect two nodes that have
different data types. This appendix describes how the controller
converts the data.
Data Conversion Rules
If you mix data types in your programming, the controller converts the
data according to these rules:
• When converting REAL values into INT values, they are
rounded up or down to the next integer. Values containing a “5,”
such as 0.5 or 0.05, are rounded up.
• The input/output values of type ANY_BIT represent BCD-coded
bit-string functions for the data types BYTE, WORD and
DWORD. BCD-coding is not defined by IEC 61131-3, it depends
on the implementation.
– Converting from an output data type to an input data type:
The conversion can always be performed without valence
loss.
– Converting from an input data type to an output data type:
Only the significant part of the input data type can be
transferred. This conversion depends on the target system.
• When converting a signed data type into an unsigned data type,
and vice versa, the bit pattern of the value is interpreted in the
specific data format, as shown in the following examples:
Value
Result
-1 (as signed value)
Fhex or FFFFhex or FFFFFFFFhex
(as unsigned value, depending on the data type)
128 (=80hex) as USINT
-127 (=80hex) as SINT
255 (=FFhex) as USINT
-1 (=FFhex) as SINT
• When converting data types to TIME data types, the conversion
is based on seconds.
1
Publication 1755-RM002A-EN-P - July 2001
A-2
Data Conversion Rules
Notes:
Publication 1755-RM002A-EN-P - July 2001
Appendix
B
ENO Behavior of Blocks
Introduction
This appendix describes the Enable-out (ENO) behavior of blocks in
RSLogix Guard.
ENO Behavior of Blocks
If an error occurs with a block and the ENO output displays it, the
values of the output are in principle undefined, i.e., the value output
can assume different values on different target systems. If an error
occurs with a block that does not support ENO, the output value is
also undefined.
In addition, note the following information about the defined error
behavior of blocks and about the restrictions of this behavior:
• All blocks possess an ENO output for displaying an error. For
example, over-/underflow in case of a DIV block.
• With some blocks, however, this output never becomes active
because the block cannot generate an error. For example, the
AND block cannot generate an error.
• The following table lists the blocks and shows whether or not
the ENO behavior is supported.
Block
ENO Supported?
Note
NOT
Yes
No error can occur
AND
Yes
No error can occur
OR
Yes
No error can occur
XOR
Yes
No error can occur
ROL
No
No error can occur
ROR
No
No error can occur
SHL
No
No error can occur
SHR
No
No error can occur
Bit Blocks:
continued on next page
1
Publication 1755-RM002A-EN-P - July 2001
B-2
ENO Behavior of Blocks
Block
ENO Supported?
Note
Bistable/Timer Blocks:
RS
Yes
No error can occur
SEMA
Yes
No error can occur
SR
Yes
No error can occur
F_TRIG
Yes
No error can occur
R_TRIG
Yes
No error can occur
TOF
Yes
No error can occur
TON
Yes
No error can occur
TP
Yes
No error can occur
Counter/Select Blocks:
CTD
Yes
No error can occur
CTU
Yes
No error can occur
CTUD
Yes
No error can occur
LIMIT
Yes
No error can occur
MAX
Yes
No error can occur
MIN
Yes
No error can occur
MUX_DI
Yes
No error can occur
MUX_I
Yes
No error can occur
MUX_SI
Yes
No error can occur
MUX_UD
Yes
No error can occur
MUX_UI
Yes
No error can occur
MUX_US
Yes
No error can occur
SEL
Yes
No error can occur
EQ
Yes
No error can occur
GE
Yes
No error can occur
GT
Yes
No error can occur
LE
Yes
No error can occur
LT
Yes
No error can occur
NE
Yes
No error can occur
Compare Blocks:
continued on next page
Publication 1755-RM002A-EN-P - July 2001
ENO Behavior of Blocks
Block
ENO Supported?
Note
ABS
No
No error can occur
ADD
No
Overflow/underflow can occur
CHS
Yes
Only for USINT, UINT, UDINT,
otherwise not supported
DIV
Yes
MOD
Yes
MUL
No
SRQT
Yes
SUB
No
Overflow/underflow can occur
AtoBOOL
Yes
Only for STRING,
otherwise not supported
AtoBYTE
No
AtoDINT
No
AtoDWORD
No
AtoINT
No
AtoREAL
No
AtoSINT
No
AtoUDINT
No
AtoUINT
No
AtoUSINT
No
AtoWORD
No
B-3
Numeric Blocks:
Overflow/underflow can occur
Convert Blocks:
Publication 1755-RM002A-EN-P - July 2001
B-4
ENO Behavior of Blocks
Notes:
Publication 1755-RM002A-EN-P - July 2001
Index
A
ABS 5-1
Absolute Value Block 5-1
ADD 5-2
Add Block 5-2
AND 1-1
ANY_BIT conversions A-1
AtoBOOL 6-2
AtoBYTE 6-3
AtoDINT 6-3
AtoDWORD 6-3
AtoINT 6-4
AtoREAL 6-4
AtoSINT 6-4
AtoUDINT 6-5
AtoUINT 6-5
AtoUSINT 6-5
AtoWORD 6-6
B
Bistable Blocks 2-1
Bit Blocks 1-1
Bit Rotate Left Block 1-2
Bit Rotate Right 1-3
Bit Shift Left Block 1-3
Bit Shift Right 1-3
Bitwise AND Block 1-1
Bitwise NOT Block 1-2
Bitwise OR 1-2
C
Change Sign Block 5-2
CHS 5-2
Compare Blocks 4-1
Convert Blocks 6-1
Convert to Block
BOOL 6-2
BYTE 6-3
DINT 6-3
DWORD 6-3
INT 6-4
REAL 6-4
SINT 6-4
UDINT 6-5
UINT 6-5
USINT 6-5
WORD 6-6
Count Down Block 3-2
Count Up and Down Block 3-3
Count Up Block 3-2
Counter Blocks 3-1
CTD 3-2
CTU 3-2
CTUD 3-3
D
Data Conversion Rules A-1
DIV 5-2
Divide Block 5-2
E
Enable Out B-1
ENO Behavior of Blocks B-1
EQ 4-1
Equal to Block 4-1
Errors in a Block B-1
Exclusive OR Block 1-4
F
F_TRIG 2-2
Falling Edge Detector Block 2-2
G
GE 4-2
Greater than Block 4-2
Greater than or Equal to Block 4-2
GT 4-2
L
LE 4-2
Less than Block 4-3
Less than or Equal to Block 4-2
LIMIT 3-3
Limit Block 3-3
LT 4-3
M
MAX 3-4
Maximum Block 3-4
MIN 3-4
Minimum Block 3-4
MOD 5-3
Publication 1755-RM002A-EN-P - July 2001
2
Index
Modulo Block 5-3
MUL 5-3
Multiplexer Blocks 3-4, 3-5, 3-6, 3-7
Multiply Block 5-3
MUX_DI 3-4
MUX_I 3-5
MUX_SI 3-5
MUX_UD 3-6
MUX_UI 3-6
MUX_US 3-7
N
NE 4-3
NOT 1-2
Not Equal Block 4-3
Numeric Blocks 5-1
O
One Shot Blocks 2-2
OR 1-2
P
Pulse Generator Block 2-5
R
R_TRIG 2-2
REAL to INT values, converting A-1
Reset/Set Block 2-2
Rising Edge Detector Block 2-2
ROL 1-2
ROR 1-3
Publication 1755-RM002A-EN-P - July 2001
Rotate Blocks 1-2
RS 2-2
S
SEL 3-7
Select Block 3-7
Select Blocks 3-1
SEMA 2-3
Set/Reset Block 2-3
Shift Blocks 1-3
SHL 1-3
SHR 1-3
signed to unsigned data conversions A-1
SQRT 5-3
Square Root Block 5-3
SR 2-3
SUB 5-4
Subtract Block 5-4
T
TIME data type A-1
Timer Blocks 2-1
Timer Off Delay Block 2-4
Timer On Delay Block 2-4
TOF 2-4
TON 2-4
TP 2-5
TRUNC functions A-1
X
XOR 1-4
How Are We Doing?
Your comments on our technical publications will help us serve you better in the future.
Thank you for taking the time to provide us feedback.
You can complete this form and mail it back to us, visit us online at www.ab.com/manuals, or
email us at [email protected]
Pub. Title/Type RSLogix Guard 1200 and 2000 Programming Software Function Block Reference Manual
Cat. No.
1754-PCS, 1755-PCS
Pub. No. 1755-RM002A-EN-P
Pub. Date July 2001
Part No.
957564-49
Please complete the sections below. Where applicable, rank the feature (1=needs improvement, 2=satisfactory, and 3=outstanding).
Overall Usefulness
Completeness
(all necessary information
is provided)
Technical Accuracy
(all provided information
is correct)
1
2
3
How can we make this publication more useful for you?
1
2
3
Can we add more information to help you?
1
Clarity
1
(all provided information is
easy to understand)
Other Comments
2
3
procedure/step
illustration
feature
example
guideline
other
explanation
definition
Can we be more accurate?
text
2
3
illustration
How can we make things clearer?
You can add additional comments on the back of this form.
Location/Phone
Your Name
Your Title/Function
Would you like us to contact you regarding your comments?
___No, there is no need to contact me
___Yes, please call me
___Yes, please email me at __________________________
___Yes, please contact me via ________________________
Return this form to:
Allen-Bradley Marketing Communications, 1 Allen-Bradley Dr., Mayfield Hts., OH 44124-9705
Phone: 440-646-3176 Fax: 440-646-3525 Email: [email protected]
Publication ICCG-5.21- January 2001
PN 955107-82
PLEASE FASTEN HERE (DO NOT STAPLE)
PLEASE FOLD HERE
NO POSTAGE
NECESSARY
IF MAILED
IN THE
UNITED STATES
BUSINESS REPLY MAIL
FIRST-CLASS MAIL PERMIT NO. 18235 CLEVELAND OH
POSTAGE WILL BE PAID BY THE ADDRESSEE
1 ALLEN-BRADLEY DR
MAYFIELD HEIGHTS OH 44124-9705
PLEASE REMOVE
Other Comments
Publication 1755-RM002A-EN-P - July 2001 9
PN 957564-49
© 2001 Rockwell Automation. All rights reserved Printed in the U.S.A.