Training Curriculum: TIA Portal Module 010
Training Curriculum: TIA Portal Module 010
311
TIA Portal Module 010
Table of contents
1 Goal................................................................................................................................................. 313
2 Prerequisite...................................................................................................................................... 313
3 Required hardware and software..................................................................................................... 314
4 Theory.............................................................................................................................................. 315
4.1 Data blocks.............................................................................................................................. 315
4.2 Data types of the SIMATIC S7-1500........................................................................................316
4.3 Optimized blocks..................................................................................................................... 317
4.4 Download without reinitialization.............................................................................................. 317
5 Task................................................................................................................................................. 318
6 Planning........................................................................................................................................... 318
6.1 Global data block for speed control and speed monitoring of the motor..................................318
6.2 Technology diagram................................................................................................................ 318
6.3 Reference list........................................................................................................................... 319
7 Structured step-by-step instructions................................................................................................. 320
7.1 Retrieve an existing project...................................................................................................... 320
7.2 Create the global data block "SPEED_MOTOR".....................................................................321
7.3 Access to data of the data block in the organization block.......................................................325
7.4 Save and compile the program................................................................................................ 329
7.5 Download the program............................................................................................................. 330
7.6 Monitor/modify values in data blocks.......................................................................................330
7.7 Initialize setpoints/reset start values........................................................................................ 331
7.8 Snapshots in data blocks......................................................................................................... 333
7.9 Expand data block and download it without reinitialization......................................................335
8 Checklist.......................................................................................................................................... 339
312
TIA Portal Module 010
2 Prerequisite
This chapter builds on the chapter Analog Values with the SIMATIC S7 CPU1516F-3 PN/DP.
313
TIA Portal Module 010
2 SIMATIC STEP 7
Professional (TIA
1 Engineering station Portal) as of V1X
4 Ethernet connection
Control panel
3 SIMATIC S7-1500 controller
314
TIA Portal Module 010
4 Theory
4.1 Data blocks
In contrast to logic blocks, data blocks contain no instructions. Rather, they serve as memory
for user data.
Data blocks thus contain variable data that is used by the user program. You can define the
structure of global data blocks as required.
Global data blocks store data that can be used by all other blocks (see Figure 1). Only the
associated function block should access instance data blocks. The maximum size of data
blocks varies depending on the utilized CPU.
Function_10
Function_11
315
TIA Portal Module 010
316
TIA Portal Module 010
The following steps can be performed while the controller is in RUN mode:
1. Activate "Download without reinitialization"
2. Insert newly defined tags in an existing block
3. Download expanded block to the controller
The newly defined tags are initialized. The existing tags retain their current value.
Prerequisite: a memory reserve must have been defined for the block beforehand and the
block with this memory reserve must have downloaded to the CPU.
317
TIA Portal Module 010
5 Task
In this chapter, the program from chapter Analog will be expanded to include a data block that
centrally provides the parameters for the two functions "MOTOR_SPEEDCONTROL“ [FC10]
and "MOTOR_ SPEEDMONITORING“ [FC11].
6 Planning
The data management and setpoint setting for the "MOTOR_SPEEDCONTROL" [FC10] and
"MOTOR_SPEEDMONITORING" [FC11] functions will be carried out using the global data
block "SPEED_MOTOR" [DB2].
This will be added to the "032-500_Analog_Values" project. This project must be retrieved
from the archive beforehand.
In the "Main" [OB1] organization block, the two functions "MOTOR_SPEEDCONTROL" [FC10]
and "MOTOR_SPEEDMONITORING" [FC11] must then be connected with the tags from
global data block "SPEED_MOTOR" [DB2].
6.1 Global data block for speed control and speed monitoring of the
motor
Speed setpoint and actual speed value will be created in Real data format (32-bit floating-point
number) as the first tags in the "SPEED_MOTOR" [DB2] data block. The speed setpoint is
thereby given the start value + 14 U/min
A structure (Struct) 'Positive_Speed' will then be created for monitoring the positive speed
limits.
This structure contains the 2 tags 'Threshold_Error' (start value + 15 rpm) and
'Threshold_Warning' (start value + 10 rpm) in Real data format (32-bit floating-point number)
and the 2 tags 'Error' and 'Warning' in Bool data format (binary number).
The structure (Struct) 'Positive_Speed' will then be inserted again as a copy and renamed to
'Negative_Speed' for monitoring the negative speed limits.
The 'Threshold_Error' tag is given the start value - 16 rpm and the 'Threshold_Warning' tag
the start value - 14 rpm.
318
TIA Portal Module 010
DI Digital Input
DO Digital Output
AI Analog Input
AO Analog Output
I Input
Q Output
NC Normally Closed
NO Normally Open
319
TIA Portal Module 010
The next step is to select the target directory where the retrieved project will be stored.
Confirm your selection with "OK".
( Target directory OK)
320
TIA Portal Module 010
Select in the next dialog and rename your new block to: "SPEED_MOTOR". Select
'Global DB' as the type. The number '2' will be automatically assigned. Select the "Add
new and open" check box. Click "OK".
321
TIA Portal Module 010
322
TIA Portal Module 010
Create the tags for the speed monitoring below the structure as shown here.
323
TIA Portal Module 010
324
TIA Portal Module 010
Note: The use of setpoints is described further below in the step-by-step instructions of the
module.
Delete the temporary tags in Main [OB1] that are no longer needed. Only the Boolean tag
'Motor_Speed_Control_Ret_Val' is still needed.
( Delete)
325
TIA Portal Module 010
Have the "SPEED_MOTOR" [DB2] data block and the "Main" [OB1] organization block
displayed side by side by clicking the ' ' icon to vertically split the editor area.
( )
Use drag-and-drop to move the tags needed for the interconnection from the
"SPEED_MOTOR" [DB2] data block onto the connections of the called functions and
function blocks in the "Main" [OB1] organization block. First we move the
'Speed_Actual_Value' tag onto the 'Actual_speed' output of the
"MOTOR_SPEEDMONITORING" [FC11] block.
( Speed_Actual_Value)
326
TIA Portal Module 010
Also connect the other contacts in Network 1 with tags from the "SPEED_MOTOR" [DB2]
data block as shown here.
Connect the contacts in Network 2 with tags from the "SPEED_MOTOR" [DB2] data block
as shown here.
327
TIA Portal Module 010
Connect the contacts in Network 3 with tags from the "SPEED_MOTOR" [DB2] data block
as shown here.
328
TIA Portal Module 010
To save your project, click the button in the menu. To compile all blocks,
click the "Program blocks" folder and select the icon for compiling in the menu.
( Program blocks )
The "Info", "Compile" area shows which blocks were successfully compiled.
329
TIA Portal Module 010
( )
( SPEED_MOTOR [DB2] )
330
TIA Portal Module 010
In the 'Monitor value' column, the values currently available in the CPU can be monitored.
If your right-click on one of the values, the 'Modify' dialog for modifying this value opens
( Modify Modify value: 14.0 OK)
The setpoints can be initialized by clicking the ' ' icon. For the tags whose 'Setpoint'
check box is selected , the start value will then be applied as the current value.
( )
331
TIA Portal Module 010
( )
332
TIA Portal Module 010
If you click the ' ' icon, a snapshot of the monitored values can be taken in order to
apply these values as start values or to transfer them back to the CPU later
( ).
Alternatively, values from the snapshot can be applied by clicking the ' ' icon for all
values or by clicking the ' ' icon for the start values only. Only the setpoints are needed
here in most cases
( )
333
TIA Portal Module 010
To transfer data captured in the snapshot back to the CPU, you must click ' '.
( )
334
TIA Portal Module 010
If you want to overwrite all setpoints with the start values, you can initiate this by clicking '
'. The values in the CPU for which the 'Setpoint' check box was not selected are
thereby retained.
( )
you must ' ' and then open the properties of the data block.
335
TIA Portal Module 010
Select the 'Optimized block access' check box in the properties under 'General',
'Attributes'.
( General Attributes Optimized block access)
Assign a 'Retentive memory reserve' to the data block for 'Download without
reinitialization'.
(Download without reinitialization Retentive memory reserve 10 bytes OK)
Download your "SPEED_MOTOR" [DB] data block to the controller again and select '
'.
(SPEED_MOTOR [DB] )
336
TIA Portal Module 010
Then click the ' ' icon to activate download without reinitialization and confirm the safety
prompt with 'OK'.
( OK)
337
TIA Portal Module 010
If you click ' ' to monitor the block again, you will see that the monitored values have
not been overwritten with the start values.
( )
338
TIA Portal Module 010
8 Checklist
No. Description Completed
339