User's Manual Rslogix 5000 PDF
User's Manual Rslogix 5000 PDF
Controllers
Common
Procedures
1756-Lx, 1769-Lx, 1789-Lx, 1794-Lx
Programming Manual
ATTENTION
Allen-Bradley, ControlLogix, DH+, Logix5000, PLC-5, RSLogix 5000, RSLinx, RSNetWorx, and SLC are trademarks of Rockwell
Automation.
ControlNet is a trademark of ControlNet International, Ltd.
Ethernet is a trademark of Digital Equipment Corporation, Intel, and Xerox Corporation.
Summary of Changes
Introduction
Updated Information
Starts on page:
3-1
5-4
12-1
13-1
17-1
19-1
A-1
A-3
IEC61131-3 Compliance
B-1
Glossary terms
Glossary
back cover
Summary of Changes
Notes:
Preface
software engineers
control engineers
application engineers
instrumentation technicians
Preface
This manual is divided into the basic tasks that you perform while
programming a Logix5000 controller.
Each chapter covers a task.
The tasks are organized in the sequence that you will typically
perform them.
As you use this manual, you will see some terms that are formatted
differently from the rest of the text:
Identifies:
For example:
Italic
bold
Type a name
Means:
courier
Right-click
name_of_program
Table of Contents
Chapter 1
Manage Project Files
Chapter 2
Organize Tasks
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
2-1
2-1
2-1
2-2
2-5
Chapter 3
Organize Tags
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
3-1
3-8
3-9
3-10
3-11
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
4-1
4-1
4-1
4-3
4-4
4-7
4-10
Chapter 4
Program Routines
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
Chapter 5
Access System Values
Chapter 6
Assign Aliases
Chapter 7
Assign an Indirect Address
Chapter 8
Buffer I/O
Table of Contents
ii
Chapter 9
Test a Project
Test a Project . . . . . . . . . . . . . . . . . .
Configure a Communication Driver . .
Download a Project to the Controller .
Select a Mode for the Controller . . . .
Correct Major Faults . . . . . . . . . . . . .
Save Your Online Changes . . . . . . . .
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
9-1
9-1
9-2
9-3
9-4
9-4
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
. 10-1
. 10-1
. 10-1
. 10-3
. 10-3
. 10-4
. 10-5
. 10-6
. 10-7
. 10-9
10-10
10-11
Chapter 10
Communicate with Another
Controller
Chapter 11
Produce a Large Array
Chapter 12
Communicate with an ASCII
Device
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
. 12-1
. 12-1
. 12-2
. 12-3
. 12-5
. 12-8
. 12-9
12-14
12-21
Table of Contents
iii
Chapter 13
Process ASCII Characters
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
. 13-1
. 13-1
. 13-2
. 13-4
. 13-6
. 13-8
13-12
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
Chapter 14
Force Values
14-1
14-2
14-2
14-4
14-5
14-6
14-6
14-7
Chapter 15
Develop a Fault Routine
Chapter 16
Create a User-Defined Major Fault When to Use this Procedure . . . . . . . . . . . . . . . . . . . . . . . 16-1
Create a User-Defined Major Fault . . . . . . . . . . . . . . . . . . . 16-1
Chapter 17
Monitor Minor Faults
Chapter 18
Develop a Power-Up Routine
Chapter 19
Store and Load a Project Using
Nonvolatile Memory
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
. 19-1
. 19-2
. 19-3
. 19-6
. 19-9
19-10
Table of Contents
iv
Appendix A
Fault Codes
Appendix B
IEC61131-3 Compliance
Glossary
ASCII Character Codes
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
B-1
B-1
B-2
B-2
B-3
B-4
B-4
B-5
Chapter
3.
4.
5.
6.
7.
8.
42194
1-2
9. Click OK.
When you create a project, the name of the project file
is the same as the name of the controller.
controller organizer
42371
As you create logic and make configuration changes, save the project.
To:
Do this:
Notes:
1-3
1-4
Notes:
Chapter
Organize Tasks
After you create a project file, organize your project into tasks.
function block
CompactLogix
ControlLogix
FlexLogix
SoftLogix
Notes:
For controllers with multiple languages, you can mix languages
in a project.
To use function blocks, you must have the following catalog
number of RSLogix 5000 software:
9324-RLD700
To see which components are installed with RSLogix 5000
software:
1. Open RSLogix 5000 software.
2. From the Help menu, choose About RSLogix 5000.
2-2
Organize Tasks
To execute your logic, you use a task (s). There are two types of
tasks:
This type of task:
Will:
continuous task
periodic task
42195
Organize Tasks
2-3
Then:
Detailed steps:
1. Create a routine
(subroutine) for each
function:
2-4
Organize Tasks
EXAMPLE
Task execution order for a project with two periodic tasks and one continuous task
Task:
Task Type:
Priority Level:
Execution Time:
20ms periodic
2ms
10ms periodic
10
4ms
continuous
none (lowest)
24ms
Legend:
Task executes.
Task is interrupted (suspended).
Task 1
Task 2
Task 3
5
10
15
20
25
30
35
40
45
50
Notes:
All periodic tasks interrupt the continuous task.
The highest priority task interrupts all lower priority tasks.
A higher priority task can interrupt a lower priority task multiple
times.
When the continuous task completes a full scan, it restarts
immediately.
Tasks at the same priority execute on a time-slice basis at
1 ms intervals.
To change the properties of a task, program, or routine (name,
type, priority, etc.), right-click the task, program, or routine and
select Properties.
Organize Tasks
2-5
2-6
Organize Tasks
Notes:
Chapter
Organize Tags
Logix5000 controllers store data in tags (in contrast to fixed data files
that are numerically addressed). With tags, you can
organize your data to mirror your machinery
document (through tag names) your application as you
develop it
When you create a tag, you assign the following properties:
Table 3.A Tag Properties
Property:
Description:
scope
name
data type
The following table outlines the most common data types and when
to use each.
Table 3.B Data Types
For:
Select:
REAL
INT
ASCII characters
string
bit
BOOL
counter
COUNTER
BOOL
floating-point number
REAL
DINT
sequencer
CONTROL
timer
TIMER
3-2
Organize Tags
Use a:
Reference:
user-defined
data type
array
single value
tag of a single
element
I/O device
The following examples show the different levels at which you can
organize your data:
Organize Tags
EXAMPLE
3-3
integer value
storage bit
counter
timer
digital I/O device
42364
3-4
Organize Tags
EXAMPLE
elements of
timer_presets
six DINTs
42367
Organize Tags
EXAMPLE
3-5
Description
1.5
2.5
1.25
1.25
1.25
8.0
5.5
3.5
3.5
9.75
7.5
5.5
9.75
7.5
9.75
0
1
subscript of 2
first
dimension 3
4
5
In the Tags window, the elements are in the order depicted below.
42367
3-6
Organize Tags
EXAMPLE
In a system of several tanks, each tank can run a variety of recipes. Because the recipe
requires a mix of data types (REAL, DINT, BOOL, etc.) a user-defined data type is used.
Data Type
temp
REAL
deadband
REAL
step
DINT
step_time
TIMER
preset
DINT[6]
mix
BOOL
An array that is based on this data type would look like this:
array of recipes
first recipe
members of the
recipe
42368
Organize Tags
3-7
User-defined data type that stores the data that is required to run a machine
EXAMPLE
Because several drill stations require the following mix of data, a user-defined data type
is created.
Data Type
part_advance
BOOL
hole_sequence
CONTROL
type
DINT
hole_position
REAL
depth
REAL
total_depth
REAL
An array that is based on this data type would look like this:
array of drills
first drill
42583
3-8
Organize Tags
42195
2.
3.
42196
4.
5.
6.
7.
Organize Tags
3-9
5. Specify the data type for the member. See Table 3.B on
page 3-1.
For an array, use the following format:
data_type[x]
where:
Then:
Yes
Repeat steps 4. to 8.
No
Click OK.
Notes:
If you include members that represent I/O devices, you must
use ladder logic to copy the data between the members in the
structure and the corresponding I/O tags. Refer to "Buffer I/O"
on page 8-1.
When you use the BOOL, SINT, or INT data types, place
members that use the same data type in sequence:
more efficient
less efficient
BOOL
BOOL
BOOL
DINT
BOOL
BOOL
DINT
DINT
DINT
BOOL
3-10
Organize Tags
Create a Tag
2.
42350
3.
4.
5.
Then select:
name_of_controller(controller)
as a producer or consumer
in a message
in only one program within the project program that will use the tag
Then type:
data_type
data_type[x]
data_type[x,y]
data_type[x,y,z]
where:
Organize Tags
3-11
4.
5.
42361
3-12
Organize Tags
TYPE
SCOPE
NAME
TAG
DESCRIPTION
in_cycle
DATATYPE
DINT
TYPE
SCOPE
NAME
TAG
MainProgram
conveyor_alarm
BOOL
TAG
MainProgram
conveyor_on
BOOL
TAG
MainProgram
drill_1
DRILL_STATION
TAG
MainProgram
hole_position
REAL[6,6]
TAG
MainProgram
machine_on
BOOL
8.
9.
DESCRIPTION
DATATYPE
10.
11.
8. Enter TAG
9. Identify the scope of the tag:
If the scope is:
Then:
controller
program
Organize Tags
Notes:
3-13
Use a:
produced tag
receive data from another controller over the backplane or consumed tag
ControlNet network at a specified interval
3-14
Organize Tags
Chapter
Program Routines
After you organize your project into an initial set of routines and tags,
use this procedure to develop the logic that each routine will execute.
To open a folder and display its contents (expand), do one of the following:
Double-click the folder.
Select the folder and press the key.
Click the + sign.
42581
4-2
Program Routines
Then:
not greyed-out
greyed-out
You cannot open, program, or edit the routine. To determine the reason:
1. Double-click the routine.
2. At the bottom of the RSLogix 5000 window, what message does the status line display?
If:
Then:
IMPORTANT
Program Routines
4-3
cursor (blue)
Do this:
rung
instruction
branch
A.
B.
C.
D.
4-4
Program Routines
Element:
Purpose:
function block
Performs an operation on an input value (s) and produces an output value (s)
Pins on the left of the block are input pins.
Pins on the right of the block are output pins.
Connects function blocks that are either far apart or on different sheets
Each OCON requires a unique name.
For each OCON, you must have at least one corresponding ICON (i.e.,
an ICON with the same name as the OCON).
Multiple ICONs can reference the same OCON. This lets you disperse
data to several points in your routine.
1.
2.
3.
42587
Program Routines
Step:
4-5
Detailed actions:
Press the Insert key.
Type the mnemonic for the required block.
Choose OK.
Drag the block to a place on the diagram that makes the diagram easy to read. The
location of a block does not affect the order in which the blocks execute.
A.
B.
C.
D.
A
B
42584
Do this:
C. Choose OK.
3. Wire output pins to input pins.
Click an output pin and then click the required input pin. A green dot indicates a valid pin.
4-6
Program Routines
5.
4.
6.
42586
Step:
Detailed actions:
A.
B.
C.
D.
A.
B.
C.
D.
E.
F.
G.
H.
I.
J.
K.
Program Routines
Assign Operands
4-7
Specify:
tag
tag_name
tag_name.bit_number
member of a structure
tag_name.member_name
tag_name[x]
tag_name[x,y]
tag_name[x,y,z]
tag_name.member_name[x]
tag_name[x,y,z].member_name
where:
4-8
Program Routines
EXAMPLE
Tags names
To access:
machine_on tag
machine_on
one_shots.1
running_seconds.DN
north_tank.mix
COP
Copy File
Source recipe[2]
Dest tanks[1,1]
Length
1
CLR
CLR
Clear
Dest north_tank.preset[2]
0
drill[1].part_advance
42357
Program Routines
4-9
For a:
Do this:
ladder instruction
Do this:
ladder instruction
function block
instruction
C. Click the
D. Select a name:
To select a:
Do this:
ladder instruction
4-10
Program Routines
Then:
Yes
No
Then type:
data_type
data_type[x]
data_type[x,y]
data_type[x,y,z]
where:
data_type is the type of data that the tag or array stores. See Table 3.B on page 3-1.
x is the number of elements in the first dimension.
y is the number of elements in the second dimension.
z is the number of elements in the third dimension.
D. From the Scope list, select the scope of the tag:
If you will use the tag:
Then select:
name_of_controller(controller)
as a producer or consumer
in a message
in only one program within the project
E. Choose OK.
Chapter
The controller supports status keywords you can use in your logic to
monitor specific events:
The status keywords are not case sensitive.
Because the status flags can change so quickly, RSLogix 5000
software does not display the status of the flags. (I.e., Even
when a status flag is set, an instruction that references that flag is
not highlighted.)
You cannot define a tag alias to a keyword.
You can use these key words:
To determine if:
Use:
the value you are storing cannot fit into the destination because it is
either:
greater than the maximum value for the destination
less than the minimum value for the destination
S: V
S:Z
S:N
S:C
For example:
adding 3 + 9 causes a carry of 1
subtracting 25 - 18 causes a borrow of 10
this is the first, normal scan of the routines in the current program
S:FS
S:MINOR
5-2
ATTENTION
5-3
Click:
AXIS
CONTROLLER
CONTROLLERDEVICE
CST
DF1
FAULTLOG
MESSAGE
MODULE
group of axes
MOTIONGROUP
PROGRAM
ROUTINE
SERIALPORT
TASK
WALLCLOCKTIME
6. In the list of attributes for the object, identify the attribute that
you want to access.
7. Create a tag for the value of the attribute:
If the data type of the attribute
is:
Then:
GSV
SSV
5-4
Select:
Class name
Instance name
Attribute Name
Dest (GSV)
Source (SSV)
EXAMPLE
At the first scan, gets the DateTime attribute of the WALLCLOCKTIME object and stores it in the
wall_clock tag, which is based on a user-defined data type.
42370
Chapter
Assign Aliases
Alias Tags
An alias tag lets you create one tag that represents another tag.
Both tags share the same value (s).
When the value (s) of one of the tags changes, the other tag
reflects the change as well.
Use aliases in the following situations:
6-2
Assign Aliases
stop
<Local:2:I.Data.1>
start
<Local:2:I.Data.0>
machine_on
drill_1_on
machine_on <Local:0:O.Data.2> drill_1.part_advance
conveyor_on
<Local:0:O.Data.0>
42351
Assign Aliases
Assign an Alias
6-3
2.
42360
3.
Do this:
select a tag
6-4
Assign Aliases
Notes:
Chapter
4500
array[1]
6000
array[2]
3000
array[3]
2500
7-2
The following example loads a series of preset values into a timer, one
value (array element) at a time.
EXAMPLE
The timer_presets array stores a series of preset values for the timer in the next rung. The
north_tank.step tag points to which element of the array to use. For example, when north_tank.step
equals 0, the instruction loads timer_presets[0] into the timer (60,000 ms).
MOV
Move
Source timer_presets[north_tank.step]
60000
Dest
north_tank.step_time.PRE
60000
north_tank.step_time.DN
/
TON
Timer On Delay
Timer
north_tank.step_time
Preset
60000
Accum
0
EN
DN
When north_tank.step_time is done, the rung increments north_tank.step to the next number and
that element of the timer_presets array loads into the timer.
north_tank.step_time.DN
ADD
Add
Source A
Source B north_tank.step
0
Dest
north_tank.step
0
When north_tank.step exceeds the size of the array, the rung resets the tag to start at the first element
in the array. (The array contains elements 0 to 3.)
EQU
Equal
Source A north_tank.step
0
Source B
4
MOV
Move
Source
Dest north_tank.step
0
42358
Expressions
7-3
Description:
Operator:
Description:
add
MOD
Modulo
subtract/negate
NOT
complement
multiply
OR
OR
divide
SQR
square root
ABS
Absolute value
TOD
integer to BCD
AND
AND
TRN
Truncate
FRD
BCD to integer
XOR
exclusive OR
Examples:
operator(value)
ABS(tag_a)
tag_b + 5
tag_c AND tag_d
(tag_e ** 2) MOD (tag_f /
tag_g)
7-4
Notes:
Chapter
Buffer I/O
Buffer I/O
8-2
Buffer I/O
EXAMPLE
Buffer I/O
The main routine of the program executes the following subroutines in this sequence.
JSR
Jump to Subroutine
Routine name map_inputs
JSR
Jump to Subroutine
Routine name drill
JSR
Jump to Subroutine
Routine name map_outputs
The map_inputs routine copies the values of input devices to their corresponding tags that are used
in the drill routine.
_1791_8AC:I.Data[0].0
drill[1].depth_limit
_1791_8AC:I.Data[0].4
drill[1].home_limit
The drill routine executes the logic for the drill machine.
drill[1].part_advance
/
one_shots.0
ONS
drill[1].depth_limit
/
drill[1].forward
drill[1].forward
drill[1].depth_limit
drill[1].home_limit
/
drill[1].retract
drill[1].retract
The map_outputs routine copies the values of output tags in the drill routine to their corresponding
output devices.
drill[1].forward
_1791_8AC:O.Data[0].0
drill[1].retract
_1791_8AC:O.Data[0].1
42369
Buffer I/O
8-3
EXAMPLE
Buffer I/O
Local:0:I.Data stores the input data for the DeviceNet network that is connected to the 1756-DNB
module in slot 0. To synchronize the inputs with the application, the CPS instruction copies the input
data to input_buffer.
While the CPS instruction copies the data, no I/O updates can change the data.
As the application executes, it uses for its inputs the input data in input_buffer.
CPS
Synchronous Copy File
Source Local:0:I.Data[0]
Dest
input_buffer[0]
Length
20
42578
8-4
Buffer I/O
Notes:
Chapter
Test a Project
Test a Project
Configure a Communication
Driver
serial
DH+
1784-KT/KTX(D)/PKTX(D)
ControlNet
1784-KTC(X)
Ethernet
Ethernet devices
9-2
Test a Project
Do this:
serial
ControlNet
DH+
Ethernet
For each Ethernet device on this network with which you want
to communicate (e.g., each 1756-ENET module or PLC-5E
controller), add a map entry:
A. In the Host Name column, type the IP address or host
name of the Ethernet device.
B. Do you want to communicate with another Ethernet
device on this network?
If:
Yes
No
Then:
1. Choose Add New.
2. Go to Step A.
Go to the next step.
3. Click OK.
4. Click Close.
Test a Project
9-3
42371
Program Remote
Run
Program Test
send messages
9-4
Test a Project
If the controller enters the faulted mode, a major fault occurred and
the controller stopped executing the logic.
TIP
If you make changes to the project while online, save the project so
that the offline project file matches the online project file:
If you want to:
Do this:
Chapter
10
Then:
See page:
10-1
Send a Message
10-11
controller_1
controller_2
produced tag
consumed tag
controller_3
consumed tag
controller_4
consumed tag
10-2
You can use produced and consumed tags with the following
controller and network combinations.
This controller:
ControlNet
Ethernet
PLC-5
ControlLogix
FlexLogix
SoftLogix
produced tag
number_of_consumers + 1
consumed tag
EXAMPLE
10-3
10-4
6. Limit the size of the tag to less than or equal to 500 bytes. If you
must transfer more than 500 bytes, create logic to transfer the
data in packets. Refer to "Produce a Large Array" on page 11-1.
7. If you share the tag over a ControlNet network, the tag may
need to be less than 500 bytes. Refer to "Adjust for Bandwidth
Limitations" on page 10-10.
8. If you are producing several tags for the same controller:
Group the data into one or more user-defined data types.
(This uses less connections than producing each tag
separately.)
Group the data according to similar update rates. (To
conserve network bandwidth, use a greater RPI for less
critical data.)
For example, you could create one tag for data that is critical
and another tag for data that is not as critical.
Produce a Tag
1. Open the RSLogix 5000 project that contains the tag that you
want to produce.
2. From the Logic menu, select Edit Tags.
3. From Scope, select name_of_controller(controller). (Only
tags that are controller scope can produce data.)
4. Select the tag that will produce the data and press the
ALT + Enter keys.
5.
6.
42352
10-5
6.
7.
8.
9.
42353
10.
10-6
IMPORTANT
10-7
10-8
The two MOV instructions reverse the order of the integers as the integers move to a new location.
Because the destination of the COP instruction is a floating-point address, it takes two consecutive
integers, for a total of 32 bits, and converts them to a single floating-point value.
42354
10-9
Description:
DINT
Status
Consumed
Controller
Remote Instance
RPI
Data Type
10-10
Yes
Rack Optimization
No
None
Send a Message
10-11
EXAMPLE
count_send
count_msg.en
/
MSG
Type - Unconfigured
Message Control
count_msg ...
EN
DN
ER
Type: MESSAGE
Scope: Controller
42188
2. For the tags that the messages will use (source or destination
tags), create the tags at the controller scope.
3. In the Logix5000 controller, use the DINT data type for integers
whenever possible:
Logix5000 controllers execute more efficiently and use less
memory when working with 32-bit integers (DINTs).
10-12
Continuously moves the values in dint_array to int_buffer. This converts the values to 16-bit integers (INTs). Then the message instruction
sends int_buffer to a PLC-5 controller.
message.EN
/
fal_control
RES
FAL
File Arith/Logical
Control
fal_control
Length
?
Position
0
Mode
all
Dest
int_buffer[fal_control.pos]
??
Expression
dint_array[fal_control.pos]
EN
MSG
Type - Unconfigured
Message Control
message ...
DN
EN
DN
ER
ER
42192
message.DN
MSG
Type - Unconfigured
Message Control
fal_control
RES
message ...
FAL
File Arith/Logical
Control
fal_control
Length
?
Position
0
Mode
all
Dest
dint_array[fal_control.pos]
??
Expression
int_buffer[fal_control.pos]
EN
DN
ER
EN
DN
ER
42192
Chapter
11
The Logix5000 controller can send as many as 500 bytes of data over a
single scheduled connection. This corresponds to 125 DINT or REAL
elements of an array. To transfer an array of more than 125 DINTs or
REALs, use a produced/consumed tag of 125 elements to create a
packet of data. You can then use the packet to send the array
piecemeal to another controller.
When you send a large array of data in smaller packets, you must
ensure that the transmission of a packet is complete before the data is
moved into the destination array, for these reasons.
Produced data over the ControlLogix backplane is sent in 50
byte segments.
Data transmission occurs asynchronous to program scan.
The logic that this section includes uses an acknowledge word to
make sure that each packet contains new data before the data moves
to the destination array. The logic also uses an offset value to indicate
the starting element of the packet within the array.
Because of the offset and acknowledge elements, each packet carries
123 elements of data from the array, as depicted below:
Producer
Consumer
array
array
packet
packet
123 offset
124 acknowledge
offset
acknowledge
11-2
1. Open the RSLogix 5000 project that will produce the array.
2. In the Controller Tags folder, create the following tags:
P
Tag Name
Type
array_ack
DINT[2]
array_packet
DINT[125]
where:
array is the name for the data that you are sending.
3. Convert array_ack to a consumed tag:
For:
Specify:
Controller
array_ack
Both controllers use the same name for this shared
data.
11-3
Type
array
array_offset
DINT
array_size
DINT
array_transfer_time
DINT
array_transfer_time_max
DINT
array_transfer_timer
TIMER
where:
array is the name for the data that you are sending.
5. In the array_size tag, enter the number of elements of real data.
(The value of x from step 4. minus the 122 elements of buffer.)
6. Create or open a routine for the logic that will create packets of
data.
7. Enter the following logic:
Times how long it takes to send the entire array
TON
Timer On Delay
Timer
array_transfer_timer
Preset
10000000
Accum
0
EN
DN
When the offset value in array_ack[0] is not equal to the current offset value but array_ack[1] equals
-999, the consumer has begun to receive a new packet, so the rung moves -999 into the last element of
the packet. The consumer waits until it receives the value -999 before it copies the packet to the array.
This guarantees that the consumer has new data.
NEQ
Not Equal
Source A
array_ack[0]
0
Source B array_packet[123]
0
EQU
Equal
Source A array_ack[1]
0
Source B
-999
MOV
Move
Source
-999
Dest array_packet[124]
0
11-4
When the offset value in array_ack[0] is equal to the current offset value, the consumer has copied the
packet to the array; so the rung checks for more data to transfer. If the offset value plus 123 is less than
the size of the array, there is more data to transfer; so the rung increases the offset by 123. Otherwise,
there is no more data to transfer; so the rung resets the offset value, logs the transfer time, and resets the
timer. In either case, the rung uses the new offset value to create a new packet of data, appends the new
offset value to the packet, and clears the acknowledge element of the packet (packet[124]).
EQU
Equal
Source A
array_ack[0]
0
Source B array_packet[123]
0
CMP
Compare
Expression (array_ack[0] + 123) < array_size
ADD
Add
Source A array_packet[123]
0
Source B
123
Dest
CMP
Compare
Expression (array_ack[0] + 123) >= array_size
array_offset
0
CLR
Clear
Dest array_offset
0
MOV
Move
Source array_transfer_timer.ACC
0
Dest
array_transfer_time
0
array_transfer_timer
RES
COP
Copy File
Source array[array_offset]
Dest
array_packet[0]
Length
123
MOV
Move
Source
array_offset
0
Dest array_packet[123]
0
CLR
Clear
Dest array_packet[124]
0
If the current transfer time is greater than the maximum transfer time, updates the maximum transfer
time. This maintains a record of the longest time to transfer data.
GRT
Greater Than (A>B)
Source A
array_transfer_time
0
Source B array_transfer_time_max
0
MOV
Move
Source
array_transfer_time
0
Dest array_transfer_time_max
0
42355
11-5
8. Open the RSLogix 5000 project that will consume the array.
9. In the Controller Tags folder, create the following tags:
P
Tag Name
Type
array_ack
DINT[2]
array_packet
DINT[125]
where:
array is the name for the data that you are sending. Use the
same name as in the producing controller (step 2.).
10. Convert array_packet to a consumed tag:
For:
Specify:
Controller
array_packet
Both controllers use the same name for this shared
data.
Type
array
array_offset
DINT
where:
array is the name for the data that you are sending.
12. Create or open a routine for the logic that will move the data
from the packets to the destination array.
11-6
MOV
Move
Source array_packet[123]
0
Dest
array_offset
0
COP
Copy File
Source
array_packet[0]
Dest array[array_offset]
Length
123
MOV
Move
Source array_packet[123]
0
Dest
array_ack[0]
0
CLR
Clear
Dest array_ack[1]
0
NEQ
Not Equal
Source A array_packet[124]
0
Source B
-999
MOV
Move
Source
-999
Dest array_ack[1]
0
42356
11-7
11-8
Notes:
Chapter
12
Use this procedure to exchange ASCII data with a device through the
serial port of the controller. For example, you can use the serial port
to:
read ASCII characters from a weigh scale module or bar code
reader
send and receive messages from an ASCII triggered device, such
as a MessageView terminal.
connection from the serial port of the controller to the ASCII device
42237
12-2
1. For the serial port of the ASCII device, determine which pins
send signals and which pins receive signals.
2. Connect sending pins to corresponding receiving pins and
attach jumpers:
If the communications: Then wire the connectors as follows:
handshake
ASCII Device
Controller
1 CD
1 CD
2 RDX
2 RDX
3 TXD
3 TXD
4 DTR
4 DTR
COMMON
COMMON
6 DSR
6 DSR
7 RTS
7 RTS
8 CTS
8 CTS
42231
do not handshake
ASCII Device
Controller
1 CD
1 CD
2 RDX
2 RDX
3 TXD
3 TXD
4 DTR
4 DTR
COMMON
COMMON
6 DSR
6 DSR
7 RTS
7 RTS
8 CTS
8 CTS
42232
12-3
baud rate
data bits
parity
stop bits
42627
5.
6.
42251
5. Select User.
6. Select the settings for the ASCII device, from step 1.
12-4
7.
8.
9.
42251
And:
Select:
Then:
No Handshaking
Go to step 10.
Full Duplex
both modems in a
point-to-point link are
full-duplex
master modem is
full-duplex while slave
modem is half-duplex
master controller.
Full Duplex
slave controller
Half Duplex
Half Duplex
8. Type the amount of delay (20 ms units) between the time that
the RTS signal turns on (high) and the time that data is sent. For
example, a value of 4 produces an 80 ms delay.
9. Type the amount of delay (20 ms units) between the time that
the last character is sent and the time that the RTS signal turns
off (low).
10. Click Apply.
12-5
2.
3.
42252
Then:
Notes:
one termination
character
two termination
characters
For printable
characters, such
as 1 or A, type the
character.
12-6
4.
5.
6.
7.
42252
two characters
Then:
A. In the Append Character 1 text
box, type the hexadecimal
ASCII code for the first
character.
B. In the Append Character 2 text
box, type $FF.
Notes:
For printable
characters, such
as 1 or A, type the
character.
12-7
Select:
Notes:
CRT
CRT
The DEL character ($7F) and the character that precedes the DEL
character are not sent to the destination.
If echo mode is selected and an ASCII instruction reads the DEL
character, the echo returns three characters: BACKSPACE SPACE
BACKSPACE ( $08 $20 $08).
printer
Printer
The DEL character ($7F) and the character that precedes the DEL
character are not sent to the destination.
If echo mode is selected and an ASCII instruction reads the DEL
character, the echo returns two characters: / ($2F) followed by
the character that was deleted.
Ignore
8. Click OK.
12-8
You store ASCII characters in tags that use a string data type.
42811
42812
IMPORTANT
or
Then:
If:
Then:
no
yes
Go to step 2.
4.
Publication 1756-PM001C-EN-P - June 2001
5. Choose OK.
12-9
As a general rule, before you read the buffer use an ACB or ABL
instruction to verify that the buffer contains the required characters:
An ARD or ARL instruction continues to read the buffer until the
instruction reads the required characters.
While an ARD or ARL instruction is reading the buffer, no other
ASCII Serial Port instructions, except the ACL, can execute.
Verifying that the buffer contains the required characters
prevents the ARD or ARL from holding up the execution of other
ASCII Serial Port instructions while the input device sends its
data.
For additional information on ASCII Serial Port instructions, refer to
Logix5000 Controllers General Instruction Set Reference Manual,
publication 1756-RM003.
IMPORTANT
Then:
Go to step 2.
Go to step 14.
3.
5.
42235a
3. Enter 0.
4. Enter a tag name for the ACB instruction and define the data
type as SERIAL_PORT_CONTROL.
5. Enter the EN bit of the ACB tag. (The tag from step 4.)
12-10
7.
8.
11.
9.
12.
42235a
7. Enter the POS member of the ACB tag. (The tag from step 4.)
8. Enter the number of characters in the data.
9. Enter 0.
10. Enter a tag name to store the ASCII characters. Define the data
type as a string.
11. Enter a tag name for the ARD instruction and define the data
type as SERIAL_PORT_CONTROL.
12. Enter the number of characters in the data.
EXAMPLE
12-11
A bar code reader sends bar codes to the serial port (channel 0) of the controller. Each
bar code contains 24 characters. To determine when the controller receives a bar code,
the ACB instruction continuously counts the characters in the buffer.
bar_code_count.EN
/
ACB
ASCII Chars in Buffer
Channel
0
SerialPort Control
bar_code_count
Character Count
0
EN
DN
ER
When the buffer contains at least 24 characters, the controller has received a bar code.
The ARD instruction moves the bar code to the bag_bar_code tag.
ARD
GEQ
Grtr Than or Eql (A>=B)
Source A bar_code_count.pos
0
Source B
24
ASCII Read
Channel
Destination
SerialPort Control
String Length
Characters Read
EN
0
bag_bar_code
''
bar_code_read
24
0
DN
ER
42227
Then:
yes
no
Stop. You are done with this procedure. To use the data, go to Process
ASCII Characters on page 13-1.
12-12
42235
15. Enter 0.
16. Enter a tag name for the ABL instruction and define the data
type as SERIAL_PORT_CONTROL.
17. Enter the EN bit of the ABL tag. (The tag from step 16.)
18. Enter the following rung:
21.
20.
19.
22.
23.
42235
19. Enter the FD bit of the ABL tag. (The tag from step 16.)
20. Enter 0.
21. Enter a tag name to store the ASCII characters. Define the data
type as a string.
22. Enter a tag name for the ARL instruction and define the data
type as SERIAL_PORT_CONTROL.
23. Enter the maximum number of characters to read if no
termination character (s) is found.
EXAMPLE
12-13
Continuously tests the buffer for a message from the MessageView terminal.
Since each message ends in a carriage return ($0D), the carriage return is configured
as the termination character in the Controller Properties dialog box, User Protocol
tab.
When the ABL finds a carriage return, its sets the FD bit.
MV_line.EN
/
ABL
ASCII Test For Buffer Line
Channel
0
SerialPort Control
MV_line
Character Count
0
EN
DN
ER
When the ABL instruction finds the carriage return (MV_line.FD is set), the controller
removes the characters from the buffer, up to and including the carriage return, and
places them in the MV_msg tag.
MV_line.FD
ARL
ASCII Read Line
Channel
Destination
SerialPort Control
String Length
Characters Read
EN
0
MV_msg
''
MV_read
12
0
DN
ER
42226
Then:
yes
no
Stop. You are done with this procedure. To use the data, go to Process
ASCII Characters on page 13-1.
12-14
If you:
And you:
Then:
Go to step 2.
Go to step 9.
Go to step 16.
Go to step 24.
4.
3.
6.
7.
42236a
EXAMPLE
12-15
When the temperature exceeds the high limit (temp_high is on), the AWA instruction
sends five characters from the string[1] tag to a MessageView terminal.
The $14 counts as one character. It is the hex code for the Ctrl-T character.
The instruction also sends (appends) the characters defined in the user protocol. In
this example, the AWA instruction sends a carriage return ($0D), which marks the end
of the message.
temp_high
AWA
ASCII Write Append
Channel
Source
SerialPort Control
String Length
Characters Sent
EN
0
string[1]
'$1425\1'
temp_high_write
5
6
DN
ER
42229
12-16
11.
10.
13.
14.
42236b
10. Enter the input condition (s) that determines when the
characters are to be sent:
You can use any type of input instruction.
The instruction must change from false to true each time the
characters are to be sent.
11. Enter 0.
12. Enter the tag name that stores the ASCII characters. Define the
data type as a string.
13. Enter a tag name for the AWT instruction and define the data
type as SERIAL_PORT_CONTROL.
14. Enter the number of characters to send.
EXAMPLE
When the temperature reaches the low limit (temp_low is on), the AWT instruction sends
nine characters from the string[2] tag to a MessageView terminal. (The $14 counts as one
character. It is the hex code for the Ctrl-T character.)
temp_low
AWT
ASCII Write
Channel
Source
SerialPort Control
String Length
Characters Sent
EN
0
string[2]
'$142224\01$r'
temp_low_write
9
9
DN
ER
42229
12-17
18.
17.
21.
22.
20.
42236c
17. Enter the input condition (s) that determines when the
characters are to be sent:
You can use any type of input instruction.
The instruction must change from false to true each time the
characters are to be sent.
18. Enter 0.
19. Enter the tag name that stores the ASCII characters. Define the
data type as a string.
20. Enter a tag name for the AWA instruction and define the data
type as SERIAL_PORT_CONTROL.
21. Enter the LEN member of the Source tag. (The tag from step 19.)
22. Enter the LEN member of the AWA instruction. (The tag from
step 20.)
12-18
EXAMPLE
When alarm is on, the AWA instruction sends the characters in alarm_msg and appends
a termination character.
Because the number of characters in alarm_msg varies, the rung first moves the
length of alarm_msg (alarm_msg.LEN) to the length of the AWA instruction
(alarm_write.LEN).
In alarm_msg, the $14 counts as one character. It is the hex code for the Ctrl-T
character.
alarm
MOV
Move
Source alarm_msg.LEN
5
Dest
alarm_write.LEN
5
AWA
ASCII Write Append
Channel
Source
SerialPort Control
String Length
Characters Sent
EN
0
alarm_msg
'$1425\1'
alarm_write
5
6
DN
ER
42229
12-19
26.
25.
29.
30.
28.
42236d
25. Enter the input condition (s) that determines when the
characters are to be sent:
You can use any type of input instruction.
The instruction must change from false to true each time the
characters are to be sent.
26. Enter 0.
27. Enter the tag name that stores the ASCII characters. Define the
data type as a string.
28. Enter a tag name for the AWT instruction and define the data
type as SERIAL_PORT_CONTROL.
29. Enter the LEN member of the Source tag. (The tag from step 27.)
30. Enter the LEN member of the AWT instruction. (The tag from
step 28.)
12-20
EXAMPLE
When MV_update is on, the AWT instruction sends the characters in MV_msg.
Because the number of characters in MV_msg varies, the rung first moves the length
of MV_msg (MV_msg.LEN) to the length of the AWT instruction (MV_write.LEN).
In MV_msg, the $16 counts as one character. It is the hex code for the Ctrl-V
character.
MV_update
MOV
Move
Source MV_msg.LEN
10
Dest
MV_write.LEN
10
AWT
ASCII Write
Channel
Source
0
MV_msg
'$161365\8\1$r'
SerialPort Control
MV_write
String Length
10
Characters Sent
10
EN
DN
ER
42229
12-21
Then:
Go to step 1.
IMPORTANT
1.
42616
2.
line feed ($0A)
new line ($0D$0A)
42615
12-22
Notes:
Chapter
13
Depending on your application, you may not need to do all the tasks
in this procedure. Use the following table to determine where to start:
If you want to:
Then go to:
On page:
13-2
Convert a Value
13-6
13-8
Build a String
13-12
13-2
Use the following steps to extract a part of a bar code so you can take
action based on its value.
For example, a bar code may contain information about a bag on a
conveyor at an airport. To check the flight number and destination of
the bag, you extract characters 10 - 18.
airline
bar code
W A
character number
origin
flight #
5
9
destination
8
M S
date
0
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
M S
9 characters
Steps:
1. Enter the following rung:
3.
4.
2.
42808
5.
6.
2. Enter the EM bit of the ARD instruction that read the bar code.
3. Enter the string tag that contains the bar code.
4. Enter the number of characters in the part of the bar code that
you want to check.
5. Enter the position of the first character in the part of the bar
code that you want to check.
6. Enter a tag name to store the part of the bar code that you want
to check. Define the data type as a string.
EXAMPLE
13-3
In the baggage handling conveyor of an airport, each bag gets a bar code. Characters
10 - 18 of the bar code are the flight number and destination airport of the bag. After the
bar code is read (bag_read.EM is on) the MID instruction copies the flight number and
destination airport to the bag_flt_and_dest tag.
42808
13-4
In this task, you use a compare instruction (EQU, GEQ, GRT, LEQ,
LES, NEQ) to check for specific characters.
The hexadecimal values of the characters determine if one string
is less than or greater than another string.
When the two strings are sorted as in a telephone directory, the
order of the strings determines which one is greater.
l
e
s
s
e
r
g
r
e
a
t
e
r
ASCII Characters
Hex Codes
1ab
$31$61$62
1b
$31$62
$41
AB
$41$42
$42
$61
ab
$61$62
AB < B
a>B
Steps:
1. Enter a rung and a compare instruction:
EQU
NEQ
GRT
GEQ
LES
LEQ
2.
3.
13-5
6.
4.
42808
2. Enter the tag that stores the part of the bar code that you want to
check. (The Destination from Extract a Part of a Bar Code,
step 6.)
3. Enter a tag name to store the characters that you want to test
against. Define the data type as a string.
4. Double-click value area of Source B.
5. Type the ASCII characters to test against and choose OK.
42615
EXAMPLE
When bag_flt_and_dest is equal to gate[1], xfer{1] turns on. This routes the bag to the
required gate.
42808
Then:
yes
no
13-6
Convert a Value
Steps:
1. Which type of number is the value?
If:
Then:
floating-point
Go to step 2.
integer
Go to step 7.
5.
3.
42810
3. Enter the EM bit of the ARD or ARL instruction that read the
value.
4. Enter the string tag that contains the value.
5. Enter a tag name to store the value for use in your application.
Define the data type as REAL.
EXAMPLE
After reading the weight from the scale (weight_read.EM is on) the STOR instruction
converts the numeric characters in weight_ascii to a REAL value and stores the result in
weight.
42810
13-7
6. Go to step 11.
7. Enter the following rung:
9.
10.
8.
42810
8. Enter the EM bit of the ARD or ARL instruction that read the
value.
9. Enter the string tag that contains the value.
10. Enter a tag name to store the value for use in your application.
Define the data type as DINT.
EXAMPLE
When MV_read.EM is on, the STOD instruction converts the first set of numeric
characters in MV_msg to an integer value. The instruction skips the initial control
character ($06) and stops at the delimiter ( \ ).
42620
11. Does this string have another value that you want to use?
If:
Then:
yes
no
13-8
Use the following steps to extract and convert a value from an ASCII
message that contains multiple values.
For example, a message may look like this:
first value
second value
third value
control character
delimiter
delimiter
termination character
And:
Then:
Go to step 2.
Then:
floating-point
integer
42810
42810
4.
13-9
5. 6.
3.
42810
8.
9.
3. Enter the EM bit of the ARL instruction that read the value.
4. Enter the string tag that contains the value.
5. Enter a tag name to store the delimiter that marks the beginning
of the value. Define the data type as a string.
6. Double-click the value area of Search.
42615
13-10
10.
11.
42810
12.
13.
If:
Then:
STOR
Go to step 15.
STOD
Go to step 18.
15.
13-11
16.
42809
15. Enter the tag that stores the value. (The tag from step 13.)
16. Enter a tag name to store the value for use in your application.
Define the data type as REAL.
17. Go to step 20.
18.
19.
42809
18. Enter the tag that stores the value. (The tag from step 13.)
19. Enter a tag name to store the value for use in your application.
Define the data type as DINT.
20. Does the string have another value that you want to use?
If:
yes
no
Then:
A. Add 1 to the Result of the Find instruction. (The tag from
step 9.)
B. Repeat steps 2 - 19.
Stop. You are done with this procedure.
13-12
Build a String
[CR]
control character
termination character
delimiter
Steps:
1. Enter the following rung:
2.
3.
4.
42813
2. Enter the input condition (s) that determines when to build the
string.
3. Enter the DINT tag that contains the first value for the string.
4. Enter a tag name to stores the ASCII representation of the value.
Define the data type as a string.
5.
6.
13-13
8.
42813
9.
10.
5. Enter a tag name to store the control and delimiter characters for
the string. Define the data type as a string.
6. Double-click the value area of the Source A.
42615
13-14
11.
13.
12.
14.
42813
15.
11. Enter the DINT tag that contains the second value for the string.
12. Enter a tag name to store the ASCII representation of the value.
Define the data type as a string.
13. Enter the tag that stores the partially completed string. (The tag
from step 10.)
14. Enter the tag that stores the ASCII representation of the second
value. (The tag from step 12.)
15. Enter a tag name to store the completed string. Define the data
type as a string.
EXAMPLE
13-15
42813
13-16
Notes:
Chapter
14
Force Values
Notes:
consumed tag
produced tag
ATTENTION
!
1
14-2
Force Values
Enter a Force
IMPORTANT
IMPORTANT
Use the Monitor Tags tab of the Tags window or use the Ladder
window to enter forces.
Force Values
14-3
Do this:
force a BOOL
14-4
Force Values
For forced values in the more complex instructions, you can only
remove forces. You must use the data monitor to set force values for
these values.
Force Values
Enable Forces
14-5
For a force (s) to take affect, you enable forces. You can only enable
and disable forces at the controller level. You cannot enable or disable
forces for a specific module, tag collection, or tag element.
ATTENTION
IMPORTANT
When forces are enabled, a > appears next to the forced value in the
ladder editor.
14-6
Force Values
Disable Forces
You can disable forces without removing forces from individual values
or from the controller. By disabling forces, the project can execute as
programmed. Forces are still entered, but they are not executed.
Remove Forces
Do this:
Expand the value and edit the Force Mask column. Change the bit
value to . to indicate no force.
BOOL value
Type a space.
If the force is on a BOOL tag or bit value, you can also remove forces
from the ladder editor. Right-click on the value and select
Remove Force.
If you remove each force individually, forces can still be enabled.
ATTENTION
Force Values
14-7
At the controller level, you can remove all forces. Removing all forces
disables forces and clears all force mask values.
Monitor Forces
Then:
off
flashing
solid
14-8
Force Values
Notes:
Chapter
15
Data Type:
Style:
TimeLow
DINT
Decimal
TimeHigh
DINT
Decimal
Type
INT
Decimal
Code
INT
Decimal
Info
DINT[8]
Hex
2. Create a tag that will store the fault information. Select the
FaultRecord data type.
15-2
Do this:
execution of an
instruction
power loss
Create a program and main routine for the Controller Fault Handler:
A. In the controller organizer, right-click Controller Fault Handler and select New Program.
B. Type:
name_of_program
description (optional)
C. Click OK.
D. Click the + sign next to Controller Fault Handler.
E. Right-click name_of_program and select New Routine.
F. Type:
name_of_routine
description (optional)
G. From the Type drop-down list, select the programming language for the routine.
H. Click OK.
I. Right-click name_of_program and select Properties.
J. Click the Configuration tab.
K. From the Main drop-down list, select name_of_routine
L. Click OK.
M. Double-click name_of_routine.
I/O
task watchdog
mode change
motion axis
15-3
If fault_type, fault_code occurs, sets the fault type and code in the major_fault_record
tag to zero.
EQU
Equal
Source A major_fault_record.Type
0
Source B
fault_type
EQU
Equal
Source A major_fault_record.Code
0
Source B
fault_code
MOV
Move
Source
MOV
Move
Source
Dest major_fault_record.Type
0
Dest major_fault_record.Code
0
When the MAJORFAULTRECORD is set to the new values that are contained in the
major_fault_record tag, the fault clears and the controller resumes execution.
SSV
Set system value
CIP Object class
PROGRAM
CIP Object name
THIS
Attribute name
MAJORFAULTRECORD
Source major_fault_record.Time_Low
0
42372
where:
is the:
major_fault_record
fault_type
fault_code
15-4
You can use a JSR instruction to test the fault routine of a program
without creating an error (i.e., simulate a fault):
1. Create a BOOL tag that you will use to initiate the fault.
2. In the main routine or a subroutine of the program, enter the
following rung:
where:
is the:
aaa
tag that you will use to initiate the fault (Step 1.)
bbb
EXAMPLE
When test_fault_routine is on, a major fault occurs and the controller executes
Fault_Routine.
Chapter
16
EXAMPLE
Create a User-Defined
Major Fault
Then:
Yes
Go to step 2.
No
16-2
42373
EXAMPLE
where:
is:
name_of_fault_routine
When input_value is greater than or equal to 80, execution jumps to name_of_fault_routine. A major
fault occurs and the controller enters the faulted mode. Outputs go to the faulted state. The
Controller Properties dialog box, Major Faults tab, displays the code 999.
GEQ
Grtr Than or Eql (A>=B)
Source A
input_value
0
Source B
80
JSR
Jump to Subroutine
Routine name name_of_fault_routine
Input par
999
42373
Chapter
17
If a fault condition occurs that is not severe enough for the controller
to shut down, the controller generates a minor fault.
The controller continues to execute.
You do not need to clear a minor fault.
To optimize execution time and ensure program accuracy, you
should monitor and correct minor faults.
Do this:
1. Enter a GSV instructions that gets the FAULTLOG object, MinorFaultBits attribute.
2. Monitor bit 6.
1. Enter a GSV instructions that gets the FAULTLOG object, MinorFaultBits attribute.
2. Monitor bit 7.
1. Enter a GSV instructions that gets the FAULTLOG object, MinorFaultBits attribute.
2. Monitor bit 9.
low battery
1. Enter a GSV instructions that gets the FAULTLOG object, MinorFaultBits attribute.
2. Monitor bit 10.
1. Create a user-defined data type that stores the fault information. Name the data type FaultRecord
and assign the following members:
Name:
Data Type:
Style:
TimeLow
DINT
Decimal
TimeHigh
DINT
Decimal
Type
INT
Decimal
Code
INT
Decimal
Info
DINT[8]
Hex
2. Create a tag that will store the values of the MinorFaultRecord attribute. Select the data type from
step 1.
3. Monitor S:MINOR.
4. If S:MINOR is on, use a GSV instruction to get the values of the MinorFaultRecord attribute.
5. If you want to detect a minor fault that is caused by another instruction, reset S:MINOR. (S:MINOR
remains set until the end of the scan.)
17-2
EXAMPLE
Minor_fault_check times for 1 minute (60000 ms) and then automatically restarts itself.
Every minute, minor_fault_check.DN turns on for one scan. When this occurs, the GSV instruction gets
the value of the FAULTLOG object, MinorFaultBits attribute, and stores it in the minor_fault_bits tag.
Because the GSV instruction only executes once every minute, the scan time of most scans is reduced.
42373
17-3
EXAMPLE
Multiplies value_a by 1000000 and checks for a minor fault, such as a math overflow:
To make sure that a previous instruction did not produce the fault, the rung first clears S:MINOR.
The rung then executes the multiply instruction.
If the instruction produces a minor fault, the controller sets S:MINOR.
If S:MINOR is set, the GSV instruction gets information about the fault and resets S:MINOR.
42373
17-4
Notes:
Chapter
18
42195
Use the power-up handler when you want to accomplish either of the
following after power is lost and then restored:
Prevent the controller from returning to Run mode.
The power-up handler will produce a major fault, type 1,
code 1, and the controller will enter the Faulted mode.
Take specific actions and then resume normal execution of the
logic.
Develop a Power-Up
Routine
Data Type:
Style:
TimeLow
DINT
Decimal
TimeHigh
DINT
Decimal
Type
INT
Decimal
Code
INT
Decimal
Info
DINT[8]
Hex
2. Create a tag that will store the fault information. Select the
FaultRecord data type.
18-2
Detailed steps:
1. Create a program.
A. In the controller organizer, right-click Power-Up Handler and select New Program.
B. Type:
name_of_program
description (optional)
C. Click OK.
Do this:
A. Open (double-click)
name_of_routine.
B. Enter the logic for the actions.
18-3
Sets the fault type and code in the major_fault tag to zero and sets MAJORFAULTRECORD to the new
values, which clears the fault.
MOV
Move
Source
MOV
0
Dest major_fault.Type
0
Move
Source
Dest major_fault.Code
0
SSV
Set system value
CIP Object class
PROGRAM
CIP Object name
THIS
Attribute name MAJORFAULTRECORD
Source
major_fault.TimeLow
0
42375
where:
18-4
Notes:
Chapter
19
19-2
Store:
Load:
several minutes
several seconds
program mode
no
Then:
Go to Store a Project on
page 19-3.
Go to Load a Project on
page 19-6.
remove a project from the nonvolatile memory of the Go to Clear Nonvolatile Memory
controller
on page 19-10.
Store a Project
19-3
ATTENTION
Steps:
1. Go online with the controller.
2. Put the controller in Program mode (Rem Program or Program).
3.
42627
5.
42865
5. Choose Load/Store.
19-4
6.
7.
8.
42866
9.
Then select:
On Power Up
Notes:
During a power cycle, you will lose any online changes, tag values,
and network schedule that you have not stored in the nonvolatile
memory.
With this option, the project also loads when you update the
firmware of the controller. After the load, the controller
automatically goes to the mode that you select from the Load Mode
drop-down list (step 7).
You can always use RSLogix 5000 software to load the project.
On Corrupt Memory
With this option, the project also loads when you update the
firmware of the controller. After the load, the controller
automatically goes to the mode that you select from the Load Mode
drop-down list (step 7).
You can always use RSLogix 5000 software to load the project.
User Initiated
19-5
Then:
On Power Up
On Corrupt Memory
User Initiated
Go to step 8.
8. Type a note that describes the project that you are storing, if
desired.
9. Choose < Store.
A dialog box asks you to confirm the store.
10. To store the project, choose Yes.
During the store, the following events occur:
On the front of the controller, the OK LED displays the
following sequence:
flashing green red green
RSLogix 5000 software goes offline.
A dialog box tells you that the store is in progress.
11. Choose OK.
When the store is finished, you remain offline. If you want to be
online, you must manually go online.
19-6
Load a Project
In this task, you use RSLogix 5000 software to load the project from
nonvolatile memory.
ATTENTION
Steps:
1. Go online with the controller.
2. Did the following dialog box open?
42873
If:
Then:
No
Go to step 3.
Yes
Go to step 5.
4.
42627
19-7
6.
42865
6. Choose Load/Store.
Project that is currently in the nonvolatile memory of
the controller (if any project is there).
42866
7.
19-8
19-9
On the first scan of the project (S:FS is on), the GSV instruction gets the FAULTLOG object,
MinorFaultBits attribute, and stores the value in minor_fault_bits. If bit 7 is on, the controller
loaded the project from its nonvolatile memory.
42867
Where:
Is:
minor_fault_bits
NVM_load
19-10
2.
42627
4.
42865
Then:
No
Go to step 5.
Yes
Go to step 11.
5. Choose Load/Store.
6. In the Load Image drop-down list, select User Initiated.
19-11
16.
42865
19-12
42874
17.
Appendix
Fault Codes
Use the following table to determine the cause and corrective action
for a major fault. The type and code correspond to the type and code
displayed in these locations:
Controller Properties dialog box, Major Faults tab
PROGRAM object, MAJORFAULTRECORD attribute
Code:
Cause:
Recovery Method:
16
20
23
Wait for the controller I/O light to turn green before changing to
Run mode.
16
20
Adjust the value to be within the valid range. Dont exceed the
array size or go beyond dimensions defined.
21
31
34
Fix the program to not load a negative value into timer preset or
accumulated value.
42
83
84
Stack overflow.
A-2
Fault Codes
Code:
Cause:
40
42
Attempted to place controller in Run mode with Wait for the download to complete and clear fault.
keyswitch during download.
11
11
11
Move the position within tolerance and then execute Motion Axis
Fault Reset.
11
Encoder channel A, B, or Z connection is broken. Reconnect the encoder channel then execute Motion Axis Fault
Reset.
11
11
11
First execute Motion Axis Fault Reset. If that doesnt work, pull
servo module out and plug back in. If all else fails replace servo
module.
11
11
First execute Motion Axis Fault Reset. If that doesnt work, pull
servo module out and plug back in. If all else fails replace servo
module.
11
32
Recovery Method:
Fault Codes
A-3
Use the following table to determine the cause and corrective action
for a minor fault. The type and code correspond to the type and code
displayed in these locations:
Controller Properties dialog box, Minor Faults tab
PROGRAM object, MINORFAULTRECORD attribute
Code:
Cause:
Recovery Method:
35
36
51
The LEN value of the string tag is greater than the DATA
size of the string tag.
52
53
Either:
Reduce the size of the ASCII value.
Use a larger data type for the destination.
56
57
49
The CTS line is not correct for the current configuration. Disconnect and reconnect the serial port cable to
the controller.
Make sure the cable is wired correctly
A-4
Fault Codes
Code:
Cause:
Recovery Method:
10
10
Appendix
IEC61131-3 Compliance
Introduction
See page:
Operating System
B-2
Data Definitions
B-2
Programming Languages
B-3
Instruction Set
B-4
B-4
B-5
Part
Part
Part
Part
Part
1:
2:
3:
4:
5:
General Information
Equipment and Requirements Test
Programming Languages
User Guidelines
Messaging Service Specification
B-2
IEC61131-3 Compliance
Operating System
Data Definitions
IEC61131-3 Compliance
B-3
Programming Languages
B-4
IEC61131-3 Compliance
Instruction Set
IEC61131-3 Program
Portability
IEC61131-3 Compliance
B-5
Table
Number:(1)
Feature
Number:
Feature Description:
none
3a
4a
6a
Subscript delimiters ([ ])
Array subscripts
Integer literal
12, 0, -12
Real literal
12.5, -12.5
-1.34E-12, 1.234E6
Base 2 literal
2#0101_0101
Base 8 literal
8#377
Base 16 literal
16#FFE0
0, 1
Empty String
Descriptions
Descriptions
Descriptions
Descriptions
Descriptions
Descriptions
Descriptions
Descriptions
Descriptions
Descriptions
Descriptions
10
10
10
10
10
10
10
12
Time
B-6
IEC61131-3 Compliance
Table
Number:(1)
Feature
Number:
Feature Description:
10
16
none
11
none
12
12
12
13
13
13
13
Empty String
Descriptions
14
Import/export
14
Import/export
14
Import/export
14
Import/export
20
20
Available in FBD
20
Available in FBD
20
Available in FBD
21
22
22
TRN instruction
22
FRD instruction
22
TOD instruction
23
Absolute value
ABS instruction
23
Square root
SQR instruction
23
Natural log
LN instruction
23
Log base 10
LOG instruction
23
Sine in radians
SIN instruction
23
Cosine in radians
COS instruction
23
Tangent in radians
TAN instruction
23
ASN instruction
23
10
ACS instruction
23
11
ATN instruction
24
12
Arithmetic add
ADD instruction
IEC61131-3 Compliance
Table
Number:(1)
Feature
Number:
Feature Description:
24
13
Arithmetic multiplication
MUL instruction
24
14
Arithmetic subtraction
SUB instruction
24
15
Arithmetic divide
DIV instruction
24
16
Modulo
MOD instruction
24
17
Exponentiation
XPY instruction
24
18
Value move
25
25
25
25
26
AND
26
OR
26
XOR
26
NOT
27
Select
27
2a
Maximum select
27
2b
Minimum select
27
High/Low limit
27
Multiplexer
28
Comparison greater-than
GRT instruction
28
GRE instruction
28
Comparison equal
EQU instruction
28
Comparison less-than
LES instruction
28
LEQ instruction
28
10
NEQ instruction
29
String length
29
Middle string
29
String concatenation
29
String insert
29
String delete
29
Find string
32
Input read
FBD editor
B-7
B-8
IEC61131-3 Compliance
Table
Number:(1)
Feature
Number:
Feature Description:
32
Input write
FBD editor
32
Output read
FBD editor
32
Output write
FBD editor
34
34
35
35
36
1b
Up-counter
37
2a
On-delay timer
37
3a
Off-delay timer
38
On-delay timing
38
Off-delay timing
57
1, 2
Horizontal line
57
3, 4
Vertical line
57
5, 6
57
9, 10
57
11, 12
57
7,8
FBD editor
57
13,14
Connectors
FBD editor
58
Unconditional jump
58
Jump target
58
Conditional jump
58
Conditional return
58
Unconditional return
59
Ladder editor
59
Ladder editor
60
Horizontal link
Ladder editor
60
Vertical link
Ladder editor
61
1, 2
61
3, 4
61
5, 6
IEC61131-3 Compliance
Table
Number:(1)
Feature
Number:
Feature Description:
62
62
62
62
62
(1)Table
B-9
associated with languages other than ladder diagram and function block diagram have been skipped.
B-10
IEC61131-3 Compliance
Notes:
Glossary
alias tag
A tag that references another tag. An alias tag can refer to another
alias tag or a base tag. An alias tag can also refer to a component of
another tag by referencing a member of a structure, an array element,
or a bit within a tag or member. See base tag.
ASCII
A 7-bit code (with an optional parity bit) that is used to represent
alphanumerical characters, punctuation marks, and control-code
characters. For a list of ASCII codes, see the back cover of this manual.
asynchronous
Actions that occur independent of each other and lack a regular
pattern. In Logix5000 controllers, I/O values update asynchronous to
the execution of logic.:
Programs within a task access input and output data directly
from controller-scoped memory.
Logic within any task can modify controller-scoped data.
Data and I/O values are asynchronous and can change during
the course of a tasks execution.
An input value referenced at the beginning of a tasks execution
can be different when referenced later.
ATTENTION
Glossary
array
An array lets you group data (of the same data type) under a common
name.
An array is similar to a file.
A subscript (s) identifies each individual element within the
array.
A subscript starts at 0 and extends to the number of elements
minus 1 (zero based).
To expand an array and
display its elements, click
the + sign.
elements of
timer_presets
six DINTs
42367
Glossary
42367
Glossary
For example:
one dimension
Tag name:
Type
Dimension 0
Dimension 1
Dimension 2
one_d_array
DINT[7]
--
--
Tag name:
Type
Dimension 0
Dimension 1
Dimension 2
two_d_array
DINT[4,5]
--
Tag name:
Type
Dimension 0
three_d_array
DINT[2,3,4] 2
Dimension 1
Dimension 2
base tag
A tag that actually defines the memory where a data element is stored.
See alias tag.
Glossary
bidirectional connection
A connection in which data flows in both directions: from the
originator to the receiver and from the receiver to the originator. See
connection, unidirectional connection.
binary
Integer values displayed and entered in base 2 (each digit represents a
single bit). Prefixed with 2#. Padded out to the length of the boolean
or integer (1, 8, 16, or 32 bits). When displayed, every group of four
digits is separated by an underscore for legibility. See decimal,
hexadecimal, octal.
bit
Binary digit. The smallest unit of memory. Represented by the digits 0
(cleared) and 1 (set).
BOOL
An data type that stores the state of a single bit, where:
0 equals off
1 equals on
branch
There is no limit to the number of parallel branch levels that you can
enter. The following figure shows a parallel branch with five levels.
The main rung is the first branch level, followed by four additional
branches.
input instruction
output instruction
Glossary
output instruction
byte
A unit of memory consisting of 8 bits.
cached connection
With the MSG instruction, a cached connection instructs the controller
to maintain the connection even after the MSG instruction completes.
This is useful if you repeatedly execute the MSG instruction because
initiating the connection each time increases scan time. See
connection, uncached connection.
change of state (COS)
Any change in the status of a point or group of points on an I/
O module.
CIP
See Control and Information Protocol.
communication format
Defines how an I/O module communicates with the controller.
Choosing a communication format defines:
what configuration tabs are available through the
programming software
the tag structure and configuration method
Glossary
compatible module
An electronic keying protection mode that requires that the vendor,
catalog number, and major revision attributes of the physical module
and the module configured in the software match in order to establish
a connection to the module. See disable keying, exact match.
connection
The communication mechanism from the controller to another module
in the control system. The number of connections that a single
controller can have is limited. Communications with I/O modules,
consumed tags, produced tags, and MSG instructions use connections
to transfer data.
consumed tag
A tag that receives the data that is broadcast by a produced tag over a
ControlNet network or ControlLogix backplane. A consumed tag must
be:
controller scope
same data type (including any array dimensions) as the remote
tag (produced tag)
See produced tag.
continuous task
The task that runs continuously.
The continuous task runs in the background. Any CPU time not
allocated to other operations (such as motion, communications,
and periodic tasks) is used to execute the programs within the
continuous task.
The continuous task restarts itself after the last of its programs
finishes.
A project does not require a continuous task.
If used, there can be only one continuous task.
All periodic tasks interrupt the continuous task.
When you create a project, the default MainTask is the
continuous task. You can leave this task as it is, or you can
change its properties (name, type, etc.).
See periodic task.
Glossary
Glossary
COUNTER
Structure data type that contains status and control information for
counter instructions
data type
A definition of the memory size and layout that will be allocated when
you create a tag of that data type.
decimal
Integer values displayed and entered in base 10. No prefix. Not
padded to the length of the integer. See binary, hexadecimal, octal.
description
Optional text that you can use to further document your application.
You can use any printable character, including carriage return,
tab, and space.
Descriptions do not download to the controller. They remain in
the offline project file.
Descriptions have these length limitations:
For tags, you can use up to 120 characters.
For other objects (tasks, programs, modules, etc.), you can
use up to 128 characters.
dimension
Specification of the size of an array. Arrays can have as many as three
dimensions. See array.
DINT
A data type that stores a 32-bit (4-byte) signed integer value
(-2,147,483,648 to +2,147,483,647). In Logix5000 controllers, use
DINTs for integers:
Logix5000 controllers execute more efficiently and use less
memory when working with 32-bit integers (DINTs) instead of
16-bit integers (INTs) or 8-bit integers (SINTs).
Typically, instructions convert SINT or INT values to an optimal
data type (usually a DINT or REAL value) during execution.
Because this requires additional time and memory, minimize the
use of the SINT and INT data types.
Glossary
10
direct
An I/O connection where the controller establishes an individual
connections with an I/O module. See rack optimized.
disable keying
An electronic keying protection mode that requires no attributes of the
physical module and the module configured in the software to match
and still establishes a connection to the module. See compatible
module, exact match.
download
The process of transferring the contents of a project on the
workstation into the controller. See upload.
elapsed time
The total time required for the execution of all operations configured
within a single task.
If the controller is configured to run multiple tasks, elapsed time
includes any time used/shared by other tasks performing other
operations.
While online, you can use the Task Properties dialog box to view
the maximum scan time and the last scan time in ms for the
current task. These values are elapsed time, which includes any
time spent waiting for higher-priority tasks.
See execution time.
electronic keying
A feature of the 1756 I/O line where modules can be requested to
perform an electronic check to insure that the physical module is
consistent with what was configured by the software. Enables the user
via the software to prevent incorrect modules or incorrect revisions of
modules from being inadvertently used. See compatible module,
disable keying, exact match.
Glossary
11
element
An addressable unit of data that is a sub-unit of a larger unit of data. A
single unit of an array.
You specify an element in an array by its subscript(s):
For this array:
Specify:
one dimension
array_name[subscript_0]
two dimension
array_name[subscript_0,
subscript_1]
three dimension
array_name[subscript_0,
subscript_1, subscript_2]
See array.
exact match
An electronic keying protection mode that requires that all attributes
(vendor, catalog number, major revision, and minor revision) of the
physical module and the module configured in the software match in
order to establish a connection to the module.
execution time
The total time required for the execution of a single program.
Execution time includes only the time used by that single
program, and excludes any time shared/used by programs in
other tasks performing other operations.
When online, use the Program Properties dialog box to view the
maximum scan time and the last scan time (in s) for the current
program. These values are execution times for the program and
do not include any time spent waiting for other programs or
higher-priority tasks.
See elapsed time.
exponential
Real values displayed and entered in scientific or exponential format.
The number is always displayed with one digit to the left of the
decimal point, followed by the decimal portion, and then by an
exponent. See style.
Glossary
12
faulted mode
The controller generated a major fault, could not clear the fault, and
has shut down.
See major fault.
float
Real values displayed and entered in floating point format. The
number of digits to the left of the decimal point varies according to
the magnitude of the number. See style.
hexadecimal
Integer values displayed and entered in base 16 (each digit represents
four bits). Prefixed with 16#. Padded out to length of the boolean or
integer (1, 8, 16, or 32 bits). When displayed, every group of four
digits is separated by an underscore for legibility. See binary, decimal,
octal.
immediate value
An actual 32-bit signed real or integer value. Not a tag that stores
a value.
index
A reference used to specify an element within an array.
instruction
The controller evaluates ladder instructions based on the rung
condition preceding the instruction (rung-condition-in).
input instruction
rung-condition-in
rung-condition-out
output instruction
Glossary
13
EXAMPLE
When running_seconds.DN turns on, running_hours counts up by one and running_seconds resets.
running_seconds.DN
CTU
Count Up
Counter
Preset
Accum
running_hours
500
0
CU
DN
running_seconds
RES
When machine_on turns on, turns on drill_1_on. When both machine_on and drill[1].part_advance
are on, turns on conveyor_on.
machine_on
drill_1_on
drill[1].part_advance
conveyor_on
42362
Glossary
14
INT
A data type that stores a 16-bit (2-byte) integer value
(-32,768 to +32,767). Minimize your use of this data type:
Typically, instructions convert SINT or INT values to an optimal
data type (usually a DINT or REAL value) during execution.
Because this requires additional time and memory, minimize the
use of the SINT and INT data types.
interface module (IFM)
A pre-wired I/O field wiring arm.
listen-only connection
An I/O connection where another controller owns/provides the
configuration data for the I/O module. A controller using a listen-only
connection does not write configuration data and can only maintain a
connection to the I/O module when the owner controller is actively
controlling the I/O module. See owner controller.
load
To copy a project from nonvolatile memory to the user memory
(RAM) of the controller. This overwrites any project that is currently in
the controller. See nonvolatile memory, store.
main routine
The first routine to execute when a program executes. Use the main
routine to call (execute) other routines (subroutines).
Glossary
15
major fault
A fault condition that is severe enough for the controller to shut
down, unless the condition is cleared. When a major fault occurs, the
controller:
1. Sets a major fault bit
2. Runs user-supplied fault logic, if it exists
3. If the user-supplied fault logic cannot clear the fault, the
controller goes to faulted mode
4. Sets outputs according to their output state during program
mode
5. OK LED flashes red
The controller supports two levels for handling major faults:
program fault routine:
Each program can have its own fault routine.
The controller executes the programs fault routine when an
instruction fault occurs.
If the programs fault routine does not clear the fault or a
program fault routine does not exist, the controller proceeds
to execute the controller fault handler (if defined).
controller fault handler:
If the controller fault handler does not exist or cannot clear
the major fault, the controller enters faulted mode and shuts
down. At this point, the FAULTLOG is updated. (See the next
page.)
All non-instruction faults (I/O, task watchdog, etc.) execute
the controller fault handler directly. (No program fault routine
is called.)
The fault that was not cleared, and up to two additional faults that
have not been cleared, are logged in the controller fault log.
Glossary
16
yes
instruction fault?
no
yes
program fault
routine exists?
execute current
programs
fault routine
no
yes
fault cleared?
no
continue logic
execution
controller logs major
fault to controller fault
handler PROGRAM
MajorFaultRecord
no
controller fault
handler exists
yes
execute controller
fault handler
yes
fault cleared?
no
continue logic
execution
enter faulted mode
record FAULTLOG
shut down
Glossary
17
References the:
timer_1.pre
input_load.height
References the:
input_location.load_info.height
Glossary
18
array_tag[position].substructure_name.member
_name
For example:
This address:
References the:
conveyor[10].source
conveyor[10].info.height
See structure.
memory
Electronic storage media built into a controller, used to hold programs
and data.
minor fault
A fault condition that is not severe enough for the controller to shut
down:
If this occurs:
problem with an instruction
The controller:
1. sets S:MINOR
2. logs information about the fault to the
PROGRAM object, MinorFaultRecord
attribute
3. sets bit 4 of the FAULTLOG object,
MinorFaultBits attribute
low battery
Glossary
19
Glossary
20
name
Names identify controllers, tasks, programs, tags, modules, etc. Names
follow IEC-1131-3 identifier rules and:
must begin with an alphabetic character (A-Z or a-z) or an
underscore (_)
can contain only alphabetic characters, numeric characters,
and underscores
can have as many as 40 characters
must not have consecutive or trailing underscore characters (_)
are not case sensitive
download to the controller
network update time (NUT)
The repetitive time interval in which data can be sent on a
ControlNet network. The network update time ranges from
2ms-100ms.
nonvolatile memory
Memory of the controller that retains its contents while the controller
is without power or a battery. See load, store.
object
A structure of data that stores status information. When you enter a
GSV/SSV instruction, you specify the object and its attribute that you
want to access. In some cases, there are more than one instance of the
same type of object, so you might also have to specify the object
name. For example, there can be several tasks in your application.
Each task has its own TASK object that you access by the task name.
octal
Integer values displayed and entered in base 8 (each digit represents
three bits). Prefixed with 8#. Padded out to the length of the boolean
or integer (1, 8, 16, or 32 bits). When displayed, every group of three
digits is separated by an underscore for legibility. See binary, decimal,
hexadecimal.
offline
Viewing and editing a project that is on the hard disk of a workstation.
See online.
Glossary
21
online
Viewing and editing the project in a controller. See offline.
optimal data type
A data type that a Logix5000 instruction actually uses (typically the
DINT and REAL data types).
In the instruction set reference manuals, a bold data type
indicates an optimal data type.
Instructions execute faster and require less memory if all the
operands of the instruction use:
the same data type
an optimal data type
If you mix data types and use tags that are not the optimal data
type, the controller converts the data according to these rules
Are any of the operands a REAL value?
If:
Yes
REALs
No
DINTs
Glossary
22
Result:
The controller truncates the upper portion of the larger integer and generates an overflow.
For example:
Decimal
Binary
DINT
65,665
0000_0000_0000_0001_0000_0000_1000_0001
INT
129
0000_0000_1000_0001
SINT
-127
1000_0001
DINT to REAL
Data precision could be lost. Both data types store data in 32 bits, but the REAL type uses some
of its 32 bits to store the exponent value. If precision is lost, the controller takes it from the
least-significant portion of the DINT.
REAL to integer
The controller rounds the fractional part and truncates the upper portion of the non-fractional
part. If data is lost, the controller sets the overflow status flag.
Numbers round as follows:
Numbers other than x.5 round to the nearest number.
X.5 rounds to the nearest even number.
For example:
REAL (source)
DINT
(result)
-2.5
-2
-1.6
-2
-1.5
-2
-1.4
-1
1.4
1.5
1.6
2.5
owner controller
The controller that creates the primary configuration and
communication connection to a module. The owner controller writes
configuration data and can establish a connection to the module. See
listen-only connection.
Glossary
23
path
A description of the devices and networks between one device and
another. A connection from one device to another follows the
specified path. See connection.
periodic task
A task that is triggered by the operating system at a repetitive period
of time.
Use a periodic task for functions that require accurate or
deterministic execution.
Whenever the time expires, the task is triggered and its
programs are executed.
Data and outputs established by the programs in the task retain
their values until the next execution of the task or they are
manipulated by another task.
You can configure the time period from 1 ms to 2000 s. The
default is 10 ms.
ATTENTION
Glossary
24
prescan
A function of the controller where the logic is examined prior to
execution in order initialize instructions and data.
The controller performs prescan when you change the controller from
Program mode to Run mode.
priority
Specifies which task to execute first if two tasks are triggered at the
same time.
postscan
A function of the controller where the logic within a program is
examined before disabling the program in order reset instructions
and data.
power-up handler
An optional task that executes when the controller powers up in the
Run mode. To use the Power-Up Handler, you must create a
power-up program and associated main routine.
42195
Glossary
25
No
No
Yes
Yes
Does the Power-Up Handler
contain a program?
Yes
Major fault, type 1, code 1,
occurs.
No
Controller enters the
faulted mode.
produced tag
A tag that a controller is making available for use by other controllers.
Produced tags are always at controller scope. See consumed tag.
product defined structure
A structure data type that is automatically defined by the software and
controller. By configuring an I/O module you add the product defined
structure for that module.
Glossary
26
program
A set of related routines and tags.
Each program contains program tags, a main executable routine,
other routines, and an optional fault routine.
To execute the routines in a program, you assign (schedule) the
program to a task:
When a task is triggered, the scheduled programs within the
task execute to completion from first to last.
When a task executes a program, the main routine of the
program executes first.
The main routine can, in turn, execute subroutines using the
JSR instruction.
The Unscheduled Programs folder contains programs that arent
assigned to a task.
If the logic in the program produces a major fault, execution
jumps to a configured fault routine for the program.
The routines within a program can access the following tags:
program tags of the program
controller tags
Routines cannot access the program tags of other programs.
See routine, task.
program scope
Data accessible only within the current program. Each program
contains a collection of tags that can only be referenced by the
routines and alias tags in that program. See controller scope.
project file
The file on your workstation (or server) that stores the logic,
configuration, data, and documentation for a controller.
The project file has an .ACD extension.
When you create a project file, the file name is the name of the
controller.
The controller name is independent of the project file name. If
you save a current project file as another name, the controller
name is unchanged.
If the name of the controller is different than the name of the
project file, the title bar of the RSLogix 5000 software displays
both names.
See application.
Publication 1756-PM001C-EN-P - June 2001
Glossary
27
rack optimized
An I/O connection where the 1756-CNB module collects digital I/O
words into a rack image (similar to 1771-ASB). A rack optimized
connection conserves ControlNet connections and bandwidth,
however, limited status and diagnostic information is available when
using this connection type. See direct.
rate
For a periodic task, the rate at which the controller executes the task,
from 1 ms to 2,000,000 ms (2000 seconds). The default is 10 ms.
REAL
A data type that stores a 32-bit (4-byte) IEEE floating-point value, with
the following range:
-3.402823E38 to -1.1754944E-38 (negative values)
0
1.1754944E-38 to 3.402823E38 (positive values)
The REAL data type also stores infinity and NAN, but the software
display differs based on the display format.
Display Format:
Equivalent:
Real
+infinite
- infinite
+NAN
-NAN
1.$
-1.$
1.#QNAN
-1.#QNAN
Exponential
+infinite
- infinite
+NAN
-NAN
1.#INF000e+000
-1.#INF000e+000
1.#QNAN00e+000
-1.#QNAN00e+000
Glossary
28
scan time
See elapsed time, execution time.
Glossary
29
scope
Defines where you can access a particular set of tags. When you
create a tag, you assign (scope) it as either a controller tag or a
program tag for a specific program, as depicted below.
42195
Glossary
30
store
To copy a project to the nonvolatile memory of the controller. This
overwrites any project that is currently in the nonvolatile memory.
See load, nonvolatile memory.
string
A group of data types that store ASCII characters.
42811
42812
or
Data Type:
Description:
Notes:
LEN
DINT
number of characters
in the string
The LEN automatically updates to the new count of characters whenever you:
use the String Browser dialog box to enter characters
use instructions that read, convert, or manipulate a string
The LEN shows the length of the current string. The DATA member may contain
additional, old characters, which are not included in the LEN count.
DATA
SINT array
To access the characters of the string, address the name of the tag.
For example, to access the characters of the string_1 tag, enter
string_1.
Each element of the DATA array contains one character.
You can create new string data types that store less or more characters.
Glossary
31
IMPORTANT
Then:
The following example shows the STRING data type and a new string
data type.
42234
Glossary
32
structure
Some data types are a structure.
A structure stores a group of data, each of which can be a
different data type.
Within a structure, each individual data type is called a
member.
Like tags, members have a name and data type.
You create your own structures, called a user-defined data
type, using any combination of individual tags and most other
structures.
To copy data to a structure, use the COP instruction. See the
Logix5000 Controllers General Instruction Set Reference Manual,
publication 1756-RM003.
The COUNTER and TIMER data types are examples of commonly
used structures.
COUNTER structure
To collapse a structure
and hide its members,
click the sign.
TIMER structure
members of
running_seconds
42365
Glossary
33
10%
9 ms
1 ms
20%
4 ms
1 ms
33%
2 ms
1 ms
50%
1 ms
1 ms
Glossary
34
1 ms
1 ms
system overhead
9 ms
9 ms
continuous task
5
10
15
20
25
1 ms
1 ms
1 ms
periodic task
1 ms
1 ms
system overhead
9 ms of continuous task time
continuous task
5
10
15
20
25
1 ms
1 ms
1 ms
1 ms
system overhead
4 ms
4 ms
4 ms
4 ms
4 ms
continuous task
5
elapsed time (ms)
10
15
20
25
Glossary
35
10
15
20
25
If the controller only contains a periodic task (s), the system overhead
timeslice value has no effect. System overhead runs whenever a
periodic task is not running.
periodic task
system overhead
5
10
15
20
25
Glossary
36
tag
A named area of the controllers memory where data is stored.
Tags are the basic mechanism for allocating memory,
referencing data from logic, and monitoring data.
The minimum memory allocation for a tag is four bytes.
When you create a tag that stores a BOOL, SINT, or INT
(which are smaller than four bytes), the controller allocates
four bytes, but the data only fills the part it needs.
User-defined data types and arrays store data in contiguous
memory and pack smaller data types into 32-bit words.
The following examples show memory allocation for various
tags:
start, which uses the BOOL data type:
Memory
allocation
allocation
Bits
31
start
not used
Bits
31
station_status
Bits
31
24
allocation 1
mixer.pressure
allocation 2
mixer.temp
allocation 3
mixer.agitate_time
allocation 4
unused
23
unused
16
15
unused
8 7
bit 0 mixer.inlet
bit 1 mixer.drain
bit 2 mixer.agitate
Glossary
37
Bits
31
16
allocation 1
temp_buffer[1]
temp_buffer[0]
allocation 2
temp_buffer[3]
temp_buffer[2]
uncached connection
With the MSG instruction, an uncached connection instructs the
controller to close the connection upon completion of the mSG
instruction. Clearing the connection leaves it available for other
controller uses. See connection, cached connection.
unidirectional connection
A connection in which data flows in only one direction: from the
originator to the receiver. See connection, bidirectional connection.
Glossary
38
upload
The process of transferring the contents of the controller into a project
file on the workstation.
If you do not have the project file for a controller, you can upload
from the controller and create a project file. However, not everything
that is stored in a project file is available from the controller. If you
upload from a controller, the new project file will not contain:
rung comments
descriptions for tags, tasks, programs, routines, modules, or
user-defined structures
chains of aliases (aliases pointing to other aliases)
Alias chains are not completely reconstructed from the
controller. If there are several possible names for a data item, the
firmware and software choose a best-fit alias that may not reflect
how the alias was specified in the original project.
See download.
user-defined data type
You can also create your own structures, called a user-defined data
type (also commonly referred to as a user-defined structure). A
user-defined data type groups different types of data into a single
named entity.
Glossary
39
less efficient
BOOL
BOOL
BOOL
DINT
BOOL
BOOL
DINT
DINT
DINT
BOOL
Glossary
40
watchdog
Specifies how long a task can run before triggering a major fault.
Each task has a watchdog timer that monitors the execution of
the task.
A watchdog time can range from 1 ms to 2,000,000 ms (2000
seconds). The default is 500 ms.
The watchdog timer begins to time when the task is initiated and
stops when all the programs within the task have executed.
If the task takes longer than the watchdog time, a major fault
occurs: (The time includes interruptions by other tasks.)
A watchdog time-out fault (major fault) also occurs if a task
triggered again while it is executing (periodic task overlap). This
can happen if a lower-priority task is interrupted by a
higher-priority task, delaying completion of the lower-priority
task.
You can use the controller fault handler to clear a watchdog
fault. If the same watchdog fault occurs a second time during the
same logic scan, the controller enters faulted mode, regardless
of whether the controller fault handler clears the watchdog fault.
ATTENTION
Index
A
address
assign indirect 7-1
enter 4-7
alias
create 6-3
use 6-1
array
create 3-10
index through 7-1
organize 3-1
produce large array 11-1
ASCII
build string 13-12
compare characters 13-4
configure serial port 12-3
configure user protocol 12-5
connect device 12-2
convert characters 13-6
decode message 13-8
enter characters 12-21
extract characters 13-2
manipulate characters 13-1
organize data 12-8
read characters 12-9
write characters 12-14
B
bar code
extract characters 13-2
test characters 13-4
branch
enter 4-3
buffer
I/O 8-1
C
chassis size 1-3
clear
major fault 9-4, 15-1
minor fault 17-1
codes
major fault A-1
minor fault A-3
communicate
other controllers 10-1
compare
D
data
ASCII 12-8
definitions B-2
enter ASCII characters 12-21
force 14-1
produce and consume 10-1
data table 3-1
download 9-2
driver
configure 9-1
Index
E
enter
address 4-7
ASCII characters 12-21
force 14-2
function block instruction 4-4
ladder instruction 4-3
Ethernet
configure driver 9-1
produce and consume tags 10-1
extract
ASCII characters 13-2
instruction
enter function block 4-4
enter ladder 4-3
instruction set B-4
IREF 4-4
L
LED
force 14-7
load a project 19-1
logic
enter function block instruction 4-4
enter ladder instruction 4-3
F
fault
clear 9-4, 15-1
create user-defined 16-1
develop routine to clear fault 15-1, 18-1
major fault codes A-1
minor fault codes A-3
monitor minor 17-1
test a fault routine 15-4
force
disable 14-6
enable 14-5
enter 14-2
LED 14-7
monitor 14-7
remove 14-6
tag 14-1
function block
controllers that support function blocks 2-1
enter 4-4
M
major fault
codes A-1
create user-defined 16-1
develop fault routine 15-1, 18-1
manipulate string 13-1
message
decode string 13-8
organize tags 10-11
minor fault
clear 17-1
codes A-3
logic 17-1
mode
controller 9-3
monitor forces 14-7
N
nonvolatile memory 19-1
I
I/O
buffer 8-1
synchronize with logic 8-1
ICON 4-4
IEC 1131-3 compliance
data definitions B-2
instruction set B-4
introduction B-1
operating system B-2
program portability B-4
programming language B-3
tables B-5
indirect address 7-1
Publication 1756-PM001C-EN-P - June 2001
O
OCON 4-4
open
routine 4-1
operating system B-2
OREF 4-4
organize
array 3-1
strings 12-8
structure 3-1
tag 3-1
tasks 2-2
Index
P
PLC-5C
share data 10-6, 10-7, 10-9
produce
large array 11-1
tag 10-1
tags for PLC-5C 10-6, 10-7
program
portability B-4
program mode 9-3
programming language B-3
project
download 9-2
load from nonvolatile memory 19-1
store in nonvolatile memory 19-1
upload 9-4
project file
create 1-1
R
read
ASCII characters 12-9
routine
create 2-3
enter function block instructions 4-4
enter ladder instructions 4-3
languages 2-1
open 4-1
verify 4-10
RSLinx
configure 9-1
run mode 9-3
rung
enter 4-3
S
save 1-2
see also store a project
save as 1-2
send
ASCII characters 12-14
serial
cable wiring 12-2
configure port for ASCII 12-3
connect an ASCII device 12-2
shut down the controller 16-1
slot number 1-3
status
T
tag
assign 4-7
create 3-10, 4-7
create alias 6-3
create using Excel 3-11
enter 4-7
force 14-1
organize 3-1
organize for message 10-11
produce and consume 10-1
produce large array 11-1
share with PLC-5C 10-6, 10-7, 10-9
string 12-8
task
organize 2-2
test a fault routine 15-4
test mode 9-3
U
upload 9-4
Index
user protocol
configure for ASCII 12-5
user-defined data type
create 3-8
V
verify
controller 2-5
routine 4-10
W
weight
convert 13-6
write
ASCII characters 12-14
Allen-Bradley
Publication Problem Report
If you find a problem with our documentation, please complete and return this form.
Pub. Title/Type
Cat. No.
Pub. No.
1756-PM001C-EN-P
Pub. Date
June 2001
Part No.
957464-72
Describe Problem(s)
Technical Accuracy
text
Completeness
procedure/step
illustration
definition
info in manual
example
guideline
feature
(accessibility)
explanation
other
illustration
Clarity
What is unclear?
Sequence
What is not in the right order?
Other Comments
Use back for more comments.
Your Name
Location/Phone
Return to: Marketing Communications, Allen-Bradley., 1 Allen-Bradley Drive, Mayfield Hts., OH 44124-6118Phone:(440) 646-3176
FAX:(440) 646-4320
PN 955107-82
NO POSTAGE
NECESSARY
IF MAILED
IN THE
UNITED STATES
1 ALLEN-BRADLEY DR
MAYFIELD HEIGHTS OH 44124-9705
PLEASE REMOVE
Other Comments
Character
Dec
Hex
Character
Dec
Hex
Character
Dec
Hex
[ctrl-@] NUL 0
$00
SPACE
32
$20
64
$40
96
$60
[ctrl-A] SOH
$01
33
$21
65
$41
97
$61
[ctrl-B] STX
$02
34
$22
66
$42
98
$62
[ctrl-C] ETX
$03
35
$23
67
$43
99
$63
[ctrl-D] EOT
$04
36
$24
68
$44
100
$64
[ctrl-E] ENQ
$05
37
$25
69
$45
101
$65
[ctrl-F] ACK
$06
&
38
$26
70
$46
102
$66
[ctrl-G] BEL
$07
39
$27
71
$47
103
$67
[ctrl-H] BS
$08
40
$28
72
$48
104
$68
[ctrl-I] HT
$09
41
$29
73
$49
105
$69
[ctrl-J] LF
10
$l ($0A)
42
$2A
74
$4A
106
$6A
[ctrl-K] VT
11
$0B
43
$2B
75
$4B
107
$6B
[ctrl-L] FF
12
$0C
44
$2C
76
$4C
108
$6C
[ctrl-M] CR
13
$r ($0D)
45
$2D
77
$4D
109
$6D
[ctrl-N] SO
14
$0E
46
$2E
78
$4E
110
$6E
[ctrl-O] SI
15
$0F
47
$2F
79
$4F
111
$6F
[ctrl-P] DLE
16
$10
48
$30
80
$50
112
$70
[ctrl-Q] DC1
17
$11
49
$31
81
$51
113
$71
[ctrl-R] DC2
18
$12
50
$32
82
$52
114
$72
[ctrl-S] DC3
19
$13
51
$33
83
$53
115
$73
[ctrl-T] DC4
20
$14
52
$34
84
$54
116
$74
[ctrl-U] NAK
21
$15
53
$35
85
$55
117
$75
[ctrl-V] SYN
22
$16
54
$36
86
$56
118
$76
[ctrl-W] ETB
23
$17
55
$37
87
$57
119
$77
[ctrl-X] CAN
24
$18
56
$38
88
$58
120
$78
[ctrl-Y] EM
25
$19
57
$39
89
$59
121
$79
[ctrl-Z] SUB
26
$1A
58
$3A
90
$5A
122
$7A
ctrl-[ ESC
27
$1B
59
$3B
91
$5B
123
$7B
[ctrl-\] FS
28
$1C
<
60
$3C
92
$5C
124
$7C
ctrl-] GS
29
$1D
61
$3D
93
$5D
125
$7D
[ctrl-^] RS
30
$1E
>
62
$3E
94
$5E
126
$7E
[ctrl-_] US
31
$1F
63
$3F
95
$5F
DEL
127
$7F
Character
Dec
PN 957464-72
2001 Rockwell International Corporation. Printed in the U.S.A.