application example 06/2016 example of the ... - siemens · they are only intended to provide...

38
https://support.industry.siemens.com/cs/ww/en/view/109738186 Application Example 06/2016 Example of the Application of TM Timer (Time-based IO) Technology Modules TIA Portal V13 SP1 / S7-1500 /Time-based IO with TM Timer

Upload: letuyen

Post on 13-Apr-2018

213 views

Category:

Documents


1 download

TRANSCRIPT

https://support.industry.siemens.com/cs/ww/en/view/109738186

Application Example 06/2016

Example of the Application of TM Timer (Time-based IO) Technology Modules TIA Portal V13 SP1 / S7-1500 /Time-based IO with TM Timer

Warranty and Liability

Time-based IO Entry ID: 109738186, V1.0, 06/2016 2

S

iem

en

s A

G 2

01

6 A

ll ri

gh

ts r

ese

rve

d

Warranty and Liability

Note The Application Examples are not binding and do not claim to be complete with regard to configuration, equipment or any contingencies. The Application Examples do not represent customer-specific solutions. They are only intended to provide support for typical applications. You are responsible for the correct operation of the described products. These Application Examples do not relieve you of the responsibility of safely and professionally using, installing, operating and servicing equipment. When using these Application Examples, you recognize that we cannot be made liable for any damage/claims beyond the liability clause described. We reserve the right to make changes to these Application Examples at any time and without prior notice. If there are any deviations between the recommendations provided in this Application Example and other Siemens publications – e. g. catalogs – the contents of the other documents shall have priority.

We do not accept any liability for the information contained in this document. Any claims against us – based on whatever legal reason – resulting from the use of the examples, information, programs, engineering and performance data etc., described in this Application Example shall be excluded. Such an exclusion shall not apply in the case of mandatory liability, e.g. under the German Product Liability Act (“Produkthaftungsgesetz”), in case of intent, gross negligence, or injury of life, body or health, guarantee for the quality of a product, fraudulent concealment of a deficiency or breach of fundamental contractual obligations (“wesentliche Vertragspflichten”). The compensation for damages due to a breach of a fundamental contractual obligation is, however, limited to the foreseeable damage, typical for the type of contract, except in the event of intent or gross negligence or injury to life, body or health. The above provisions do not imply a change of the burden of proof to your detriment. Any form of duplication or distribution of these Application Examples or excerpts hereof is prohibited without the expressed consent of Siemens AG.

Security informa-

tion

Siemens provides products and solutions with Industrial Security functions that support the secure operation of plants, systems, machines and networks.

In order to secure plants, systems, machines and networks against cyber threats it is necessary to implement (and to maintain continuously) a holistic, state-of-the-art Industrial Security concept. With this in mind, Siemens’ products and solutions are only part of such a concept.

The customer is responsible for preventing unauthorized access to the customer’s plants, systems, machines and networks. Systems, machines and components should only be connected with the company’s network or the Internet, when and insofar as this is required and the appropriate protective measures (for example, use of firewalls and network segmentation) have been taken.

In addition, Siemens’ recommendations regarding appropriate protective action should be followed. For more information on Industrial Security, visit http://www.siemens.com/industrialsecurity.

Siemens’ products and solutions undergo continuous development to make them even more secure. Siemens explicitly recommends to carry out updates as soon as the respective updates are available and always only to use the current product versions. Use of product versions that are no longer supported, and failure to apply latest updates may increase customer’s exposure to cyber threats.

In order to always be informed about product updates, subscribe to the Siemens Industrial Security RSS Feed at http://www.siemens.com/industrialsecurity.

Table of Contents

Time-based IO Entry ID: 109738186, V1.0, 06/2016 3

S

iem

en

s A

G 2

01

6 A

ll ri

gh

ts r

ese

rve

d

Table of Contents Warranty and Liability ................................................................................................. 2

1 Task ..................................................................................................................... 4

1.1 Introduction ........................................................................................... 4 1.2 Overview of the automation task .......................................................... 4

2 Solution............................................................................................................... 5

2.1 Overview............................................................................................... 5 2.2 Hardware and software components ................................................... 6 2.2.1 Validity .................................................................................................. 6 2.2.2 Components used ................................................................................ 6

3 Basics ................................................................................................................. 8

3.1 Time-based IO ...................................................................................... 8 3.1.1 Function principle: ................................................................................ 8 3.1.2 LTIME data format ................................................................................ 8 3.1.3 Application cycle ................................................................................... 8 3.1.4 Signal input ........................................................................................... 9 3.1.5 Signal output ...................................................................................... 10 3.2 Function blocks for the time-based IO ............................................... 10 3.2.1 Function block “TIO_SYNC” ............................................................... 10 3.2.2 Function block “TIO_DI” ..................................................................... 13 3.2.3 Function block “TIO_DQ” ................................................................... 15

4 Mode of Operation ........................................................................................... 19

4.1 General overview ............................................................................... 19 4.2 Program overview .............................................................................. 19 4.3 Block interfaces .................................................................................. 20 4.3.1 Technology function block TIO_SYNC ............................................... 20 4.3.2 Function block PulseDelay ................................................................. 20

5 Configuration and Settings............................................................................. 24

5.1 Connecting the technology module to the CPU ................................. 24 5.2 Creating the isochronous PROFINET connection ............................. 24 5.2.1 Requirements ..................................................................................... 24 5.2.2 Settings the isochronous mode on the technology module ............... 26 5.2.3 Checking the isochronous mode on the interface module ................. 27 5.2.4 Settings on the PROFINET sync domain ........................................... 28 5.3 Mode setting on the technology module ............................................ 29 5.3.1 Making basic settings ......................................................................... 30 5.3.2 Setting of operating modes of input channels .................................... 30 5.3.3 Setting of operating modes of the output channels ............................ 31 5.4 Setting the application cycle ............................................................... 31

6 Installation and Commissioning .................................................................... 33

6.1 Installing the hardware ....................................................................... 33 6.2 Commissioning ................................................................................... 33 6.2.1 Preparation ......................................................................................... 33 6.2.2 Loading the S7 project into the CPU .................................................. 34

7 Operating the Application ............................................................................... 36

8 Links & Literature ............................................................................................ 37

9 History............................................................................................................... 38

1 Task

1.1 Introduction

Time-based IO Entry ID: 109738186, V1.0, 06/2016 4

S

iem

en

s A

G 2

01

6 A

ll ri

gh

ts r

ese

rve

d

1 Task

1.1 Introduction

For the distributed IO systems ET 200MP and ET 200SP the technology modules TM Timer DIDQ 16x24V and TM Timer DIDQ 10x24V are available via which signals with a high time resolution can be read at the digital inputs and on which signals can be output at the digital outputs. For this, what is known as time stamps, are used which clearly assign the switching event to the time-based IO time system of the SIMATIC S7-1500 CPU.

1.2 Overview of the automation task

With the technology modules TM Timer DIDQ 16x24V or TM Timer DIDQ 10x24V a pusher is to be realized on a conveyor belt.

Figure 1-1 Overview of the automation task

