Siemens Industry Online Support
Siemens AG
Entry type: Application example Entry ID: 6189558, Entry date: 01/04/2001

saving the running times of single steps

  • Entry
  • Associated product(s)

How can I save the running times of single steps?

Using S7-GRAPH V5 you can save the running times of single steps in a memory area of your choice. In addition to other information, the running time of single steps is also stored in the instance data block. A step structure is created in the instance data block for each step in the sequencer of the GRAPH FBs.
The structure element "StepX.T", for example, contains the total step activation time.
The element "StepX.U" contains the undisturbed step activation time.

Using arithmetic functions you can store the desired time information in the desired memory area. For this you program an action for each step. Upon terminating the step, this action copies the step activation time from the instance data block into the corresponding memory area depending on events.


S0 N

"Memory area":=Step1.T

There is also the option of having the running times go via the interface of the GRAPH FB.

Sample function:
In the following example the running times "Total step activation time" and the "Undisturbed step activation time" of the single steps of the sequencer FB2 are stored in a data block. After terminating each step, the information is copied from the instance data block DB2 into the data block DB1. Via the output parameters "S_TIME" and "S_TIMEOK" of the GRAPH FB the current running times of the step active at the moment are stored in the marker areas.

The download contains a STEP 7 V5.1 project with the organization block OB1, the function FC1, the data block DB1 and the S7-GRAPH block FB1 with the associated instance data block. You can adapt the blocks as you wish to suit your requirements.


Copy the "step_time.exe" file into a separate directory and then start it with a double-click. The S7 V5.1 project is now unpacked automatically with all the associated subdirectories. You can then open and process the unpacked project with the SIMATIC Manager.

Security information
In order to protect technical infrastructures, systems, machines and networks against cyber threats, it is necessary to implement – and continuously maintain – a holistic, state-of-the-art IT security concept. Siemens’ products and solutions constitute one element of such a concept. For more information about cyber security, please visit
Rate entry
no rating
Requests and feedback
What do you want to do?
Note: The feedback always relates to the current entry / product. Your message will be forwarded to our technical editors working in the Online Support. In a few days, you will receive a response if your feedback requires one. If we have no further questions, you will not hear from us.