Use the Siemens S7 Browse Agent
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.
- 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.
- Type lusrmgr.msc in the start menu and press Enter. The local user management console opens.
Click Groups. Then, right-click Siemens TIA Openness and select Add to Group... The Siemens TIA Openness Properties window opens.
On the Siemens TIA Openness Properties window, click Add... The Select Users window opens.
- On the Select Users window, click Advanced. Another window titled Select Users opens.
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.
- Click OK. The original Select Users window closes.
- On the Siemens TIA Openness Properties window, click Apply.
- Close the remaining windows, log out of Windows, and then log back in.
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
- In Litmus Edge, navigate to DeviceHub > Devices.
Click the Connect a Device box. The Connect Device dialog box appears.
- In the Device Type drop-down list, select Siemens.
- In the Driver Name drop-down list, select Siemens S7 or Siemens S7-Advanced (Gen1).
- Configure the parameters for the device. See Connect a Device and Siemens S7 or Siemens S7-Advanced (Gen1) to learn more.
- Copy the name you gave to the device and paste it somewhere for reference later.
- In Windows Explorer, extract the contents of the downloaded zip file.
- Open the extracted folders until you view the files ExportCSV.16.exe and litmus.siemens.dll.
- 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.
- Copy Siemens.Engineering.dll.
- Paste the file into the Siemens S7 Browse Agent folder, next to the .exe file and litmus.siemens.dll.
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:
- Navigate to System > Tokens.
- In the REST API Keys section, click the Add REST API Key icon.
- Enter a name for the token in the Key Name field, and then click Create API Key.
- In the Value column for the key, click the Copy icon and paste it somewhere for reference later.
- From the V16 folder, double-click the ExportCSV.16.exe file to open the agent. The DeviceHub Automated Tag Generation dialog box appears.
- 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.
- Select the project file and click Open.
- 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.
- 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."
- From the Siemens S7 Browse Agent dialog box, click Export.
- 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.
- Navigate to the folder on your hard drive that you designated for the CSV file and confirm it was successfully created.
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.
- From the Siemens S7 Browse Agent dialog box, click Upload.
- In Litmus Edge, navigate to DeviceHub > Tags.
- Click the Siemens S7 device.
- Confirm the tags from the CSV file are successfully uploaded.