pn/bacnet link – configuring data exchange · pn/bacnet link - configuring data exchange...

37
PN/BACnet LINK - Configuring data exchange TIA Portal V15, SIMATIC S7 https://support.industry.siemens.com/cs/ww/en/view/109757273 Siemens Industry Online Support

Upload: vuongduong

Post on 17-Sep-2018

275 views

Category:

Documents


5 download

TRANSCRIPT

Page 1: PN/BACnet LINK – Configuring data exchange · PN/BACnet LINK - Configuring data exchange Application example, 04/2018, Entry ID: 109757273, V1.0 3 Table of contents 1 Task

PN/BACnet LINK - Configuring data exchange

TIA Portal V15, SIMATIC S7

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

Siemens Industry Online Support

Page 2: PN/BACnet LINK – Configuring data exchange · PN/BACnet LINK - Configuring data exchange Application example, 04/2018, Entry ID: 109757273, V1.0 3 Table of contents 1 Task

Siemens AG Division Digital Factory Postfach 48 48 90026 NÜRNBERG Germany

1.0 Ⓟ 04/2018 Subject to change

Copyright © Siemens AG 2018. All rights reserved 2

S

iem

ens

AG 2

018

All r

ight

s re

serv

ed

Legal information Warning notice system

This manual contains notices you have to observe in order to ensure your personal safety, as well as to prevent damage to property. The notices referring to your personal safety are highlighted in the manual by a safety alert symbol, notices referring only to property damage have no safety alert symbol. These notices shown below are graded according to the degree of danger.

DANGER

indicates that death or severe personal injury will result if proper precautions are not taken.

WARNING

indicates that death or severe personal injury may result if proper precautions are not taken.

CAUTION

indicates that minor personal injury can result if proper precautions are not taken.

NOTICE indicates that property damage can result if proper precautions are not taken.

If more than one degree of danger is present, the warning notice representing the highest degree of danger will be used. A notice warning of injury to persons with a safety alert symbol may also include a warning relating to property damage.

Qualified Personnel The product/system described in this documentation may be operated only by personnel qualified for the specific task in accordance with the relevant documentation, in particular its warning notices and safety instructions. Qualified personnel are those who, based on their training and experience, are capable of identifying risks and avoiding potential hazards when working with these products/systems.

Proper use of Siemens products Note the following:

WARNING

Siemens products may only be used for the applications described in the catalog and in the relevant technical documentation. If products and components from other manufacturers are used, these must be recommended or approved by Siemens. Proper transport, storage, installation, assembly, commissioning, operation and maintenance are required to ensure that the products operate safely and without any problems. The permissible ambient conditions must be complied with. The information in the relevant documentation must be observed.

Page 3: PN/BACnet LINK – Configuring data exchange · PN/BACnet LINK - Configuring data exchange Application example, 04/2018, Entry ID: 109757273, V1.0 3 Table of contents 1 Task

PN/BACnet LINK - Configuring data exchange Application example, 04/2018, Entry ID: 109757273, V1.0 3

Table of contents

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

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

2.1 System configuration ................................................................................................................ 5

2.2 Hardware and software components ........................................................................................ 6

2.3 General procedure .................................................................................................................... 6

3 Planning and configuring cyclic data exchange........................................................................................ 8

3.1 Configuring the server............................................................................................................... 8

3.2 Adding a device ...................................................................................................................... 10 3.2.1 Adding a device for the EDE file export .................................................................................. 10 3.2.2 Configuring device after manual addition ............................................................................... 13

3.3 Configuring cyclic data exchange ........................................................................................... 17 3.3.1 General ................................................................................................................................... 17 3.3.2 Activate client and server ........................................................................................................ 17

4 Planning and configuring of acyclic data exchange ................................................................................ 21

4.1 Configuring the server............................................................................................................. 21

4.2 Adding a device ...................................................................................................................... 21 4.2.1 Adding a device for the EDE file export .................................................................................. 21 4.2.2 Configuring device after manual addition ............................................................................... 22

4.3 Configuring acyclic data exchange ......................................................................................... 24 4.3.1 General ................................................................................................................................... 24 4.3.2 Insert function blocks and libraries ......................................................................................... 24 4.3.3 Reading properties .................................................................................................................. 27 4.3.4 Writing properties .................................................................................................................... 33

