![siemens step 7 appliction filename siemens step 7 appliction filename](https://www.askom.pl/WebHelp/Asix_Evo_10/EN/Communication_Drivers_HTML5/S7Opt_pliki/13.jpg)
The whole project webHMI-DataProvider can be downloaded here, it contains:
![siemens step 7 appliction filename siemens step 7 appliction filename](https://instrumentationtools.com/wp-content/uploads/2020/05/GSD-File-installation-in-Simatic-Manager.png)
#Siemens step 7 appliction filename download#
Details about this, can be read in the next article: Logging into Simatic S7-1200 web API using a python client (Part 2) Project Files & Download Hence, an authentication identifier needs to be passed together with either the session.get() or the session.post() method. This means, that the previous designed web API will not be accessible, as well. When access restrictions and user-privileges are configured properly, the user-defined pages hide behind a login form, which will automatically be displayed when accessing the PLC using HTTP/HTTPS. This should not be the case for productive environments, there users and groups with eligible access rights should be defined. The procedure shown above works fine when no access protection for the web server is configured in the PLC. PostData('', 's71212cert.crt', False, False) Security and Access Protection Return("Status Code: " + str(action.status_code)) The following file (api.io) represents my API and allows reading and writing:Īction = session.post(url_api, data=payload, verify=s7certfile) In addition to just read these values, I wanted to be able to change DO0 and DO1 using a http post. temp1 : temperature measured at the analogue input 0 (voltage was converted to temperature in the PLC's user program).temp0 : temperature measured at the analogue input 0 (voltage was converted to temperature in the PLC's user program).In this case I have designed a simple API which responses with a JSON string containing four values: To distinguish between user-defined pages/apps (HTML files) and the API-interface, I decided to not indicate these "JSON" files as HTML files, instead I configured the TIA Portal and the files to be of the file type ".io" (can be seen in the picture above, the TIA Portal allows to define "Files with dynamic content"). The same applies, tag names will be replaced by their current values. The ReST interface can be designed by omitting HTML syntax and instead using "JSON syntax" (or XML, etc.). Now the idea becomes clear: the web server renders the HTML file and replaces the tags with their values. The form "posts" data to the web server to change the tags' valuesĪI 0 (☌): :="webHMIData".webHMI_AI0_TempCels:ĪI 1 (☌): :="webHMIData".webHMI_AI1_TempCels:.:="webHMIData".webHMI_AI0_TempCels: is a tag name inside the PLC, and will be replaced by the web server with the current value when the HTML is rendered (requested by the client).The first two lines are samples for awp-commands and tell the web server that these tags can be written by the user-defined application (through a http/s post, using a form or another client).
![siemens step 7 appliction filename siemens step 7 appliction filename](http://www.automation-sense.com/medias/images/configuration-pg-pc-step7-siemens-2.gif)
#Siemens step 7 appliction filename code#
The following code snipped shows a simple user-defined page, which displays two temperature values and the current states of digital output 0 and digital output 1: The "user-defined pages" are simple HTML files (can also contain JavaScript, CSS, linking to other files, etc.) which contain specific tags (called awp-commands) which correspond to PLC-internal data-blocks. Activating the user-defined pages inside the user program is done by moving the "WWW" data block from the "Instructions" side-pane into the current program block (TIA Portal). The web server can easily be configured in Step 7, by enabling it and adding "user-defined pages". In this case I will introduce a client written in Python using the requests library (and Tkinter to display a GUI). The client which requests data from the S7 web-API can be a web app running on the S7 written in JavaScript but can also be any other client. With a bit of fortunes it can easily be achieved to "configure" the integrated web server to respond with a JSON or XML (or any other text based format) to a http/s request. Therefore, the access to variables and tags inside the PLC is not limited to the S7-1200 native web frontend, it is also possible to develop user-defined pages (or rather web apps) using JavaScript and HTML. The Siemens Simatic S7-1200 PLC comes with an integrated web server which just needs to be activated for the specific project. It is used in web-services and is one possibility to achieve M2M (Machine-to-Machine) communication. ReST (Representational State Transfer) is an often used technique in distributed environments to simplify the data exchange between devices.