Solutions

Litmus LE_ISO_on_TCP library for TIA portal V16

20min

Overview

Document image


How to add the LE_ISO_on_TCP library to TIA portal V16

This section will provide instructions on how to add the LE_ISO_on_TCP TIA portal library to the TIA portal V16 project.

Requirements

The library is provided as a compressed library of the type “.zal16” and does require TIA portal V16.

Document image


Step by Step guide to import the library

This guide will provide instructions on how to import the library into a project in TIA portal V16.

Step 1: Open the TIA portal V16 project the library is to be used in.

Document image


Step 2: Import the library through the Options->Global libraries->Open library menu.

Document image


Step 3: For “Look in:” select the folder the file was saved into [1]. For “Files of type:” select the option “Compressed libraries (*.zal16 ....) [2]. Select the file [3]. Press the Open button [4].

Document image


Step 4: As the library is shared as a compressed file, TIA portal V16 does require the user to specify the location [1] where the uncompressed library will be stored. To uncompress the file into the selected folder, press the Select Folder button [2].

Document image


Step 5: Once the compressed file has been unpacked, the library does appear now under the Global libraries section.

Document image


With this, the library is now available to be used in the PLC code.

How to add and configure the LE_ISO-on-TCP library to TIA portal PLC program

This section will provide an overview about what an automation engineer needs to consider and add when deploying the LE_ISO-on-TCP library to a PLC program.

NOTE: This guide will not provide instructions on how to write a Siemens PLC program.

Requirements

The LE_ISO-on-TCP library is added to TIA portal for the project.

Knowledge Prerequisits

To successfully to use this component, the user is expected to know about:

  • Writing Siemens PLC programs using TIA V16

NOTE: The guide will use a Siemens S7 1500 for the example. The Library is also available for the S7 300/400.

Step by Step guide to configure a network using the library

Step 1: Expand the S7-1500 type within the LE_ISO-on-TCO from Global Library.

Document image


Step 2: Add the library "LE_ISO-on-TCP" into the Program blocks.

Document image


Step 3: The Function block will appear as part of the program blocks now.

Document image


Step 4: Add a new a new data block (DB) to hold the connection parameters using the TCON_IP_RFC structure.

Document image


Step 5: Configure the required Start values for the following parameters which are used for a communication with LE.

Document image


Note: The TCON_IP_RFC structure is a predefined structure in TIA Portal. Details about this structure can be found TIA Portal's Help. 

 

 

Type

Value

Description

InterfaceId

HW_ANY

64

HW-identifier of IE-interface submodule (Specific to a certain configuration)

ID

CONN_OUC

12

connection reference / identifier (Specific to a certain configuration)

ConnectionType

Byte

12

type of connection: 12 = ISO-on-TCP (18=ISO-on-TCP)

ActiveEstablished

Bool

0

active/passive connection establishment

RemoteAddress

IP_V4

remote IP address (IPv4) -> leave empty as LE will establish connection

RemoteTSelector

TSelector

remote transport selector -> leave empty

LocalTSelector

TSelector

local transport selector -> required

Example of a LocalTSelector setting. This can be set according to individual needs.

LocalTSelector.TSelLength

Uint

5

Length of the following TSAP -> example uses a TSAP of the length of 5.

LocalTSelector.TSel{1]

Byte

16#54

'T'

LocalTSelector.TSel{2]

Byte

16#43

'C'

LocalTSelector.TSel{3]

Byte

16#50

'P'

LocalTSelector.TSel{4]

Byte

16#2D

'-'

LocalTSelector.TSel{5]

Byte

16#32

'2'

Step 6: The LE_ISO-on-TCP Library requires a single DB (data block) which holds all the data to be send via the library. The Litmus edge driver communicating with the library can only return the data types: - bytes - word - dwordSiemens allows that some data types can be easily translated into other data types such as word. This does make it possible to use existing configurations if they are in such a data type.More information can be found in the Siemens help.Example: This DB uses an Array of Uint.

