Logix 5000 Controllers Tasks, Programs, and Routines
Logix 5000 Controllers Tasks, Programs, and Routines
Identifies information that is critical for successful application and understanding of the product.
Allen-Bradley, Rockwell Software, Rockwell Automation, and TechConnect are trademarks of Rockwell Automation, Inc.
Trademarks not belonging to Rockwell Automation are property of their respective companies.
Summary of changes
This manual contains new and updated information. There are a number of minor
changes throughout this publication that were made to clarify existing
information. The major changes are listed in the following table.
Change
Topic
Updated GSV and SSV classes and attributes from all-capital letters to
initial capitalization for version 24.
Table of contents
Preface
Chapter 1
Manage tasks
Introduction ............................................................................................................ 9
Select controller tasks ............................................................................................. 9
Use caution in the number of tasks that you use ..................................... 11
Prioritize periodic and event tasks ..................................................................... 11
Additional considerations ............................................................................ 12
Example ........................................................................................................... 13
Leave enough time for unscheduled communication .................................... 14
Avoid overlaps ....................................................................................................... 15
Manually check for overlaps ........................................................................ 16
Programmatically check for overlaps.......................................................... 17
Configure output processing for a task ............................................................. 19
Manually configure output processing ...................................................... 21
Programmatically configure output processing........................................ 22
Inhibit a task .......................................................................................................... 23
Manually inhibit or uninhibit a task .......................................................... 24
Programmatically inhibit or uninhibit a task ........................................... 25
Create a task........................................................................................................... 26
Create a periodic task .................................................................................... 27
Language switching ....................................................................................... 29
Adjust the system-overhead time slice .............................................................. 30
Configure the system-overhead time slice ................................................. 31
Adjust the system watchdog time ...................................................................... 32
Adjust the watchdog timer for a task ......................................................... 33
Chapter 2
Manage event tasks
Introduction .......................................................................................................... 35
Choose the trigger for an event task .................................................................. 35
Module Input Data State Change trigger......................................................... 37
How an I/O module triggers an event task ............................................... 37
Make sure your module can trigger an event task .................................... 40
Checklist for an Input Event Task ............................................................. 40
Example Input Event Task ....................................................................... 42
Estimate throughput ..................................................................................... 43
Example estimate throughput.................................................................. 44
Rockwell Automation Publication 1756-PM005-EN-P - October 2014
Table of contents
Index
Preface
This manual details how to set up controller tasks and the programs and routines
for the proper execution of these tasks. This manual is one of a set of related
manuals that show common procedures for programming and operating
Logix5000 controllers.
For a complete list of common procedures manuals, refer to the Logix5000
Controllers Common Procedures Programming Manual, publication 1756PM001.
The term Logix5000 controller refers to any controller that is based on the
Logix5000 operating system.
Preface
Additional resources
Description
Chapter 1
Manage tasks
Introduction
The default project provides a single task for all your logic. Although this is
sufficient for many applications, some situations may require more than one task.
A different task can interrupt a task that is running and take control.
Continuous Task
Chapter 1
Manage tasks
If you want to run a section of your Then use this type of Description
logic
task
At a constant period (for
example, every 100 ms)
Periodic Task
Event Task
Fill a tank to its maximum level and then open a drain valve.
Continuous task
Continuous task
Continuous task
Your system must check the position of a field arm each 0.1 s and calculate the average Periodic task
rate of change in its position. This is used to determine braking pressure.
Read the thickness of a paper roll every 20 ms.
Periodic task
A packaging line glues boxes closed. When a box arrives at the gluing position, the
controller must immediately run the gluing routine.
Event task
Event task
In an engine test stand, you want to capture and archive each analog data immediately Event task
after each sample of data.
Immediately after receiving new production data, load the data into the station.
Event task
In a line that packages candy bars, you have to make sure that the perforation occurs in Event task
the correct location on each bar. Each time the registration sensor detects the
registration mark, check the accuracy of an axis and perform any required adjustment.
A gluing station must adjust the amount of glue it applies to compensate for changes in Event task
the speed of the axis. After the motion planner runs, check the command speed of the
axis and vary the amount of glue, if needed.
10
Manage tasks
In a production line, if any of the programs detect an unsafe condition the entire line
must shut down. The shutdown procedure is the same regardless of the unsafe
condition.
Event task
Chapter 1
Notes
ControlLogix
1756-L71
1756-L72
1756-L73
1756-L74
1756-L75
GuardLogix
1756-L71S
1756-L72S
1756-L73S
SoftLogix5800
1756-L7SP
32
CompactLogix
1769-L2x
1769-L31
1769-L32x
1769-L35x
32
32
3
4
6
8
1768-L43
1768-L45
16
1769-L16x
1769-L18x
1769-L24x
1769-L27x
1769-L30x
1769-L33x
1769-L36x
32
Other tasks may overlap. If a task is interrupted too frequently or too long,
it may not finish running before it is triggered again.
Although a project can contain multiple tasks, the controller runs only one task at
a time. If a periodic or event task is triggered while another task is running, the
priority of each task indicates what the controller should do.
Rockwell Automation Publication 1756-PM005-EN-P - October 2014
11
Chapter 1
Manage tasks
CompactLogix
15
ControlLogix
15
DriveLogix
15
FlexLogix
15
SoftLogix5800
Then
Notes
Assign a priority number that is greater than the A higher priority task can interrupt a
lower priority task multiple times.
priority number of the other task.
Additional considerations
As you estimate the execution interrupts for a task, consider the following.
Consideration
Description
Motion planner
The motion planner interrupts all user tasks, regardless of their priority.
The number of axes and coarse update period for the motion group affect how long and how
often the motion planner runs.
If the motion planner is running when a task is triggered, the task waits until the motion
planner is done.
If the coarse update period occurs while a task is running, the task pauses to let the motion
planner run.
I/O task
CompactLogix, FlexLogix, and DriveLogix controllers use a dedicated periodic task to process I/O
data. This I/O task:
Does not show up in the Tasks folder of the controller.
Does not count toward the task limits for the controller.
Operates at priority 6.
Runs at the fastest RPI you have scheduled for the system.
Runs for as long as it takes to scan the configured I/O modules.
As you assign priorities to your tasks, consider the I/O task.
12
15
715
Chapter 1
Manage tasks
System overhead
System overhead is the time that the controller spends on unscheduled communication.
Unscheduled communication is any communication that you do not configure through the
I/O configuration folder of the project, such as Message (MSG) instructions and
communication with HMIs or workstations.
System overhead interrupts only the continuous task.
The system overhead time slice specifies the percentage of time (excluding the time for
periodic or event tasks) that the controller devotes to unscheduled communication.
The controller performs unscheduled communication for up to 1 ms at a time and then
resumes the continuous task.
Continuous task
You do not assign a priority to the continuous task. It always runs at the lowest priority. All
other tasks interrupt the continuous task.
Example
The following example shows the execution of a project with three user tasks.
Task
Priority
Period
Execution time
Duration
Motion planner
N/A
8 ms (base update
rate)
1 ms
1 ms
Event task 1
N/A
1 ms
12 ms
Periodic task 1
12 ms
2 ms
24 ms
5 ms (fastest RPI)
1 ms
15 ms
System overhead
N/A
1 ms
16 ms
Continuous task
N/A
N/A
20 ms
48 ms
13
Chapter 1
Manage tasks
Description
Initially, the controller runs the motion planner and the I/O task (if one exists).
After running the continuous task for 4 ms, the controller triggers the system overhead.
The period for periodic task 1 expires (12 ms), so the task interrupts the continuous task.
After running the continuous task again for 4 ms, the controller triggers the system overhead.
The trigger occurs for event task 1.
Event task 1 waits until the motion planner is done.
Lower priority tasks are delayed.
The continuous task automatically restarts.
The Studio 5000 environment includes a task monitor tool on the distribution
CD. You can use this tool to analyze how tasks are running.
14
Task
Priority
Execution Time
Period Specified
Higher
20 ms
80 ms
Lower
30 ms
100 ms
50 ms
The execution time of the highest priority task (Task 1) is significantly less
than its specified period (20 ms is less than 80 ms).
The total execution time of all tasks is significantly less than the specified
period of the lowest priority task (50 ms is less than 100 ms).
Manage tasks
Chapter 1
Avoid overlaps
Adjust the period of the tasks as needed to get the best balance between
running your logic and servicing unscheduled communication.
Description
Task trigger occurs.
Task runs.
Task trigger occurs.
Task runs.
Task trigger occurs.
Task runs.
Overlap occurs. Task is triggered while it is still running.
The trigger does not restart the task. The trigger is ignored.
Each task requires enough time to finish before it is triggered again. Make sure that
the scan time of the task is significantly less than the rate at which the trigger
occurs. If an overlap occurs, reduce the frequency at which you trigger the task.
If the type of task is
Then
Periodic
Event
Adjust the configuration of your system to trigger the task less frequently.
15
Chapter 1
Manage tasks
16
Manage tasks
Chapter 1
The Task Overlap Count shows the number of overlaps since the counter
was last reset.
3. Click OK.
To write logic to check for an overlap, use a Get System Value (GSV) instruction
to monitor either of these objects.
17
Chapter 1
Manage tasks
If you want to
Object
Attribute
Data Type
Description
FaultLog
MinorFaultBits
DINT
Task
Task
Status
OverlapCount
DINT
DINT
To determine if
10
Status information about the task. Once the controller sets one of these
bits, you must manually clear the bit.
To determine if
(1) Battery for 1756-L6X, 1769-L2X, and 1769-L3X controllers. ESM for 1756-L7X and CompactLogix 5370 series controllers.
Example:
1. The GSV instruction sets Task_2_Status = Status attribute for Task_2 (DINT value).
3. If Condition_1 = 1, then clear the bits of the Status attribute for Task_2:
The SSV instruction sets the Status attribute of Task_2 = Zero. Zero is a DINT tag with a value of 0.
18
Manage tasks
Configure output
processing for a task
Chapter 1
19
Chapter 1
Manage tasks
20
Manage tasks
Chapter 1
21
Chapter 1
Manage tasks
Then
Disable the processing of outputs at the Check Disable Automatic Output Processing To Reduce Task
end of the task
Overhead.
5. Click OK.
Data Type
Instruction
Description
DisableUpdateOutputs
DINT
GSV
SSV
To
EXAMPLE
If Condition_1 = 0 then let Task_2 process outputs when it is done.
1. The ONS instruction limits the true run of the SSV instruction to one scan.
2. The SSV instruction sets the DisableUpdateOutputs attribute of Task_2 = 0. This lets the task automatically process outputs when it finishes its run.
22
Manage tasks
Chapter 1
Inhibit a task
By default, each task runs based on its trigger (event, periodic, or continuous). As
an option, you can prevent a task from running when its trigger occurs (that is,
inhibit the task). This is useful when you test, diagnose, or start up your project.
If You Want to
Then
Example:
During the commissioning of a system that uses several tasks, you can first test each task individually.
Inhibit all the tasks except one, and then test that task.
Once the task meets your requirements, inhibit it and uninhibit a different task.
Continue this process until you have tested all your tasks.
If a task is inhibited, the controller still prescans the task when the controller
transitions from Program to Run or Test mode.
23
Chapter 1
Manage tasks
24
Manage tasks
Chapter 1
Then
4. Click OK.
Data Type
Instruction
Description
InhibitTask
DINT
GSV
SSV
0 (default)
25
Chapter 1
Manage tasks
EXAMPLE
If Condition_1 = 0 then let Task_2 run.
1. The ONS instruction limits the true run of the SSV instruction to one scan.
2. The SSV instruction sets the InhibitTask attribute of Task_2 = 0. This uninhibits the task.
Create a task
26
Manage tasks
Chapter 1
Topic
Description
Name
Description
Type
Trigger
Tag
Select the check box and type a time period that must elapse
before a task can run.
Priority
Watchdog
3. Click OK.
27
Chapter 1
Manage tasks
28
Manage tasks
Chapter 1
Description
Type
Period
Type a value for when (or at what time interval) you want
the task to run.
Priority
Watchdog
4. Click OK.
Language switching
In versions 17 and later of the application, you can display project documentation,
such as tag descriptions and rung comments, for any supported localized language.
You can store project documentation for multiple languages in a single project file
rather than in language-specific project files. You define all the localized languages
that the project will support and set the current, default, and optional customlocalized language. The software uses the default language if the current language's
content is blank for a particular component of the project. However, you can use a
custom language to tailor documentation to a specific type of project file user.
Enter the localized descriptions in your project, either when programming in that
language or by using the import/export utility to translate the documentation
offline and then import it back into the project. When you enable language
switching, you can dynamically switch between languages as you use the software.
Project documentation that supports multiple translations within a project
includes the following:
Equipment phases
Trends
Controllers
Tasks
29
Chapter 1
Manage tasks
Is
Scheduled
Communication
Service Communication
10%
9 ms
1 ms
20%
4 ms
1 ms
25%
3 ms
1 ms
33%
2 ms
1 ms
50%
1 ms
1 ms
66%
1 ms
2 ms
75%
1 ms
3 ms
80%
1 ms
4 ms
90%
1 ms
9 ms
As shown in the table, for version 16 and later of the application, the system
overhead time slice at 50% stays fixed at 1 ms.
30
Manage tasks
Chapter 1
The same applies for 66% and higher, except that there are multiple 1 ms intervals.
For example, at 66% there are two 1 ms intervals of consecutive time and at 90%
there are nine 1 ms intervals of consecutive time.
31
Chapter 1
Manage tasks
4. Use either Run Continuous Task (default) or Reserve for System Tasks.
Select the Run Continuous Task radio button when there are no
communication or background tasks to process; the controller
immediately returns to the continuous task.
Select the Reserve for System Task radio button to allocate the entire
1 ms of the system-overhead time slice when the controller has
communication or background tasks to perform before returning to the
continuous task. This lets you simulate a communication load on the
controller during design and programming before HMIs, controller to
controller messaging, and so forth, are set up. Use this setting for testing
purposes only.
5. Click OK.
Each task contains a watchdog timer that specifies how long a task can run before
triggering a major fault.
If the watchdog timer reaches a configurable preset, a major fault occurs. Depending on the controller fault
handler, the controller might shut down.
32
The watchdog timer begins to run when the task is initiated and stops when
all the programs within the task have run.
If the task takes longer than the watchdog time, a major fault occurs. The
time includes interruptions by other tasks.
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.
Manage tasks
Chapter 1
33
Chapter 1
Manage tasks
3. In the Watchdog box, type a numeric value for the watchdog timeout for
the task.
4. Click OK.
34
Chapter 2
Introduction
An event task, if configured correctly, interrupts all other tasks for the minimum
amount of time required to respond to the event.
This section describes how to set up event tasks and lists considerations, such as a
higher priority task, that can affect the execution of an event task.
Each event task requires a specific trigger that defines when the task is to run. The
following table reviews some of these triggers.
Use this trigger
Consumed Tag
Axis Registration
1 or 2
For the registration input to trigger the event task, first run a Motion Arm Registration (MAR)
instruction. This lets the axis detect the registration input and in turn trigger the event task.
Once the registration input triggers the event task, run the MAR instruction again to re-arm the
axis for the next registration input.
If the scan time of your normal logic is not fast enough to re-arm the axis for the next
registration input, consider placing the MAR instruction within the event task.
Axis Watch
For the registration input to trigger the event task, first run a Motion Arm Watch (MAW)
instruction. This lets the axis detect the watch position and in turn trigger the event task.
Once the watch position triggers the event task, run the MAW instruction again to re-arm the
axis for the next watch position.
If the scan time of your normal logic is not fast enough to re-arm the axis for the next watch
position, consider placing the MAW instruction within the event task.
35
Chapter 2
The base update period for the motion group triggers both the motion planner and the event
task.
Because the motion planner interrupts all other tasks, it runs first. If you assign the event task as
the highest priority task, it runs after the motion planner.
EVENT instruction
Multiple EVENT instructions can trigger the same task. This lets you run a task from different
programs.
The following table lists some example situations for event tasks and the
corresponding triggers.
For this example situation
A packaging line glues boxes closed. When a box arrives at the gluing position, the controller must immediately run the
gluing routine.
A production line uses a proximity sensor to detect the presence of a part. Because the proximity sensor is on for only a very
short time (pulse), the continuous task might miss the off to on transition of the sensor.
In an engine test stand, you must capture and archive each sample of analog data.
Controller A produces an array of production data for Controller B. You want to make sure that Controller B doesnt use the
values while Controller A is updating the array.
Consumed Tag
In a line that packages candy bars, make sure that the perforation occurs in the correct location on each bar. Each time the
registration sensor detects the registration mark, check the accuracy of an axis and perform any required adjustment.
Axis Registration 1 or 2
At the labeling station of a bottling line, you want to check the position of the label on the bottle. When the axis reaches the
position that is defined as the watch point, check the label.
Axis Watch
A gluing station must adjust the amount of glue it applies to compensate for changes in the speed of the axis. After the
motion planner runs, check the command speed of the axis and vary the amount of glue, if needed.
In a production line, if any of the programs detect an unsafe condition the entire line must shut down. The shutdown
procedure is the same regardless of the unsafe condition.
EVENT instruction
The triggers that you can use for an event task vary by your controller type.
Important: The Logix Designer application may let you configure a trigger for an event task that your controller does
not support. The project verifies and successfully downloads, but the event task does not run.
CompactLogix
FlexLogix
ControlLogix
EVENT
instruction
X
X
X
DriveLogix
SoftLogix5800
Motion Group
Execution
Chapter 2
To trigger an event task based on data from an input module, use the Module
Input Data State Change trigger.
Definition
Multicast
The RPI specifies the interval that a module multicasts its data. For example, an input
module sends data to a controller at the RPI that you assign to the module.
The range is 0.2750 ms.
When the specified time frame elapses, the module multicasts its data. This is also called
a cyclic update.
The RTS specifies when an analog module scans its channels and multicasts the data (update
the input data buffer then multicast).
37
Chapter 2
Term
Definition
The RPI specifies when the module multicasts the current contents of the input data
buffer without scanning (updating) the channels.
The module resets the RPI timer each time an RTS transfer occurs.
The COS parameter instructs a digital input module to multicast data whenever a specified
input point transitions from On Off or Off On.
You enable COS on a per-point basis.
When any point that is enabled for COS receives the specified change, the module
multicasts the data for all its points.
By default, COS is enabled for both On Off and Off On changes for all points.
You must specify an RPI regardless of whether you enable COS. If a change does not occur
within the RPI, the module sends its data at the RPI.
The following table summarizes when an input module multicasts its data and
triggers an event task within its own chassis.
If the input module is
And
Digital
COS is enabled for any point on When any point that is enabled for COS receives the specified
change
the module
At the RPI
At the RPI
Never
RTS RPI
Analog
At the RPI (does not contain updated data from the channels)
If the module is in a remote chassis, only the RPI determines when the controller
receives the data and event trigger over the network.
Over this network
EtherNet/IP
ControlNet
38
Chapter 2
39
Chapter 2
Modules
1756-IA8D
1756-IA16I
1756-IB16
1756-IB16I
1756-IB32
1756-IG16
1756-IH16ISOE
1756-IN16
1756-IV32
1756-IA16
1756-IA32
1756-IB16D
1756-IB16ISOE
1756-IC16
1756-IH16I
1756-IM16I
1756-IV16
1756-IF16
1756-IF6CIS
1756-IF8
1756-IT6I
1756-IF4FXOF2F/A
1756-IF6I
1756-IR6I
1756-IT6I2
1756-CNB/A
1756-CNB/D
1756-CNBR/B
1756-DNB
1756-SYNCH/A
1756-CNB/B
1756-CNBR/A
1756-CNBR/D
1756-ENBT/A
1784-PCIDS/A
1756-MODULE
1789-MODULE
40
2.
Place the module that triggers the event and the modules that respond to the event (outputs) in the same chassis as the controller.
Remote modules add network communication to the response time.
3.
4.
Chapter 2
If a digital device triggers the event, enable COS for only the point that triggers the event task.
Enable change of state for the type of transition that triggers the task, either Off On, On Off, or both.
If you configure COS for both Off On and On Off, the point triggers an event task whenever the point turns on or off. Make sure
the duration of the input is longer than the scan time of the task. Otherwise an overlap could occur.
Disable (clear) COS for the remaining points on the input module. If you configure multiple points on a module for COS, each point
could trigger the event task. This could cause an overlap.
5.
Task priority
6.
Motion planner
The motion planner interrupts all other tasks, regardless of their priority.
The number of axes and coarse update period for the motion group effect how long and how often the motion planner executes.
If the motion planner is executing when a task is triggered, the task waits until the motion planner is done.
If the coarse update period occurs while a task is executing, the task pauses to let the motion planner execute.
7.
8.
Automatic Output
Processing
For an event task, you can typically disable automatic output processing (default). This reduces the elapsed time of the task.
9.
IOT instruction
Use an IOT instruction for each output module that you reference in the event task.
The IOT instruction overrides the RPI for the module and immediately sends the data.
41
Chapter 2
42
Chapter 2
The event task uses the following logic to control the diverter.
If Diverter_Photoeye = 1 (part is in the diverter position)
and Divert_Part = 1 (divert this part)
then Diverter = 1 (turn on the diverter)
otherwise Diverter = 0 (turn off the diverter)
Estimate throughput
To estimate the throughput time from input to output (screw to screw), use the
following worksheet.
Consideration
1.
Value
What is the input filter time of the module that triggers the event task?
What is the hardware response time for the input module that triggers the event task?
Make sure you use the appropriate type of transition (Off On or On Off). See Nominal hardware response times for
the 1756 I/O modules most commonly used with Event tasks later in this section.
3.
4 slot
13 s
7 slot
22 s
10 slot
32 s
13 slot
42 s
17 slot
54 s
4.
What is the total execution time of the programs of the event task?
5.
6.
7.
Add steps 1...6. This is the minimum estimated throughput, where execution of the motion planner or other tasks do not delay or interrupt the
event task.
8.
9.
What is the total scan time of the tasks that have a higher priority than this event task (if any)?
10.
Add steps 7...9. This is the nominal estimated throughput, where execution of the motion planner or other tasks delay or interrupt the event task.
43
Chapter 2
The following table lists nominal hardware response times for 1756 I/O modules
with event tasks.
Cat. No.
60 C
Off On
On Off
Off On
On Off
1756-IB16
265
582
265
638
1756-IB16D
303
613
305
673
1756-IB32/B
330
359
345
378
1756-IV16
257
435
254
489
1756-IV32
381
476
319
536
1756-OB16D
48
519
51
573
1756-OB16E
60
290
61
324
1756-OB32
38
160
49
179
1756-OV16E
67
260
65
326
1756-OV32E
65
174
66
210
44
Consideration
1.
Chapter 2
Value
0 s
What is the input filter time of the module that triggers the event task?
This is typically shown in milliseconds. Convert it to microseconds (s).
2.
330 s
What is the hardware response time for the input module that triggers the event task?
Make sure you use the appropriate type of transition (Off On or On Off). See the table, earlier in this section, that
lists nominal hardware response times for the 1756 I/O modules most commonly used with Event tasks.
3.
13 s
4 slot
13 s
7 slot
22 s
10 slot
32 s
13 slot
42 s
17 slot
54 s
400 s
4.
What is the total run time of the programs of the event task?
5.
13 s
6.
51 s
7.
Add steps 1...6. This is the minimum estimated throughput, where execution of the motion planner or other tasks do not delay or interrupt the
event task.
8.
9.
What is the total scan time of the tasks that have a higher priority than this event task (if any)?
10.
Add steps 7...9. This is the nominal estimated throughput, where execution of the motion planner or other tasks delay or interrupt the event task.
807 s
1130 s
0 s
1937 s
Additional considerations
The following considerations affect the scan time of the event task, which affects
the speed at which it can respond to the input signal.
Consideration
Description
Each logic element (rung, instruction, Structured Text construct, and so forth)
adds scan time to the task.
Task priority
If the event task is not the highest priority task, a higher priority task may delay
or interrupt the execution of the event task.
If one of these instructions are active, the event task cannot interrupt the
currently running task. (The task with the CPS or UID.)
45
Chapter 2
To couple the running of an event task with the running of the motion planner,
use the Motion Group Execution trigger.
46
Chapter 2
The base update period for the motion group triggers the running of both
the motion planner and the event task.
Because the motion planner interrupts all other tasks, it runs first. If you
assign the event task as the highest priority task, it runs immediately after
the motion planner.
This timing diagram shows the relationship between the motion planner and the
event task.
The Base Update Period for the motion group triggers the motion planner and
the event task. See the online help for more information on the Motion Group
Properties dialog box.
47
Chapter 2
1.
Scan time
Make sure the scan time of the event task is significantly less than the base update period of the motion group. Otherwise, a task
overlap could occur.
2.
Task priority
3.
4.
For an event task, you can typically disable automatic output processing (default). This reduces the elapsed time of the task.
To let the registration input of an axis trigger an event task, use the Axis
Registration 1 or Axis Registration 2 triggers.
When the specified registration input reaches its trigger condition, it triggers the
event task.
48
Chapter 2
In the configuration of the event task, specify which registration input you
want to trigger the task. Choose either Axis Registration 1 or Axis
Registration 2.
You must first arm the registration input using a Motion Arm
Registration (MAR) instruction.
Once the registration input triggers the task, you have to re-arm the
registration input.
This timing diagram shows the relationship between the registration input and the
event task.
Arm the registration input (MAR instruction). This lets the axis detect the registration input and trigger the event task.
Initially, arm the registration input to detect the first trigger condition.
Re-arm the registration input after each execution of the event task.
Re-arm the registration input fast enough to detect each trigger condition.
If your normal logic is
Then
Fast enough to re-arm the registration input between intervals of the Arm the registration input within your normal logic, if desired.
trigger condition
For example, normal logic always completes at least two scans
between registration inputs.
Not fast enough to re-arm the registration input
2.
Task priority
Configure the event task as the highest priority task. If a periodic task has a higher priority, the event task is delayed until the periodic
task is finished.
3.
Limit the number of event tasks. Each additional task reduces the processing time available for other tasks that could cause an overlap.
4.
For an event task, you can typically disable automatic output processing (default). This reduces the elapsed time of the task.
Rockwell Automation Publication 1756-PM005-EN-P - October 2014
49
Chapter 2
Each time the registration sensor detects the registration mark, check the
accuracy of an axis and perform any required adjustment.
Due to the speed of the line, you have to arm the registration input within
the event task.
50
Chapter 2
If Task_Status.0 = 1 then an EVENT instruction triggered the event task. In the continuous task, the EVENT runs to arm
registration for the first time.
The JMP instruction causes the controller to jump to the Arm LBL instruction. This skips all the logic of the routine
except the rung that arms registration for the axis.
Other logic
The MAR instruction runs each time the task runs and arms Axis_1 for registration.
The OTU instruction sets the EN bit of the MAR instruction = 0.
The MAR instruction is a transitional instruction.
For the MAR instruction to run, its rung-condition-in must go from false to true.
By first clearing the EN bit, the instruction responds as if its rung-condition-in changed from false to true.
The MAR instruction arms the axis for registration.
The controller does not clear the bits of the Status attribute once they are set. To use a bit for new status information,
you must manually clear the bit.
If Task_Status.0 = 1 then clear that bit.
The OTU instruction sets Task_Status.0 = 0.
The SSV instruction sets the Status attribute of THIS task (Task_1) = Task_Status. This includes the cleared bit.
51
Chapter 2
To configure the watch position of an axis to trigger an event task, use the
Axis Watch trigger.
52
Chapter 2
When the axis reaches the position that is specified as the watch position, it
triggers the event task.
You must first arm the axis for the watch position by using a Motion Arm
Watch (MAW) instruction.
Once the axis reaches the watch position and triggers the event task, you
have to re-arm the axis for the next watch position.
This timing diagram shows the relationship between the watch position and the
event task.
Use a MAW instruction to set up a watch position. This lets the axis trigger the event task when it reaches the watch position.
Initially, arm the axis to detect the first watch position.
When the axis reaches the watch position and triggers the event task, re-arm the axis for the next watch position.
Re-arm the axis fast enough to detect each watch position.
If your normal logic is
Then
Fast enough to re-arm the axis between intervals of the watch position
(For example, normal logic always completes at least two scans
between watch positions.)
2.
Task priority
3.
4.
For an event task, you can typically disable automatic output processing (default). This reduces the elapsed time of the task.
53
Chapter 2
When the axis reaches the position that is defined as the watch point, check
the label and perform any required adjustment.
Due to the speed of the line, you have to arm axis for the watch position
within the event task.
The following logic arms and re-arms the axis for the watch position.
Continuous task
If Arm_Watch = 1 (system is ready to set up a watch position) then
the ONS instruction limits the EVENT instruction to one scan.
the EVENT instruction triggers Task_1 (event task).
54
Chapter 2
The GSV instruction sets Task_Status (DINT tag) = Status attribute for the event task. In the Instance Name attribute,
THIS means the Task object for the task that the instruction is in (that is, Task_1).
If Task_Status.0 = 1 then an EVENT instruction triggered the event task. In the continuous task, the EVENT runs to set
up the watch position for the first time.
The JMP instruction causes the controller to jump to the Arm LBL instruction. This skips all the logic of the routine
except the rung that arms the axis for the watch position (MAW instruction).
Other logic
The MAW instruction runs each time the task runs and arms Axis_1 for the watch position.
The OTU instruction sets the EN bit of the MAW instruction = 0.
The MAW instruction is a transitional instruction.
To run the MAW instruction, its rung-condition-in must go from false to true.
By first clearing the EN bit, the instruction responds as if its rung-condition-in changed from false to true.
The MAW instruction arms the axis for the watch position.
The controller does not clear the bits of the Status attribute once they are set. To use a bit for new status information,
you must manually clear the bit.
If Task_Status.0 = 1 then clear that bit.
The OTU instruction sets Task_Status.0 = 0.
The SSV instruction sets the Status attribute of THIS task (Task_1) = Task_Status. This includes the cleared bit.
55
Chapter 2
To trigger an event task based on data from a consumed tag, use the Consumed
Tag trigger.
A produced/consumed tag relationship can pass an event trigger along with data
to a consumer controller. Typically, you use an Immediate Output (IOT)
instruction to send the event trigger to the consumer controller.
56
Chapter 2
Description
In Controller A, logic updates the values of a produced tag.
Once the update is complete, the Controller A runs an IOT instruction to send the data and an event trigger
to Controller B.
Controller B consumes the new data.
After Controller B updates the consumed tag, it runs the event task.
The type of network between the controllers determines when the consuming
controller receives the new data and event trigger through the IOT instruction.
The following table lists the times when the consuming device receives the new
data and event trigger.
With this controller
ControlLogix
Backplane
Immediately
EtherNet/IP network
Immediately
ControlNet network
SoftLogix5800
The following diagrams compare the receipt of data via an IOT instruction over
EtherNet/IP and ControlNet networks.
EtherNet/IP Network (ControlLogix controller)
ControlNet Network
57
Chapter 2
Description
RPI occurs for the produced tag.
The produced tag transfers old data to the consuming controller.
The producer controller starts to update the values of the produced tag.
RPI occurs again for the produced tag.
The produced tag transfers a mix of old and new data to the consuming controller.
The producer controller finishes updating the values of the produced tag.
The producer controller runs an Immediate Output (IOT) instruction.
The produced tag immediately transfers all the new data to the consuming controller.
When the consumer controller receives all the data, it runs its event task.
Although the producing controller runs the IOT instruction immediately after it
loads new data, the event task is not triggered (in the consuming controller) until
the consuming controller has received all the new data. This verifies that the
controller operates on a complete packet of new data.
58
Chapter 2
Description
The first controller runs an action with which other controllers need to stay synchronized.
When the action is done, the controller runs an IOT instruction. The IOT instruction uses a produced tag as
its target.
When controller A receives the produced tag, it runs its event task.
When controller B receives the produced tag, it runs its event task.
If you want to send a complete image of data at one instance in time, then produce a copy of the data, as shown in the following
illustration.
59
Chapter 2
2.
On the New Tag dialog box for the produced tag, click Connection to open the Produced Tag Connection dialog box. Check
Send Data State Change Event to Consumer(s).
If you leave this check box cleared (unchecked), the producing controller triggers the event task at the end of any task that
automatically updates local outputs. In other words, the task scan triggers the event in addition to the IOT instruction.
3.
IOT instruction
Use an IOT instruction at the point in your logic where you want to trigger the event task.
The IOT instruction overrides the RPI for the tag and immediately sends the event trigger and the data of the tag.
60
1.
Buffer of data
If you want to make sure that the controller does not use data from the consumed tag while the data is changing, use a copy of the
consumed tag. Use the event task to copy the data.
2.
Task priority
3.
Limit the number of event tasks. Each additional task reduces the processing time available for other tasks. This could cause an overlap.
4.
For an event task, you can typically disable automatic output processing (default). This reduces the elapsed time of the task.
Rockwell Automation Publication 1756-PM005-EN-P - October 2014
Chapter 2
Producer controller
This controller controls station 24 and produces data for the next station (station
25). To signal the transmission of new data, the controller uses the following
elements:
Produced_Tag
Ladder logic
Ladder Logic
If New_Data = on, then this occurs for one scan.
61
Chapter 2
Consumer controller
The controller at station 25 uses the data produced by station 24. To determine
when new data has arrived, the controller uses an event task.
62
Chapter 2
To trigger an event task based on conditions in your logic, use the EVENT
Instruction Only trigger.
The EVENT Instruction Only trigger requires that you use a Trigger Event Task
(EVENT) instruction to trigger the task. You can use an EVENT instruction
from multiple points in your project. Each time the instruction runs, it triggers the
specified event task.
63
Chapter 2
Description
Program A runs an EVENT instruction.
The event task that is specified by the EVENT instruction runs one time.
Program B runs an EVENT instruction.
The event task that is specified by the EVENT instruction runs one time.
Data Type
Instruction
Description
Status
DINT
GSV
SSV
Provides status information about the task. Once the controller sets a bit, you must manually clear the
bit to determine if another fault of that type occurred.
To determine if
The controller does not clear the bits of the Status attribute once they are set.
To use a bit for new status information, you must manually clear the bit.
Use a Set System Value (SSV) instruction to set the attribute to a different
value.
64
1.
EVENT instruction
Use a Trigger Event Task (EVNT) instruction at each point in your logic that you want to trigger the event task.
2.
Task priority
3.
4.
For an event task, you can typically disable automatic output processing (default). This reduces the elapsed time of the task.
Chapter 2
65
Chapter 2
If you want your event task to run automatically, if the trigger fails to occur within
a certain time, assign a timeout value to the task. When the event task is finished,
the timeout timer begins to increment. If the timer reaches its preset value before
the event task is triggered, the event task runs automatically.
Description
Event task runs.
Timeout time stops incrementing.
Event task is done.
Timeout timer resets and begins incrementing.
Timeout timer reaches the timeout value.
Event task automatically runs.
In the Status attribute of the TASK object, bit 1 turns on.
66
Chapter 2
67
Chapter 2
Data Type
Instruction
Description
Rate
DINT
GSV
SSV
Periodic
Event
EnableTimeOut
Example
DINT
GSV
SSV
0 (default)
To make sure that a timeout value is always defined and enabled for an event task, the logic configures the timeout when the controller enters Run mode.
If S:FS = 1 (first scan) then set the timeout value for Task_2 and enable the timeout function.
1. The first MOV instruction sets Task_2_Timeout = 10000000 s (DINT value). Then the SSV instruction sets the Rate attribute for Task_2 =
Task_2_Timeout. This configures the timeout value for the task.
2. The second MOV instruction sets One = 1 (DINT value). Then the SSV instruction sets the EnableTimeout attribute for Task_2 = One. This enables the
timeout function for the task.
68
Chapter 2
Attribute
Data Type
Instruction
Description
Status
DINT
GSV
SSV
Provides status information about the task. Once the controller sets a bit, you must manually clear the bit to
determine if another fault of that type occurred.
Example
To determine if
If a timeout occurs for the event task, communication with the triggering device might have failed. This requires the process to shut down. To shut down
the controller, the event task calls the fault routine for the program and supplies a user-defined fault code (999 in this example).
1. The GSV instruction sets Task_2_Status = Status attribute for Task_2 (DINT value).
2. If Task_2_Status.1 = 1, then a timeout occurred so shut down the controller and set the major fault code to 999.
The JSR instruction calls the fault routine for the program. This produces a major fault.
The major fault code = 999 (value of the input parameter of 999).
3. If Condition_1 = 1, then clear the bits of the Status attribute for Task_2.
The SSV instruction sets the Status attribute of Task_2 = Zero. Zero is a DINT tag with a value of 0.
69
Index
C
change of state
configure for I/O module 40
communication
impact on execution 14
configure
output processing for a task 21
consumed tag
maintain data integrity 61
synchronize controllers 62
controller
number of tasks 11
synchronize 62
COS. See change of state 40
create
periodic task 29
E
event task
axis registration trigger 51
axis watch trigger 54
checklist for consumed tag event 62, 63
checklist for input event 43
checklist for motion group event 50
checklist for registration event 52
checklist for watch position event 56
choose trigger 37
consumed tag trigger 58
estimate throughput 45
EVENT trigger 66
input data trigger 39
motion group trigger 48
timeout 70
execute
event task 37
I
I/O
impact on execution 14
output processing 21
throughput for event task 45
I/O module
M
monitor
task 18
motion planner
impact on execution 14
trigger event task 48
O
output processing
manually configure 22
overview 21
programmatically configure 24
overlap
manually check for 18
overview 17
programmaticlly check for 19
overrun. See overlap 17
P
periodic task
create 29
project
number of tasks 11
R
registration
trigger event task 51
S
synchronize
controllers 62
system overhead time slice
impact on executon 14
71
Index
T
tag
trigger event task 58
task
avoid overlap 17
choose event trigger 37
create periodic 29
define timeout 70
inhibit 25
manually check for overlap 18
manually configure output processing 22
monitor 18, 19
number supported 11
output processing 21
overlap 17
programmatically check for overlap 19
programmatically configure output processing 24
trigger via EVENT instruction 66
throughput
estimate for event task 45
timeout
define for event task 70
trigger
axis registration 51
axis watch 54
choose for event task 37
consumed tag 58
EVENT instruction 66
module input data 39
motion group 48
W
watch point
trigger event task 54
72
Installation assistance
If you experience a problem within the first 24 hours of installation, review the information that is contained in this manual. You can
contact Customer Support for initial help in getting your product up and running.
United States or Canada
1.440.646.3434
Use the Worldwide Locator available at http://www.rockwellautomation.com/locations, or contact your local Rockwell
Automation representative.
Contact your distributor. You must provide a Customer Support case number (call the phone number above to obtain one) to
your distributor to complete the return process.
Please contact your local Rockwell Automation representative for the return procedure.
Documentation feedback
Your comments will help us serve your documentation needs better. If you have any suggestions on how to improve this document,
complete the feedback form, publication RA-DU002.
Copyright 2014 Rockwell Automation, Inc. All rights reserved. Printed in the U.S.A.