Pages

Saturday, April 25, 2015

Raspberry Pi SCADA: Communitating with S7-200 Using Python

Since the S7-200 is a bit different then the newer S7-1500/S7-1200 PLCs it took a bit of work to get it working. The python-snap7 library was missing the connection method for the old TSAP method of connecting. So I forked the library and added the missing function to connect. I did a pull request to get it merged back with the original and it's pending currently. Here is the link to the forked library:https://github.com/SimplyAutomationized/python-snap7

I've also been working on a din rail enclosure for the pi that wasn't so large. I'm going to be adding a 24vdc to 5vdc dc-dc converter to the enclosure it so I don't have to bring in usb to it.

Anyway back to the good stuff. I added the Cli_Connection in the Client.py library so the code will now be as follows: