You are on page 1of 29

Scalable PLC AC500

AC500 CPU
Task Configuration
Basic module
ABB Group Version 3.0 (2012-04)
Technical Guides

Task Configuration
Contents

ABB Group
August 22, 2013 | Slide 2

Processing of the hardware I/Os

Task definition

Task configuration

Multitasking

Task Configuration
Coming up

ABB Group
August 22, 2013 | Slide 3

Processing of the hardware I/Os

Task definition

Task configuration

Multitasking

Task Configuration
Processing of Inputs and Outputs (1)
%IX0.0

%QX0.0

Processing (CPU)

%IX0.3

Outputs

%IX0.2

Switches

Solenoids

%IX0.1

Inputs

Push
Buttons

%QX0.1

%QX0.2

Motor Starters
Lights

%QX0.3

Horns

%IX0.4
%QX0.4

Relays
Timers
Thermal
Couples
Relays

%IX0.5

%IX0.6

%IX0.7

Optical
Relays

%IX1.0

Contacts

%IX1.1

ABB Group
August 22, 2013 | Slide 4

LD I1
AND I2
ST O1

Engineering tool with


PLC programming software

%QX0.5

Optical Relays
%QX0.6

1234

Pulse Counters

Task Configuration
Processing of Inputs and Outputs (2)
I1

Battery
O1

+
I2

P
RAM

FPROM

RAM

LD I1
AND I2
ST O1
Buffered by battery:
Retain variables
SRAMdisk
Real time clock
ABB Group
August 22, 2013 | Slide 5

PC with
Control Builder PS501

Program execution

Task Configuration
Coming up

ABB Group
August 22, 2013 | Slide 6

Processing of the hardware I/Os

Task definition

Task configuration

Multitasking

Task Configuration
Task Definition
Internal
Operations

LD I1
AND I2
ST O1

Scan Inputs
Program
Scan

Service
Comms

Program scan

Update
Outputs

Operating
Cycle

A task is a time unit in the processing of an IEC program.


It is defined by:
A name
One or more program calls
Priority
Trigger condition (cyclic, freewheeling, triggered by event,
triggered by external event)
ABB Group
August 22, 2013 | Slide 7

Task Configuration
Default Task
If no task configuration is specified in the project, a default task is
created automatically:

Type: cyclic
Priority: 10
Cycle time: t#10ms
Program call: PLC_PRG (main program)

Program execution time


1st cycle

ABB Group
August 22, 2013 | Slide 8

2nd cycle

Task Configuration
Processing of Inputs and Outputs (1)
I/O Hardware
Inputs

Outputs

Interrupt

Interrupt and
task done

CPU
Image
all inputs

Start of a task

Image
all outputs

End of a task

Inputs used in a task


Local variables
Global variables
%M registers
%R registers
Outputs

I/O hardware

Task

Image

I/O Bus
Onboard I/Os of AC500-eCo PM55x und PM56x
COM1: CS31 bus
FBP slave interface
Communication modules: slots 0 to 4

Instructions
Task
execution

LD I1
AND I2
ST O1

Task Configuration
Processing of Inputs and Outputs (2)
Task

2nd cycle

1st cycle
O

II

O
O II

O
O

t
I

Read inputs :

The inputs used in the task are copied


byte-wise from input data image into image
(read inputs)

Write outputs:

The output values used in the task are


copied byte-wise from image to output data
image (set outputs)

ABB Group
August 22, 2013 | Slide 10

Task Configuration
Minimal Length for an Input Signal
Program execution, Signal

OO II

O II

O I

TRUE not
recognized

ABB Group
August 22, 2013 | Slide 11

TRUE recognized
by chance

TRUE recognized:
The input signal is longer than
the cycle time

Task Configuration
The Fast Counters
Program
execution

II

O
O

II

Input signal: Fast counter function is needed

Fast counter operating independent of the cycle time is used for input
signals up to 50 kHz resp. 300kHz.
Fast counter function is provided by:

ABB Group
August 22, 2013 | Slide 12

Digital input modules connected via I/O bus to AC500 CPU


DC551 module in a de-central AC31 bus extension
DC541 module
CD522 module (up to 300 kHz)

O
O

II

Task Configuration
Task Types (1)
Cyclic task

Task

Task execution time


Interval

t
Interval (cycle) = const

Freewheeling task
Task

Interval
ABB Group
August 22, 2013 | Slide 13

t
Interval const

Task Configuration
Task Types (2)
Event

