How-To Guides
DeviceHub Guides

Use the Siemens S7 Browse Agent

11min

With the Siemens S7 Browse Agent, you can export tags and variables from a TIA Portal project and import them into Litmus Edge. The agent will export all input (I), output (Q), and memory (M) tags from the tag table and tags from all non-optimized data blocks. See Tag Data Type Conversions to learn more.

Before You Begin

  • Create a TIA Portal project that includes the S7 PLC that you want to add to DeviceHub. The project should have only one PLC. If you have more than one PLC in your project, create copies of your project with only PLC in each project and run the agent separately for each project.
  • Go to the Litmus Central Portal and download the corresponding agent for your version of TIA Portal.
  • If the TIA Portal project is open, close the project.
  • Follow the steps below to enable TIA Openness.

Enable TIA Openness

  1. Type lusrmgr.msc in the start menu and press Enter. The local user management console opens.
  2. Click Groups. Then, right-click Siemens TIA Openness and select Add to Group... The Siemens TIA Openness Properties window opens.

    lusrmgr window
    lusrmgr window
    
  3. On the Siemens TIA Openness Properties window, click Add... The Select Users window opens.

    Adding the user to the Siemens TIA Openness group
    Adding the user to the Siemens TIA Openness group
    
  4. On the Select Users window, click Advanced. Another window titled Select Users opens.
  5. Click Find Now in the new window. The search results populate. Find your Windows user, select it, then click OK. The new Select Users window closes, and the original Select Users window now shows your user name.

    Select Users window
    Select Users window
    
  6. Click OK. The original Select Users window closes.
  7. On the Siemens TIA Openness Properties window, click Apply.
  8. Close the remaining windows, log out of Windows, and then log back in.

Use the Siemens S7 Browse Agent

Using the Siemens S7 Browse Agent includes the following tasks:

  • Step 1: Add Siemens S7 Device to DeviceHub
  • Step 2: Extract the Siemens S7 Browse Agent
  • Step 3: Copy the Library File
  • Step 4: Create an API Key
  • Step 5: Configure the Siemens S7 Browse Agent
  • Step 6: Export Tags to CSV File
  • Step 7: Upload Tags to Litmus Edge

Step 1: Add Siemens S7 Device to DeviceHub

  1. In Litmus Edge, navigate to DeviceHub > Devices.
  2. Click the Connect a Device box. The Connect Device dialog box appears.

    Connect a Device box
    Connect a Device box
    
  3. In the Device Type drop-down list, select Siemens.
  4. In the Driver Name drop-down list, select Siemens S7 or Siemens S7-Advanced (Gen1).
  5. Configure the parameters for the device. See Connect a Device and Siemens S7 or Siemens S7-Advanced (Gen1) to learn more.
  6. Copy the name you gave to the device and paste it somewhere for reference later.

Step 2: Extract the Siemens S7 Browse Agent

  1. In Windows Explorer, extract the contents of the downloaded zip file.
  2. Open the extracted folders until you view the files ExportCSV.16.exe and litmus.siemens.dll.

Step 3: Copy the Library File

  1. Locate the file Siemens.Engineering.dll in your program installation folder.
    • If you have TIA Portal V15, it is located in Program Files > Siemens > Automation > Portal V15 > Public API > V15.
    • If you have TIA Portal V15.1, it is located in Program Files > Siemens > Automation > Portal V15_1 > Public API > V15_1.
    • If you have TIA Portal V16, it is located in Program Files > Siemens > Automation > Portal V16 > Public API > V16.
  2. Copy Siemens.Engineering.dll.
  3. Paste the file into the Siemens S7 Browse Agent folder, next to the .exe file and litmus.siemens.dll.

Step 4: Create an API Key

This is an optional step which allows the Siemens S7 Browse Agent to upload the tag CSV file to Litmus Edge.

To create an AP key:

  1. Navigate to System > Tokens.
  2. In the REST API Keys section, click the Add REST API Key icon.
  3. Enter a name for the token in the Key Name field, and then click Create API Key.
  4. In the Value column for the key, click the Copy icon and paste it somewhere for reference later.

Step 5: Configure the Siemens S7 Browse Agent

  1. From the V16 folder, double-click the ExportCSV.16.exe file to open the agent. The DeviceHub Automated Tag Generation dialog box appears.
  2. Click the Project Diff File Browse icon and navigate to your TIA Portal project. The default save file path is Documents > Automation > Project_Name > Project_Name.ap16, where Project_Name is the name you gave your project.
  3. Select the project file and click Open.
  4. Click the CSV File Browse icon, navigate to the folder you want to store the CSV file, enter v15 tags in the File Name field, and then click Save.
  5. Configure the following parameters:
    • DeviceHub Driver: During "Step 1: Add Siemens S7 Device to DeviceHub," if you added a device using the Siemens S7-Advanced (Gen1) driver, select Gen1. If you used the Siemens S7 driver, select Gen2.
    • Device Name: Paste the device name that you copied in "Step 1: Add Siemens S7 Device to DeviceHub."
    • Gateway Address (optional): Enter the Litmus Edge IP Address.
    • API Token (optional): Paste the REST API Key that you copied in "Step 4: Create an API Key."
The Siemens S7 Browse Agent
The Siemens S7 Browse Agent


Step 6: Export Tags to CSV File

  1. From the Siemens S7 Browse Agent dialog box, click Export.
  2. View the Logs pane to see the export process. When the Openness access popup window appears, select Yes or Yes to all to grant access to the agent. This process may take some time. When you see Finished in the Logs pane, the tags are exported to a CSV file.
  3. Navigate to the folder on your hard drive that you designated for the CSV file and confirm it was successfully created.
The Openness access popup
The Openness access popup


Step 7: Upload Tags to Litmus Edge

If you skipped "Step 4: Create an API Key," you will need to upload the tag CSV file from Litmus Edge DeviceHub instead of from the Siemens S7 Browse Agent. See Add Tags to learn more.

  1. From the Siemens S7 Browse Agent dialog box, click Upload.
  2. In Litmus Edge, navigate to DeviceHub > Tags.
  3. Click the Siemens S7 device.
  4. Confirm the tags from the CSV file are successfully uploaded.