Sunteți pe pagina 1din 21

Contents

Page

Debug - Monitor (Status)


...............................................................................................................
Program Status Modes of Operation ................................................................................................ 3
Use of Trigger Points with Program Status ....................................................................... 4
Selecting the Display Information of the Program Status
...............................................................
Activating the Monitor/Modify Variables" Tool
...........................................................
Entering a Variable Table
................................................................................................................
Monitoring and Modifying Variables ................................................................................................ 8
Setting Trigger Points
....................................................................................................................
Saving a Variable Table
................................................................................................................
Opening a Variable Table ................................................................................................................ 11
Establishing a Connection to the CPU ............................................................................................ 12
Modifying Outputs in the Stop Mode
...............................................................................................
Forcing ............................................................................................................................................. 14
Breakpoints (Part 1) ......................................................................................................................... 15
Breakpoints (Part 2) ......................................................................................................................... 16
Exercise: Monitoring and Modifying Variables
..............................................................................
Exercise: Modifying Variables in the Stop State .............................................................................. 18
Exercise: Using Trigger Points for the Modify Variables Function .................................................... 19
Exercise: Forcing ........................................................................................................................... 20
Exercise: Combining Program Status and Monitor Variable
.....................................................

Training Center
for Automation and Drives

Page 1

5
6
7
9
10

13

17

21

ST-7PRO1
Test Functions

Monitor

You can activate the Monitor" ("Status") test mode for the block which is currently
open by
b clicking
li ki th
the S
Spectacles
t l iicon with
ith th
the mouse or b
by selecting
l ti th
the menu
options Debug -> Monitor.
In the test mode, the elements in LAD / FBD are displayed in different colors. You
define these by selecting the menu options Options -> Customize.
E.g.: Status fulfilled
-> "Element is displayed in green"
Status not fulfilled
-> "Element is displayed in blue"

Notes

1. When the Monitor" test mode is activated, yyou cannot make any
y changes
g to
the program.
You cannot change the view of the block (LAD, STL, FBD) either.
2. The status can only be displayed when the instructions are being executed.
The status is not displayed when the CPU is in the STOP mode or when the
block is not called.

Training Center
for Automation and Drives

Page 2

ST-7PRO1
Test Functions

Debug-> Operation

There are two modes of operation for the test mode, which differ in their effect on
th scan cycle
the
l titime off the
th user program:
Process operation and
Test operation.

Process Operation

In process operation, the test functions are restricted so that the permissible scan
cycle time increase that you select is not exceeded.
The status of programmed loops is only determined the first time they are executed.
The test functions Breakpoint
p
and Single-step
g
p (p
(program
g
execution)
) cannot be
executed.

Test Operation

In test operation, all test functions can be performed without restrictions.


The status of programmed loops is determined every time they are executed.
The scan cycle time can be increased considerably due to the updating of the test
function program status with every loop execution.

P
Parameter
t
Assignment

Th above
The
b
iinformation
f
ti only
l applies
li if th
the mode
d off operation
ti h
has nott already
l d
been defined in the hardware configuration.
The mode of operation can be defined on the Protection tab page when assigning
the CPU parameters. This setting can then no longer be changed in the Operation
dialog box.

Training Center
for Automation and Drives

Page 3

ST-7PRO1
Test Functions

Trigger Points

After you have selected the menu options Debug -> Call Environment, a dialog box
pops up (see
(
slide
lid above).
b
) Here
H
you can enter
t a Call
C ll path.
th This
Thi iis h
helpful
l f l if a bl
block
k
is called several times in a program and you want to monitor only one specific call.
You can also specify data blocks as trigger conditions.
The status display of the block begins from the point when the specified DB is
opened.

Call Path

In the example, FC 1 is called three times (see program structure). So that you can
specifically monitor a call, enter the three blocks that are found immediately before
the status block. A requirement for this is that the call takes place through different
bl k S
blocks.
So th
thatt you can monitor
it the
th third
thi d call,
ll enter
t iin th
the example
l
FC 30 at 3rd Block.

Open Data Blocks

