FluidPyPLC


NameFluidPyPLC JSON
Version 0.3.7 PyPI version JSON
download
home_pagehttps://github.com/MrLostInTheInternet/FluidPyPLC
SummaryFluidSim Circuits Analyzer & PLC ST Code Generator
upload_time2024-02-13 18:17:07
maintainer
docs_urlNone
authorMrLostInTheInternet (Eugen Iofciu Vasile)
requires_python
licenseGPLv3
keywords python plc fluidsim structured text plc python codesys circuits pneumatics oleodynamics plc programming
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            <p align="center">
    <h1 align="center">
        🔗 FluidPyPLC
    </h1>
    <p align="center">
    Analyzer of Circuits' Sequences
    <br/>
    PLC ST code Generator <br>
    Ladder Logic converter</p>
</p>

[![Downloads](https://static.pepy.tech/badge/FluidPyPLC)](https://pepy.tech/project/FluidPyPLC)
![PyPI version](https://img.shields.io/pypi/v/FluidPyPLC.svg)
[![Snyk Vulnerabilities](https://snyk.io/advisor/python/FluidPyPLC/badge.svg)](https://snyk.io/advisor/python/FluidPyPLC)
![License](https://img.shields.io/pypi/l/FluidPyPLC.svg)
[![PyPI Downloads](https://img.shields.io/pypi/dd/FluidPyPLC.svg)](https://pypi.org/project/FluidPyPLC/)
[![Downloads](https://static.pepy.tech/badge/FluidPyPLC/month)](https://pepy.tech/project/FluidPyPLC)
![Python Version](https://img.shields.io/pypi/pyversions/FluidPyPLC.svg)

<div align="center">
  <h4>
    <a href="/CONTRIBUTING.md">
      👥 Contributing
    </a>
    <a href="/LICENSE">
      📄License
    </a>
  </h4>
</div>

# Simulation
<p align="center">
    <img alt="UI" src="https://github.com/MrLostInTheInternet/FluidPyPLC/blob/main/assets/newUi.png" style="width:650px" align="left">
    <img alt="FluidSim" src="https://github.com/MrLostInTheInternet/FluidPyPLC/blob/main/assets/FluidSim.gif" style="width:275px;" align="right">
    <img alt="FluidSim" src="https://github.com/MrLostInTheInternet/FluidPyPLC/blob/main/assets/newUI_fluidsim_related.png" style="width:275px;" align="right">
</p>
<br clear="all"/>

# Table of Contents
- [Table of Contents](#table-of-contents)
- [🏁 Getting Started ](#getting-started)
  - [⚙️ Configuration ](#configuration)
  - [⬇️ Installation ](#️installation)
  - [🎈 Usage ](#usage)
  - [⚙️ CODESYS configuration ](#codesys_configuration)
- [📄 License](#license)
- [✍️ Authors ](#️authors)
# 🏁 Getting Started <a name = "getting-started"></a>

FluidPyPLC is an updated version of the previous FluidPy, it is more light and efficient than before. It has new settings and can handle more sequence's cases.
Enjoy the new version.

<h1>What is FluidPyPLC?</h1>
It's a python script that takes any sequence of pistons e.g. A+/B-/B+/A-. It solves all the blocks of the inserted sequence, it draws the Phases' Diagram, and converts the solution in Structured Text for PLCs. The GUI mode will show you the data structure of the sequence, the plc ST code and the plot. You can then copy and paste the ST code in any program you want that reads it, e.g. CODESYS.
(I tried with CODESYS and works)


## ⚙️ Configuration <a name="configuration"></a>
To use this tool you need to install Python and Pip on your computer. For Windows users you can find it [here](https://python.org/downloads) or by using:
```bash
winget install python3 python3-pip
```
For Linux users you can install it via apt:
```bash
sudo apt-get install python3 python3-pip python3-tk
```
## ⬇️ Installation <a name="installation"></a>
Use pip to install FluidPyPLC:
```bash
pip install FluidPyPLC
pip install setuptools
```

Now you need to set a main folder where to save your data, and you need to create there the Plot and the plc folder. You can do it manually or you can use:
```bash
fluidpy --folder path/to/your/folder
```
And FluidPyPLC will create the two folders for you, and change the config.json file "folder_path" to "your folder path".

[+] For Windows Users. If you want an icon to execute the GUI faster -> create a new shortcut and assign the Target:
```bash
Target: fluidpy.exe --gui
```
Windows will automatically locate the fluidpy.exe script in your Python/scripts folder and you can launch the app from your icon now.

If fluidpy.exe is not recognize as a command, you have to add the Python/scripts to your PATH, locate then your Python/scripts folder on your computer, copy the path and add it to the PATH ENV Variables.

[Use my favicon if you want]
## 🎈 Usage <a name="usage"></a>
You can invoke the command from anywhere on your terminal:
```bash
fluidpy
```

To view all the usage's methods use the tags ```--help``` or ```-h```.
 
## ⚙️ CODESYS configuration <a name="codesys_configuration"></a>
[+] To test your PLC's sequence code you can use the plc.py and one of the CONFIGURATION pdfs in the Configurations folder.


[+] If you want to test the code with the CODESYS Visualization, use the plc.bak2.py as plc.py, and the tutorial below. 

In CODESYS you have to create a project. In the project you will have your PLC device, your main application with your main PRG file. To test the ST code you must add a Modbus Serial Device to handle the inputs and outputs of your plc. The Modbus will act as an intermediate between your code and a virtual plc device, like you are setting up the inputs and outputs on a plc in real life.

To do that, open your CODESYS project, go to
```bash
Tools -> CODESYS installer
```
then search for "Modbus" and install the modules required. After that you have to
```bash
right-click your PLC device -> Add device 
```
and then select
```bash
Modbus -> Modbus serial port -> Modbus COM
```
Now that the Modbus COM is added: <br>
```bash
right-click Modbus_COM -> Add device -> Select Modbus -> Modbus serial device -> Modbus Serial Device
```
If you want to rename it you can (e.g. Modbus I/O handler, etc..). <br>
Now <b>right-click it -> Map I/O</b> and finally you can map your inputs and outputs based on the ST code generated by FluidPyPLC. <br>
Now you only have to design your Machine in the visualization file and assign the switches to the limit switches (To test the code, you have to manually change the limit switches as you don't have physical Pneumatic Pistons with physical limit switches). Enjoy your PLC's simulation.

## 🎈 Ladder Logic <a name="LadderLogic"></a>
In the GUI mode you can launch the Ladder Logic Converter and it will create an output.xml file into the main path chosen by you. The .xml file will be in PLCopenXML format ready to be imported into CODESYS.

Things to still add to the code:
- [X] Ladder Logic Converter
- [ ] Automatic Import Button
- [ ] Automatic PLC configuration between CODESYS and FluidSim

# 📄 License <a name = "license"></a>
GPLv3

# ✍️ Authors <a name = "authors"></a>
- [MrLostInTheInternet](https://github.com/MrLostInTheInternet)

<p align="center">
<br>
<a href="https://github.com/MrLostInTheInternet" target='_blank'>
<img height='32' style='border:0px;height:32px;border-radius:.5rem' src='https://img.shields.io/badge/GitHub-100000?style&#x3D;for-the-badge&amp;logo&#x3D;github&amp;logoColor&#x3D;white' border='0'
</a>

<a href="https://youtu.be/aMCsqmX1pOI" target='_blank'>
<img height='32' style='border:0px;height:32px;border-radius:.5rem' src='https://img.shields.io/badge/YouTube-FF0000?style=for-the-badge&logo=youtube&logoColor=white'
border='0'
</a>
    
<p align="center">
thanks to <a href="https://github.com/writeme-project/writeme">writeme</a> for the README template
</p>

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/MrLostInTheInternet/FluidPyPLC",
    "name": "FluidPyPLC",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "python,plc,fluidsim,structured text,plc python,codesys,circuits,pneumatics,oleodynamics,plc programming",
    "author": "MrLostInTheInternet (Eugen Iofciu Vasile)",
    "author_email": "<eugen.iofciuvasile@hotmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/0d/a0/3492b45d4a64163c9ddec903a5818dc3b26f8bdb7502aefbd791cbea36b8/FluidPyPLC-0.3.7.tar.gz",
    "platform": null,
    "description": "<p align=\"center\">\n    <h1 align=\"center\">\n        \ud83d\udd17 FluidPyPLC\n    </h1>\n    <p align=\"center\">\n    Analyzer of Circuits' Sequences\n    <br/>\n    PLC ST code Generator <br>\n    Ladder Logic converter</p>\n</p>\n\n[![Downloads](https://static.pepy.tech/badge/FluidPyPLC)](https://pepy.tech/project/FluidPyPLC)\n![PyPI version](https://img.shields.io/pypi/v/FluidPyPLC.svg)\n[![Snyk Vulnerabilities](https://snyk.io/advisor/python/FluidPyPLC/badge.svg)](https://snyk.io/advisor/python/FluidPyPLC)\n![License](https://img.shields.io/pypi/l/FluidPyPLC.svg)\n[![PyPI Downloads](https://img.shields.io/pypi/dd/FluidPyPLC.svg)](https://pypi.org/project/FluidPyPLC/)\n[![Downloads](https://static.pepy.tech/badge/FluidPyPLC/month)](https://pepy.tech/project/FluidPyPLC)\n![Python Version](https://img.shields.io/pypi/pyversions/FluidPyPLC.svg)\n\n<div align=\"center\">\n  <h4>\n    <a href=\"/CONTRIBUTING.md\">\n      \ud83d\udc65 Contributing\n    </a>\n    <a href=\"/LICENSE\">\n      \ud83d\udcc4License\n    </a>\n  </h4>\n</div>\n\n# Simulation\n<p align=\"center\">\n    <img alt=\"UI\" src=\"https://github.com/MrLostInTheInternet/FluidPyPLC/blob/main/assets/newUi.png\" style=\"width:650px\" align=\"left\">\n    <img alt=\"FluidSim\" src=\"https://github.com/MrLostInTheInternet/FluidPyPLC/blob/main/assets/FluidSim.gif\" style=\"width:275px;\" align=\"right\">\n    <img alt=\"FluidSim\" src=\"https://github.com/MrLostInTheInternet/FluidPyPLC/blob/main/assets/newUI_fluidsim_related.png\" style=\"width:275px;\" align=\"right\">\n</p>\n<br clear=\"all\"/>\n\n# Table of Contents\n- [Table of Contents](#table-of-contents)\n- [\ud83c\udfc1 Getting Started ](#getting-started)\n  - [\u2699\ufe0f Configuration ](#configuration)\n  - [\u2b07\ufe0f Installation ](#\ufe0finstallation)\n  - [\ud83c\udf88 Usage ](#usage)\n  - [\u2699\ufe0f CODESYS configuration ](#codesys_configuration)\n- [\ud83d\udcc4 License](#license)\n- [\u270d\ufe0f Authors ](#\ufe0fauthors)\n# \ud83c\udfc1 Getting Started <a name = \"getting-started\"></a>\n\nFluidPyPLC is an updated version of the previous FluidPy, it is more light and efficient than before. It has new settings and can handle more sequence's cases.\nEnjoy the new version.\n\n<h1>What is FluidPyPLC?</h1>\nIt's a python script that takes any sequence of pistons e.g. A+/B-/B+/A-. It solves all the blocks of the inserted sequence, it draws the Phases' Diagram, and converts the solution in Structured Text for PLCs. The GUI mode will show you the data structure of the sequence, the plc ST code and the plot. You can then copy and paste the ST code in any program you want that reads it, e.g. CODESYS.\n(I tried with CODESYS and works)\n\n\n## \u2699\ufe0f Configuration <a name=\"configuration\"></a>\nTo use this tool you need to install Python and Pip on your computer. For Windows users you can find it [here](https://python.org/downloads) or by using:\n```bash\nwinget install python3 python3-pip\n```\nFor Linux users you can install it via apt:\n```bash\nsudo apt-get install python3 python3-pip python3-tk\n```\n## \u2b07\ufe0f Installation <a name=\"installation\"></a>\nUse pip to install FluidPyPLC:\n```bash\npip install FluidPyPLC\npip install setuptools\n```\n\nNow you need to set a main folder where to save your data, and you need to create there the Plot and the plc folder. You can do it manually or you can use:\n```bash\nfluidpy --folder path/to/your/folder\n```\nAnd FluidPyPLC will create the two folders for you, and change the config.json file \"folder_path\" to \"your folder path\".\n\n[+] For Windows Users. If you want an icon to execute the GUI faster -> create a new shortcut and assign the Target:\n```bash\nTarget: fluidpy.exe --gui\n```\nWindows will automatically locate the fluidpy.exe script in your Python/scripts folder and you can launch the app from your icon now.\n\nIf fluidpy.exe is not recognize as a command, you have to add the Python/scripts to your PATH, locate then your Python/scripts folder on your computer, copy the path and add it to the PATH ENV Variables.\n\n[Use my favicon if you want]\n## \ud83c\udf88 Usage <a name=\"usage\"></a>\nYou can invoke the command from anywhere on your terminal:\n```bash\nfluidpy\n```\n\nTo view all the usage's methods use the tags ```--help``` or ```-h```.\n \n## \u2699\ufe0f CODESYS configuration <a name=\"codesys_configuration\"></a>\n[+] To test your PLC's sequence code you can use the plc.py and one of the CONFIGURATION pdfs in the Configurations folder.\n\n\n[+] If you want to test the code with the CODESYS Visualization, use the plc.bak2.py as plc.py, and the tutorial below. \n\nIn CODESYS you have to create a project. In the project you will have your PLC device, your main application with your main PRG file. To test the ST code you must add a Modbus Serial Device to handle the inputs and outputs of your plc. The Modbus will act as an intermediate between your code and a virtual plc device, like you are setting up the inputs and outputs on a plc in real life.\n\nTo do that, open your CODESYS project, go to\n```bash\nTools -> CODESYS installer\n```\nthen search for \"Modbus\" and install the modules required. After that you have to\n```bash\nright-click your PLC device -> Add device \n```\nand then select\n```bash\nModbus -> Modbus serial port -> Modbus COM\n```\nNow that the Modbus COM is added: <br>\n```bash\nright-click Modbus_COM -> Add device -> Select Modbus -> Modbus serial device -> Modbus Serial Device\n```\nIf you want to rename it you can (e.g. Modbus I/O handler, etc..). <br>\nNow <b>right-click it -> Map I/O</b> and finally you can map your inputs and outputs based on the ST code generated by FluidPyPLC. <br>\nNow you only have to design your Machine in the visualization file and assign the switches to the limit switches (To test the code, you have to manually change the limit switches as you don't have physical Pneumatic Pistons with physical limit switches). Enjoy your PLC's simulation.\n\n## \ud83c\udf88 Ladder Logic <a name=\"LadderLogic\"></a>\nIn the GUI mode you can launch the Ladder Logic Converter and it will create an output.xml file into the main path chosen by you. The .xml file will be in PLCopenXML format ready to be imported into CODESYS.\n\nThings to still add to the code:\n- [X] Ladder Logic Converter\n- [ ] Automatic Import Button\n- [ ] Automatic PLC configuration between CODESYS and FluidSim\n\n# \ud83d\udcc4 License <a name = \"license\"></a>\nGPLv3\n\n# \u270d\ufe0f Authors <a name = \"authors\"></a>\n- [MrLostInTheInternet](https://github.com/MrLostInTheInternet)\n\n<p align=\"center\">\n<br>\n<a href=\"https://github.com/MrLostInTheInternet\" target='_blank'>\n<img height='32' style='border:0px;height:32px;border-radius:.5rem' src='https://img.shields.io/badge/GitHub-100000?style&#x3D;for-the-badge&amp;logo&#x3D;github&amp;logoColor&#x3D;white' border='0'\n</a>\n\n<a href=\"https://youtu.be/aMCsqmX1pOI\" target='_blank'>\n<img height='32' style='border:0px;height:32px;border-radius:.5rem' src='https://img.shields.io/badge/YouTube-FF0000?style=for-the-badge&logo=youtube&logoColor=white'\nborder='0'\n</a>\n    \n<p align=\"center\">\nthanks to <a href=\"https://github.com/writeme-project/writeme\">writeme</a> for the README template\n</p>\n",
    "bugtrack_url": null,
    "license": "GPLv3",
    "summary": "FluidSim Circuits Analyzer & PLC ST Code Generator",
    "version": "0.3.7",
    "project_urls": {
        "Homepage": "https://github.com/MrLostInTheInternet/FluidPyPLC"
    },
    "split_keywords": [
        "python",
        "plc",
        "fluidsim",
        "structured text",
        "plc python",
        "codesys",
        "circuits",
        "pneumatics",
        "oleodynamics",
        "plc programming"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "cfd3914abb175899167a4871b7867915322440b8c76d03748ee039b4add8ddef",
                "md5": "3964eccad5bf4e692e3d3d200bf5517c",
                "sha256": "da2393b1514440995f44d92dd7a8e2d05a901579c6d8dae868c20f817ba65f1b"
            },
            "downloads": -1,
            "filename": "FluidPyPLC-0.3.7-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "3964eccad5bf4e692e3d3d200bf5517c",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 32046,
            "upload_time": "2024-02-13T18:17:04",
            "upload_time_iso_8601": "2024-02-13T18:17:04.806736Z",
            "url": "https://files.pythonhosted.org/packages/cf/d3/914abb175899167a4871b7867915322440b8c76d03748ee039b4add8ddef/FluidPyPLC-0.3.7-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "0da03492b45d4a64163c9ddec903a5818dc3b26f8bdb7502aefbd791cbea36b8",
                "md5": "fd4a52f801639aceb7fac5c7c4121512",
                "sha256": "d4fd7d03e27d8b19966c3e745d37d437605358c9746e0cbbdd87b66fa4af7975"
            },
            "downloads": -1,
            "filename": "FluidPyPLC-0.3.7.tar.gz",
            "has_sig": false,
            "md5_digest": "fd4a52f801639aceb7fac5c7c4121512",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 32134,
            "upload_time": "2024-02-13T18:17:07",
            "upload_time_iso_8601": "2024-02-13T18:17:07.265635Z",
            "url": "https://files.pythonhosted.org/packages/0d/a0/3492b45d4a64163c9ddec903a5818dc3b26f8bdb7502aefbd791cbea36b8/FluidPyPLC-0.3.7.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-02-13 18:17:07",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "MrLostInTheInternet",
    "github_project": "FluidPyPLC",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "fluidpyplc"
}
        
Elapsed time: 0.19685s