This project is based on python, codesys and postgresql, and runs on Windows 10.
After installing python3.8, create a virtual environment using the commands
python -m virtualenv venv
.\venv\Scripts\activate
Note: Powershell should allow to run scripts to perform the previous commands. If that happens, follow this link.
After setting up the virtual environment run the file requirements.txt
python -m pip install -r requirements.txt
It is possible to change the MES to interact with the PLC, the database and the UDP as long as they all share the same network. Under the file directory, the config.json
should be changed with the IP of the machine running the respective service.
Note: All the arguments should be written surrounded by double quotation marks ("")
Run the following command in the virtual environment's terminal on the source directory:
python .\Main.py
Select the terminal running the MES and press Ctrl
+Fn
+b
or Ctrl
+Break
In order to install docker on windows please download the latest docker toolbox .exe release from the official repo.
Notes: You need to have Intel VT-x or AMD-V hardware virtualization enabled or the instalation will fail. If this happens, please enable it in your computers's BIOS and retry.
- Run the installer using the full instalation configuration and remember to tick the option to install VirtualBox.
- Run the Docker Quickstart Terminal shortcut and wait for the setup to finish.
- Open the Docker Quickstart Terminal or whichever shell you prefer (admin access may be needed)
- Navigate to the /II_project/db directory
- Run:
docker-compose up -d
- After the containers are created you can check on them using:
docker ps
- Oracle VM VirtualBox should be installed by default after installing docker. Run the application
- Open the settigns and navigate to the Network tab
- Open Port Forwading under the Advanced options
- Create 2 new rules like the following
Name: pqadmin, Host Port: 5050, Guest Port: 5050
Name: postgres, Host Port: 5432, Guest Port: 5432
You can now access the PgAdmin webpage by going to your prefered browser and entering the following adress:
<YOUR-DOCKER-MACHINE-IP>:5050
Where your <YOUR-DOCKER-MACHINE-IP>
is usually by default 192.168.99.100
if not, you can check it by running docker-machine ip
on the shell.
User: ii@project.com
Password: ii_project
User: ii
Password: ii_project
To delete all containers and data run:
docker-compose down --volumes
or docker-compose down -v