Faq 02yfy319 Dlimrun en

Download as pdf or txt
Download as pdf or txt
You are on page 1of 13

FAQ Ÿ 07/2014

How is a
download possible during
RUN?
SIMOTION from V4.4 and higher

http://support.automation.siemens.com/WW/view/de/94770057
This article originates from Siemens Industry Online Support. The terms of use
specified there apply (www.siemens.com/terms_of_use).

Security Siemens provides products and solutions with industrial security functions that
informati support the secure operation of plants, solutions, machines, devices, and/or
on networks. They are important components in a holistic industrial security
concept. With this in mind, Siemens’ products and solutions undergo continuous
development. Siemens recommends strongly that you regularly check for
product updates.
To ensure that Siemens products and solutions are operated securely, suitable
preventive measures (e.g. cell protection concept) must be taken and each
component must be integrated into a state-of-the-art holistic industrial security
concept. Third-party products that may be in use should also be considered. For
more information about industrial security, visit
http://www.siemens.com/industrialsecurity.
To receive information about product updates on a regular basis, register for our
product newsletter. For more information, visit
http://support.automation.siemens.com.
ã Siemens AG 2014 All rights reserved

FAQ Download im RUN


Entry ID: 94770057, V1.0, 07/2014 2
Table of contents
1 Overview ......................................................................................................... 4
2 System interrelationships .............................................................................. 5
2.1 Unit concept ...................................................................................... 5
2.1 Download during RUN ....................................................................... 5
2.2 Dependencies on other sources......................................................... 6
2.3 Changes to the interface area of a user unit ....................................... 8
3 Settings for download during RUN ................................................................ 9
3.1 Settings in SCOUT ............................................................................ 9
3.2 Download during RUN for modified data declarations....................... 10
3.3 Download during RUN of programs in motion tasks ......................... 11
3.4 When is a download not possible during RUN? ................................ 12
3.5 Recommendations for change-optimized programming .................... 12
Appendix ................................................................................................................ 13
4 Changes ........................................................................................................ 13
5 Contact person ............................................................................................. 13
ã Siemens AG 2014 All rights reserved

FAQ Download im RUN


Entry ID: 94770057, V1.0, 07/2014 3
1 Overview

1 Overview

What has to be taken into account so that a download is successful during RUN?

The FAQ describes the system interrelationships and the necessary settings so that a download
can be executed while a SIMOTION SCOUT V4.4 project is running on a SIMOTION CPU.

With a download, SIMOTION SCOUT checks all modified sources, so that consistent data is
always loaded.
From SIMOTION SCOUT V4.4 and higher, selected, individual sources can be loaded
(consistent subsets).
This is true for a download at STOP as well as a download during RUN.

Therefore, only transparent and understandable changes should be made for a download
during RUN.
ã Siemens AG 2014 All rights reserved

FAQ Download im RUN


Entry ID: 94770057, V1.0, 07/2014 4
2 System interrelationships

2 System interrelationships

2.1 Unit concept Unit


Interface
Several programs, FBs or FCs (global unit data declarations
(Programorganisation units, POUs) can be
and published POEs)
included in a source (unit).
The global unit variables and the POUs are
published in an interface unit; these can be Program_1
used in other units.
When changes are made to the unit, the Program_2
complete unit is always loaded.
FB_1

FC_1

FC_2
ã Siemens AG 2014 All rights reserved

2.1 Download during RUN

Adding newly loaded units during RUN is made at the cycle control point.
At this control point, neither the code (of the programs, FBs or FCs) nor data (variables) of these
units may be used in a task.
Cyclic tasks:
At the cycle control point, all cyclic tasks have been ended and are restarted. At this instant in
time, no sources are currently active in cyclic tasks; this means that loaded sources can be
exchanged for cyclic tasks during RUN.
Motion tasks:
At the cycle control point, the system determines which POUs are currently active, and when
necessary, inhibits the units involved for exchange during RUN.

Therefore, for a download during RUN, it is important to use separate units (POUs and data
declarations) for use in cyclic and sequential tasks.

Also refer to the Section "Recommendations for change-optimized programming" at the end of
the document.

Example to clarify the situation:


