Sign inSign up

th0masis/mappdatabase

By th0masis

•Updated 11 months ago

Image
0

403

th0masis/mappdatabase repository overview

⁠Overview

mappDatabase establishes a connection between B&R PLC and database systems. It can be used to retrieve, update, delete
information, and much more. Supports MySQL, MSSQL, and PostgreSQL databases.

More information about mappDatabase: BR help⁠

⁠Quick Start

Get started with a minimal working example:

docker run --name mappdb -d -p 85:85 th0masis/mappdatabase:latest

⁠Deploy Container

The mappDatabase port must be exposed because it enables communication with the PLC. Different database types use different default ports.

PostgreSQL Example (Default)

  docker run --name mappdatabase-01 --restart=always -d -p 85:85 -p 5432:5432 -e DB_PORT=5432 -e DB_HOST=localhost -e POLL_INTERVAL=20 th0masis/mappdatabase:latest

MySQL on Same Machine

If the database is on the same machine as the Docker container, you don't need to expose the MySQL port (3306):

  docker run --restart=always --name mappdatabase-01 -d -p 86:85 -e DB_TYPE=mysql -e POLL_INTERVAL=60 th0masis/mappdatabase:5_12

MySQL on Remote Machine

If the database is on a remote machine, you need to expose the port for the container:

  docker run --restart=always --name mappdatabase-01 -d -p 85:85 -p 3306:3306 -e DB_HOST=192.168.1.123 -e DB_TYPE=mysql -e POLL_INTERVAL=60 th0masis/mappdatabase:5_12

Automation Studio 6 Example

The 6_0 version is compatible with B&R Automation Studio 6:

  docker run --name mappdatabase-01 --restart=always -d -p 55002:85 -e DB_HOST=localhost -e POLL_INTERVAL=20 th0masis/mappdatabase:6_0
⁠Configuration

Environment Variables - Version 5_12

VariableDefault ValueDescription
APP_PORT85Port for mappDatabase in PLC
DB_HOSTlocalhostHostname or IP address of the database server
DB_PORT3306Port of the database server
DB_TYPEmysqlDatabase type: mysql, mssql, or postgres
POLL_INTERVAL60Interval (seconds) for polling the database

Environment Variables - Version 6

VariableDefault ValueDescription
APP_PORT85Port for mappDatabase in PLC
DB_HOSTlocalhostHostname or IP address of the database server
DB_PORT3306Port of the database server
POLL_INTERVAL60Interval (seconds) for polling the database

Note: Version 6 does not support the DB_TYPE environment variable.

⁠Version Notes

  • 5_12: Compatible with Automation Studio 5, supports multiple database types (MySQL, MSSQL, PostgreSQL)
  • 6_0: Compatible with Automation Studio 6
  • 6_0.1: Compatible with Automation Studio 6, solved bug - ms sql driver
  • 6_4:The script updated outdated Python modules

Tag summary

Content type

Image

Digest

sha256:cff3a513f…

Size

48.8 MB

Last updated

11 months ago

docker pull th0masis/mappdatabase