In the example, FB 1 is called several times by the same FC 40 block. In this case,
the Call path cannot be used for testing. Here you use the opened data block as a
trigger for testing. Since, as a rule, an instance DB is also used with an FB, you can
use this instance DB in the DB2-number field as the trigger condition. In the
example, DB 1 was used for the first call, DB 2 for the second call and DB 3 for the
third call. You have to enter DB 2 in order to see the second call.

Note

The "Test Operation" mode is a prerequisite for testing with the Call path.

Training Center
for Automation and Drives

Page 4

ST-7PRO1
Test Functions

Introduction

In the block status, you can select which information is to be displayed on the
screen. By
B d
default,
f lt you see St
Status
t Bit,
Bit RLO,
RLO and
d Standard
St d d status.
t t
If you want to display additional information, select the menu options Options ->
Customize -> STL.

Dialog Box

In the screen you can see the dialog box for putting together the information.
In addition to the information displayed by default, the following is also possible:

Note

Training Center
for Automation and Drives

AR1 Address register 1, only meaningful with register indirect addressing


AR2 Address register 2, only meaningful with register indirect addressing
A
Accumulator
l t 2
DBR1 Data block register 1 (global or first DB opened)
DBR2 Data block register 2 (local or second DB opened)
Indirect, meaningful with memory indirect addressing (shows the contents of
MD and DD e.g. with the instruction L IW [MD 100] ).

With a running program status, you can hide and show additional information, you
can change the representation (decimal, hexadecimal, real) or display separators.
To do so, click with the right mouse button on the title RLO, STA .. and choose the
menu option
ti you wantt (see
(
screen).
)

Page 5

ST-7PRO1
Test Functions

General

Monitor/Modify Variables" is another STEP 7 tool which enables you to monitor the
variables
i bl off a program iin selectable
l t bl fformats.
t
It also allows you to modify the status or contents of variables in the CPU.

Toolbar

You can change the toolbar by selecting the menu options View -> Toolbar. There
are three different toolbars which you can activate/deactivate:

View

Training Center
for Automation and Drives

Standard

View

Variable

You can adjust the number of columns in the variable table by selecting the menu
options
Vi
View
->
> Symbol
S b l/S
Symbol
b lC
Commentt / M
Monitor
it F
Formatt / Monitor
M it Value
V l / Modify
M dif Value
V l
or by using the View" toolbar.

Page 6

ST-7PRO1
Test Functions

Creating a VAT

There are two different ways of creating a variable table:


1 in
1.
i th
the LAD/STL/FBD Edit
Editor, b
by selecting
l ti th
the menu options
ti
PLC ->
>
Monitor/Modify Variables. You can work directly online with this table.
2. in the SIMATIC Manager, by selecting the menu options Insert New Object
Variable Table when the Blocks folder is open. This table is created
offline. You can save it and open it again later, switch to online mode and
then test it.

Table

Each address to be monitored or modified takes up one line of the variable table.
The meanings of the columns of the variable table are as follows:

Address

The variables absolute address is found in this column.

Symbol

The variables symbolic name (identifier) is found here. It is identical to the name
entered in the symbol table.

Symbol Comment

The symbol comment from the symbol table is displayed in this column.

M it Format
Monitor
F
t

This column
Thi
l
contains
t i a standard
t d d setting,
tti
e.g. HEX.
HEX
You can change the format as follows:
click an entry in the format column with the right mouse button. The list of
formats pops up.
or keep clicking on the entry in the format column with the left mouse button
until the format you want appears.

Monitor Value

The contents of the variable at the last update is displayed here.

Modify Value

You enter the new value for the variable (the modify value) in this column.

Training Center
for Automation and Drives

Page 7

->

ST-7PRO1
Test Functions

Monitor

You can monitor variables in two ways:

The monitor values can be updated once by selecting the menu options
Variable -> Update Monitor Values or by clicking on the
icon.

Modify

Modify Value Valid

The monitor values can be updated every cycle by selecting the menu
options Variable -> Monitor or by clicking on the
icon

Procedure for modifying variables:


1.
With the left mouse button, click the line in the Modifyy Value column for
the variable that you want to modify.
2.
Enter the value in the correct form for the data type.
3a. To activate the modify values once, select the menu options Variable ->
Activate Modify Values or click the
icon (or item 3b).
3b.

To activate the modify values every cycle, select the menu options
Variable -> Modify or click the
icon.

