{"id":3357,"date":"2026-11-17T18:42:52","date_gmt":"2026-11-17T10:42:52","guid":{"rendered":"https:\/\/resource.fatek.com\/index.php\/2026\/11\/17\/p5hmi-fvd-en-15\/"},"modified":"2026-11-17T18:42:52","modified_gmt":"2026-11-17T10:42:52","slug":"p5hmi-fvd-en-15","status":"publish","type":"post","link":"https:\/\/resource.fatek.com\/index.php\/2026\/11\/17\/p5hmi-fvd-en-15\/","title":{"rendered":"Chapter 15 Database"},"content":{"rendered":"<p>It can be used to connect to the database server and upload data to the database or download data from the database to the HMI. The database function can be added and activated in the function\u3010Function\u3011of\u3010Project Explorer\u3011. (\u203bNote: This item can only be seen when the model is PC.)<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/p5hmi-fvd-en-15\/p5hmi-fvd-en-15-001.png\" \/><\/p>\n<p>Figure 187 Database<\/p>\n<h3>15.1 \u3010Database Server\u3011<\/h3>\n<h4>15.1.1 \u3010General\u3011<\/h4>\n<p>After clicking Add or Edit, the\u3010Database Server Properties\u3011window will pop up. The following describes each setting:<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/p5hmi-fvd-en-15\/p5hmi-fvd-en-15-002.png\" \/><\/p>\n<p>Figure 188\u3010Database Server Properties\u3011\u3010General\u3011setting page<\/p>\n<p>Table 95\u3010Database Server Properties\u3011\u3010General\u3011properties setting page<\/p>\n<div class=\"fatek-tw\">\n<table>\n<tr>\n<td>\n<p><strong>Property<\/strong><\/p>\n<\/td>\n<td>\n<p><strong>Description<\/strong><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p><strong>\u3010Basic\u3011<\/strong><\/p>\n<\/td>\n<td>\n<p>\u3010Comment\u3011<\/p>\n<p>Comment for this connection <\/p>\n<p>\u3010DBMS\u3011<\/p>\n<p>Database server system, currently only supports MySQL and Microsoft SQL Server.<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p><strong>\u3010Connection\u3011<\/strong><\/p>\n<\/td>\n<td>\n<p>\u3010IP\u3011<\/p>\n<p>Set the address of the connected server, then you can enter\u3010Host IP\u3011below.<\/p>\n<p>\u3010Domain Name\u3011<\/p>\n<p>Set the address of the connected server, then you can enter the\u3010Host Name\u3011below<\/p>\n<p>\u3010Port\u3011<\/p>\n<p>Set the communication port connected to the database server, the default is 3306<\/p>\n<p>\u3010Username\u3011<\/p>\n<p>Set the user name to connect to the database server<\/p>\n<p>\u3010Password\u3011<\/p>\n<p>Set the password to connect to the database server<\/p>\n<p>\u3010Connection Test\u3011<\/p>\n<p>Test the above information can successfully connect to the server or not, if test success, then can select the\u3010Schema\u3011.<\/p>\n<p>\u3010Schema\u3011<\/p>\n<p>if test success, then can select the database.<\/p>\n<\/td>\n<\/tr>\n<\/table>\n<\/div>\n<h4>15.1.2 \u3010Advanced\u3011<\/h4>\n<p>The connection status and parameters of the database can be viewed or controlled by setting the address.<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/p5hmi-fvd-en-15\/p5hmi-fvd-en-15-003.png\" \/><\/p>\n<p>Figure 189\u3010Database Server Properties\u3011\u3010Advanced\u3011setting page<\/p>\n<p>Table 96\u3010Database Server Properties\u3011\u3010Advanced\u3011properties setting page<\/p>\n<div class=\"fatek-tw\">\n<table>\n<tr>\n<td>\n<p><strong>Property<\/strong><\/p>\n<\/td>\n<td>\n<p><strong>Description<\/strong><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p><strong>\u3010Status Word\u3011<\/strong><\/p>\n<\/td>\n<td>\n<p>\u3010Connection Status\u3011<\/p>\n<p>Display the connection status.<\/p>\n<div class=\"fatek-tw\">\n<table>\n<tr>\n<td>\n<p>No.<\/p>\n<\/td>\n<td>\n<p>Value<\/p>\n<\/td>\n<td>\n<p>Status<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>1<\/p>\n<\/td>\n<td>\n<p>0<\/p>\n<\/td>\n<td>\n<p>Disconnected<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>2<\/p>\n<\/td>\n<td>\n<p>1<\/p>\n<\/td>\n<td>\n<p>Connection failed<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>3<\/p>\n<\/td>\n<td>\n<p>2<\/p>\n<\/td>\n<td>\n<p>Connected<\/p>\n<\/td>\n<\/tr>\n<\/table>\n<\/div>\n<p>\u3010Error Code\u3011<\/p>\n<p>Database server system, currently only supports MySQL<\/p>\n<div class=\"fatek-tw\">\n<table>\n<tr>\n<td>\n<p>No.<\/p>\n<\/td>\n<td>\n<p>Value<\/p>\n<\/td>\n<td>\n<p>Status<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>1<\/p>\n<\/td>\n<td>\n<p>0<\/p>\n<\/td>\n<td>\n<p>No error<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>2<\/p>\n<\/td>\n<td>\n<p>Others<\/p>\n<\/td>\n<td>\n<p>Error code returned by the database server<\/p>\n<\/td>\n<\/tr>\n<\/table>\n<\/div>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p><strong>\u3010Control Word\u3011<\/strong><\/p>\n<\/td>\n<td>\n<p>\u3010Connection\u3011<\/p>\n<p>Control the connection status<\/p>\n<div class=\"fatek-tw\">\n<table>\n<tr>\n<td>\n<p>No.<\/p>\n<\/td>\n<td>\n<p>Value<\/p>\n<\/td>\n<td>\n<p>Function<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>1<\/p>\n<\/td>\n<td>\n<p>0<\/p>\n<\/td>\n<td>\n<p>Ready<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>2<\/p>\n<\/td>\n<td>\n<p>1<\/p>\n<\/td>\n<td>\n<p>Start connecting<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>3<\/p>\n<\/td>\n<td>\n<p>2<\/p>\n<\/td>\n<td>\n<p>Stop connecting<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>4<\/p>\n<\/td>\n<td>\n<p>3<\/p>\n<\/td>\n<td>\n<p>Update connection parameters<\/p>\n<\/td>\n<\/tr>\n<\/table>\n<\/div>\n<p>\u3010Host\u3011<\/p>\n<p>Set the connected host, for example:<\/p>\n<p>If the connection setting selects\u3010IP\u3011, enter: 192.168.0.100<\/p>\n<p>If the connection setting selects\u3010Domain Name\u3011, enter: DESKTOP-NLURQM5<\/p>\n<p>\u3010Port\u3011<\/p>\n<p>Set the port to connect to the database server<\/p>\n<p>\u3010Username\u3011<\/p>\n<p>Set the username to connect to the database server<\/p>\n<p>\u3010Password\u3011<\/p>\n<p>Set the password to connect to the database server<\/p>\n<p>\u3010Schema\u3011<\/p>\n<p>Set the connected database name<\/p>\n<\/td>\n<\/tr>\n<\/table>\n<\/div>\n<h3>15.2 \u3010SQL Query\u3011<\/h3>\n<p>Provides data exchange function for HMI and database, and can set the format of the data field for SQL query.<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/p5hmi-fvd-en-15\/p5hmi-fvd-en-15-004.png\" \/><\/p>\n<p>Figure 190\u3010SQL Query\u3011page<\/p>\n<h4>15.2.1 \u3010General\u3011<\/h4>\n<p><img decoding=\"async\" src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/p5hmi-fvd-en-15\/p5hmi-fvd-en-15-005.png\" \/><\/p>\n<p>Figure 191\u3010SQL Query\u3011\u3010General\u3011setting page<\/p>\n<p>Table 97\u3010SQL Query\u3011\u3010General\u3011properties setting page<\/p>\n<div class=\"fatek-tw\">\n<table>\n<tr>\n<td>\n<p><strong>Property<\/strong><\/p>\n<\/td>\n<td>\n<p><strong>Description<\/strong><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p><strong>\u3010Basic\u3011<\/strong><\/p>\n<\/td>\n<td>\n<p>\u3010Comment\u3011<\/p>\n<p>Comment of this SQL Query<\/p>\n<p>\u3010Database Server\u3011<\/p>\n<p>Choose a database as the data source<\/p>\n<p>\u3010Table\u3011<\/p>\n<p>Import the form from the database<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p><strong>\u3010Table Structure\u3011<\/strong><\/p>\n<\/td>\n<td>\n<p>\u3010Address Type\u3011<\/p>\n<p>Here you can select the address where the data will be placed after reading the column below<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/p5hmi-fvd-en-15\/p5hmi-fvd-en-15-006.png\" \/><\/p>\n<p>\u3010Add\u3011<\/p>\n<p>Add a new column<\/p>\n<p>\u3010Delete\u3011<\/p>\n<p>Delete the selected column<\/p>\n<p>\u3010Insert\u3011<\/p>\n<p>Insert a column below the selected column<\/p>\n<p>\u3010Import Files From Database\u3011<\/p>\n<p>Import field data from the selected database<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p><strong>\u3010Table Column\u3011<\/strong><\/p>\n<\/td>\n<td>\n<p>\u3010Field Name\u3011<\/p>\n<p>The field name must same as the database table field setting<\/p>\n<p>\u3010Comment\u3011<\/p>\n<p>Comment for this column<\/p>\n<p>\u3010Primary Key\u3011<\/p>\n<p>Set the primary key<\/p>\n<p>\u3010Type\u3011<\/p>\n<p>Set the data type<\/p>\n<p>\u3010Words\u3011<\/p>\n<p>Set the needed words<\/p>\n<p>\u3010Address\u3011<\/p>\n<p>Set the address where the data is placed after reading<\/p>\n<\/td>\n<\/tr>\n<\/table>\n<\/div>\n<h4>15.2.2 \u3010Command\u3011<\/h4>\n<p><img decoding=\"async\" src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/p5hmi-fvd-en-15\/p5hmi-fvd-en-15-007.png\" \/><\/p>\n<p>Figure 192\u3010SQL Query\u3011\u3010Command\u3011setting page<\/p>\n<p>Table 98\u3010SQL Query\u3011\u3010Command\u3011properties setting page<\/p>\n<div class=\"fatek-tw\">\n<table>\n<tr>\n<td>\n<p><strong>Property<\/strong><\/p>\n<\/td>\n<td>\n<p><strong>Description<\/strong><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p><strong>\u3010Control Word\u3011<\/strong><\/p>\n<\/td>\n<td>\n<p>Use the control address to control the command of\u3010SQL Query\u3011.<\/p>\n<p>\u3010Command ID\u3011<\/p>\n<p>Choose the command from\u3010Command List\u3011to command<\/p>\n<div class=\"fatek-tw\">\n<table>\n<tr>\n<td>\n<p>ID<\/p>\n<\/td>\n<td>\n<p>Function<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>1<\/p>\n<\/td>\n<td>\n<p>Add the target address data to the end of the database<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>2<\/p>\n<\/td>\n<td>\n<p>According to\u3010Row Selection\u3011and\u3010Page Change\u3011to read data from the database to the target address.<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>3<\/p>\n<\/td>\n<td>\n<p>According to\u3010Row Selection\u3011and\u3010Page Change\u3011, update the target address data to the database.<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>4<\/p>\n<\/td>\n<td>\n<p>According to\u3010Row Selection\u3011and\u3010Page Change\u3011to delete a data<\/p>\n<\/td>\n<\/tr>\n<\/table>\n<\/div>\n<p>\u3010Row Selection\u3011<\/p>\n<p>Select which row of data to read to the target address<\/p>\n<p>\u3010Page Change\u3011<\/p>\n<p>Choose which page to read. One page for every 1000 data, if the database has more than 1000 data, you need to enable this function<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p><strong>\u3010Status Word\u3011<\/strong><\/p>\n<\/td>\n<td>\n<p>Use the status word group to monitor the processing status of\u3010SQL Query\u3011.<\/p>\n<p>\u3010Status\u3011<\/p>\n<div class=\"fatek-tw\">\n<table>\n<tr>\n<td>\n<p>No.<\/p>\n<\/td>\n<td>\n<p>Bit Value<\/p>\n<\/td>\n<td>\n<p>Function<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>1<\/p>\n<\/td>\n<td>\n<p>0<\/p>\n<\/td>\n<td>\n<p>Normal<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>2<\/p>\n<\/td>\n<td>\n<p>1<\/p>\n<\/td>\n<td>\n<p>The data exceeds 1000, need to use the page change function<\/p>\n<\/td>\n<\/tr>\n<\/table>\n<\/div>\n<p>\u3010Error\u3011<\/p>\n<div class=\"fatek-tw\">\n<table>\n<tr>\n<td>\n<p>No.<\/p>\n<\/td>\n<td>\n<p>Bit Value<\/p>\n<\/td>\n<td>\n<p>Function<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>1<\/p>\n<\/td>\n<td>\n<p>0<\/p>\n<\/td>\n<td>\n<p>No error<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>2<\/p>\n<\/td>\n<td>\n<p>1<\/p>\n<\/td>\n<td>\n<p>Unknown error<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>3<\/p>\n<\/td>\n<td>\n<p>2<\/p>\n<\/td>\n<td>\n<p>Error command<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>4<\/p>\n<\/td>\n<td>\n<p>3<\/p>\n<\/td>\n<td>\n<p>Database is not connected<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>5<\/p>\n<\/td>\n<td>\n<p>4<\/p>\n<\/td>\n<td>\n<p>Error reading argument<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>6<\/p>\n<\/td>\n<td>\n<p>5<\/p>\n<\/td>\n<td>\n<p>Unable to write output<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>7<\/p>\n<\/td>\n<td>\n<p>6<\/p>\n<\/td>\n<td>\n<p>Wrong number of arguments<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>8<\/p>\n<\/td>\n<td>\n<p>7<\/p>\n<\/td>\n<td>\n<p>MySQL error<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>9<\/p>\n<\/td>\n<td>\n<p>8<\/p>\n<\/td>\n<td>\n<p>Unsupported data type<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>10<\/p>\n<\/td>\n<td>\n<p>9<\/p>\n<\/td>\n<td>\n<p>The number of fields exceeds the limit<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>11<\/p>\n<\/td>\n<td>\n<p>10<\/p>\n<\/td>\n<td>\n<p>Row Selection is out of range<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>12<\/p>\n<\/td>\n<td>\n<p>11<\/p>\n<\/td>\n<td>\n<p>Internal error<\/p>\n<\/td>\n<\/tr>\n<\/table>\n<\/div>\n<p>\u3010Error Message\u3011<\/p>\n<p>Error message returned by the database server<\/p>\n<p>\u3010Total Pages\u3011<\/p>\n<p>Display the total number of pages<\/p>\n<\/td>\n<\/tr>\n<\/table>\n<\/div>\n<h3>15.3 Database Related Object<\/h3>\n<p>\u3010SQL Query Table\u3011can be selected in the\u3010Toolbox\u3011, use\u3010SQL Query Table\u3011to display the execution results of\u3010SQL Query\u3011commands.<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/resource.fatek.com\/wp-content\/uploads\/fatek\/p5hmi-fvd-en-15\/p5hmi-fvd-en-15-008.png\" \/><\/p>\n<p>Figure 193\u3010SQL Query Table\u3011setting<\/p>\n","protected":false},"excerpt":{"rendered":"<p>It can be used to connect to the database server and up [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[57],"tags":[],"class_list":["post-3357","post","type-post","status-publish","format-standard","hentry","category-en-p5hmi-fvd"],"_links":{"self":[{"href":"https:\/\/resource.fatek.com\/index.php\/wp-json\/wp\/v2\/posts\/3357","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/resource.fatek.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/resource.fatek.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/resource.fatek.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/resource.fatek.com\/index.php\/wp-json\/wp\/v2\/comments?post=3357"}],"version-history":[{"count":0,"href":"https:\/\/resource.fatek.com\/index.php\/wp-json\/wp\/v2\/posts\/3357\/revisions"}],"wp:attachment":[{"href":"https:\/\/resource.fatek.com\/index.php\/wp-json\/wp\/v2\/media?parent=3357"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/resource.fatek.com\/index.php\/wp-json\/wp\/v2\/categories?post=3357"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/resource.fatek.com\/index.php\/wp-json\/wp\/v2\/tags?post=3357"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}