A Appendix............................................................................................................................................... 36

A.1 Internet links ............................................................................................................................ 36

A.2 History ..................................................................................................................................... 36

A.3 List of abbreviations ................................................................................................................ 37

Page 4: PN/BACnet LINK – Configuring data exchange · PN/BACnet LINK - Configuring data exchange Application example, 04/2018, Entry ID: 109757273, V1.0 3 Table of contents 1 Task

4

PN/BACnet LINK - Configuring data exchange Application example, 04/2018, Entry ID: 109757273, V1.0

Task 1This application example shows the cyclic and acyclic data exchange of two "PN/BACnet LINK" gateways.

● Cyclic data exchange

The PN/BACnet LINK as client accesses I/O objects of a PN/BACnet LINK operating asserver.

● Acyclic data exchange

The PN/BACnet LINK as client hereby accesses the properties of a PN/BACnet LINKoperating as server.

From the point of view of the S7 controller, this process is identical for all devices. The application example does not address the configuration of the PN/BACnet LINK in detail.

Required knowledge The following knowledge is required:

● Knowledge of programming a SIMATIC S7 controller

● Knowledge of configuration with TIA Portal

● Knowledge of working with the PROFINET fieldbus

● Well-founded knowledge in the PN/BACnet communication protocol

● General knowledge in the field of automation technology

● General knowledge of communication networks

Page 5: PN/BACnet LINK – Configuring data exchange · PN/BACnet LINK - Configuring data exchange Application example, 04/2018, Entry ID: 109757273, V1.0 3 Table of contents 1 Task

PN/BACnet LINK - Configuring data exchange Application example, 04/2018, Entry ID: 109757273, V1.0 5

Solution 22.1 System configuration

For the application example use the following configuration:

The PN/BACnet LINKs are connected via PROFINET to the SIMATIC S7 controller. The PN/BACnet LINKs are configured as follows:

● PN/BACnet LINK 1 – in "Server" operating mode

● PN/BACnet LINK 2 – in "Client" operating mode

The configuration takes place on a PC with installed TIA Portal.

Page 6: PN/BACnet LINK – Configuring data exchange · PN/BACnet LINK - Configuring data exchange Application example, 04/2018, Entry ID: 109757273, V1.0 3 Table of contents 1 Task

Solution 2.2 Hardware and software components

6

PN/BACnet LINK - Configuring data exchange Application example, 04/2018, Entry ID: 109757273, V1.0

2.2 Hardware and software components The application example was created with the following components:

Hardware components

Component Number Article number Comment SIMATIC S7 controller 1 6ES7214-1AG40-0XB0 CPU 1214C, DC/DC/DC PN/BACnet LINK 2 6BK1621-1AA00-0AA0 Supply voltage 24 V DC Power supply SIMATIC S7-1200 Power Module PM1207

1 6EP1332-1SH71 For power supply of controller and PN/BACnet LINK

Software components

Component Number Article number Comment TIA Portal V15 1 6ES7822-0AA00-0YL0 The package "Update 2" has to be

installed

Example files and projects

File Comment 109757273_network_transitions_pnbacnet_link_de.pdf 109757273_network_transitions_pnbacnet_link_en.pdf

The German version of this document. The English version of this document.

BACnet_communication_V15.zip The TIA project of the application example

You can find the download link in the section "Internet links (Page 36)".

2.3 General procedure Proceed as follows:

1. Create a new project.

2. Set the language of the user interface to English:

3. Click "Catalog" ① and insert the devices according to section"Hardware and software components (Page 6)".

Page 7: PN/BACnet LINK – Configuring data exchange · PN/BACnet LINK - Configuring data exchange Application example, 04/2018, Entry ID: 109757273, V1.0 3 Table of contents 1 Task

Solution 2.3 General procedure

PN/BACnet LINK - Configuring data exchange Application example, 04/2018, Entry ID: 109757273, V1.0 7

4. Connect the CPU and PN/BACnet LINK using a PROFINET connection.

CPU and PN/BACnet LINK are connected via PROFINET ② in the "Network view"window.

5. Configure the PROFINET interfaces ③ based on the conditions of your PROFINETnetwork.

