3/26/2023 11:03 AM | |
Joined: 2/6/2022 Last visit: 10/31/2024 Posts: 50 Rating: (4) |
In this example we will use XMLRPC call to access Siemens LOGO. The Twisted module for python is a event-driven network Engine. Able to run as an event-loop application. Meaning we could access Siemens LOGO from request and response API. In the example we will write to memory bit V1107.4 in other words 'm29' in LOGOComfort. HOW_TO_SETUP We make s7 server that include m29 and q1. The server use TSAP:02.00, client use TSAP:03.00 To make a XMLRPC server in Python we will use Twisted a module for python. We also need to include python-snap7 to connect to Siemens LOGO. The server use port: 7080 so make sure that one is not busy or change it to something else. The method name is 'logo_write' and the parameter is a dictionary of key and value. ex. m29:0 or m29:1 In other words the key is 'm29' and the value is a boolean of 0 or 1. The python code only show how it works. The code have been running on Python 3.9 The example use XMLRPC call but the same approach could also be done with JSON-RPC. And also in other frameworks like NodeJS if the implemitation is JavaScript language. If you need a client to make XMLRPC call you could use postman https://www.postman.com/
I'm macOS user so I also include a AppleScript that could make XMLRPC call.
Here is 'hello world' for Siemens LOGO :)
|
Last edited by: FredrikS7 at: 03/26/2023 11:05:24Last edited by: FredrikS7 at: 03/26/2023 11:06:47Last edited by: FredrikS7 at: 03/26/2023 11:09:23Last edited by: FredrikS7 at: 03/26/2023 11:10:02Last edited by: FredrikS7 at: 03/26/2023 11:31:10Last edited by: FredrikS7 at: 03/26/2023 11:55:02Last edited by: FredrikS7 at: 03/26/2023 12:02:50Last edited by: FredrikS7 at: 03/26/2023 16:20:30Last edited by: FredrikS7 at: 03/26/2023 16:21:33Last edited by: FredrikS7 at: 03/26/2023 16:52:07 |
|
Follow us on