The bottles passing by are detected with the help of a light barrier. The pusher, located at a distance, is to be controlled with a time-delay, as soon as an ejected bottle was detected by the light barrier. Through the motion speed of the bottles on the conveyer line, the delay time can be precisely determined. The pusher is then controlled after the lapse of the delay time for a specified period of time, which means that the bottles passing by can be precisely ejected.

2 Solution

2.1 Overview

Time-based IO Entry ID: 109738186, V1.0, 06/2016 5

S

iem

en

s A

G 2

01

6 A

ll ri

gh

ts r

ese

rve

d

2 Solution

2.1 Overview

Schematic layout

The figure below shows a schematic overview of the most important components of the solution:

Figure 2-1 Schematic illustration of the solution

PROFINET IO (isochronous)

Delay time

Setup

The TM Timer DIDQ technology module is connected to the SIMATIC CPU via an interface module by means of an isochronous PROFINET connection.

The bottles on the conveyor line are registered via a light barrier that is connected to the TM Timer DIDQ technology module. The signals acquired are provided with highly-precise time stamps and are passed on to the SIMATIC CPU in the TM Timer DIDQ technology module. This is where a delay time is calculated for the pusher signal from the speed of the conveyor line and the distance to the light barrier. This delay time is added to the time stamp of the required signal. The newly calculated time stamp is then transferred to the TM Timer DIDQ technology module which then controls the respective output at the precisely specified time and therefore enables the pusher.

2 Solution

2.2 Hardware and software components

Time-based IO Entry ID: 109738186, V1.0, 06/2016 6

S

iem

en

s A

G 2

01

6 A

ll ri

gh

ts r

ese

rve

d

Note The solution described here, is a simple example to explain the functionality of the time-based IO. This is why always only one pusher job can be processed from the acquisition to the execution.

In real applications, the example would have to be expanded by a job buffer in order to be able to also consistently process several eject jobs that occur in quick succession. To make the time-based IO technology easier to understand, the implementation of a job buffer was omitted in this example.

Assumed knowledge

This application does not include a description of:

How to establish and configure an isochronous PROFINET connection between the SIMATIC CPU and the distributed IO.

Determination of the speed of the conveyor line and the calculation of the thus resulting delay time.

Handling and processing of values or tags in LTIME format.

Basic knowledge of these topics and of the configuration of modules or the programming in the TIA Portal is assumed.

2.2 Hardware and software components

2.2.1 Validity

This application is valid for

STEP 7 from V13 SP1 Update 2 and higher

SIMATIC S7-1500 from firmware version V1.5

2.2.2 Components used

The application has been created using the following components:

Hardware components

Table 2-1 Hardware components

Component Qty Article number Note

SIMATIC CPU

S7-1516

1 6ES7 516-3AN00-0AB0 Firmware version: V1.8.0

Interface module

IM 155-5 PN HF

1 6ES7 155-5AA00-0AC0 Firmware version: V3.0.0

TM Timer

DIDQ 16x24V

1 6ES7 552-1AA00-0AB0 Firmware version: V1.1.23

2 Solution

2.2 Hardware and software components

Time-based IO Entry ID: 109738186, V1.0, 06/2016 7

S

iem

en

s A

G 2

01

6 A

ll ri

gh

ts r

ese

rve

d

Note The isochronous PROFINET connection between the SIMATIC CPU and distributed IO for an ET200MP can also be established with an interface module IM 155-5 PN ST.

For ET200S it is essential to use the IM 155-6 PN HF interface module.

Software components

Table 2-3 Software components

Component Qty Article number Note

TIA Portal V13

STEP 7 Professional

1 6ES7 822-1AE03-0YA5 Version: V13 SP1 Upd5

System function blocks from the TIA Portal

Table 2-4 System function blocks from the TIA Portal

Component Qty Article number Note

TIO_SYNC 1 Instructions library: Technology / Time-based IO

Version 1.2

TIO_DI 1 Instructions library: Technology / Time-based IO

Version 1.2

TIO_DQ 1 Instructions library: Technology / Time-based IO

Version 1.3

Example files and projects

The following list includes all files and projects that are used in this example.

Table 2-5 Sample files and projects

Component Note

109738186_TimeBasedIO_Basic_ ET200MP_PROJ_v10.zip

Program example for the ET200MP on which this documentation is based.

109738186_TimeBasedIO_Basic_ ET200SP_PROJ_v10.zip

Additional program example for the ET200SP with the following differences:

IRT setting of the To time (signal output time) increased to 0.3ms.

Output channel of the TM Timer DIDQ 10x24V is channel 0.

Additional wiring of the ground connection of the output channel.

109738186_TimeBasedIO_ DOC_v10_en.pdf

This document

3 Basics

3.1 Time-based IO

Time-based IO Entry ID: 109738186, V1.0, 06/2016 8

S

iem

en

s A

G 2

01

6 A

ll ri

gh

ts r

ese

rve

d

3 Basics

3.1 Time-based IO

3.1.1 Function principle:

Time-based IO stands for time-based processing of input and output signals. For this, all events are related to a common time base, the so-called TIO_Time. The TIO_Time is available in LTIME format and provides unique time values during the entire runtime of the SIMATIC CPU, so that each event (input and output signal) can be assigned a unique time value, this is called a time stamp.

Figure 3-1 Basics of time-based IO

PROFINET IO

TM Timer DI/DQ

Time base TIO_Time

Input event

of

time T1

Input event

of

time T2

Input event

of

time T3

Input event

of

time T4

Time stamp T1 Time stamp T2 Time stamp T3 Time stamp T4

3.1.2 LTIME data format

The LTIME data format is a 64-bit number which contains the desired point in time in nanoseconds. This means, that in this data type, unique points in time can be stored precise to the nanosecond in a period of over 290 years.

For time-based IO, the LTIME data format is the basis for the TIO_Time time base, which is incremented starting from zero, beginning with every restart of the SIMATIC CPU and therefore provides a unique assignment of events with the time stamps.

More detailed information on this data format can be found in the documentation or in the TIA Portal online help.

3.1.3 Application cycle

In order to ensure highly precise and deterministic processing of the SIMATIC CPU time stamps, the TM Timer DIDQ technology module is connected to the SIMATIC CPU by means of an isochronous PROFINET connection.

Isochronous means that data is interchanged between the TM Timer technology module and the SIMATIC CPU via the PROFINET connection within clearly defined

3 Basics

3.1 Time-based IO

Time-based IO Entry ID: 109738186, V1.0, 06/2016 9

S

iem

en

s A

G 2

01

6 A

ll ri

gh

ts r

ese

rve

d

time references. This time reference is called send clock of the isochronous PROFINET connection.

The send clock is defined in the range of up to 4 milliseconds when configuring the isochronous PROFINET connection. More detailed information can also be found in the documentation or in the TIA Portal online help or the references at the end of this document.

Figure 3-2 Send clock and application cycle

PROFINET IO

TM Timer DI/DQ

Synchronous

Cycle

Time

Send clock

Synchronous

Cycle

Synchronous

Cycle

PROFINET

SIMATIC CPU

SIMATIC CPU

Application cycle

