Skip to content
This repository has been archived by the owner on Sep 22, 2022. It is now read-only.

peymanmajidi/Siemens-PLC-s7__Py

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Siemens PLC s7 | PYTHON

Simple write and read on plc s7

What you need

plc

You should download following link: wget http://sourceforge.net/projects/snap7/files/1.2.1/snap7-full-1.2.1.tar.gz/download or I put this version on 📂OS/

  • On Debian-base OS:
tar -zxvf snap7-full-1.2.1.tar.gz
cd snap7-full-1.2.1/build/unix && sudo make -f arm_v6_linux.mk all
sudo cp ../bin/arm_v6-linux/libsnap7.so /usr/lib/libsnap7.so
sudo cp ../bin/arm_v6-linux/libsnap7.so /usr/local/lib/libsnap7.so
sudo apt-get install python3-pip
sudo pip3 install python-snap7
sudo ldconfig
  • On Windows Only copy files on 📂OS/ to System32 folder Here is the code:
import snap7

plc = snap7.client.Client()
plc.connect('192.168.2.100', 0, 1)

How to Connect to SQL server via Command line (shell)

tsql -H 192.168.2.82 -U 'sa' -P '123456789' -p 1433

List all of the tables

sp_help # end withs 'user table' or you can use Sql Server Operation Studio Microsoft SQLSOS Dowload Link

Mount a network folder (windows share)

sudo apt-get install cifs-utils # only first time make sure this utility is installed
sudo mount -t cifs //192.168.1.10/sharedfolder ./path/to/mount/ -o username=peyman,password=1234567890

Screenshot)

Happy Codding 🍓

Peyman Majidi

About

write and read double word on plc s7 | Python

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages