Working with Tasks in Control Expert

In the process namespace, Control Expert includes the MAST task by default. The MAST task cannot be removed. However, you can add the tasks FAST, AUX0, and AUX1. Note that creating a task in the process part of a safety project is the same as creating a task in a non-safety project. Refer to the topic Create and Configure a Task in the EcoStruxure™ Control Expert Operating Modes manual for more information.

In the safe namespace, Control Expert includes the SAFE task by default. The SAFE task cannot be removed, and no other tasks can be added to the Program Safety section of the Project Browser in Control Expert. You can add multiple sections to the SAFE task.

Configuring the SAFE Task Properties

The SAFE task supports only periodic task execution (cyclic execution is not supported). Both the SAFE task Period and Watch Dog settings are input in the Properties of SAFE dialog and can support the following value range:

  • SAFE task period: 10...255 ms with a default of 20 ms.

  • SAFE task watchdog: 10...500 ms, in increments of 10 ms, with a default of 250 ms.

Set the SAFE task Period to a minimum value depending on the safe data size and the PLC model. The minimum SAFE task period can be calculated according to the following formulas:

  • Absolute minimum necessary for safe I/O communication:

    • 10 ms

  • Time (in ms) necessary to transfer and compare the safe data between the CPU and the COPRO:

    • (0.156 x Data_Safe_Size) + 2 ms (for BME•584040S, and BME•586040S)

    • (0.273 x Data_Safe_Size) + 2 ms (for BME•582040S)

    Where the Data_Safe_Size is the size in Kbytes of the safe data.

  • Additional time (in ms) needed by Hot Standby PACs to transfer the safe data from the primary PAC to the standby PAC:

    • (K1 x Taskkb + K2 x TaskDFB) / 500

    In this formula:

    • TaskDFB = the number of DFBs declared in the safe part of the application.

    • Taskkb = the size (in Kbytes) of the safe data exchanged by the SAFE task between the primary and standby PACs.

    • K1 and K2 are constants, with values determined by the specific CPU module used in the application:

Coefficient

BMEH582040S

BMEH584040S, and BMEH586040S

K1

32.0

10.0

K2

23.6

7.4

NOTE:
  • The value produced by these formulas is an absolute minimum for the SAFE task period valuable only for a first estimation of the SAFE cycle time limit. It does not include the time necessary for user code execution or for the margin necessary for the intended operation of the PAC multi-task system. Refer to the topic System Throughput Considerations in the Modicon M580 Standalone System Planning Guide for Frequently Used Architectures.

  • By default, Data_Safe_Size and Sizekbytes are equal. Their values can be viewed, respectively, in the PLC > Memory Consumption menu and the PLC > Hot Standby screen.

Example Calculations

Sample results of calculating the minimum SAFE task period are set forth below

Minimum Safe Task Period (ms)

Sizekbytes1

NbDFB_Inst

BMEP582040S

BMEP584040S or BMEP586040S

BMEH582040S

BMEH584040S or BMEH586040S

0

0

10

10

10

10

50

10

16

10

20

11

100

10

30

18

37

20

150

10

43

25

54

29

200

10

57

33

70

37

250

10

71

41

87

46

300

20

84

49

105

55

350

20

98

57

121

64

400

20

112

64

138

73

450

20

125

72

155

81

500

20

139

80

172

90

550

30

-

88

-

99

600

30

-

96

-

108

650

30

-

103

-

117

700

30

-

111

-

126

750

30

-

119

-

134

800

40

-

127

-

143

850

40

-

135

-

152

900

40

-

142

-

161

950

40

-

150

-

170

1000

40

-

158

-

179

1. Sizekbytes and Data_Safe_Size are assumed to be equal.

NOTE: Configure the SAFE task watchdog with a value that is greater than the SAFE task Period .

Refer to the topic Process Safety Time, for information regarding how the SAFE task configuration affects process safety time.

Refer to the topic M580 Safety PAC Tasks for information describing the execution priority of the SAFE task.

Creating Code Sections

Right click on the Section folder for a task and select New Section... to open a configuration dialog. For the safety and process tasks, the following program languages are available:

Language

Safety tasks

Process tasks

SAFE

MAST

FAST

AUX0

AUX1

IL

FBD

LD

LL984 segment

SFC

ST

✔: available

– : not available

Except for these limitations on programming language availability for the SAFE task, the new section configuration dialog operates the same as for a non-safety M580 project. Refer to the topic Properties Dialog Box for FBD, LD, IL, or ST Sections in the EcoStruxure™ Control Expert Operating Modes manual for more information.

Adding Data to Code Sections

Because the SAFE task is separated from the process tasks, only data accessible in the Safety Data Editor is available to be added to a SAFE task code section. This data includes:

  • Unlocated safety variables (i.e. with no %M or %MW address) created in the Safety Data Editor .

  • Data objects that are part of M580 safety module device DDT structures.

Similarly, data available to non-safety task code sections includes all data within the scope of the process namespace. This includes all project data except:

  • Data exclusively available to the SAFE namespace (see above).

  • Data objects created in the Global Data Editor.

Code Analysis

When you analyze or build a project, Control Expert displays a detected error message if:

  • Data belonging to the process namespace is included in the SAFE task.

  • Data belonging to the safe namespace is included in a process task (MAST, FAST, AUX0, AUX1).

  • Located bits (%M) or words (%MW) are included in a SAFE task section.