After each isochronous data transfer or after a defined number (reduction ratio) of send clocks, the isochronous OB (Synchronous Cycle) is executed in the SIMATIC CPU. The execution of this isochronous OB represents the application cycle. In this OB, the blocks for the control of the TM Timer DIDQ technology module must be called.

3.1.4 Signal input

In each application cycle, a maximum of two switching edges can be detected via the TM Timer DIDQ module for each channel. For example, a rising edge, i.e. the setting of the signal output and of a falling edge, i.e. the resetting of the signal input. These two sensor signals can be uniquely identified by time stamps in the time system of the SIMATIC CPU.

Figure 3-3 Signal input

Time

TIO_Time

Send clock = Application cycle (1:1)

PROFINET

Signal of sensor

Time stamp T1

Rising edge

Time stamp T2

Falling edge

Time stamp T3

Rising edge

Time stamp T5

Rising edge

Time stamp T4

Falling edge

3 Basics

3.2 Function blocks for the time-based IO

Time-based IO Entry ID: 109738186, V1.0, 06/2016 10

S

iem

en

s A

G 2

01

6 A

ll ri

gh

ts r

ese

rve

d

3.1.5 Signal output

In each application cycle, a maximum of two switching edges can be output via the TM Timer DIDQ technology module for each channel. A rising edge to set the signal output, and a falling edge to reset the signal output. The output signals can also be uniquely and exactly specified via the time system of the SIMATIC CPU.

Figure 3-4 Signal output

Time

TIO_Time

Send clock = Application cycle (1:1)

PROFINET

Output signal

Rising edge

at time T1

(Time stamp)

Falling edge

at time T2

(Time stamp)

Rising edge

at time T3

(Time stamp)

Rising edge

at time T5

(Time stamp)

Falling edge

at time T4

(Time stamp)

3.2 Function blocks for the time-based IO

For the time-based IO functionality, several function blocks are available that have to be used in the user program and that are explained in more detail in the following chapters.

3.2.1 Function block “TIO_SYNC”

With the help of the “TIO_SYNC” function block, up to eight TM Timer DIDQ technology modules with the time base of the SIMATIC CPU for time-based IO the TIO_TIME are synchronized.

Table 3-1 Function block “TIO_SYNC”

Function block “TIO_SYNC”

TIO_DI

HWID_1TIO_SYNC_

Data

Status

Error

HWID_2

HWID_3

HWID_4

HWID_5

HWID_6

HWID_7

HWID_8

SendClock

PIP_Mode

PIP_PART

3 Basics

3.2 Function blocks for the time-based IO

Time-based IO Entry ID: 109738186, V1.0, 06/2016 11

S

iem

en

s A

G 2

01

6 A

ll ri

gh

ts r

ese

rve

d

Function block “TIO_SYNC”

Input parameters (IN)

Parameters Data type Function

HWID_1

HWID_8

HW_IO Hardware identifier of the TM Timer DIDQ technology module from the hardware configuration of the TIA Portal.

Via these parameters at least one, and a maximum of eight TM Timer DIDQ technology modules can be assigned to the block for the synchronization of the time base.

Note:

This parameter is only applied in the function block by a stop-run transition of the CPU!

SendClock LTime Set send clock of the sync domain of the PROFINET connection in isochronous mode.

This value is passed on via the “TIO_SYNC_Data” data type to the other function blocks for the time-based IO.

PIP_Mode USInt Mode for the update of the I/O data of the TM Timer DIDQ technology modules:

0: AEV model with internal update of the process image with SYNC_PO and SYNC_PI.

1: AEV model without internal process image update. The functions SYNC_PO and SYNC_PI have to be supplemented in the user program of the synchronous OB.

2: EVA model without internal process image update. The functions SYNC_PO and SYNC_PI have to be supplemented in the user program of the synchronous OB.

This value is passed on via the “TIO_SYNC_Data” data type to the other function blocks for the time-based IO.

Note:

More detailed information can be found in the FAQ in the bibliography /3/.

PIP_PART USInt Selection of the partial process image of I/O data, which is to be updated isochronously.

The selection of the partial process image is only relevant, if PIP_Mode = 0 has been selected as update mode. In the other cases the partial process image has to be specified directly on the functions SYNC_PO and SYNC_PI.

Output parameters (OUT)

Parameters Data type Function

TIO_SYNC_DATA

TIO_SYNC_Data

System time provided by the “TIO_SYNC” function block.

All function blocks “TIO_DI” or “TIO_DQ” that use a channel of the TM Timer DIDQ technology modules which is assigned to the appropriate “TIO_SYNC” synchronization block have to be provided with the system time of this block.

The system time is explained in more detail in the next section.

Status DWORD Status of the function block, especially in the event of an error occurring.

3 Basics

3.2 Function blocks for the time-based IO

Time-based IO Entry ID: 109738186, V1.0, 06/2016 12

S

iem

en

s A

G 2

01

6 A

ll ri

gh

ts r

ese

rve

d

Function block “TIO_SYNC”

Error Bool This output shows that an error occurred within the block or during the job processing or the configuration of the block.

Refer to the status output for more information about the cause of the error.

The output is reset as soon as the cause of error has been eliminated.

The TIO_SYNC_Data data type for the provision of the system time for the time-based IO function blocks looks like this:

Parameters Data type Function

TIO_TIME_BASE

LTime Internal use

TIO_TIME LTime Common time base of the TM Timer DIDQ technology modules connected to the TIO_SYNC function block.

Through this time base the CPU is provided a relative time for handling of the time stamp that is in the LTime data format and which starts each time with the value 0 when starting the CPU and that then provides a unique and nanosecond-precise reference value for over 290 years.

PIP_MODE USInt Mode for the update of the I/O data of the TM Timer DIDQ technology modules.

This value is passed on via the data type to the other function blocks for the time-based IO.

APP_CYC LTime Time set for the application cycle of the "Synchronous Cycle" OB including a possibly set reduction ratio of the OB cycle.

SEND_ CLOCK

LTime Set send clock of the sync domain of the PROFINET connection in isochronous mode.

This value is passed on via the data type to the other function blocks for the time-based IO.

TBase LTime Internal use

ERROR Bool Internal use

Note As basis for the processing of the time stamp in the user program for the acquisition of the input signals or the setting of output signals, a common time base, TIO_TIME, is to be used. All time stamps for the time-based IO refer to this time base.

If more than eight TM Timer DIDQ technology modules are used in an application, several TIO_SYNC function blocks have to be used. The respective TIO_TIME time base of the TIO_SYNC function block will have to be used in the user program that is assigned to the appropriate TM Timer DIDQ technology module.

3 Basics

3.2 Function blocks for the time-based IO

Time-based IO Entry ID: 109738186, V1.0, 06/2016 13

S

iem

en

s A

G 2

01

6 A

ll ri

gh

ts r

ese

rve

d

3.2.2 Function block “TIO_DI”

With the help of the “TIO_DI” function block, edges of an input signal can be acquired as time stamp on a channel of the TM Timer DIDQ technology module.

Table 3-2 Function block “TIO_DI”

Function block “TIO_DI”

TIO_DI

HWID DI

