13 DATABASE FUNCTION
13.2 Database Access Instruction
237
13
Creating Unicode text files
When the DBIMPORT(P) instruction is executed, a database is created on an SD memory card, according to setting details in
the tab-delimited format of Unicode text file. The user must create Unicode text files on an SD memory card.
Setting details of Unicode text file
The following table lists items which must be specified in a Unicode text file to create a database.
*1 The termination character, NULL, is not counted in the number of characters.
*2 The length of characters is represented by single-byte characters. For double-byte character strings, one double-byte character should
be counted as two single-byte characters.
*3 For the programmable controller CPU with firmware version earlier than "28", the maximum number is 16.
Item
Description
Database name
Specify a database name, using single-byte alpha-numeric characters.
• Within 32 characters
• Not case-sensitive
• The following characters cannot be used: " # % * + , / : ; < = > ? [ \ ] | ' { } & ~ $ @ ^
Table definition start tag
Specify the tag, <table>, using a single-byte lower-case characters. When defining more than one table, enclose each
table with <table> and </table>.
Table name
Specify a table name, using single-byte alpha-numeric characters.
• Within 32 characters
• Not case-sensitive
• The following characters cannot be used: " # % * + , / : ; < = > ? [ \ ] | ' { } & ~ $ @ ^
• The maximum number of tables is 32.
Field name
Specify the name of each field of each record, using single-byte alpha-numeric characters, and in the tab-delimited format.
• The maximum number of characters which can be used for each field name is 32.
• Case-sensitive
• The following characters cannot be used: " and '
• The maximum number of fields is 128.
Data type
Specify the data type of each field in the tab-delimited format. The data types which can be specified are as follows. They
must be specified using upper-case characters.
• BOOL
• WORD
• DWORD
• INT
• DINT
• REAL
• LREAL
• STRING: Specify the number of characters after a colon (:) (For example, when the number of characters is 16, the user
can specify like that: "STRING: 16"). The range of the number of characters is 1 to 124.
• WSTRING: Specify the number of characters after the colon (:) The range of the number of characters is 1 to 124.
Key constraint
Specify the key constraint on each field, using single-byte alphabetical characters. Between key constraints, a tab must be
inserted as a delimiter. One of the following can be specified:
0: None
1: Primary key (used to uniquely identify each record) When a primary key is specified, its key name also must be
specified after a colon (:) (e.g. "1: pk1"). Key names must be up to 16 single-byte alphabetical characters and are case
sensitive.
2: NOT NULL constraint (When this setting is selected, setting values cannot be left unspecified by skipping specification
of primary keys or foreign keys. (This value is used to set a restriction.)
3: Foreign key (used to refer to the field of another table.) When a foreign key is specified, a table name, which is to be
associated with the key name, also must be specified after a colon (:), like that: "3: Key Name: Table Name" (e.g. "3:
fk1: tb2"). Key names must be up to 16 single-byte alphabetical characters and are case sensitive.
Index
Specify 0 (single-byte numeric character) when any indexes are not specified. When an index is specified, the name of the
index and a field name must be specified using a colon (:) between them, like that: "Index Name: Field Name" (e.g. "id1:
field1").
• Index names must be up to 16 single-byte alphabetical characters and are case sensitive.
• The maximum number of indexes is 128.
• For fields with a primary or foreign key constraint, indexes are automatically set, and it is not necessary to specify
indexes by this setting (if specified, the DBIMPORT(P) instruction is completed with an error).
Setting value
Specify the setting value of each field in the tab-delimited format.
• Characters or numbers which will be set to each field must match with the specified data type (
Page 238 Format of setting values in Unicode text)
• Individual records are set by row.
Table definition end tag
Specify the tag, </table>, using a single-byte lower-case characters.
Summary of Contents for MELSEC iQ-R-R00CPU
Page 2: ......
Page 151: ...9 MONITOR FUNCTION 9 1 Real Time Monitor Function 149 9 MEMO ...
Page 323: ...18 SEQUENCE SCAN SYNCHRONIZATION SAMPLING FUNCTION 321 18 MEMO ...
Page 330: ...328 20 ROUTING SETTING 20 3 Precautions MEMO ...
Page 423: ...26 BASIC CONCEPT 26 8 State Transition of the Redundant System 421 26 MEMO ...
Page 1014: ...1012 APPX Appendix 15 Added and Enhanced Functions MEMO ...
Page 1027: ......