Triggered by event
Event: 0 1 edge
of a global variable

Task

t
Interrupt

Triggered by external event


Event: 0 1 edge of an
interrupt channel.
A short task with high priority.

Task

t
ABB Group
August 22, 2013 | Slide 14

Task Configuration
Cyclic Task
PID

PID
Interval 1

1st cycle

PID
Interval 2

2nd cycle
Interval 1
Interval 2

Program scan mode:


cyclic task
The task is executing the
program(s) with the priority
and interval defined in the
task configuration.

Constant execution interval


for a loop controller like PID

More information in CoDeSys Help

ABB Group
August 22, 2013 | Slide 15

Task Configuration
Freewheeling Task
Program scan mode: freewheeling task
The task is configured as freewheeling and has no constant
scan time.
PID

PID
Interval 1

1st cycle

Interval 2

2nd cycle

Interval 1
Interval 2

ABB Group
August 22, 2013 | Slide 16

PID

3rd cycle

No constant execution interval


for a loop controller like PID

Task Configuration
Coming up

ABB Group
August 22, 2013 | Slide 17

Processing of the hardware I/Os

Task definition

Task configuration

Multitasking

Task Configuration
Task Configuration
Program call

Type

Priority
Name of the task
2. Click Task Configuration

Cycle time

1.

Click Resources

ABB Group
August 22, 2013 | Slide 18

Task monitoring
(recommended)

Task Configuration
Task Monitoring

Activate watchdog: Task termination in error status as soon


as the processing takes longer than defined in the Time field

Watchdog time (e.g.: t#200ms): Maximum runtime of the


task. After the expiration of this term, regarding the currently
set sensitivity the watchdog will be triggered.

Sensitivity: numbers of runtime time overruns in a row


triggering the wachdog.

More information in CoDeSys Help

ABB Group
August 22, 2013 | Slide 19

Task Configuration
Coming up

ABB Group
August 22, 2013 | Slide 20

Processing of the hardware I/Os

Task definition

Task configuration

Multitasking

Task Configuration
Number of Tasks

ABB Group
August 22, 2013 | Slide 21

CPU type

PM55x
PM56x

PM57x
PM58x

PM59x

Number of
tasks

2 (thereof one
interrupt)

16

Task Configuration
Task Priority
1 9:

For high priority tasks triggered by external event with


very short execution time

10 31: For regular tasks

ABB Group
August 22, 2013 | Slide 22

Task Configuration
Multitasking
Multitasking

Several tasks are configured

The execution order of the task is defined by the priority

Tasks with higher priority interrupt those with the lower one
Example:
Start trigger condition for all 3 tasks at the same time t1
Task 1 high priority
Task 2 low priority

Task 3 lowest priority


t1
ABB Group
August 22, 2013 | Slide 23

Task Configuration
Which Task is being processed?
For the execution, the following rules apply:

ABB Group
August 22, 2013 | Slide 24

That task is executed, whose condition has been met; i.e.,


its specified time has expired, or after its condition (event)
variable exhibits a rising edge

If several tasks have a valid requirement, then the task with the
highest priority will be executed

If several tasks have valid conditions and equivalent priorities,


then the task that has had the longest waiting time will be
executed first

The processing of the program calls will be done according to


their order (top down) in the task editor

Task Configuration
Inputs and Outputs within an Image
Case 1: Single task
The task creates its own input and output images.
O

II

O
O

O I

Case 2: Several tasks


Each starting task creates its own image of inputs and outputs byte-wise.
Avoid overlapping of input areas!
I

O
I

ABB Group
August 22, 2013 | Slide 25

Task 1
O

Task 2
O

Task 3

Image
Inputs
Local
variables
Global
variables
%M registers
%R registers
Outputs

Image
Inputs
Local
variables
Global
variables
%M registers
%R registers
Outputs

Task Configuration
The Task Execution

More information in CoDeSys Help

ABB Group
August 22, 2013 | Slide 26

Task Configuration
The Task Execution: Online Indication

More information in CoDeSys Help

ABB Group
August 22, 2013 | Slide 27

Task Configuration
Cross-References to Documentation
1. CoDeSys Help\Target System\
AC500 / S500\System Technology\System
Technology of the AC500 CPUs\Inputs, outputs
and flags in AC500
or
System start-up / program processing
2. CoDeSys Help\CoDeSys Programming System\
The Resources\Task Configuration\

ABB Group
August 22, 2013 | Slide 28

ABB Group
August 22, 2013 | Slide 29

You might also like