Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1

TOPIC: dB information help-learning

dB information help-learning 5 years 5 months ago #9916

  • cdahl7
  • cdahl7's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 9
  • Karma: 0
I understand control a lot better than software, but I'm trying to change that. I'm taking a DB class in school right now and historically working in controls. I haven't used proview, but it is something that has always remained in the back of mind to want to learn more about and use if presented the option. Being that it is open source, I think is a good option for learning. I'm trying to understand better how the databases work in Proview. like 10,000 ft view. Maybe if I have time, I will try and dig through source code, but I really need a high level overview.

I understand there is the workbench database (configuration database). It is typically a Berklee DB database. The database is a tree structure of objects. Are tree of objects then represented in native XML files? And the XML files are modified with the application as user modifies there volumes?

I know storage station uses mysql, but the designer guide also makes it seem like you can use a mysql database for the workbench
Is that true? Does the application automatically know you are using a mysql database and the application can automatically handle this in the backend? If you use mysql does the application just create XML documents at every save point and dump the XML documents into Mysql? Is there a way to modify objects in the mysql DB and write back to Preview (XML?) What are main pros/cons of using Berklee vs Mysql as workbench?

I understand that the rtdb is generated from the workbench. Is the rtdb also a berklee DB? How does using mysql as workbench affect this process?

Is there more information somewhere about the databases that someone can point me to?

Real world example...Let's say theoretically, I need to program a new plant. I have signal data and some basic control narrative information in a spreadsheet (like how each signal is related to equipment e.g. signal is open limit on discrete valve,etc...) from engineering design contractor that needs to be transformed into a control program. Now, I wanted to be able to manipulate/create plant objects in bulk (say in creating a new plant database with 3000 signals/channels and 2000 PLC objects (to control those signals). Rather than using the GUI, what is the best route to get data into preview in bulk? Is writing scripts to generate XML documents directly the best option? What if you use Mysql as the DB? Can you create your classes, open the mysql db in mysql workbench and perform a series of manipulations (queries/joins/imports...) to input the spreadsheet data into mysql and then generate the XML back to preview? Is there a better way to handle bulk configuration changes/creation? Is there any built in tools to assist in this?
The administrator has disabled public write access.

dB information help-learning 5 years 5 months ago #9918

  • barnes
  • barnes's Avatar
  • OFFLINE
  • Expert Boarder
  • Posts: 92
  • Karma: 0
I installed Mysql on my development computer to get an idea how the database works.
I dont know if this helps but here is some output from Mysql.

Proview sets up the Mysql database automatically.

Try looking at the design guide pdf on the web site. It has an explanation of the storage station installation.


mysql> show databases;
+
+
| Database |
+
+
| information_schema |
| mysql |
| performance_schema |
| pwrp__hscada |
+
+
5 rows in set (0.00 sec)

mysql> use pwrp__hscada;

Database changed
mysql> show tables;
+
+
| Tables_in_pwrp__hscada |
+
+
| O000_001_001_001_0000002a__1 |
| O000_001_001_001_0000006e__2 |
| O000_001_001_001_000000a0__3 |
| O000_001_001_001_000000a1__4 |
| O000_001_001_001_000000e7__6 |
| O000_001_001_001_000000f7__5 |
| O000_001_001_001_000000fe__7 |
| O000_001_001_001_000001c7__8 |
| O000_001_001_001_000001c8__9 |
| O000_001_001_001_000001c9__10 |
| O000_001_001_001_000001ca__11 |
| O000_001_001_001_000001cb__12 |
| O000_001_001_001_000001cc__13 |
| O000_001_001_001_000001ce__14 |
| O000_001_001_001_000001cf__15 |
| O000_001_001_001_00000269__16 |
| O000_001_001_001_0000026a__17 |
| O000_001_001_001_0000026b__18 |
| O000_001_001_001_0000026c__19 |
| items |
| objectitemattributes |
| objectitems |
| sev_stat |
| sev_version |
+
+
24 rows in set (0.00 sec)

