1. Import DBGW Add-On instruction #
1.1 If DBGW has to be imported into a running PLC (stopping not allowed)
First: Create a temporary PLC-program for importing and adjusting the different Data types, by following the guide below.
Second: Export DBGW Add-On Instruction and import into running PLC.
1.2 Right click on Add-On Instructions and select “Import Add-On Instruction”

1.3 Browse to your unzipped folder location for DBGW-Service, and select DBGW, and click on Open

1.4 Click on “Data Types”, see screenshot below

1.5 Click on “OK” for confirming default tag names.
1.6 The following UDTs are created

1.7 Double click on “DBGW_DB”. Enter array length for maximum number of records that can be received from database. Click “OK”

1.8 Enter array length for DINTs, REALs & Strings.
Creates the lay-out for all records, used for all queries (Selected, Updated, Inserted and Deleted and executing Stored Procedures)

According to datatypes for used SQL table columns, see below
SQL Datatype | PLC datatype |
---|---|
Varchar | String |
NVarchar (PLC only supports Non Unicode (1 byte characters), Unicode are not supported (2 bytes for special characters) | String |
Char | String |
NChar (PLC only supports Non Unicode (1 byte characters), Unicode are not supported (2 bytes for special characters) | String |
Datetime | String |
Uniqueidentifier | String |
TinyInt | DINT |
SmallInt | DINT |
Integer | DINT |
BigInt (PLC only supports from -2147483648 to 2147483647) | DINT |
Float (PLC only supports Single-precision floating-point format, 4 byte) | REAL |
Real (PLC only supports Single-precision floating-point format, 4 byte) | REAL |
Decimal (PLC only supports Single-precision floating-point format, 4 byte) | REAL |
Numeric (PLC only supports Single-precision floating-point format, 4 byte) | REAL |
Money | REAL |
Bit | BOOL |
1.8 Open Data Types for Strings and double click on “DBGW_strColumn. Change “Maximum Characters”, to fit table column datatypes that are converted to PLC-strings

1.9 Double click on “DBGW_strRead”.
Only change “Maximum characters” if PLC/Ethernet module doesn’t support 1460 bytes/TCP-packet.
Note: 1756-EWEB and 1756-ENxx modules only supports 484 bytes/TCP-packet

1.10 Double click on “DBGW_strWrite”.
Enter “Maximum characters” to fit length of longest SQL query.
Note: 1756-EWEB and 1756-ENxx modules only supports 462 bytes/TCP-packet

1.11 Double click on “DBGW_strMaxRecord”
Enter length of longest record, to be received or send. This value has to be greater or equal to the value for DBGW_strRead and less than 4096.
Note: If DBGW_strMaxRecord is less than DBGW_strRead a stop of the PLC can occur.

1.12 Import and adjustments completed. DBGW ready to be used in PLC programs.