Litmus LE_ISO_on_TCP library for 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.
The library is provided as a compressed library of the type “.zal16” and does require TIA portal V16.
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.
Step 2: Import the library through the Options->Global libraries->Open library menu.
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].
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].
Step 5: Once the compressed file has been unpacked, the library does appear now under the Global libraries section.
With this, the library is now available to be used in the PLC code.
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.
The LE_ISO-on-TCP library is added to TIA portal for the project.
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 1: Expand the S7-1500 type within the LE_ISO-on-TCO from Global Library.
Step 2: Add the library "LE_ISO-on-TCP" into the Program blocks.
Step 3: The Function block will appear as part of the program blocks now.
Step 4: Add a new a new data block (DB) to hold the connection parameters using the TCON_IP_RFC structure.
Step 5: Configure the required Start values for the following parameters which are used for a communication with LE.
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.
Step 7: Add a new Network to your program and add a new Empty box.
Step 8: Select for the box the LE_ISO-on-TCP library.
Step 9: The library will add a Data block. Either accept the default settings or modify them according to your needs.
Step 10: Configure the function block with the respective Inputs and optional outputs.
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. |
Step 11: Compile the porgram and download it to your PLC.
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.
The LE_ISO-on-TCP library has been added to a Siemens PLC program and that program is downloaded onto the PLC and running.
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 1: Open the Litmus Ede User UI with your browser.
Step 2: Navigate to DeviceHub to add a new Device.
Step 3: Add a new device and select "Siemens" for the Device Type.
Step 4: Select as Driver "Siemens ISO-on-TCP".
Step 5: Configure the driver.
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.
Step 7: The device will automatically connect to the PLC.
Step 8: To be able to collect the data, open the Tags panel under DeviceHub.
Step 9: Select the Siemens device you jsut added and press the Add Tag icon.
Step 10: Select the Add a Tag.
Step 11: Add the new Tag by providing the relevant parameters.
Mandatory are: - Value Type -> This is the value type used by DeviceHub. The available options are the Siemens data types:
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.
The address used is taken from the DB in TIA Portal.
Step 13: It is possible to verify that data are read using the topic and flows.