Skip to main content

🔗 FluidPyPLC

Analyzer of Circuits' Sequences
PLC ST code Generator
Ladder Logic converter

Downloads PyPI version Snyk Vulnerabilities License PyPI Downloads 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

Release files for FluidPyPLC 0.3.7

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for FluidPyPLC 0.3.7
File Size Uploaded
FluidPyPLC-0.3.7.tar.gz 32.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for FluidPyPLC 0.3.7
File Interpreter ABI Platform
FluidPyPLC-0.3.7-py3-none-any.whl Python 3 none any Details

Total release size: 64.2 kB

Release files / FluidPyPLC-0.3.7.tar.gz

Download URL FluidPyPLC-0.3.7.tar.gz
Size 32.1 kB
Tags Source
SHA-256 checksum
How to use checksums
d4fd7d03e27d8b19966c3e745d37d437605358c9746e0cbbdd87b66fa4af7975
BLAKE2b-256 checksum
How to use checksums
0da03492b45d4a64163c9ddec903a5818dc3b26f8bdb7502aefbd791cbea36b8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.12.2

Release files / FluidPyPLC-0.3.7-py3-none-any.whl

Download URL FluidPyPLC-0.3.7-py3-none-any.whl
Size 32.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
da2393b1514440995f44d92dd7a8e2d05a901579c6d8dae868c20f817ba65f1b
BLAKE2b-256 checksum
How to use checksums
cfd3914abb175899167a4871b7867915322440b8c76d03748ee039b4add8ddef
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.12.2

Release history Release notifications | RSS feed

This release

0.3.7 This release

2 release files

0.3.6

2 release files

0.3.4

2 release files

0.3.2

2 release files

0.1.10

2 release files

0.1.9

2 release files

0.1.8

2 release files

0.1.7

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page