ChannelTimeStamp

RETIO_SYNC_

Data

TimeStamp

FE

EdgeSelEventCount

RE

TOEventCount

FE

LEC

Status

Error

Input parameters (IN)

Parameters Data type Function

HWID HW_IO Hardware identifier of the TM Timer DIDQ technology module from the hardware configuration of the TIA Portal.

Note:

This parameter is only applied in the function block by a stop-run transition of the CPU!

Channel UInt Channel number of the digital input that is to be used on the TM Timer DIDQ technology module.

The channel number depends on the channel configuration of the module that is set in the hardware configuration of the TIA Portal:

ET200MP:

– 0 inputs, 16 outputs Channel: not possible

– 3 inputs, 13 outputs Channel: 0..2

– 4 inputs, 12 outputs Channel: 0..3

– 8 inputs, 8 outputs Channel: 0..7

ET200SP:

– 4 inputs, 6 outputs Channel: 0..3

Note:

This parameter is only applied in the function block by a stop-run transition of the CPU!

TIO_SYNC_DATA

TIO_SYNC_Data

System time provided by the “TIO_SYNC” function block.

All function blocks “TIO_DI” or “TIO_DQ” that use a channel of the TM Timer DIDQ technology module which is assigned to a “TIO_SYNC” synchronization block have to be provided with the system time of this block.

3 Basics

3.2 Function blocks for the time-based IO

Time-based IO Entry ID: 109738186, V1.0, 06/2016 14

S

iem

en

s A

G 2

01

6 A

ll ri

gh

ts r

ese

rve

d

Function block “TIO_DI”

EdgeSel UInt Mode selection to which edges of the input signal of the respective channel the time stamp is to be acquired:

0: Reserved

1: Two rising edges

2: Two falling edges

3: Rising and falling edge (Sequence depending on occurrence)

4: First rising, then falling edge

5: First falling, then rising edge

6 to 255 Reserved

Note:

The mode selection refers to an application cycle each. For mode 4 and 5 both edges have to be within an application cycle and must not be distributed to two cycles!

TO LTime Time to output the output data transferred in the distributed I/O via the isochronous PROFINET connection.

Apply the time from the hardware configuration of the TIA Portal for the isochronous PROFINET connection. However, please note that hardware changes may have an influence on this time!

Note:

This parameter is only applied in the function block by a stop-run transition of the CPU!

Note:

Have the time calculated in the hardware configuration via the “Automatic” setting and then simply specify an easily transferrable, slightly higher time manually. This time can then be simply transferred into the PLC program and it should also include a small reserve for hardware changes.

Output parameters (OUT)

Parameters Data type Function

DI Bool State of the digital input of the selected channel.

The state of the digital input is only output on this output after the respective user cycle on the block.

If an inversion of the digital input is configured in the hardware configuration, this parameter is also inverted.

TimeStampRE

LTime Time stamp at which a rising edge has been detected on the digital input of the selected channel.

Exception:

If the EdgeSel = 2 mode was selected, the time stamp of the second falling edge is output here.

TimeStampFE

LTime Time stamp at which a falling edge was detected on the digital input of the selected channel.

Exception:

If the EdgeSel = 1 mode was selected, the time stamp of the second rising edge is output here.

EventCountRE

UInt Counter of the valid time stamp for rising edges.

The counter is incremented with every valid time stamp output. In the event of a counter overflow, the counter value starts again at zero. With every new start-up of the CPU the counter is reset to zero again.

3 Basics

3.2 Function blocks for the time-based IO

Time-based IO Entry ID: 109738186, V1.0, 06/2016 15

S

iem

en

s A

G 2

01

6 A

ll ri

gh

ts r

ese

rve

d

Function block “TIO_DI”

EventCountFE

UInt Counter of the valid time stamp for falling edges.

The counter is incremented with every valid time stamp output. In the event of a counter overflow, the counter value starts again at zero. With every new start-up of the CPU the counter is reset to zero again.

LEC UInt Counter for edges for which no time stamp could be output on the block.

The TM Timer DIDQ technology module can detect up to seven edges within an application cycle but can only output a maximum of two edges on the function block.

At the beginning of a new application cycle the counter is reset to zero, so it has to be evaluated directly after calling the function block in the PLC program.

Status DWORD Status of the function block, especially in the event of an error occurring.

Error Bool This output shows that an error occurred within the block or during the job processing or the configuration of the block.

Refer to the status output for more information about the cause of the error.

The output is reset as soon as the cause of error has been eliminated.

3.2.3 Function block “TIO_DQ”

With the help of the “TIO_DQ” function block, up to two edges of a signal that have been precisely defined via time stamp can be output on a channel of the TM Timer DIDQ technology module.

Table 3-3 Function block “TIO_DQ”

Function block “TIO_DQ”

TIO_DQ

HWID

StatusDQ

Channel

BUSY

TIO_SYNC_

Data

DONE

Out_Mode

Status

TO

Error

REQ

TimeStamp

RETimeStamp

FE

3 Basics

3.2 Function blocks for the time-based IO

Time-based IO Entry ID: 109738186, V1.0, 06/2016 16

S

iem

en

s A

G 2

01

6 A

ll ri

gh

ts r

ese

rve

d

Function block “TIO_DQ”

Input parameters (IN)

Parameters Data type Function

REQ Bool Starts the job for the output of an output signal with a rising edge.

Note:

Whilst an active job is running, the time stamps on the inputs TimeStampRE and TimeStampFE can be changed directly and in each cycle without rising edge on the REQ input.

If the time stamps are not to be changed during the active job, it has to be made sure that the values on the input parameters TimeStampRE and TimeStampFE are not changed during the entire active job!

Note:

An active job can only be stopped by specifying an invalid time stamp, for example, a time stamp from the past.

HWID HW_IO Hardware identifier of the TM Timer DIDQ technology module from the hardware configuration of the TIA Portal.

Note:

This parameter is only applied in the function block by a stop-run transition of the CPU!

Channel UInt Channel number of the digital input that is to be used on the TM Timer DIDQ technology module.

The channel number depends on the channel configuration of the module that is set in the hardware configuration of the TIA Portal:

ET200MP:

– 0 inputs, 16 outputs Channel: 0..15

– 3 inputs, 13 outputs Channel: 0..12

– 4 inputs, 12 outputs Channel: 0..11

– 8 inputs, 8 outputs Channel: 0..7

ET200SP:

– 4 inputs, 6 outputs Channel: 0..5

Note:

This parameter is only applied in the function block by a stop-run transition of the CPU!

TIO_SYNC_DATA

TIO_SYNC_Data

System time provided by the “TIO_SYNC” function block.

All function blocks “TIO_DI” or “TIO_DQ” that use a channel of the TM Timer DIDQ technology module which is assigned to a “TIO_SYNC” synchronization block have to be provided with the system time of this block.

3 Basics

3.2 Function blocks for the time-based IO

Time-based IO Entry ID: 109738186, V1.0, 06/2016 17

S

iem

en

s A

G 2

01

6 A

ll ri

gh

ts r

ese

rve

d

Function block “TIO_DQ”

Out_Mode UInt Mode selection of what edge is to be output as output signal on the respective channel of the technology module:

0: Output only one rising edge (defined via the parameter on the TimeStampRE input).

1: Output only one falling edge (defined via the parameter on the TimeStampFE input).

2: Output rising and falling edge (defined via the parameters on the inputs TimeStampRE and TimeStampFE).

3: Direct output of a signal edge. The signal edge, for which the respective input parameter is set to zero, is output each time

– Parameter TimeStampRE = 0 rising edge

– Parameter TimeStampFE = 0 falling edge

– Both parameter = 0 no edge is output.

4 to 255: Reserved

Note:

The mode selection is based on the entire runtime of the active job and is not limited to an application cycle.

TO LTime Time to output the output data transferred in the distributed I/O via the isochronous PROFINET connection.

Apply the time from the hardware configuration of the TIA Portal for the isochronous PROFINET connection. However, please note that hardware changes may have an influence on this time!

Note:

This parameter is only applied in the function block by a stop-run transition of the CPU!

Note:

Have the time calculated in the hardware configuration via the “Automatic” setting and then simply specify an easily transferrable, slightly higher time manually. This time can then be simply transferred into the PLC program and it should also include a small reserve for hardware changes.

TimeStampRE

LTime Time stamp for the output of a rising edge on the respective output of the TM Timer DIDQ technology module with regard to the “TIO_Time” system time that is transferred to the function block on the TIO_SYNC_DATA input.

Note:

During an active job, changes on this input are instantly transferred to the block. No other rising edge has to be created on the REQ input!

3 Basics

3.2 Function blocks for the time-based IO

Time-based IO Entry ID: 109738186, V1.0, 06/2016 18

S

iem

en

s A

G 2

01

6 A

ll ri

gh

ts r

ese

rve

d

Function block “TIO_DQ”

TimeStampFE

LTime Time stamp for the output of a falling edge on the respective output of the TM Timer DIDQ technology module with regard to the “TIO_Time” system time that is transferred to the function block on the TIO_SYNC_DATA input.

Note:

During an active job, changes on this input are instantly transferred to the block. No other rising edge has to be created on the REQ input!

Output parameters (OUT)

Parameters Data type Function

StatusDQ Bool State of the digital output of the selected channel.

The state of the digital output is only output on this output after the respective user cycle on the block.

If an inversion of the digital output is configured in the hardware configuration, this parameter is also inverted.

Note:

The “TIO_DQ” function block cannot check the configuration and the actual state of the digital output. If, for example, a hardware release has been configured and if the output has not been released at the time of output, the “StatusDQ” parameter may possibly deliver an incorrect value.

BUSY Bool Display that a running job is still active and not yet completed.

DONE Bool Display for a cycle that a job has been completed without errors.

Status DWORD Status of the function block, especially in the event of an error occurring.

Error Bool This output shows that an error occurred within the block or during the job processing or the configuration of the block.

Refer to the status output for more information about the cause of the error.

The output is reset as soon as the cause of error has been eliminated.

4 Mode of Operation

4.1 General overview

Time-based IO Entry ID: 109738186, V1.0, 06/2016 19

S

iem

en

s A

G 2

01

6 A

ll ri

gh

ts r

ese

rve

d

4 Mode of Operation

4.1 General overview

The present user example includes a block that uses the just mentioned function blocks in order to detect a rising edge of the input signal and to provide it with a time stamp, before an output signal with exactly defined length is output in a defined time-delayed way.

Figure 4-1 Overview of the application example

PROFINET IO (isochronous)

Delay time

The light barrier detects a drink bottle and creates a precise time stamp for the detected signal edge. With the help of a constant belt speed and the distance of the pusher to the light barrier, the delay time can be detected which defines the time (time stamp) when the pusher is to be operated.

4.2 Program overview

The blocks of the application example are called in the isochronous OB synchronous cycle, in order to guarantee highly precise and deterministic processing of the time stamps.

Figure 4-2 Program overview

Synchronous

CycleTIO_SYNC

PulseDelay

Synchronization of the technology modules.

Time base offering.

Detection of the input signal at digital input

(Channel 0)

Output of the output signal at digital output

(Channel 8)

4 Mode of Operation

4.3 Block interfaces

Time-based IO Entry ID: 109738186, V1.0, 06/2016 20

S

iem

en

s A

G 2

01

6 A

ll ri

gh

ts r

ese

rve

d

The TIO_SYNC function block synchronizes the connected TM Timer DIDQ technology modules and provides the system time as reference value for the application example.

The PulseDelay function block includes the actual application. A rising edge of the input signal is detected via the block and then a time-delayed output signal is output.

4.3 Block interfaces

4.3.1 Technology function block TIO_SYNC

This block is responsible for the isochronous synchronization of up to eight TM Timer DIDQ technology modules.

This block must be called in the isochronous OB synchronous cycle before other function blocks are called.

The interface of the block has already been explained in detail in chapter 0.

Note For more information on the function block or on the interface, refer to the system manual on time-based IO or the TIA Portal online help.

NOTICE If the TIO_SYNC function block of the TIA Portal system is used in version 1.2, PIP_Mode=2 has to be selected on the TIO_SYNC block, and the SYNC_PI function must be called at the beginning of the isochronous cycle and at the end and SYNC_PO has to be called. Otherwise there may be malfunctions in the application example.

It is not permissible to use the TIO_SYNC system block in version 1.1 or lower!

4.3.2 Function block PulseDelay

In this block, the actual application introduced here is realized. For this purpose, the block uses the two function blocks TIO_DI and TIO_DQ, which have already been explained in more detail in the basic chapter 3.2 in this document.

On the PulseDelay block a rising signal edge is detected with the help of the TIO_DI function block on the input of the TM Timer DIDQ technology module. If a signal edge was detected, a defined delay time is added to the detected time stamp and the thus calculated time stamp is transferred to the output of the TM Timer DIDQ technology module with the help of the TIO_DQ function block. Out_Mode = 2 is used for the output of a rising and a falling edge. The rising edge is output at the time of the calculated time stamp. For the falling edge the time stamp is increased by the defined pulse duration.

The block interface of the PulseDelay function block for operating and controlling the application, looks as follows:

4 Mode of Operation

4.3 Block interfaces

Time-based IO Entry ID: 109738186, V1.0, 06/2016 21

S

iem

en

s A

G 2

01

6 A

ll ri

gh

ts r

ese

rve

d

Table 4-1 Function block “Pulse Delay”

Function block “PulseDelay”

PulseDelay

Pulse

DelayTime

Busy

Pulse

DurationTime

Active

HWID

Error

ChannelInput

Status

ChannelOutput

StatusID

Enable

TIO_SYNC_

DATA

To

Input parameters (IN)

Parameters Data type Function

Enable Bool The processing of the input signals or the response to a rising edge is released via this input.

Note:

Monitoring of the input signals via the TIO_DI block takes place continuously. However, if the input is Enable = True there will also be a response to the positive edge of the input signal that was detected by the TIO_DI block.

Pulse DelayTime

LTime Specification of the delay time with which the output signal is output delayed to the input signal.

