FluidSim Circuits Analyzer & PLC ST Code Generator
Project description
🔗 FluidPyPLC
Analyzer of Circuits' Sequences
PLC ST code Generator
Ladder Logic converter
Simulation
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
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file FluidPyPLC-0.3.7.tar.gz
.
File metadata
- Download URL: FluidPyPLC-0.3.7.tar.gz
- Upload date:
- Size: 32.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.12.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d4fd7d03e27d8b19966c3e745d37d437605358c9746e0cbbdd87b66fa4af7975 |
|
MD5 | fd4a52f801639aceb7fac5c7c4121512 |
|
BLAKE2b-256 | 0da03492b45d4a64163c9ddec903a5818dc3b26f8bdb7502aefbd791cbea36b8 |
File details
Details for the file FluidPyPLC-0.3.7-py3-none-any.whl
.
File metadata
- Download URL: FluidPyPLC-0.3.7-py3-none-any.whl
- Upload date:
- Size: 32.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.12.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | da2393b1514440995f44d92dd7a8e2d05a901579c6d8dae868c20f817ba65f1b |
|
MD5 | 3964eccad5bf4e692e3d3d200bf5517c |
|
BLAKE2b-256 | cfd3914abb175899167a4871b7867915322440b8c76d03748ee039b4add8ddef |