Code Monkey home page Code Monkey logo

siemens-plc-s7__py's Introduction

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

siemens-plc-s7__py's People

Contributors

peymanmajidi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.