The time defined here is added to the acquired time stamp of the positive edge of the input signal and then used as time stamp for the output of the output signal.

Pulse Duration Time

LTime Specification of the pulse duration of the output signal.

The time defined here is added to the time stamp for the output of the positive edge of the output signal and then used as time stamp for the negative edge of the output signal.

HWID HW_IO Hardware identifier of the TM Timer DIDQ technology module from the hardware configuration of the TIA Portal.

Note:

This parameter is only applied in the function block by a stop-run transition of the CPU!

Note:

The two channels used for the input and output signals have to be located on the same TM Timer DIDQ technology module, defined by the hardware ID. A distribution of the channels to the two TM Timer DIDQ technology modules is not possible due to the use of the same HWID input parameter for the function blocks TIO_DI and TIO_DQ within the PulseDelay block!

4 Mode of Operation

4.3 Block interfaces

Time-based IO Entry ID: 109738186, V1.0, 06/2016 22

S

iem

en

s A

G 2

01

6 A

ll ri

gh

ts r

ese

rve

d

Function block “PulseDelay”

Channel Input

UInt Channel number of the digital input that is to be used on the TM Timer DIDQ technology module.

The channel number depends on the channel configuration of the module that is set in the hardware configuration of the TIA Portal:

ET200MP:

– 0 inputs, 16 outputs Channel: not possible

– 3 inputs, 13 outputs Channel: 0..2

– 4 inputs, 12 outputs Channel: 0..3

– 8 inputs, 8 outputs Channel: 0..7

ET200SP:

– 4 inputs, 6 outputs Channel: 0..3

Note:

This parameter is only applied in the function block by a stop-run transition of the CPU!

Channel Output

UInt Channel number of the digital output that is to be used on the TM Timer DIDQ technology module.

This parameter also depends on the hardware configuration:

ET200MP:

– 0 inputs, 16 outputs Channel: 0..15

– 3 inputs, 13 outputs Channel: 0..12

– 4 inputs, 12 outputs Channel: 0..11

– 8 inputs, 8 outputs Channel: 0..7

ET200SP:

– 4 inputs, 6 outputs Channel: 0..5

Note:

This parameter is only applied in the function block by a stop-run transition of the CPU!

TIO_SYNC_DATA

TIO_SYNC_Data

System time provided by the “TIO_SYNC” function block.

The blocks “TIO_DI” and “TIO_DQ” used in the function block are supplied with this synchronized system time.

To LTime Time to output the output data transferred in the distributed I/O via the isochronous PROFINET connection.

Apply the time from the hardware configuration of the TIA Portal for the isochronous PROFINET connection. However, please note that hardware changes may have an influence on this time!

Note:

This parameter is only applied in the function block by a stop-run transition of the CPU!

Note:

Have the time calculated in the hardware configuration via the “Automatic” setting and then simply specify an easily transferrable, slightly higher time manually. This time can then be simply transferred into the PLC program and it should also include a small reserve for hardware changes.

4 Mode of Operation

4.3 Block interfaces

Time-based IO Entry ID: 109738186, V1.0, 06/2016 23

S

iem

en

s A

G 2

01

6 A

ll ri

gh

ts r

ese

rve

d

Function block “PulseDelay”

Output parameters (OUT)

Parameters Data type Function

Busy Bool The function block has been released and signal outputs can take place on the defined digital output.

The signal output depends on a detected rising edge on the input signal.

Active Bool A rising edge and the appropriate time stamp have been detected on the input signal.

After the lapse of the defined delay time, the output of the output signal can take place on the defined digital output.

Error Bool This output shows that an error occurred within the block or during job processing or the configuration of a block used in the function block.

Refer to the status outputs and StatusID of the function block for more information about the cause of the error.

The output is reset as soon as the cause of error has been eliminated.

Status DWORD Status of the function block, especially in the event of an error occurring.

The precise assignment of the error message via the status parameter can be found on the StatusID output.

StatusID UInt Assignment of the status display or error message, output via the status parameter:

0: No error

1: Block-internal error

2: Error on function block “TIO_DI”

3: Error on function block “TIO_DQ”

Note Warnings and errors of the blocks TIO_DI and TIO_DQ can be found in the function manual of the time-based IO or in the TIA Portal online help.

5 Configuration and Settings

5.1 Connecting the technology module to the CPU

Time-based IO Entry ID: 109738186, V1.0, 06/2016 24

S

iem

en

s A

G 2

01

6 A

ll ri

gh

ts r

ese

rve

d

5 Configuration and Settings The following chapters contain information on configuration steps in the TIA Portal which are required for the operation of this application example.

The configurations are only briefly introduced. Basic knowledge of these topics is assumed. More detailed information on this can also be found in the documentation or in the TIA Portal online help.

5.1 Connecting the technology module to the CPU

For isochronous processing of the input and output signals of the TM Timer DIDQ technology module, the TM Timer DIDQ technology modules must be connected to the SIMATIC CPU via an interface module (IM) which supports the isochronous system function.

Figure 5-1 Connection of the technology module to the SIMATIC CPU

An ET200MP or also an ET200SP station can be used as distributed IO. However, the TM Timer DIDQ technology module for the ET200SP has less input and output channels.

5.2 Creating the isochronous PROFINET connection

The isochronous mode function must be set on the technology module, the interface module and the PROFINET connection to the SIMATIC CPU.

This is generally shown in the following steps.

5.2.1 Requirements

However, before the establishment of the isochronous PROFINET connection is started, the following requirements should be fulfilled within the TIA Portal project.

Setting the topology

For the TIA Portal to be able to calculate the time for the reading of the isochronous input data (Ti) and the time for outputting the isochronous output data (To), the PROFINET connections of the individual modules have to be explicitly specified in the hardware configuration. This is done in the topology view of the hardware configuration.

5 Configuration and Settings

5.2 Creating the isochronous PROFINET connection

Time-based IO Entry ID: 109738186, V1.0, 06/2016 25

S

iem

en

s A

G 2

01

6 A

ll ri

gh

ts r

ese

rve

d

In this view the individual ports of the different modules can be connected precisely to each other according to the actual wiring of the bus connections. The connections can be established via drag-and-drop in the graphic or via the table view of the individual module ports

Figure 5-2 Specifying the topology

Note If the connections are to be established via drag-and-drop in the graphic, the assignment of the ports on the modules can be detected with the help of the mouse-over function, by placing the mouse pointer for a longer period of time over the respective port.

Assigning the distributed I/O of the SIMATIC CPU

By setting the topology, the PROFINET connection to the SIMATIC CPU may possibly be already established automatically. Thus, the PROFINET connection does no longer have to be explicitly created in the network view of the TIA Portal.

However, the assignment of the distributed I/O to the SIMATIC CPU is to be checked. If this assignment is not yet entered, the desired SIMATIC CPU can be selected from a list, by clicking the link in the graphic.

Figure 5-3 Assigning the distributed I/O of the SIMATIC CPU

5 Configuration and Settings

5.2 Creating the isochronous PROFINET connection

Time-based IO Entry ID: 109738186, V1.0, 06/2016 26

S

iem

en