Document image


Step 7: Add a new Network to your program and add a new Empty box.

Document image


Step 8: Select for the box the LE_ISO-on-TCP library.

Document image


Step 9: The library will add a Data block. Either accept the default settings or modify them according to your needs.​

Document image


Step 10: Configure the function block with the respective Inputs and optional outputs.

Document image


Example of a configuration.

Input Parameters:

Input Parameter (EN)

Value

Description

enable

M0.4 (CONNECT)

A memory address used to set if the function block is enabled or disabled. Could be used to turn communication off at runtime.

paramts

rtc.rtc

Link to the rtc parameter in the data block rtc from Step 5

data

DB30DBX0.0 (DB1.Var_1)

The datablock which does hold the values to be send from Step 6

send_req

M0.5 (SEND)

A memory address used to initiate the sending of the data. This can be set to true at every cycle or based on specific conditions. This needs to be reset to false after a send

Output Parameters:

Output Parameter (ENO)

Value

Description

error

Is left at the default, which only shows the status within the LE_ISO-on-TCP data block.

This could be set to a tag and be shown on a HMI.

sent

Is left at the default, which only shows the status withhin the LE_ISO-on-TCP data block.

This could be set to a tag and be shown on a HMI.

Document image


Step 11: Compile the porgram and download it to your PLC.

How to read data send by the LE_ISO-on-TCP library with Litmus Edge

This section will provide an overview on how to read the data send by the implemented LE_ISO-on-TCP Library.

NOTE: This guide will not provide instructions on how to write a Siemens PLC program.

Requirements

The LE_ISO-on-TCP library has been added to a Siemens PLC program and that program is downloaded onto the PLC and running.

Knowledge Prerequisites

To successfully to use this component, the user is expected to know about:

  • Adding devices in Litmus Edge
  • Adding tags in Litmus Edge

NOTE: The guide will use a Siemens S7 1500 for the example. The Library is also available for the S7 300/400.

Step by Step guide to read data into Litmus Edge

Step 1: Open the Litmus Ede User UI with your browser.

Step 2: Navigate to DeviceHub to add a new Device.

Document image


Step 3: Add a new device and select "Siemens" for the Device Type.

Document image


Step 4: Select as Driver "Siemens ISO-on-TCP".

Document image


Step 5: Configure the driver.

Document image


Mandatory are: - Name -> This will be the Name of the Device in Litmus Edge - Network Address -> This is the IP address of the Siemens PLC - Local TSAP -> This is the value set in Step 5 of the previous chapter under the rtc data block - Remote TSAP -> This is the value set in Step 5 of the previous chapter under the rtc data blockOptional but Recommended - Enable Alias Topic -> This will build the topics in Litmus Edge using the devicename and tagname

Step 6: After configuring the Device, use the Add Device button to create the device in Litmus Edge.

Document image


Step 7: The device will automatically connect to the PLC.

Document image


Step 8: To be able to collect the data, open the Tags panel under DeviceHub.

Document image


Step 9: Select the Siemens device you jsut added and press the Add Tag icon.

Document image


Step 10: Select the Add a Tag.

Document image


Step 11: Add the new Tag by providing the relevant parameters.

Document image


Mandatory are: - Value Type -> This is the value type used by DeviceHub. The available options are the Siemens data types: 

Document image


Siemens is able to transform some data types into other data type. In the example used by this guide, on the PLC the data are in Uint but this is possible to be also handled as word or dword. - Tag Name -> This is the name the tag will have in Litmus Edge. Tag Names have to be unique on a device to device base. - Address -> This is the Offset from the data block which is used to send the data.

Step 12: Add the tag with the Add Tag button.

Document image


The address used is taken from the DB in TIA Portal.

Document image


Step 13: It is possible to verify that data are read using the topic and flows.

Document image

Document image