In this example, in the execution system, the programs from Unit_2 and Unit_3 are assigned a
motion task and programs from Unit_1 are assigned a BackgroundTask.
The FC_1 function from Unit_1 is called from the Program_21 program of Unit_2, which in the
context of the Program_21 program is then also executed in motion task 2.

FAQ Download im RUN


Entry ID: 94770057, V1.0, 07/2014 5
2 System interrelationships

Unit_3

Motion Task_1 Program_31 endless (while true)


Program_31

Unit_2 Call Return


Program_21
Motion Task_2
Program_21

FC_1
Unit_1

Program_11 Program_11 Cycle control point


BackgroundTask (cycl. tasks completed)

FC_1

t
t1 t2 t3 t4 t5 t6 t7 t8 t9

If the complete code of Unit_1 would only be processed in the BackgroundTask, then the
modified Unit_1 could be replaced at time t4. At this time, all cyclic tasks have been completed.
However, as Unit_2 has started a call for code (POU) from Unit_1, which at time t4 has not yet
returned, Unit_1 cannot be exchanged at this time. Therefore, in the example above, Unit_1 can
only be replaced at the earliest at time t7.
ã Siemens AG 2014 All rights reserved

A unit cannot be exchanged as long as it is being processed by a motion task.


However, in the example above, Unit_3 can never be exchanged in the endlessly executed
motion task.
The example clearly shows that a unit should only contain POUs that are either executed in
cyclic tasks or motion tests, but never mixed.

2.2 Dependencies on other sources


Changes to connected sources also have an influence on the download during RUN, as it is
possible that other units must be loaded.
SIMOTION applies the unit concept, so that you can access the published global variables, data
types, functions (FCs), function blocks (FBs) and programs of other source files. You can
connect to other program sources to use their exported components by using a USES
instruction in ST sources or using the register connections in the declaration tables of MCC and
LAD/FBD sources.

FAQ Download im RUN


Entry ID: 94770057, V1.0, 07/2014 6
2 System interrelationships

If additional units depend on another modified unit (in the example above, when making a
ã Siemens AG 2014 All rights reserved

change to Unit A, Units B and C are also involved), then the system checks as to whether
changes relevant to the runtime exist, and whether these units must also be exchanged when
the download takes place.
This is only required if changes have been made at the interfaces of actually used (called) data
and POUs.
This behavior applies to all supported RT versions that are processed using SIMOTION
SCOUT V4.4 (must be previously saved and everything must be recompiled).
In the event of a simple change to the code of a POU and in the event of any changes to the
data in the IMPLEMENTATION part of a unit, only the modified unit has to be loaded and
exchanged.

Example:
In UnitA, data (data types and variables) and POUs (programs, functions, function blocks) used
by UnitB are communicated via the interface area:

UnitA UnitB

Interface Uses UnitA;


<Data>
<POUs>
End_Interface Using data
and/or POUs
from UnitA

FAQ Download im RUN


Entry ID: 94770057, V1.0, 07/2014 7
2 System interrelationships

If you change the interface area of UnitA, then this has an impact on UnitB:
· UnitB is also recompiled
(before the download, a complete check is made regarding the compilation state of all
dependent sources)
· If UnitA is to be exchanged (loaded), then also UnitB must be exchanged, dependent on
the scope of changes (see above) and how the dependencies were actually checked.

Special feature for motion tasks that are used:


If, for example, in UnitA there is a program that runs in a cyclic task, and in UnitB a program that
runs in an endless motion task, then under certain circumstances, you cannot exchange UnitA
during RUN, as also UnitB would have to be exchanged.

2.3 Changes to the interface area of a user unit


In the engineering system, a check is made as to whether changes in the interface area of a
user unit only relate to the interfaces of the published programs or to the conditions of
UserInterruptTasks. When the change has an impact on the programs or the conditions for the
UnserInterruptTasks, the execution system must be loaded and exchanged.
ã Siemens AG 2014 All rights reserved

When exchanging the execution system, it is not permissible that a task is running (this is also
problematical for long-running and endlessly running motion tasks).
Before SIMOTION SCOUT V4.4, for any changes in the interface area of a user unit (which
provides PROGRAMS, which are also used in the execution system), the execution system had
to be reloaded.