mysql> select tablename, oname from items;
+
+
+
| tablename | oname |
+
+
+
| O000_001_001_001_0000002a__1 | VolHscada:H1-ServicePPITemperature |
| O000_001_001_001_0000006e__2 | VolHscada:H1-ServicePHeaterON |
| O000_001_001_001_000000a0__3 | VolHscada:H1-FW0_TX_Rate |
| O000_001_001_001_000000a1__4 | VolHscada:H1-FW0_RX_Rate |
| O000_001_001_001_000000f7__5 | VolHscada:H1-PILightsON |
| O000_001_001_001_000000e7__6 | VolHscada:H1-PITemperature |
| O000_001_001_001_000000fe__7 | VolHscada:H1-PIHeaterON |
| O000_001_001_001_000001c7__8 | VolHscada:H1-FuelTankLevel |
| O000_001_001_001_000001c8__9 | VolHscada:H1-InsideTemp |
| O000_001_001_001_000001c9__10 | VolHscada:H1-OutsideTemp |
| O000_001_001_001_000001ca__11 | VolHscada:H1-TraceCurrent |
| O000_001_001_001_000001cb__12 | VolHscada:H1-FreezerTemperature |
| O000_001_001_001_000001cc__13 | VolHscada:H1-WellPressure01 |
| O000_001_001_001_000001ce__14 | VolHscada:H1-WellDiffPressure |
| O000_001_001_001_000001cf__15 | VolHscada:H1-Current |
| O000_001_001_001_00000269__16 | VolHscada:H1-CWellPipeTemp |
| O000_001_001_001_0000026a__17 | VolHscada:H1-CBasementTemp |
| O000_001_001_001_0000026b__18 | VolHscada:H1-CLowerFreezerTemp |
| O000_001_001_001_0000026c__19 | VolHscada:H1-CUpperFreezerTemp |
+
+
+
19 rows in set (0.01 sec)
Last Edit: 5 years 5 months ago by barnes.
The administrator has disabled public write access.

dB information help-learning 5 years 5 months ago #9919

  • cdahl7
  • cdahl7's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 9
  • Karma: 0
I believe the storage, run time, and configuration nodes use separate databases. Storage node for storing time series historical data generated from runtime, runtime for executing plc and r/w signal data, and configuration for configuring the system.

I’m more curious about the configuration (workbench) database and run-time dB then storage server database, unless I’m totally misunderstanding the architecture...
The administrator has disabled public write access.

dB information help-learning 5 years 5 months ago #9920

  • barnes
  • barnes's Avatar
  • OFFLINE
  • Expert Boarder
  • Posts: 92
  • Karma: 0
I suspect you are correct. I would suggest looking at the source code. Berkley and some other database libraries were installed.

Configuring a large amount of tags would be very time consuming. A way to input large groups of tags would be a good feature. Other software I have used uses a text file to import tags from a long list.

This seems a worthy effort if it does not already exist.
Last Edit: 5 years 5 months ago by barnes.
The administrator has disabled public write access.

dB information help-learning 5 years 5 months ago #9921

  • claes
  • claes's Avatar
  • OFFLINE
  • Platinum Boarder
  • Posts: 3178
  • Thank you received: 502
  • Karma: 133
Both in Berkeley db and mysql the object headers and bodies are stored as blobs (binary data) so it's not possible to do any manipulations from outside the configurator.

The ordinary way to insert objects in some automized way is to use the script utility in the configurator. Often speadsheet data is exported to a csv-file that can be opened and parsed by a script There are script function to open and parse the file, and also to create objects in the database and to set attribute values. This is often done for signals, channels and storage objects, but there are also script functions to create plc objects.

/Claes
The administrator has disabled public write access.
  • Page:
  • 1
Time to create page: 8.600 seconds