4.

Use the Monitor test function to check whether the modify value has been
entered in the variable.

You can make the modify value entered in the table invalid by clicking on the
icon.
The invalid value is optically displayed like a comment. You make the modify
value valid again by clicking on the icon again.
O l valid
Only
lid modify
dif values
l
can b
be activated.
ti t d

Training Center
for Automation and Drives

Page 8

ST-7PRO1
Test Functions

Trigger

You set the trigger points in the Monitoring and Modifying Variables tool by
selecting
l ti th
the menu options
ti
V i bl ->
Variable
> Set
S t Trigger...
Ti
or by
b clicking
li ki th
the
icon.

Trigger Points

The Monitor Trigger Point specifies when the values of the variables being
monitored are to be updated.
The Modify Trigger Point specifies when fixed values are to be assigned to the
variables being modified.

Trigger Frequency

The Monitor
Monitor Trigger Frequency
Frequency specifies whether the values are to be updated
once only when the trigger point is reached or every cycle (every time the trigger
point is reached).
The Modify Trigger Frequency specifies whether the new values are to be
assigned to the variables being modified once only or every cycle.

Attention !

When the Monitor Trigger Frequency is set to Once, a click on the icons
or
has the same effect: the values are updated once.
When the Modify Trigger Frequency is set to Once, a click on the icons
or
has the same effect: the values are activated once.
When the trigger frequencies are set to Every Cycle, the above-mentioned icons
have the different effects previously described.

Note

Training Center
for Automation and Drives

When the same trigger points are set for Monitor and Modify, Monitor has priority,
that is, monitoring is done first.
For some CPU versions (e.g. CPU 314-1AE03), the modify function is not carried
out with every cycle when the Modify Trigger Frequency" is set to Every cycle".
Remedy: Using the test function "Force".

Page 9

ST-7PRO1
Test Functions

Save

Training Center
for Automation and Drives

When you cancel or finish a test phase, you can save the variable table.
The name of a variable table consists of the letters "VAT" followed by a number
from 0 to 65535 (with no space in between), e.g. "VAT5".

Page 10

ST-7PRO1
Test Functions

What to Do

Training Center
for Automation and Drives

1. Activate the menu options Table -> Open.


2. Choose the project name in the Open" dialog window.
3. Select the relevant program in the project pane underneath and click the
Blocks folder.
4. Select the table you want in the right-hand pane.
5. Confirm with "OK".

Page 11

ST-7PRO1
Test Functions

PLC

The variables in a VAT are variable parts of a CPU program.


B f
Before
you can monitor
it or modify
dif th
the variables,
i bl
you mustt establish
t bli h a connection
ti tto
the CPU concerned. It is possible to connect each variable table to a different CPU.
You select the menu options
PLC -> Connect To . . .
or click the appropriate icons in the toolbar to establish a connection to one of the
following CPUs:
Configured CPU
Direct CPU
Accessible CPU . . .

Configured CPU

The variables of the CPU, in whose S7 program (H/W Station) the variable table is
stored, are displayed.

Direct CPU

The variables of the CPU, which are directly connected to the PG, are displayed.

Accessible CPU

The variables of the CPU, which are selected in the dialog box, are displayed.
You select the menu options PLC -> Connect To -> Accessible CPU... to establish
a connection to an accessible CPU.
Thus, you can establish a connection to every CPU in the network.

Training Center
for Automation and Drives

Page 12

ST-7PRO1
Test Functions

Overview

The Enable Peripheral Outputs" function switches off the output disable of the
peripheral outputs (PQ).
(PQ) This enables you to modify the peripheral output when the
CPU is in the STOP mode.

Selection

To enable the peripheral outputs, proceed as follows:


