Skip to main content

FluidSim Circuits Analyzer & PLC ST Code Generator

Project description

🔗 FluidPyPLC

Analyzer of Circuits' Sequences. PLC ST code Generator
Updated version of FluidPy

Downloads PyPI version Snyk Vulnerabilities License Downloads Python Version

Simulation

UI FluidSim FluidSim


Table of Contents

🏁 Getting Started

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.

What is FluidPyPLC?

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

To use this tool you need to install Python and Pip on your computer. For Windows users you can find it here or by using:

winget install python3 python3-pip

For Linux users you can install it via apt:

sudo apt-get install python3 python3-pip python3-tk

⬇️ Installation

Use pip to install FluidPyPLC:

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:

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:

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

You can invoke the command from anywhere on your terminal:

fluidpy

To view all the usage's methods use the tags --help or -h.

⚙️ CODESYS configuration

[+] 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

Tools -> CODESYS installer

then search for "Modbus" and install the modules required. After that you have to

right-click your PLC device -> Add device 

and then select

Modbus -> Modbus serial port -> Modbus COM

Now that the Modbus COM is added:

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..).
Now right-click it -> Map I/O and finally you can map your inputs and outputs based on the ST code generated by FluidPyPLC.
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

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:

  • Ladder Logic Converter
  • Automatic Import Button
  • Automatic PLC configuration between CODESYS and FluidSim

📄 License

GPLv3

✍️ Authors


thanks to writeme for the README template

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

FluidPyPLC-0.3.4.tar.gz (31.2 kB view details)

Uploaded Source

Built Distribution

FluidPyPLC-0.3.4-py3-none-any.whl (31.3 kB view details)

Uploaded Python 3

File details

Details for the file FluidPyPLC-0.3.4.tar.gz.

File metadata

  • Download URL: FluidPyPLC-0.3.4.tar.gz
  • Upload date:
  • Size: 31.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.12.1

File hashes

Hashes for FluidPyPLC-0.3.4.tar.gz
Algorithm Hash digest
SHA256 2171d725c0429800b7fa7d07d6988a4bb5bd935afd9f91e51a94125ba6f55c0d
MD5 165baf3edc1fa0885ed51185be91c8da
BLAKE2b-256 e60c6983789e9311b70b35760a2ff74b887899f206536ec1243ed1b47324f9d4

See more details on using hashes here.

File details

Details for the file FluidPyPLC-0.3.4-py3-none-any.whl.

File metadata

  • Download URL: FluidPyPLC-0.3.4-py3-none-any.whl
  • Upload date:
  • Size: 31.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.12.1

File hashes

Hashes for FluidPyPLC-0.3.4-py3-none-any.whl
Algorithm Hash digest
SHA256 f409d6244428750d37486f7a420db1f5f247734ae0d848dee8be9bfb5ad8688d
MD5 28fd89e824b44b468e98296e8b91f1f6
BLAKE2b-256 14c70317721bf1cf61f81f08334461c5ed374e184b8c91941c427f650313a16b

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page