s A

G 2

01

6 A

ll ri

gh

ts r

ese

rve

d

Creating the isochronous OB synchronous cycle.

In order to be able to use the isochronous PROFINET connection in the user program, the respective function blocks of the user program also have to be called in an isochronous organization block (OB).

An isochronous organization block (OB) has to be available in the user program for this purpose. If required, add a new block to the program blocks and select the isochronous OB synchronous cycle in the selection dialog.

Figure 5-4 Creating the isochronous OB synchronous cycle

Note It is recommended to create the isochronous OB synchronous cycle before the settings on the technology modules so that it is already available and can be selected when configuring the channels of the technology modules.

However, it is also possible to create an appropriate organization block directly when configuring the technology modules.

5.2.2 Settings the isochronous mode on the technology module

First of all the isochronous mode has to be enabled on the TM Timer DIDQ technology module and the module has to be assigned to an isochronous OB and a partial process image.

The settings required for this can be made via the parameter mask for the I/O addresses of the module.

5 Configuration and Settings

5.2 Creating the isochronous PROFINET connection

Time-based IO Entry ID: 109738186, V1.0, 06/2016 27

S

iem

en

s A

G 2

01

6 A

ll ri

gh

ts r

ese

rve

d

Figure 5-5 Setting the isochronous mode on the technology module

5.2.3 Checking the isochronous mode on the interface module

The settings made can then be checked via the setting mask for the isochronous mode on the interface module.

Figure 5-6 Checking the settings of the isochronous mode on the interface module

Note These checking options are particularly useful when using several technology modules on the same interface module that are used in isochronous mode, since the isochronous mode on all modules can be checked at one glance and if required it can also be set.

5 Configuration and Settings

5.2 Creating the isochronous PROFINET connection

Time-based IO Entry ID: 109738186, V1.0, 06/2016 28

S

iem

en

s A

G 2

01

6 A

ll ri

gh

ts r

ese

rve

d

5.2.4 Settings on the PROFINET sync domain

Finally, a sync domain is created for the PROFINET connection, which is used to preset the PROFINET clock in the range up to 4 ms and to define the SIMATIC CPU as sync master and the distributed I/O as sync slave with the RT class IRT.

Figure 5-7 Settings on the PROFINET sync domain

In the settings overview of the PROFINET connections for the isochronous settings, the times for reading the isochronous input data (Ti) and the outputting of the isochronous output data (To) can be checked for each interface module.

Here, there is also the option to set the times for the reading of the isochronous input data (Ti) and the outputting of the isochronous output data (To) for the entire isochronous OP synchronous cycle to the same values. This setting offers the advantage that the same Ti and To times apply for all components and that these times do not have to be differentiated depending on the signal in the user program.

This is why you should make the following setting in this setting mask for all modules involved in the user example, such as the TM Timer DIDQ technology module and possibly the data supplier for the speed information of the conveyor belt:

Deselect the automatic setting of the Ti/To function in the Ti/To values of the OB and then specify the values manually in the input fields for Ti and To that can be easily used in the user program and that are just above the minimum possible values which would result from the automatic setting.

Then select the “From OB” function in the overview of the I/O module for the Ti/To settings.

5 Configuration and Settings

5.3 Mode setting on the technology module

Time-based IO Entry ID: 109738186, V1.0, 06/2016 29

S

iem

en

s A

G 2

01

6 A

ll ri

gh

ts r

ese

rve

d

Figure 5-8 Overview of the isochronous mode settings on the PROFINET connection

The data for the “To” input parameter of the PulseDelay function block can also be found in this setting mask (see position 1).

Figure 5-9 Input parameters of the PulseDelay function block

Note For the time setting, please note the following: The time for outputting the isochronous output data (To) refers to the TM Timer DIDQ technology module and therefore has to be taken from the interface module on which this module is connected.

5.3 Mode setting on the technology module

The TM Timer DIDQ technology module can be used for a broad range of tasks. This means that this module can be configured in a great number of areas. The basic configuration steps are briefly explained in the chapters below.

1

5 Configuration and Settings

5.3 Mode setting on the technology module

Time-based IO Entry ID: 109738186, V1.0, 06/2016 30

S

iem

en

s A

G 2

01

6 A

ll ri

gh

ts r

ese

rve

d

5.3.1 Making basic settings

First, the number of inputs and outputs of the TM Timer DIDQ technology module must be determined.

Figure 5-10 Basic setting on the technology module

The technology module of the ET200MP TM Timer DIDQ 16x24V used in the application example shown here can be operated in the following channel configurations:

0 inputs and 16 outputs

3 inputs and 13 outputs

4 inputs and 12 outputs

8 inputs and 8 outputs

For the use of the technology module in the context with this application example, a configuration with at least one input has to be selected.

5.3.2 Setting of operating modes of input channels

For each input channel the operating mode of the channel has be specified for the module.

The technology module of the ET200MP TM Timer DIDQ 16x24V introduced in the application example has the following operating modes on the inputs:

Counter

Timer DI

Oversampling

The input has to be set as Timer DI for the user example.

5 Configuration and Settings

5.4 Setting the application cycle

Time-based IO Entry ID: 109738186, V1.0, 06/2016 31

S

iem

en

s A

G 2

01

6 A

ll ri

gh

ts r

ese

rve

d

Figure 5-11 Mode setting on the technology module - inputs

5.3.3 Setting of operating modes of the output channels

For each output channel the operating mode of the channel has be specified for the module.

The technology module of the ET200MP TM Timer DIDQ 16x24V used in the application example shown here has the following operating modes on the outputs:

Timer DQ

Oversampling

Pulse width modulation PWM

For the user example, the output must be set as Timer DQ.

Figure 5-12 Mode setting on the technology module - outputs

5.4 Setting the application cycle

The properties dialog of the isochronous OB synchronous cycle is used to specify the application cycle.

The application cycle of the isochronous OB synchronous cycle can be executed in each send clock of the isochronous PROFINET connection or can be executed with a reduction ratio in relation to it.

5 Configuration and Settings

5.4 Setting the application cycle

Time-based IO Entry ID: 109738186, V1.0, 06/2016 32

S

iem

en

s A

G 2

01

6 A

ll ri

gh

ts r

ese

rve

d

Figure 5-13 Setting the application cycle (reduction ratio)

Note A reduction of the application cycle contributes to relieving the SIMATIC CPU. However, it usually does not reduce the accuracy of the signal acquisition of the TM Timer DIDQ technology module.

6 Installation and Commissioning

6.1 Installing the hardware

Time-based IO Entry ID: 109738186, V1.0, 06/2016 33

S

iem

en

s A

G 2

01

6 A

ll ri

gh

ts r

ese

rve

d

6 Installation and Commissioning

6.1 Installing the hardware

The following figure shows the schematic hardware setup of the application example.

Figure 6-1 Schematic diagram of the hardware setup and the wiring

24V DC 24V DC

IM 155-5 PN HF

PN PN

L+ M

SIMATIC CPU

1516-3 PN/DP

PN PN PN

L+ M

PROFINET IO

24V DC 24V DC

TM Timer

DIDQ 16x24V