Page 8: PN/BACnet LINK – Configuring data exchange · PN/BACnet LINK - Configuring data exchange Application example, 04/2018, Entry ID: 109757273, V1.0 3 Table of contents 1 Task

8

PN/BACnet LINK - Configuring data exchange Application example, 04/2018, Entry ID: 109757273, V1.0

Planning and configuring cyclic data exchange 33.1 Configuring the server

This section describes the planning and configuring of a PN/BACnet LINK for the cyclic data exchange of an I/O image between a PN/BACnet LINK and another BACnet device.

Additional and supplementary information is available in the "SIMATIC Gateways PN/BACnet LINK" operating instructions. This is available under the following link:

Industry Online Support (http://www.siemens.com/automation/service&support)

Configuring the server Proceed as follows:

1. Select "Network view ① → Link_2 ②".

2. Select "Device view ① → Device overview → BACnet → Server ②".

Page 9: PN/BACnet LINK – Configuring data exchange · PN/BACnet LINK - Configuring data exchange Application example, 04/2018, Entry ID: 109757273, V1.0 3 Table of contents 1 Task

Planning and configuring cyclic data exchange 3.1 Configuring the server

PN/BACnet LINK - Configuring data exchange Application example, 04/2018, Entry ID: 109757273, V1.0 9

3. Select "Properties ① → General → Device object ②" and enter "2" ③ as instance.

Defining objects 1. Select "Properties ① → General → I/O Object → Define I/O Object ②" and

click "New" ③.

2. Select "Binary Input" ① and enter "10" ② as instance and click "New" ③ again.

Page 10: PN/BACnet LINK – Configuring data exchange · PN/BACnet LINK - Configuring data exchange Application example, 04/2018, Entry ID: 109757273, V1.0 3 Table of contents 1 Task

Planning and configuring cyclic data exchange 3.2 Adding a device

10

PN/BACnet LINK - Configuring data exchange Application example, 04/2018, Entry ID: 109757273, V1.0

3. Select "Binary output" ① and enter "20" ② as instance.

4. Select "Properties ① → General → I/O object → Overview ②".

The created objects are displayed in the column "Type" ③ and "Instance" ④.

3.2 Adding a device

3.2.1 Adding a device for the EDE file export To add the server to the client, you have the following options:

● Export the EDE file

● Manually add a reference of the I/O object of the server to the client.

Page 11: PN/BACnet LINK – Configuring data exchange · PN/BACnet LINK - Configuring data exchange Application example, 04/2018, Entry ID: 109757273, V1.0 3 Table of contents 1 Task

Planning and configuring cyclic data exchange 3.2 Adding a device

PN/BACnet LINK - Configuring data exchange Application example, 04/2018, Entry ID: 109757273, V1.0 11

Export the EDE file of the server Proceed as follows:

1. Click "Network view ① → Link_2 ② → Network data ③".

2. Select "Network view ① → Network overview → BACnet station_2 → Link_2 ②".

3. Select "Properties ① → General → BACnet → Server ②".

Page 12: PN/BACnet LINK – Configuring data exchange · PN/BACnet LINK - Configuring data exchange Application example, 04/2018, Entry ID: 109757273, V1.0 3 Table of contents 1 Task

Planning and configuring cyclic data exchange 3.2 Adding a device

12

PN/BACnet LINK - Configuring data exchange Application example, 04/2018, Entry ID: 109757273, V1.0

4. Click the button "Export EDE file" ③.

The "Export EDE file" window is displayed.

5. Save the EDE file.

The EDE file of the server is saved.

Import the EDE file into the client Proceed as follows:

1. Double-click "Network view ① → Network overview → Link_1 ②".

2. Select "Properties ① → General → BACnet → Client" ②.

3. Click "Import EDS file" ③.

The "Export EDE file" window is displayed.

4. Select the EDE file saved according to section "Export EDE file".

5. Double-click the EDE file.

The EDE file is imported.

Page 13: PN/BACnet LINK – Configuring data exchange · PN/BACnet LINK - Configuring data exchange Application example, 04/2018, Entry ID: 109757273, V1.0 3 Table of contents 1 Task

Planning and configuring cyclic data exchange 3.2 Adding a device

PN/BACnet LINK - Configuring data exchange Application example, 04/2018, Entry ID: 109757273, V1.0 13

3.2.2 Configuring device after manual addition

Insert submodule Proceed as follows:

Note

Only experienced users with the necessary knowledge should add a submodule manually.

1. Click "Network view ① → Link_1 ②".

2. Select "Device view ① → Device overview → Link_1 ②".

Page 14: PN/BACnet LINK – Configuring data exchange · PN/BACnet LINK - Configuring data exchange Application example, 04/2018, Entry ID: 109757273, V1.0 3 Table of contents 1 Task

Planning and configuring cyclic data exchange 3.2 Adding a device

14

PN/BACnet LINK - Configuring data exchange Application example, 04/2018, Entry ID: 109757273, V1.0

3. Select "Catalog" ① and double-click "BACnet device" ②.

A BACnet device is added to the client as submodule.

4. Select "Device view ① → Device overview → BACnet device ②".

5. Enter a unique name.

"SIMATIC_2" was selected for the application example.

6. Select "Properties ① → General → BACnet device → Device Object ②" and enter "2" ③as instance.

Page 15: PN/BACnet LINK – Configuring data exchange · PN/BACnet LINK - Configuring data exchange Application example, 04/2018, Entry ID: 109757273, V1.0 3 Table of contents 1 Task

Planning and configuring cyclic data exchange 3.2 Adding a device

PN/BACnet LINK - Configuring data exchange Application example, 04/2018, Entry ID: 109757273, V1.0 15

Assign I/O object reference to the submodule 1. Select "Properties ① → General → BACnet device → I/O object references →

Define I/O object reference ②" and click "New" ③.

2. Enter "Binary Input" ①, "10" ② as instance, "10 ms" ③ as update interval, and click"New" ④ again.

Page 16: PN/BACnet LINK – Configuring data exchange · PN/BACnet LINK - Configuring data exchange Application example, 04/2018, Entry ID: 109757273, V1.0 3 Table of contents 1 Task

Planning and configuring cyclic data exchange 3.2 Adding a device

16

PN/BACnet LINK - Configuring data exchange Application example, 04/2018, Entry ID: 109757273, V1.0

3. Enter "Binary output" ①, "20" ② as instance, and "Send on change of value" ③ asupdate interval.

4. Select "Properties ① → General → BACnet device → I/O object references →Overview ②".

The created objects are displayed in the columns "Type" ③ and "Instance" ④.

Page 17: PN/BACnet LINK – Configuring data exchange · PN/BACnet LINK - Configuring data exchange Application example, 04/2018, Entry ID: 109757273, V1.0 3 Table of contents 1 Task

Planning and configuring cyclic data exchange 3.3 Configuring cyclic data exchange

PN/BACnet LINK - Configuring data exchange Application example, 04/2018, Entry ID: 109757273, V1.0 17

3.3 Configuring cyclic data exchange

3.3.1 General The following section describes how to read and write I/O objects.

In the application example, a clock signal is written to the output object of the server. The client reads the clock signal alternately.

The clock signal is changed cyclically and thus changes the digital output object of the server.

3.3.2 Activate client and server

Procedure Proceed as follows:

1. Switch to the project tree and click "Devices ① → PLC_1 → Program blocks →Main [OB1] ②".

Page 18: PN/BACnet LINK – Configuring data exchange · PN/BACnet LINK - Configuring data exchange Application example, 04/2018, Entry ID: 109757273, V1.0 3 Table of contents 1 Task

Planning and configuring cyclic data exchange 3.3 Configuring cyclic data exchange

18

PN/BACnet LINK - Configuring data exchange Application example, 04/2018, Entry ID: 109757273, V1.0

2. Insert program line 1 ① and 3 to 6 ②.

Activation is performed by setting the "ClientControl Bit" to "TRUE". Next, the server must be set to the operating state.

Page 19: PN/BACnet LINK – Configuring data exchange · PN/BACnet LINK - Configuring data exchange Application example, 04/2018, Entry ID: 109757273, V1.0 3 Table of contents 1 Task

Planning and configuring cyclic data exchange 3.3 Configuring cyclic data exchange

PN/BACnet LINK - Configuring data exchange Application example, 04/2018, Entry ID: 109757273, V1.0 19

Changing the value of the I/O object Proceed as follows:

1. Switch to the project tree and click "Devices ① → PLC_1 → Program blocks →Cyclic interrupt [OB30]".

2. Insert the program lines 1 to 6 ①.

These program lines invert the current value of the I/O object.

Page 20: PN/BACnet LINK – Configuring data exchange · PN/BACnet LINK - Configuring data exchange Application example, 04/2018, Entry ID: 109757273, V1.0 3 Table of contents 1 Task

Planning and configuring cyclic data exchange 3.3 Configuring cyclic data exchange

20

PN/BACnet LINK - Configuring data exchange Application example, 04/2018, Entry ID: 109757273, V1.0

Start cyclic data exchange 1. Start the cyclic data exchange by setting "Config_DB".CyclicStartRead" ① in the table to

"TRUE" ②.

Therefore, cyclic data exchange runs between both PN/BACNet LINKs.

Parameter description Main[OB1]

Parameter Description Link_1.Client.ClientControl This tag is generated automatically during the configuration of the

gateway. The bit determines whether the client is active (TRUE) or inactive (FALSE). In this application example, the client, PN/BACnet LINK 1, should be active.

Link_2.Server.Server.Control This tag is generated automatically during the configuration of the gateway. Bits 0 ... 3 determine the following: • 0 – The server is in operating state.• 1 – The server is in operating state, read only• 4 – The server is not in operating state.In this example, the server should be in operating state.

Link_2.Server.I/O object1 Link_2.Server.I/O object2 Link_1.SIMATIC_2.I/O object2

Objects of the server or object references of the client can be ac-cessed via this tag. The tags are generated automatically during the configuration of the gateways.

Result If the program has been compiled and loaded in the PLC, a running light is visible on the CPU.

Page 21: PN/BACnet LINK – Configuring data exchange · PN/BACnet LINK - Configuring data exchange Application example, 04/2018, Entry ID: 109757273, V1.0 3 Table of contents 1 Task

PN/BACnet LINK - Configuring data exchange Application example, 04/2018, Entry ID: 109757273, V1.0 21

Planning and configuring of acyclic data exchange 44.1 Configuring the server

This section describes the planning and configuring of a PN/BACnet LINK for the acyclic data exchange of an I/O image between a PN/BACnet LINK and another BACnet device.

Additional and supplementary information is available in the "SIMATIC Gateways PN/BACnet LINK" operating instructions. This is available under the following link:

Industry Online Support (http://www.siemens.com/automation/service&support)

4.2 Adding a device

4.2.1 Adding a device for the EDE file export The procedure is described in the section "Adding a device for the EDE file export (Page 10)".

Page 22: PN/BACnet LINK – Configuring data exchange · PN/BACnet LINK - Configuring data exchange Application example, 04/2018, Entry ID: 109757273, V1.0 3 Table of contents 1 Task

Planning and configuring of acyclic data exchange 4.2 Adding a device

22

PN/BACnet LINK - Configuring data exchange Application example, 04/2018, Entry ID: 109757273, V1.0

4.2.2 Configuring device after manual addition The procedure is described in the section "Configuring device after manual addition (Page 13)". Perform the steps in the "Insert submodule" section. The steps required for acyclic data exchange are often described in the following section.

Assign I/O object reference to the submodule Proceed as follows:

1. Select "Properties ① → General → BACnet device → I/O object references →Define I/O object reference ②" and click "New" ③.

2. Enter "Binary Input" ①, "10" ② as instance, "100 ms" ③ as update interval and click"New" ④.

Page 23: PN/BACnet LINK – Configuring data exchange · PN/BACnet LINK - Configuring data exchange Application example, 04/2018, Entry ID: 109757273, V1.0 3 Table of contents 1 Task

Planning and configuring of acyclic data exchange 4.2 Adding a device

PN/BACnet LINK - Configuring data exchange Application example, 04/2018, Entry ID: 109757273, V1.0 23

3. Enter "Binary output" ①, "20" ② as instance, and "Send on change of value" ③ asupdate interval.

4. Select "Properties ① → General → BACnet device → I/O object references →Overview ②".

The created objects are displayed in the columns "Type" ③ and "Instance" ④.

Page 24: PN/BACnet LINK – Configuring data exchange · PN/BACnet LINK - Configuring data exchange Application example, 04/2018, Entry ID: 109757273, V1.0 3 Table of contents 1 Task

Planning and configuring of acyclic data exchange 4.3 Configuring acyclic data exchange

24

PN/BACnet LINK - Configuring data exchange Application example, 04/2018, Entry ID: 109757273, V1.0

4.3 Configuring acyclic data exchange

4.3.1 General The following section explains how you can read and write data of a BACnet device using an S7 program. Use program blocks for this purpose:

● BACnetRead

● BACnetWrite

● GenerateObjectID

The readout within the program blocks is executed using acyclic services "WRREC" and "RDREC" of the S7 controller.

● First, the WRREC is executed.

● A RDREC is then executed.

SectionActivate client and server (Page 17) describes how to enable the client and the server.

4.3.2 Insert function blocks and libraries The following section describes how to import a cyclic interrupt and create the related function block and import it into the library. Create a cyclic interrupt that is called every 100 ms.

Page 25: PN/BACnet LINK – Configuring data exchange · PN/BACnet LINK - Configuring data exchange Application example, 04/2018, Entry ID: 109757273, V1.0 3 Table of contents 1 Task

Planning and configuring of acyclic data exchange 4.3 Configuring acyclic data exchange

PN/BACnet LINK - Configuring data exchange Application example, 04/2018, Entry ID: 109757273, V1.0 25

Procedure Proceed as follows:

1. Switch to the project tree and click "Devices ① → PLC_1 → Add new block ②".

2. Double-click "Add new block" ②.

The following dialog box is displayed.

Page 26: PN/BACnet LINK – Configuring data exchange · PN/BACnet LINK - Configuring data exchange Application example, 04/2018, Entry ID: 109757273, V1.0 3 Table of contents 1 Task

Planning and configuring of acyclic data exchange 4.3 Configuring acyclic data exchange

26

PN/BACnet LINK - Configuring data exchange Application example, 04/2018, Entry ID: 109757273, V1.0

3. Click "Organization block" ① and "Cyclic interrupt" ②.

Check whether ③ and ④ are configured as shown. This sets a cyclic interrupt that iscalled every100 ms.

4. Confirm your entries with OK.

5. The function blocks BACnetRead and BACnetWrite are called in the function blockRW_BACnet.

These can be imported as library. The library is included in the ZIP file in accordance withsection "Hardware and software components (Page 6)".

6. To ensure that the function block RW_BACnet is called in the interrupt, drag the functionblock to the interrupt.

A data block is then created. The interrupt changes as follows:

Page 27: PN/BACnet LINK – Configuring data exchange · PN/BACnet LINK - Configuring data exchange Application example, 04/2018, Entry ID: 109757273, V1.0 3 Table of contents 1 Task

Planning and configuring of acyclic data exchange 4.3 Configuring acyclic data exchange

PN/BACnet LINK - Configuring data exchange Application example, 04/2018, Entry ID: 109757273, V1.0 27

4.3.3 Reading properties

Expand function block RW_BACnet [FB1] Proceed as follows:

1. Add the function "GenerateObjectID" from the library.

2. Switch to the project navigation and click "Devices ① → PLC_1 → Program blocks →Cyclic interrupt [OB30] ②".

Page 28: PN/BACnet LINK – Configuring data exchange · PN/BACnet LINK - Configuring data exchange Application example, 04/2018, Entry ID: 109757273, V1.0 3 Table of contents 1 Task

Planning and configuring of acyclic data exchange 4.3 Configuring acyclic data exchange

28

PN/BACnet LINK - Configuring data exchange Application example, 04/2018, Entry ID: 109757273, V1.0

3. Insert the program lines 1 to 6 ① and 8 to 19 ②.

The parameters of the example are described in the "Parameter description" section.

Page 29: PN/BACnet LINK – Configuring data exchange · PN/BACnet LINK - Configuring data exchange Application example, 04/2018, Entry ID: 109757273, V1.0 3 Table of contents 1 Task

Planning and configuring of acyclic data exchange 4.3 Configuring acyclic data exchange

PN/BACnet LINK - Configuring data exchange Application example, 04/2018, Entry ID: 109757273, V1.0 29

Parameter description

Parameter Description execute Specifies whether block is to be executed (TRUE/FALSE).

This parameter is used to transfer the value of the CPU tag Trigger, which points to a free output address. This CPU tag is necessary because the block is not executed again until "execute" is reset from 1 to 0. This way it is easy to create a watch table.

HW_IO Is the hardware ID of the client – see section "Display hardware ID" ObjectToRead The structure contains the object data that is read ObjectToRead.DNET The network ID of the data network in which the device is integrated.

The information can be found under "Device view → BACnet/IP interface → NetworkID".

ObjectToRead.Device Instance of the server ObjectToRead.ObjectType Specifies which object type it is:

• 0: Analog input• 1: Analog output• 3: Digital input• 4: Digital output

ObjectToRead.InstanceNr Instance of the input/output object ObjectToRead.PropertyID Number of properties that can be read ObjectToRead.ArrayIndex –1maxDataSize Maximum data length that can be read OrderNumber 1 busy Indicates that the acyclic data exchange is still running. done Indicates that the acyclic data exchange has been completed. error Indicates that an error occurred status Displays the status of the acyclic service.

This is displayed if an SDO communications error occurs during RDREC.

rdData Field in which the read data are stored.

Page 30: PN/BACnet LINK – Configuring data exchange · PN/BACnet LINK - Configuring data exchange Application example, 04/2018, Entry ID: 109757273, V1.0 3 Table of contents 1 Task

Planning and configuring of acyclic data exchange 4.3 Configuring acyclic data exchange

30

PN/BACnet LINK - Configuring data exchange Application example, 04/2018, Entry ID: 109757273, V1.0

Displaying the hardware ID If you want to see the hardware ID, proceed as follows:

1. Select "Device view ① → Device overview → BACnet → Client ②".

2. Select "Properties ① → System constants → Link_1 - SIMATIC_2 ②".

The hardware ID is displayed at ③, here as an example.

Change the value of the input and output Initiate that the server changes the digital input and output value.

Proceed as follows:

1. Switch to the project navigation and click "Devices ① → PLC_1 → Program blocks →Cyclic interrupt [OB30] ②".

Page 31: PN/BACnet LINK – Configuring data exchange · PN/BACnet LINK - Configuring data exchange Application example, 04/2018, Entry ID: 109757273, V1.0 3 Table of contents 1 Task

Planning and configuring of acyclic data exchange 4.3 Configuring acyclic data exchange

PN/BACnet LINK - Configuring data exchange Application example, 04/2018, Entry ID: 109757273, V1.0 31

2. Insert the program line ②.

These program lines invert the current value of the I/O object at the time when the acyclic read is requested.

Page 32: PN/BACnet LINK – Configuring data exchange · PN/BACnet LINK - Configuring data exchange Application example, 04/2018, Entry ID: 109757273, V1.0 3 Table of contents 1 Task

Planning and configuring of acyclic data exchange 4.3 Configuring acyclic data exchange

32

PN/BACnet LINK - Configuring data exchange Application example, 04/2018, Entry ID: 109757273, V1.0

Start acyclic reading The change of the data at the server input and output is controlled with this operation. The program lines in "Cyclic interrupt [OB30]" invert the value of the I/O object whenever the acyclic process is triggered.

Proceed as follows:

1. The data that is to be written from ""Config_DB".writeAcyclicValue" to the FB"RW_BACnet" is assigned in the "Block interface" by the following program line:

See section "Expand function block RW_BACnet [FB1]", position 2.

2. Switch to the project navigation and click "Devices ① → PLC_1 → Watch and force tables→ Overview table ②".

3. Switch to the "Overview table".

4. Set the tag ""Config_DB".AcyclicStartRead" ① to "TRUE" ②.

Acyclic data exchange starts. After completion of the acyclic reading, the tag"Config_DB".AcyclicStartRead" is reset to "FALSE".

The result of reading can be checked in the watch table.

Page 33: PN/BACnet LINK – Configuring data exchange · PN/BACnet LINK - Configuring data exchange Application example, 04/2018, Entry ID: 109757273, V1.0 3 Table of contents 1 Task

Planning and configuring of acyclic data exchange 4.3 Configuring acyclic data exchange

PN/BACnet LINK - Configuring data exchange Application example, 04/2018, Entry ID: 109757273, V1.0 33

4.3.4 Writing properties The writing of a property is based on the section "Reading properties (Page 27)".

Expand function block RW_BACnet [FB1] Proceed as follows:

1. Switch to the project tree and click "Devices ① → PLC_1 → Program blocks →RW_BACnet [FB1] ②".

Page 34: PN/BACnet LINK – Configuring data exchange · PN/BACnet LINK - Configuring data exchange Application example, 04/2018, Entry ID: 109757273, V1.0 3 Table of contents 1 Task

Planning and configuring of acyclic data exchange 4.3 Configuring acyclic data exchange

34

PN/BACnet LINK - Configuring data exchange Application example, 04/2018, Entry ID: 109757273, V1.0

2. Insert the program lines 31 to 36 ①, 38 ② and 40 to 52 ②:

The parameters of the example are described in the "Parameter description" section.

Parameter description

Parameter Description execute, HW_IO, busy, error, status, ObjectToWrite

See section "Reading properties (Page 27)"

Priority The priority of the BACnet, permitted are 1 to 16 DataType According to BACnet specification wrDataSize Length of the requested data in bytes accessSlot Number of the data record used. wrData Contains the data that are to be written

Page 35: PN/BACnet LINK – Configuring data exchange · PN/BACnet LINK - Configuring data exchange Application example, 04/2018, Entry ID: 109757273, V1.0 3 Table of contents 1 Task

Planning and configuring of acyclic data exchange 4.3 Configuring acyclic data exchange

PN/BACnet LINK - Configuring data exchange Application example, 04/2018, Entry ID: 109757273, V1.0 35

Start acyclic writing Proceed as follows:

1. The data that is to be written from ""Config_DB".writeAcyclicValue" to the FB"RW_BACnet" is assigned in the "Block interface" by the following program line:

#wrData := "Config_DB".writeAcyclicValue;

See section "Expand function block RW_BACnet [FB1]", position 2.

2. Switch to the project navigation and click "Devices ① → PLC_1 →Watch and force tables → Overview table ②".

3. Switch to the "Overview table".

4. In the overview table, set the value for ""Confi_DB".AcyclicStartWrite" ① in the "Modifyvalue" column to "TRUE" ②.

Acyclic data exchange starts. After acyclic writing has ended, the""Config_DB".AcyclicStartWrite" tag is reset to "FALSE".

The result of reading can be checked in the watch table.

Page 36: PN/BACnet LINK – Configuring data exchange · PN/BACnet LINK - Configuring data exchange Application example, 04/2018, Entry ID: 109757273, V1.0 3 Table of contents 1 Task

36

PN/BACnet LINK - Configuring data exchange Application example, 04/2018, Entry ID: 109757273, V1.0

Appendix AA.1 Internet links

No. Subject area 1 Entry - PN/BACnet LINK - Configuring data exchange

(https://support.industry.siemens.com/cs/products?search=109757273&mfn=ps&o=DefaultRankingDesc&lc=en-WW)

2 SIMATIC gateways PN/BACnet LINK (https://support.industry.siemens.com/cs/ae/en/view/109752591)

3 Industry Online Support (https://support.industry.siemens.com/cs/start?lc=en-WW)

4 Mall (https://mall.industry.siemens.com/mall/en/WW/Catalog/Products/10140445?activeTab=ProductInformation&tree=CatalogTree)

5 Industrial communication (https://w3.siemens.com/mcms/automation/en/industrial-communications/Pages/Default.aspx)

6 Contact person for the database (http://w3.siemens.com/aspa_app/)

A.2 History

Edition Comment 04/2018 First edition

Page 37: PN/BACnet LINK – Configuring data exchange · PN/BACnet LINK - Configuring data exchange Application example, 04/2018, Entry ID: 109757273, V1.0 3 Table of contents 1 Task

Appendix A.3 List of abbreviations

PN/BACnet LINK - Configuring data exchange Application example, 04/2018, Entry ID: 109757273, V1.0 37

A.3 List of abbreviations

BACnet Building Automation and Control Networks CAN Controller Area Network CPU Central Processor Unit DB Data block I/O Input/output FB Function block HSP Hardware Support Package OB Organization block OD Object dictionary PN PROFINET RDREC Read Record (read data record) SDO Service Data Object WRREC Write record (write data record)