Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

55 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PyPLC

Wrapper for python-snap7 library.

Authors

Jaime Alvarez Diaz
email
GitHub Profile

Installation

Install as a package from source files

git clone https://github.com/Jaimead7/PyPLC.git
cd PyPLC
py -m pip install .

Install as a package from pypi

py -m pip install jaimead7-pyplc

Usage

Create a .toml file with the structure descrived in ./docs/examples/plc.toml.

from pathlib import Path
import pyPLC

file_path: Path = Path('./docs/examples/plc.toml')
manager: PyPLC = PyPLC.from_file(file_path)
ret = manager.connect()

ret, value = manager.read_var(var= 'Var1')  # value = 10.5
ret, value = manager.write_var(var= 'Var1', value= 3.4)
ret, value = manager.read_var(var= 'Var1')  # value = 3.4

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

About

Siemens S7 PLCs communication with python-snap7

Resources

Stars

Watchers

Forks

Releases

Used by

Contributors

Languages