L+ M

Ch.0

Ch.7

Ch.8

… Ch.1

6

Signal input

Channel 0

Signal output

Channel 8

X1.P

2

X1.P

1

Table 6-1 Installing the hardware

No. Action Remark

1. Connect the SIMATIC CPU to the 24V power supply

2. Connect all distributed IO components like the interface module and the technology module to the 24V power supply.

An ET200MP is used as distributed IO in the application example. However, an ET200SP can also be used.

3. Connect the SIMATIC CPU and the distributed IO with a PROFINET cable.

On the SIMATIC CPU, use the PROFINET ports, mentioned in the figure, of the CPU (X1.P2) and of the interface module (X1.P1).

4. Connect the selected input channel of the technology module with the output of the acquisition sensor and the output channel with the input of the actuator.

In the figure, the signal input is via channel 0 and the signal output via channel 8 of the technology module.

6.2 Commissioning

6.2.1 Preparation

Open the application example in the TIA Portal, by carrying out the following steps:

1. Download the project file from the Siemens Industry Online Support. You will find the download link the references in /2/.

2. Save the zip file in any directory on your computer and unzip the file.

6 Installation and Commissioning

6.2 Commissioning

Time-based IO Entry ID: 109738186, V1.0, 06/2016 34

S

iem

en

s A

G 2

01

6 A

ll ri

gh

ts r

ese

rve

d

3. Set the IP address of the PG/PC so that the PG/PC is located in the same subnet as the CPU.

4. Use an Ethernet cable to connect the PG/PC with the Ethernet interface of the CPU S7-1516-3 PN/DP.

For this application example, the following IP addresses were used:

CPU S7-1516-3 PN/DP: IP address: 192.168.0.1 / Subnet mask: 255.255.255.0

IM 155-5PN HF: IP address: 192.168.0.2 / Subnet mask: 255.255.255.0

6.2.2 Loading the S7 project into the CPU

Now load the TIA Portal project into the SIMATIC CPU as follows:

1. Open the “TIA Portal V13 SP1”.

2. Go to the project view.

3. Click “Project > Open” in the menu bar in TIA Portal.

4. Click “Browse” and open the unzipped project.

5. Right-click PLC_1 [CPU1516F-3 PN/DP] in the project tree and then “Download to device > Hardware and software (only changes)”.

6. Select the corresponding interface and click “Start search”.

Figure 6-2

6 Installation and Commissioning

6.2 Commissioning

Time-based IO Entry ID: 109738186, V1.0, 06/2016 35

S

iem

en

s A

G 2

01

6 A

ll ri

gh

ts r

ese

rve

d

7. Select the CPU based on the MAC address and then click “Load”.

Figure 6-3

Note The IP address and the device name are automatically assigned when downloading the project to the CPU.

8. Confirm the dialog by clicking “Load”.

9. Click “Finish” when loading is complete.

Figure 6-4

7 Operating the Application

6.2 Commissioning

Time-based IO Entry ID: 109738186, V1.0, 06/2016 36

S

iem

en

s A

G 2

01

6 A

ll ri

gh

ts r

ese

rve

d

7 Operating the Application You can operate the application with the help of the included watch table that represents the inputs and outputs of the PulseDelay function block.

1. Open the “Watch and force tables” group in the project tree.

2. Open the PulseDelay watch table.

3. Set the PulseDelay watch table to online mode via the glasses icon.

Figure 7-1 Operator control using the watch table

You can use the following input parameters of the PulseDelay function block in order to operate the application.

1. Set the PulseDelayTime delay time between input and output response to a suitable value.

2. Also set the length of the pulse to be output via the PulseDurationTime parameter.

3. Start the block by setting the Enable input

If you now apply a 24 V pulse or a 24 V signal on channel 0 of the TM Timer DIDQ 16x24V technology module, a 24 V pulse with defined length (PulseDurationTime) is output on channel 8 of the TM Timer DIDQ 16x24V technology module after the lapse of a set delay time (PulseDelayTime).

The response of the output signals of the PulseDelay function block can also be monitored via the watch table in the output area.

8 Links & Literature

Time-based IO Entry ID: 109738186, V1.0, 06/2016 37

S

iem

en

s A

G 2

01

6 A

ll ri

gh

ts r

ese

rve

d

8 Links & Literature Table 8-1

Topic

\1\ Siemens Industry Online Support

https://support.industry.siemens.com

\2\ Download page of the entry https://support.industry.siemens.com/cs/ww/en/view/109738186

\3\ FAQ

“Isochronous mode - an example with SIMATIC S7-1500“

Based on different configuration examples this document shows you the setting options and correlations of the “isochronous mode” functionality in the TIA Portal.

https://support.industry.siemens.com/cs/ww/en/view/109480489

\4\ Application Example

“Measuring input with Time-based IO”

Implementing a measuring Input with the technology modules TM Timer DIDQ 16x24V or TM Timer DIDQ 10x24V.

https://support.industry.siemens.com/cs/ww/en/view/109480157

\5\ Application Example

“Cam Control Unit with time-based IO”

This application example shows how to realize a cam control unit with multiple cam tracks and up to 128 cams per cam track using the technology modules TM Timer DIDQ 16x24V for the ET 200MP and TM Timer DIDQ 10x24V for the ET 200SP.

https://support.industry.siemens.com/cs/ww/en/view/109476953

\6\ SIMATIC PROFINET System Description

System Manual

Edition: 03/2012

Document ID: A5E00298287-06

Article number: -

https://support.industry.siemens.com/cs/en/en/view/19292127/40650672139

Chapter: Isochronous mode

https://support.industry.siemens.com/cs/en/en/view/19292127/36668171019

\7\ SIMATIC ET 200MP/S7-1500

TM Timer DIDQ 16x24V Technology module (6ES7552-1AA00-0AB0)

Manual

Edition: 08/2014

Document ID: A5E34078537-AA

Article number: -

https://support.industry.siemens.com/cs/en/en/view/95153313/71000873867

\8\ SIMATIC ET 200SP

TM Timer DIDQ 10x24V technology module (6ES7138-6CG00-0BA0)

Manual

Edition: 08/2014

Document ID: A5E34301685-AA

Article number: -

https://support.industry.siemens.com/cs/en/en/view/95153951/71000983563

9 History

Time-based IO Entry ID: 109738186, V1.0, 06/2016 38

S

iem

en

s A

G 2

01

6 A

ll ri

gh

ts r

ese

rve

d

Topic

\9\ SIMATIC

High precision input/output with time-based IO

Function Manual

Edition: 08/2014

Document ID: A5E33454821-AB

Article number: -

https://support.industry.siemens.com/cs/en/en/view/82527590/69734674059

\10\ SIMATIC

STEP 7 Professional V13 SP1

System Manual

Edition: 12/2014

Document ID: Printout of the Online help

Article number: -

https://support.industry.siemens.com/cs/en/en/view/109011420/74495465995

Chapter: LTIME (IEC time)

https://support.industry.siemens.com/cs/en/en/view/109011420/61410814475

9 History

Table 9-1

Version Date Modifications

V1.0 06/2016 First version