1. Select the menu options Table -> Open to open the variable table (VAT) that
contains the peripheral outputs you want to modify, or, activate the window
for the relevant variable table.
2. Select the menu options PLC -> Connect to to establish a connection to the
CPU y
you want,, so that you
y can modifyy the peripheral
p p
outputs
p
of the active
variable table.
3. Select the menu options PLC -> Operating Mode to open the Operating
Mode dialog box and switch the CPU to the STOP mode.
4. Enter the appropriate values for the peripheral outputs you want to modify in
the Modify Value" column.
Examples: PQB 7 Modify Value: 2#0001000011
PQW 2
W#16#0027
PQD 4
DW#16#0001
5. You switch on the Enable Peripheral Outputs" mode by selecting the menu
options Variable -> Enable Peripheral Outputs.
6. You modify the peripheral outputs by selecting the menu options Variable ->
Activate Modify Values. The Enable Peripheral Outputs" remains active until
you select the menu options Variable -> Enable Peripheral Outputs again to
switch off this function.
7. To assign new values, start again with step 4.

Note

Training Center
for Automation and Drives

If the CPU changes its operating mode and goes from STOP to RUN or
STARTUP, for example, a message pops up.
If the CPU is in the RUN mode and the Enable Peripheral Outputs" function
selected, a message also pops up.

Page 13

is

ST-7PRO1
Test Functions

Forcing

You can establish predefined values for user program variables with the Force
f
function.
ti
With the
th S7-400,
S7 400 iinputs,
t outputs,
t t bit memories
i and
d peripherals
i h l can b
be
forced. With the S7-300, only inputs and outputs.

Notes for Forcing

You can only open one Force Values window for a CPU.
You will find the name of the variable table for the current online connection
the titlebar of the Force Values window.
You will find the date and time of the current force task in the CPU in the
statusbar.
You cannot monitor and modify variables when the Force Values window is
active.

in

Before you start the "Force" function, you should make sure that no one else is
carrying out this function at the same time on the same CPU. You can only cancel
or end a force job by selecting the menu options Variable > Stop Forcing.
You cannot cancel the force task by closing the Force Values window or by exiting
the Monitor/Modify Variables" application.
You cannot undo "Forcing" with the menu options Edit -> Undo. Take the time to
find out about the differences between forcing variables and modifying variables.
Attention!

Please note, that incorrect handling when executing the "Force" function can

Note

Training Center
for Automation and Drives

endanger the life or the health of persons or


cause damage to a machine or the entire system.

This function is only possible as of a specific version of the CPU


(e.g. CPU 314-1AE03).

Page 14

ST-7PRO1
Test Functions

Breakpoints

With the help of this test function, you can test a program you have created in the
STL programming
i llanguage iin single-step
i l t mode.
d This
Thi iis only
l necessary iin program
creation so that you can, for example, test programmed loops.
You can set several breakpoints, depending on the CPU.

Breakpoint
Functions

You can choose the breakpoint functions in the Program Editor by selecting the
menu option "Test" or through the Breakpoint Bar.

Breakpoint Bar

You can activate the breakpoint bar by selecting the menu options View ->
Breakpoint Bar in the Program Editor
Editor.

Note

In order to carry out these test functions, you must have fulfilled the following
requirements:

Attention!

The "Test Operation" mode must have been assigned parameters.


The block to be tested must be opened online.

If a breakpoint
p
is activated, the CPU stops
p at this statement. The outputs
p
are
deactivated for safety reasons.

!
Note

Training Center
for Automation and Drives

This function is only possible as of a specific version of the CPU


(
(e.g.
CPU 314-1AE03).
314 1AE03)

Page 15

ST-7PRO1
Test Functions

Breakpoint Bar
S t/D l t B
Set/Delete
Breakpoint
k i t

B
Breakpoints
k i t A
Active
ti
Show Next Breakpoint

Execute Call
Delete All Breakpoints

Resume

Next Statement

Set/Delete Breakpoint With Set/Delete Breakpoint" you determine where the program execution is to be
halted. The breakpoints statement is not executed.
Breakpoints Active

With Breakpoints Active" you activate all breakpoints; not only those already set but
also those still to be set.

Show Next
Breakpoint
p

With Show Next Breakpoint, the Editor jumps to the next selected breakpoint,
without executing
g the p
program.
g

Resume

With Resume, the program runs until the next active breakpoint.

Next Statement

With "Next Statement, you execute the program in single-step. If you reach a block
call, you jump to the first statement after the block call with "Next Statement".

Execute Call

Here, when you reach a block call you branch into the block with Execute Call". At
the end of the block you jump back to the next statement after the block call.

Training Center
for Automation and Drives

Page 16

ST-7PRO1
Test Functions

Goal

You have already worked with the conveyor model. Now you are to check all the
sensors and
d actuators
t t
on the
th conveyor model.
d l

What to Do

In the S7 program "My Program insert a variable table VAT 1.


Enter the addresses that you see in the slide above into the table. The
symbols are only for orientation and are not displayed for you, since you
have not as yet created a symbol table for this S7 program.

Note: to save typing, you can use the menu options Insert -> Block, to enter eight
lines for e.g. the inputs I 8.0 to I 8.7 in the table.
Save the variable table.
Establish a connection to the CPU.
As the trigger point for monitor and modify select Start of cycle" and as the
trigger frequncy select Every cycle".
Activate the Monitor Variable function.
Check all the sensors on the conveyor model.
Exit the monitor function.
With th
the outputs,
t t enter
t "1" one after
ft th
the other
th iin th
the M
Modify
dif V
Value
l column.
l
Activate the Modify function. Now you have checked all actuators on the
conveyor model.
Result

Training Center
for Automation and Drives

You now know if your conveyor model is fully functional. If it is not, please let your
instructor know.

Page 17

ST-7PRO1
Test Functions

Goal

The CPU has gone into the Stop mode because of a fault. Now, your system is to
b ttransitioned
be
iti
d iinto
t ad
defined
fi d state.
t t You
Y are to
t move the
th conveyor model
d l up tto th
the
light barrier by using the modify function while in the Stop mode.

What to Do

Result

You can carry out the modify function in the Stop state
state.

Training Center
for Automation and Drives

Switch the CPU to STOP.


In the variable table VAT 1, enter a new line with the address PQB 20
(PQB 8).
Switch the Monitor Format to "BIN".
Enter "00100000" as the Modify Value for the new address.
Use the menu options Variable -> Enable Peripheral Outputs.
Trigger the monitoring function by using the menu options Variable ->
Activate Modify Values.
Move the conveyor model to the right until the bottle reaches the light barrier.
When the light barrier is reached press the "Esc" button to end the modifying of
the conveyor model.

Page 18

ST-7PRO1
Test Functions

Goal

You are to understand the meanings of the trigger points while using Modify
V i bl
Variables.

What to Do

Result

You now know how the trigger points operate with the Modify Variable function.

Training Center
for Automation and Drives

Enter a new network in OB 1 of the S7 program "My Program" (see slide).


Transfer all blocks from the S7 program "My Program".
Switch the CPU to RUN, if it is still in the STOP mode from the last exercise.
In the variable table VAT 1, enter the additional address Q 8.6 (Q 4.6).
Set the Modify Trigger Point as shown in the slide.
Try to modify the output to "0"
0.
If this is not possible, try it with another trigger point.

Page 19

ST-7PRO1
Test Functions

Goal

Sensor signals have failed in the system. You are to simulate these using the
"F
"Force"
" ttestt function.
f
ti

What to Do

Result

Training Center
for Automation and Drives

In the Monitor and Modify Variable" tool select the menu options Variable ->
Display Force Values.
In the "Force Values" window, enter the addresses I 0.0 to I 0.2 with the
force values (see slide).
Trigger the force function by selecting the menu options Variable -> Force.
Close the "Force Values window.
Determine how the CPU behaves.

The force values are now assigned to the input signals.

Page 20

ST-7PRO1
Test Functions

Goal

You are to carry out several test functions at the same time.

What to Do

Result

Training Center
for Automation and Drives

In one window, open the Monitor and Modify Variable" tool and in another
window open the LAD/STL/FBD Editor (with an open FC 1 block, S7
program "My Program").
Arrange the two windows so that they are both visible at the same time.
In the Monitor and Modify Variable" window add the addresses I 0.0 to I0.2.
Activate the Monitor Variable function.
In the LAD/STL/FBD Editor" window activate the p
program
g
status.
Determine what effect the "Force" test function has on the program in the
FC 1 block.
Cancel the force task by selecting the menu options Variable -> Display
Force Values and then Variable -> Stop Forcing.

You have now become familiar with working with several windows. This could be
helpful in troubleshooting.

Page 21

ST-7PRO1
Test Functions

S-ar putea să vă placă și