This is a simple, Python-based inventory system that incorporates a MicroLogix PLC, a pure Python inventory database, and a Flask webapp. The webapp is used to view, pick, and place inventory items. The Controller
backend leverages pycomm
to interface the PLC and perform the necessary functions.
Virtual environments are recommended. virtualenvwrapper is recommended.
pycomm
isn’t currently Python 3 compatible. Use virtualenvwrapper
to create a compatible virtual environment named “inventory” with the following command:
mkvirtualenv --python=python2.7 inventory
After the venv is created, virtualenvwrapper
should activate it. Note the prompt change to confirm.
git clone --recurse-submodules https://github.com/ephsmith/inventory.git
Assure that the venv is activated and issue the following commands to install package requirements:
cd inventory pip install -r requirements.txt
cd pycomm pip install -e . cd ..
Run this command in the top-level repository dir:
pip install -e .
Run plc-test
from the top-level directory with the inventory venv activated.
python plc-test.py
The current state of the webapp is for development purposes only. To run the webapp, assert that the venv is activated and issue the following commands from the top-level repo dir:
export FLASK_APP=webhouse.py
flask run
Then visit http://127.0.0.1:5000/
in a web browser.