FAQ Download im RUN


Entry ID: 94770057, V1.0, 07/2014 8
3 Settings for download during RUN

3 Settings for download during RUN

3.1 Settings in SCOUT

Permit download during RUN


ã Siemens AG 2014 All rights reserved

Set the compiler switch to “Create program instance data only once”

This setting is important for a download during RUN, as this means that dependencies on the
execution system are significantly reduced.
In this case, the instance data lie in the source or in the code of the program, and for modified
instance data of a program, the execution system can remain unchanged.

FAQ Download im RUN


Entry ID: 94770057, V1.0, 07/2014 9
3 Settings for download during RUN

3.2 Download during RUN for modified data declarations


Changes made to VAR_GLOBAL blocks and changes in VAR blocks of programs (program
instance data) can be loaded during RUN, if it is permissible to initialize the variable values
(compiler Pragma BlockInit_OnChange or Pragma lines in the declaration tables).
In ST source files:

in LAD/FBD and MCC declaration tables:


ã Siemens AG 2014 All rights reserved

Changes can always be made to VAR_TEMP blocks in programs and FBs as well as all
declaration blocks for FCs.
When compiling the source, it is identified if it is not possible to perform a download during RUN
(without initializing the variables).
Warning ST_1: 32300 :Data change in the source prevents download during RUN
The alarm is also output when using the above-mentioned Pragmas.

FAQ Download im RUN


Entry ID: 94770057, V1.0, 07/2014 10
3 Settings for download during RUN

Example:
In this particular example, all commented out declarations and operations can be activated and
loaded during RUN.
ã Siemens AG 2014 All rights reserved

Also a new FB, or one changed in the interface (e.g. new input parameter) can be loaded during
RUN, if, in the calling unit, the above-mentioned Pragma was used when instantiating the FB.
After the download, the Pragma can be deleted or commented out, so that for a subsequent
download, the variables do not have to be initialized again. A change such as this to the
Pragma line can always be loaded during RUN after compilation.

Alternative approach if an initialization of the variable values


should be avoided:
Insert a new global variable and avoid the initialization of variables in the existing
VAR_GLOBAL block
· via a new VAR_GLOBAL block (at the end of the declaration section)... or
· via a new unit with VAR_GLOBAL block that is connected with USES

3.3 Download during RUN of programs in motion tasks


Provide application-based options so that the motion task is not active when you want to
exchange the unit.
It is also possible to specifically control motion tasks (stop, inhibit, start) using the Task Manager
in the SCOUT device diagnostics.

FAQ Download im RUN


Entry ID: 94770057, V1.0, 07/2014 11
3 Settings for download during RUN

Exit a running motion task with "Reset task" and "Disable task start".
Carry out a download during RUN.
Start the motion task with "Enable task start" and "Start task".

3.4 When is a download not possible during RUN?


For the following changes, a download is not possible during RUN:
Changes
· to HW Config
ã Siemens AG 2014 All rights reserved

· to the execution system


· to the address list (I/O configuration)
· to the global device variables

Also newly created or deleted technology objects prevent a download during RUN.

3.5 Recommendations for change-optimized programming

· Do not call POUs of a unit in cyclic tasks and motion tasks.


· Use the option "Only create program instance data once".
· If possible, apply the USES instruction in the implementation section, because as a
consequence, these connections are not further inherited by other connected units.
· Declare the remanent variables and HMI-relevant variables in a separate dedicated unit.
· Create the dummy variables in theglobal device variables or even better, use global unit
variables instead.
· Create an appropriate I/O quantity structure.

FAQ Download im RUN


Entry ID: 94770057, V1.0, 07/2014 12
4 Changes

Appendix

4 Changes
Table 4-1: Revisions/Author
Version Date/change
1.0 17.07.2014

5 Contact person
Siemens AG
Industry Sector
I DT MC PMA APC
ã Siemens AG 2014 All rights reserved

Frauenauracher Strasse 80
D - 91056 Erlangen, Germany
E-mail: tech.team.motioncontrol@siemens.com

FAQ Download im RUN


Entry ID: 94770057, V1.0, 07/2014 13

You might also like