0% found this document useful (0 votes)
3 views62 pages

LNDB

The document outlines the Software End User License Agreement (EULA) for Campbell Scientific's software, detailing the terms for trial and licensed versions, usage rights, and warranty information. It specifies the installation requirements, supported databases and operating systems, and provides a comprehensive guide on setting up and using the LNDB application for data management. Additionally, it includes sections on importing, exporting data, and troubleshooting, along with a table of contents for easy navigation.

Uploaded by

Leo Benítez
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views62 pages

LNDB

The document outlines the Software End User License Agreement (EULA) for Campbell Scientific's software, detailing the terms for trial and licensed versions, usage rights, and warranty information. It specifies the installation requirements, supported databases and operating systems, and provides a comprehensive guide on setting up and using the LNDB application for data management. Additionally, it includes sections on importing, exporting data, and troubleshooting, along with a table of contents for easy navigation.

Uploaded by

Leo Benítez
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 62

Revision: 03/2020

Copyright © 2010 – 2020


Campbell Scientific, Inc.
Campbell Scientific, Inc.
Software End User License
Agreement (EULA)
NOTICE OF AGREEMENT: This software is copyrighted software. Please carefully read this EULA.
By installing or using this software, you are agreeing to comply with the following terms and
conditions. If you do not want to be bound by this EULA, you must promptly return the software,
any copies, and accompanying documentation in its original packaging to Campbell Scientific or
its representative.
This software can be installed as a trial version or as a fully licensed copy. All terms and
conditions contained herein apply to both versions of software unless explicitly stated.
TRIAL VERSION: Campbell Scientific distributes a trial version of this software free of charge to
enable users to work with Campbell Scientific data acquisition equipment. You may use the trial
version of this software for 30 days on a single computer. After that period has ended, to
continue using this product you must purchase a fully licensed version.
This trial may be freely copied. However, you are prohibited from charging in any way for any
such copies and from distributing the software and/or the documentation with any other
products (commercial or otherwise) without prior written permission from Campbell Scientific.
LICENSE FOR USE: Campbell Scientific grants you a non-exclusive license to use this software in
accordance with the following:
(1) The purchase of this software allows you to install and use a single instance of the software on
one physical computer or one virtual machine only.
(2) This software cannot be loaded on a network server for the purposes of distribution or for
access to the software by multiple operators. If the software can be used from any computer
other than the computer on which it is installed, you must license a copy of the software for each
additional computer from which the software may be accessed.
(3) If this copy of the software is an upgrade from a previous version, you must possess a valid
license for the earlier version of software. You may continue to use the earlier copy of software
only if the upgrade copy and earlier version are installed and used on the same computer. The
earlier version of software may not be installed and used on a separate computer or transferred
to another party.
(4) This software package is licensed as a single product. Its component parts may not be
separated for use on more than one computer.
(5) You may make one (1) backup copy of this software onto media similar to the original
distribution, to protect your investment in the software in case of damage or loss. This backup
copy can be used only to replace an unusable copy of the original installation media.
WARRANTIES: The following warranties are in effect for ninety (90) days from the date of
shipment of the original purchase. These warranties are not extended by the installation of
upgrades or patches offered free of charge.
Campbell Scientific warrants that the installation media on which the software is recorded and
the documentation provided with it are free from physical defects in materials and workmanship
under normal use. The warranty does not cover any installation media that has been damaged,
lost, or abused. You are urged to make a backup copy (as set forth above) to protect your
investment. Damaged or lost media is the sole responsibility of the licensee and will not be
replaced by Campbell Scientific.
Campbell Scientific warrants that the software itself will perform substantially in accordance with
the specifications set forth in the instruction manual when properly installed and used in a
manner consistent with the published recommendations, including recommended system
requirements. Campbell Scientific does not warrant that the software will meet licensee’s
requirements for use, or that the software or documentation are error free, or that the operation
of the software will be uninterrupted.
Campbell Scientific will either replace or correct any software that does not perform substantially
according to the specifications set forth in the instruction manual with a corrected copy of the
software or corrective code. In the case of significant error in the installation media or
documentation, Campbell Scientific will correct errors without charge by providing new media,
addenda, or substitute pages. If Campbell Scientific is unable to replace defective media or
documentation, or if it is unable to provide corrected software or corrected documentation
within a reasonable time, it will either replace the software with a functionally similar program or
refund the purchase price paid for the software.
All warranties of merchantability and fitness for a particular purpose are disclaimed and
excluded. Campbell Scientific shall not in any case be liable for special, incidental, consequential,
indirect, or other similar damages even if Campbell Scientific has been advised of the possibility
of such damages. Campbell Scientific is not responsible for any costs incurred as a result of lost
profits or revenue, loss of use of the software, loss of data, cost of re-creating lost data, the cost
of any substitute program, telecommunication access costs, claims by any party other than
licensee, or for other similar costs.
This warranty does not cover any software that has been altered or changed in any way by
anyone other than Campbell Scientific. Campbell Scientific is not responsible for problems
caused by computer hardware, computer operating systems, or the use of Campbell Scientific’s
software with non-Campbell Scientific software.
Licensee’s sole and exclusive remedy is set forth in this limited warranty. Campbell Scientific’s
aggregate liability arising from or relating to this agreement or the software or documentation
(regardless of the form of action; e.g., contract, tort, computer malpractice, fraud and/or
otherwise) is limited to the purchase price paid by the licensee.
COPYRIGHT: This software is protected by United States copyright law and international
copyright treaty provisions. This software may not be sold, included or redistributed in any other
software, or altered in any way without prior written permission from Campbell Scientific. All
copyright notices and labeling must be left intact.
Table of contents
1. Introduction 1
1.1 Supported Databases 1
1.2 Supported Operating Systems 2
1.3 What's New in 2.0? 2

2. Getting Started 3
2.1 Installing and Starting the LNDB Service 3
2.2 Selecting a LoggerNet Server 5
2.3 Selecting a Database 6
2.3.1 SQL Server Compact 7
2.3.2 SQL Server 8
2.3.3 MySQL 9
2.3.4 Oracle 10
2.3.5 PostgreSQL 10
2.3.6 Remember and Automatically Login 11
2.3.7 Creating a Database for MySQL, Microsoft SQL Server, Oracle, or PostgreSQL 11

3. Selecting Datalogger Tables 12


3.1 Station Setup 12
3.2 Table Setup 13

4. Options 14

5. Resolving a Conflict 15
5.1 Archive Database Table 17
5.2 Modify Database Table 18

6. Checking Status and Reviewing Data 18


6.1 Status Tab 19
6.2 Data Review Tab 20
6.2.1 Deleting or Archiving Tables 20
6.3 Significant Events Tab 21
6.4 Status Messages Tab 22
6.5 Log Files 23
6.6 Status Bar 23

Table of Contents - iv
7. Importing Data 24
7.1 Database Selection 25
7.2 Import From 25
7.3 TDF File 26
7.4 Import Into 26
7.5 Data File Columns vs Database Table Columns 26
7.6 Import Requirements (into existing table) 27
7.7 Import 27

8. Exporting Data 27
8.1 Database Selection 28
8.2 Export From 28
8.3 Export Into 29
8.4 Check for Missing Records 30
8.5 Export 31
8.6 Select Columns 31
8.7 Array Compatible CSV Options 32
8.8 Representation of NULL Values 33

9. QuickReports 34
9.1 Database Selection 35
9.2 QuickReports Setup 40
9.3 Customizing Your Report 42
9.4 Generating Your Report 42

10. Troubleshooting 43

Appendix A. Data Type Mapping 44

Appendix B. SQL Rights 47

Appendix C. Metatables 50

Appendix D. Unicode Support and Upgrade Process 51


D.1 Deciding Whether to Migrate MySQL Tables to UTF-8 51
D.2 Migrating Existing MySQL Tables to UTF-8 52
D.3 Convert MySQL Tables 54
D.4 Windows Code Page 1252 54

Table of Contents - v
1. Introduction
LNDB is an application used to move data from one LoggerNet server into a single database.
There are two main components in LNDB: LNDB Manager and LNDB Engine. LNDB Manager is
used to set up a database and select the datalogger data tables that will be stored in the
database. It also provides tools to monitor the LNDB Engine and to review the database data.
LNDB Engine runs as a service and sends the selected data from the LoggerNet data cache to the
database. LNDB also includes a report generator and utilities for importing and exporting data.

NOTE:
LNDB works with only one LoggerNet server and a single database. Only one copy of LNDB
can be running on a computer. If you need to work with multiple LoggerNet servers, you will
need multiple copies of LNDB running on separate computers. Each will also need its own
separate database.

1.1 Supported Databases


LNDB has been tested with the following databases:
Microsoft SQL Server (Express, Standard, and Enterprise) 2005-2019
Microsoft SQL Server Compact 3.5 SP2
MySQL 5.0 – 8.0 (with an appropriate 32-bit Unicode ODBC database driver; for example,
MySQL 5.0 or 5.1 with MySQL 3.51.27 or 5.1.6 ODBC database driver, note that earlier
versions of 5.x ODBC database drivers have known issues; MySQL 5.6 with MySQL 5.3
ODBC database driver)
PostgreSQL 9.4 – 11.1
Oracle 12c Release 1 (12.1.01) and 18c (18.1.0)

NOTE:
LNDB may work with other versions of these databases.
Relational databases like the ones supported by LNDB enforce an upper limit on the number
of columns you can have in a single database table. Depending on the database, this limit is
usually 1000 or 1024. In order for LNDB to store data successfully to the database, we
recommend that data tables have fewer than 1000 columns.

LNDB 1
A SQL Server Compact database is limited to 4 GB in size. If you anticipate the need for a
larger database, a SQL Server or MySQL database should be used.
Using a server-based database such as SQL Server, MySQL, Oracle, or PostgreSQL will be
more robust and may give better performance. When using SQL Server, MYSQL, Oracle, or
PostgreSQL, you will need to create a database instance to be used by LNDB (see Creating a
Database for MySQL, Microsoft SQL Server, Oracle, or PostgreSQL (p. 11)).
Sub-second data in a MySQL database requires MySQL 5.6.4 (or later) and LNDB 1.2 (or later).
Note that only newly-created tables will include sub-second data. Existing tables will not be
updated to include sub-second data.
If LNDB has been running with a SQL Server 2005 database, the timestamps in the tables will
be of type DateTime. If you then upgrade to SQL Server 2008 the DateTime data type for the
timestamps is carried over to the 2008 database. However, LNDB expects the timestamps to
be of type DateTime2 which has a higher precision than DateTime. This type mismatch
causes queries to fail. In order to fix this issue, you will need to use the SQL Server
management tools to change the data type for the timestamp columns to DateTime2.

1.2 Supported Operating Systems


LNDB runs on Windows 10, 8, or 7 and Windows Server 2012 R2 or 2016.

NOTE:
When using Windows Server with security policies other than the default policies, you will
need to work with your IT administrator to work out any security issues.

In addition to a supported Windows operating system, LNDB 2.0 requires Microsoft .NET
Framework 4.6.2 or newer to run properly. Microsoft .NET Framework 3.5 must also be installed
to use the reporting functions of LNDB 2.0.

1.3 What's New in 2.0?


LNDB 2.0 includes the following enhancements from 1.3:

l Support for
o PostgreSQL
o Oracle
l Miscellaneous other changes and bug fixes.

LNDB 2
2. Getting Started
Setting up LNDB involves the following steps:

2.1 Installing and Starting the LNDB Service 3


2.2 Selecting a LoggerNet Server 5
2.3 Selecting a Database 6

2.1 Installing and Starting the LNDB Service


The first time you open LNDB, the following message will occur indicating that the LNDB Engine
Service is not running.

Once you press OK, the LNDB Engine Service Manager will open. This utility is used to install
LNDB as a service and to enable/disable that service as required.

NOTE:
You must have administrative rights on your computer in order to run the Service Manager. If
you do not have administrative rights, an error message will be displayed when the Service
Manager tries to open.

LNDB 3
Press the Install button to install LNDB as a service. You will then be asked what account to install
the service under.

You can choose to install the service under the Local System account or under a User account.
Note that a User account is most likely necessary if you are using Windows Authentication in SQL
Server. In most other cases, the Local System account can be used. If User account is chosen, you
will be asked to provide a username and password.
Once the application is installed as a service, press the Start button on the LNDB Engine Service
Manager window to start the service.

LNDB 4
You can then press the Close button to close the LNDB Engine Service Manager.
Once LNDB is installed as a service, you can open the LNDB Engine Service Manager from the
File > Configure LNDB Engine Service menu item or by double-clicking on the LNDB Engine
Status Label on the Status Bar (p. 23). The LNDB Engine Service Manager can also be opened
directly from the LoggerNet toolbar under the Database category.

2.2 Selecting a LoggerNet Server


The Log into LoggerNet Server dialog box comes up automatically the first time LNDB is run,
once the LNDB Service is installed and started. It can be opened at any time from the File >
Select LoggerNet Server menu item or by double-clicking on the LN Connection Status Label on
the Status Bar (p. 23).
This dialog box allows you to specify the computer running the LoggerNet server to which LNDB
should connect. The dialog box has the following fields:

LNDB 5
Server Address - This is the TCP/IP address of the computer running the LoggerNet server to
which you are trying to connect. This must be the valid name of an existing computer or a TCP/IP
address (in the form ###.###.###.### for an IPv4 address or
[####:####:####:####:####:####:####:####] for an IPv6 address). If the software server
resides on the same computer as the client, you can simply type in LocalHost for the server name.

NOTE:
Note that if you have used a command line argument to change LoggerNet’s default port
number, you must specify this alternate port number when entering the Server Address (e.g.,
LocalHost:6700 or 192.168.7.123:6700).

Username - Your username on the LoggerNet server.


Password - Your password for the LoggerNet server.
The User Name and Password fields are required only if your server administrator has set up
security on your LoggerNet server.
Each time you start the client, you will be prompted to enter this information. However, you can
save the login information by selecting the Remember username and password check box, or you
can select the Automatically login to this server check box to skip this window and use the
information from the last session.

NOTE:
All information must be saved for the LNDB Engine. The Remember username and password
check box and the Automatically login to this server check box apply only to the LNDB
Manager.
If you are connecting to a remote LoggerNet server, the LoggerNet server must have Remote
Connections enabled (Tools > Options > Allow Remote Connections) in order for LNDB to be
able to connect to the server.

2.3 Selecting a Database


The Select Database dialog box comes up automatically the first time LNDB is opened once the
service is installed and started and the server is selected. At other times, it can be opened from
the File > Select Database menu item or by double-clicking on the DB Connection Status Label
on the Status Bar (p. 23). LNDB supports SQL Server Compact, SQL Server, MySQL, Oracle, and
PostgreSQL databases. Once you select a database, fill in the necessary information, and click
OK, a connection attempt will be made. If the connection succeeds, the database dialog will be
closed and the connection will be used for the application. If the connection fails, a message will
be shown and the Select Database dialog will continue to be shown.

LNDB 6
NOTE:
When using SQL Server, MYSQL, Oracle, or PostgreSQL, you will need to first create a
database instance to be used by LNDB. See Creating a Database for MySQL, Microsoft SQL
Server, Oracle, or PostgreSQL (p. 11).
SQL Server Compact is included with the LNDB install. This database should not be
uninstalled. It is required for LNDB to function correctly.

2.3.1 SQL Server Compact

SQL Server Compact is a single-file database that is installed when LNDB is installed. It only
requires the selection of a filename. The default location of the database will be <working
directory>\LNDB.sdf. LNDB does not support any encryption or security options on the SQL
Server Compact database. When selecting the database within the LNDB Manager, the database
will be created when the OK button is pressed.

LNDB 7
2.3.2 SQL Server

To configure a connection to SQL Server you must select a SQL Server instance. The list of
published SQL Server instances is shown in the Data Source combo box. You can also type into
the Data Source combo box, because the desired server might not be published. Windows
Authentication or SQL Server Authentication can be selected. Windows Authentication does not
require a username and password, but rather uses Windows user accounts to authenticate valid
users. SQL Server Authentication requires a login ID and Password and is independent of
Windows user accounts. You can select the <default> database or select a specific database from
the Database combo box.

LNDB 8
2.3.3 MySQL

The MySQL connection is an ODBC connection. You must use the Windows ODBC Data Source
Administrator to configure the database connection. A 32-bit ODBC driver must be used. 64-bit
ODBC drivers are not supported. Press the ODBC Data Source Administrator button in the Select
Database screen of LNDB Manager to open the 32-bit version of the Administrator. If you
choose to open the Administrator outside of LNDB, the 32-bit version can be accessed from
c:\windows\syswow64\odbcad32.exe (on 64-bit Windows) or c:\windows\system32\odbcad32.exe
(on 32-bit Windows).
Currently only system data sources are supported and show in the Data Source combo box.
A Login ID and Password are needed in most cases for LNDB to authenticate and activate its
connection to the mySQL database. The Login ID and Password may be left blank, if their values
have been specified in the configuration of the ODBC driver (performed in a separate screen). If
the ODBC driver configuration does not specify these values, they should be provided using this
screen. Both the Login ID and Password should be specified together, otherwise the values from
the ODBC driver configuration will be used. If values for Login ID and Password are provided in
both this screen and the ODBC driver configuration, the values specified in this screen will be
used during authentication, and those in the ODBC driver configuration will be ignored.
You can select the <default> database (default as configured in the data source) or select a
different database.

LNDB 9
2.3.4 Oracle

To configure a connection to an Oracle database you must enter a Hostname:Port, Login ID,
Password, and Service Name. The default port for Oracle is 1521.

2.3.5 PostgreSQL

LNDB 10
To configure a connection to a PostgreSQL database you must enter a Hostname:Port, Login ID,
Password, and Database. The default port for PostgreSQL is 5432.

2.3.6 Remember and Automatically Login


If you select the Remember and Automatically Login check box, the Login ID and Password will
be remembered and the next time the application starts an attempt will be made to login without
showing the dialog again. Regardless of whether this check box is selected, all other information
(Database Type, Data Source, etc.) will be remembered for all databases.
If you do not check the Remember and Automatically Login check box, the username and
password are still saved so the LNDB Engine can connect to the database. However, in this case,
the username and password are not automatically filled in on the login dialog box.

2.3.7 Creating a Database for MySQL, Microsoft SQL


Server, Oracle, or PostgreSQL
When you select mySQL, Microsoft SQLServer, Oracle, or PostgreSQL as your database engine
used with LNDB, you will usually want to work with the Information Technology (IT) personnel at
your organization or with external database hosting partners. Unless you have sufficient
experience and expertise for administering these database servers, running them yourself is often
very time consuming and distracting.
LNDB requires a "database" instance to be created on a mySQL, Microsoft SQLServer, Oracle, or
PostgreSQL database server. This will (in most circumstances) only be used by LNDB. This
database instance can also be referred to as a "catalog" or "service". You should work with your IT
personnel or hosting partner to get this database/catalog/service created on the database server
before you begin using LNDB.
When configuring LNDB to interact with mySQL, Microsoft SQLServer, Oracle, or PostgreSQL you
will refer to the database/catalog/service by its name. This enables LNDB to know where to create
its tables and populate (insert) the data into the database server. This database/catalog/service
can be named anything you choose, but you may wish to choose a name like "LNDBDatabase" or
"LoggerNetData" so that its purpose will be clear to all parties involved.
The database/catalog/service name is specified in the Select Database screen of the LNDB
Manager. Selecting the wrong database name from the server (such as system databases or other
databases that exist by default) can have highly unfavorable results. Please work carefully with
the appropriate personnel to ensure this is configured properly.

LNDB 11
3. Selecting Datalogger Tables
The first tab on the main screen is Setup. From this screen, you select the datalogger tables for
which you would like to move data into the database. The right side of the screen changes
depending upon whether a station or a table is highlighted in the left tree as described below.
If you check a station in the left tree, all final storage tables for the station are selected. This
includes all tables except Public, Status, DataTableInfo, ports_and_flags, and __inlocs__. If a table
has a conflict and is enabled for storage, its icon and its parent station’s icon are overlaid with an
error icon.
The toolbar at the top of the Setup tab can be used to Select All Final Storage Tables for all
stations or to Deselect All Tables for all stations. It can also be used to select whether to view the
entire network or a Subnet. (Note to use subnets, they must first be configured in the LoggerNet
Admin Setup Screen.)
If a change is made to the setup, the Apply and Cancel buttons are enabled. Press Apply to save
the pending edits and restart the engine. Press Cancel to undo the pending edits.

NOTE:
If a station, table or column that is enabled for storage has an invalid name (i.e., contains ', ",
or `), an icon and text indicating such is placed at the top of the screen. The issue can be
resolved by changing the station name in LoggerNet's Setup Screen or by changing the table
or column name in the CRBasic program.

3.1 Station Setup


When a station is highlighted in the left tree, the Station Setup screen is shown. On the Station
Setup screen, tables can be enabled/disabled for storage by selecting/deselecting the check
boxes next to the table names.
A conflict exists for a table when datalogger columns do not match database columns.
If in "Stop Storing Data" mode (see Options (p. 14)) and conflicts exist, an icon is placed next to
the table with the conflict. Also a larger icon with bold text stating there are conflicts is placed at
the top of the station setup screen. To resolve a conflict, right-click on the table name on the
right side of the screen and select Resolve. This brings up the Resolve Table dialog box which
allows you to resolve the conflict. See Resolving a Conflict (p. 15).

LNDB 12
3.2 Table Setup
When a table is highlighted in the left tree, the right side contains the Table Setup screen.
Clicking the Store in Database check box will enable storage for the table.
The datalogger columns and database columns are listed side by side. If the database table does
not currently exist, the name of the column that will be created is listed next to the datalogger
column. If the database table does exist and you have chosen "Stop Storing Data" or
"Modify/Archive Database Table" when table definitions change, the datalogger columns are
matched up with the database columns. Blank spaces exist where there is not a corresponding
datalogger or database column.
If in "Stop Storing Data" mode, the table is enabled for storage, and a conflict exists, an icon is
placed next to those columns with conflicts. An icon and bold text stating there is a conflict is
also placed at the top of the screen. A Resolve… button is made visible and can be used to
resolve the conflict. See Resolving a Conflict (p. 15).

LNDB 13
4. Options
The Options Dialog can be opened from the Tools > Options menu item. The following options
are available:
When Tables Change
This tab allows you to determine what will happen when a datalogger’s table definitions change.
Choose from the following options:
Stop Storing Data
Storing data to the database for the individual table stops if table definitions change. You
must manually resolve the change.
Archive Database Table (continue storing)
The table is automatically archived when table definitions change. Following the archive, the
database table is automatically recreated and LNDB begins to store data into the newly
created table.

LNDB 14
An archive consists of renaming the existing table. The new name is chosen by attaching "_
arch#" to the original name. # is chosen by starting with 1 and increasing until a table name
is found that does not already exist.
Modify/Archive Database Table (continue storing)
When table definitions change:
New columns are added to the database table. (previous rows are filled with NULL.)
Old columns are orphaned. (Columns are left, new records contain NULL.)
If any column’s process, units, or data type change the table is archived.
Data Review Options
This tab allows you to select the number of records to be shown in the Data Review tab. The
maximum number of records to show is 100,000.

5. Resolving a Conflict
A conflict exists for a table when datalogger columns do not match database columns. If in "Stop
Storing Data" mode (see Options (p. 14)), the conflict must be manually resolved by selecting the
table in the left tree of the Setup tab and then pressing the Resolve… button on the Table Setup
screen. (Alternately, you can select the datalogger in the left tree of the Setup tab, right click on
the table name on the right side of the screen, and select Resolve.)

LNDB 15
Clicking the Resolve… button brings up the Resolve Table dialog. You have two options:

1. Archive Database Table.


2. Modify Database Table. (This option is disabled if a column’s data type has changed. The
only way to resolve this conflict is to archive the database table.)

Once a conflict has been resolved, the conflict icons and bold text are removed. Storage begins
(or continues) for the table once the action(s) have completed.

LNDB 16
5.1 Archive Database Table

If Archive Database Table is selected, the database table name is shown with the action stating
that the table will be renamed to a specific new name. Press the Archive Table button to archive
the table.

LNDB 17
5.2 Modify Database Table

If Modify Database Table is selected, each column that has a conflict is shown with the proper
action displayed. Each action is done when you click the Execute Actions button.

6. Checking Status and


Reviewing Data
The function of the Setup Tab of LNDB’s main screen is described in Selecting Datalogger Tables
(p. 12). The other tabs on the main screen can be used to check the status of LNDB and to review
LNDB data. The Status Bar at the bottom of the LNDB main screen can also be used to quickly
check the status of the LNDB engine, database, and LoggerNet server. All of these functions are
described below.

LNDB 18
6.1 Status Tab

The Status tab shows the storage status for each datalogger table. The following columns are
shown:
Database Table - The database table name for each station’s table. They are grouped by
station.
Last Write Time - The last time that data was written to the database table.
Last Record Timestamp - The timestamp of the last record in the database table.
Status - There are 3 valid values:
Storing Data: Data for the table is being stored
Stopped – Conflict: The table has a conflict and storage has stopped.
Blank: Not storing data for this table
Last Error - The last database error (insert error, error creating a database table, or error
retrieving the start conditions) for the given table. This value is only reset when you restart the
engine.

LNDB 19
The Status columns can be sorted. When you click a column other than the Database Table
column, the grouping of tables by station is removed and the records are sorted. Click the
Database Table column to again group the tables by station.
When the engine is stopped all engine statistics are cleared.

6.2 Data Review Tab

The Data Review tab shows tables and data from the database. When a table on the left side is
selected, the data for the table is shown on the right side. You can refresh tables or data by
clicking the corresponding refresh button.

6.2.1 Deleting or Archiving Tables


All database tables except the Metatables (p. 50) (LNDBStationMeta, LNDBTableMeta, and
LNDBColumnMeta) can be removed by clicking the Delete button or archived by clicking the
Archive button. If a metatable is selected, the Delete and Archive buttons are grayed out.

NOTE:
The metatables should not be modified by the user.

LNDB 20
When you archive a table, you are asked for an archive name. The default name is
<basename>_arch<number>. Basename is the first part of the name before the first "_arch".
Number is the smallest number that makes the table name unique. The maximum number of
characters allowed for the table name is 64 for MySQL and 128 for SQL Server and SQL Server
Compact.
Upon completion of a Delete or Archive, any conflicts for the table are removed and storage is
restarted for the table (if enabled for storage).

NOTE:
When storage begins for a newly created table, data always backfills and starts at the oldest
available record. It does not start at the last record from the deleted or archived table.
Therefore, a table may be recreated so quickly after deletion, that it may appear as if the table
was not actually deleted.

The format of timestamp columns is based on the precision of the first two records shown. If the
time has second data, it will be shown. If the time has sub-second data, it will show 3 or 7
decimal places based on the precision.

6.3 Significant Events Tab

LNDB 21
The Significant Events tab shows significant messages. The messages can be paused by clicking
the Pause Messages button. Up to 400 messages are displayed, after which the oldest is removed
when new messages are added. If you close down LNDB Manager and reopen it, the messages
are not lost. Clicking the Clear Messages button permanently removes the messages. They are
not shown again the next time LNDB Manager is started.
The Significant Events include:
Database Table Created
Database Table Modified
Database Table Archived
Database Table Storage Stopping due to a conflict
Table Conflict Resolved
Insert Record Failure

6.4 Status Messages Tab

The Status Messages tab shows events and the state of the LNDB Engine. These include the
Significant Event messages, data events, LoggerNet events, database events, etc. The Pause

LNDB 22
Messages button pauses the displaying of new messages. These messages are not persistent and
ring at 100 messages. When LNDB Manager closes and reopens, or if you click the Clear
Messages button, the messages clear and are not shown again.

6.5 Log Files


Three log file types are created and stored at <working directory>\logs. For each log file type,
there can be up to ten 1MB files. Once the tenth log file reaches 1 MB, the oldest file will be
overwritten with new messages. The three log file types are:
Significant.log - Contains the Significant Events Tab (p. 21) messages.
State.log - Contains all of the Status Messages Tab (p. 22) messages.
<database name>_Failed Inserts.log - Contains SQL insert statements for all records that
failed to be inserted. This log will contain no error information.

6.6 Status Bar

The Status Bar at the bottom of the main screen has three status labels:
LNDB Engine Status Label - Shows the state of the LNDB Engine.

LNDB 23
DB Connection Status Label - Shows the selected data source and whether the connection
is not connected, connecting, or connected.
LN Connection Status Label - Shows the LoggerNet host and port (if not the default port
6789) and whether the connection is not connected, connecting, or connected.
You can use the Status Bar as an alternative to LNDB's File menu. Double-click on any of the
Status Bar labels to bring up the corresponding dialog box (i.e., the LNDB Engine Status Label to
bring up the LNDB Engine Service Manager (see Installing and Starting the LNDB Service (p. 3)),
the DB Connection Status Label to bring up Select Database (see Selecting a Database (p. 6)), or
the LN Connection Status Label to bring up Login to LoggerNet Server (see Selecting a
LoggerNet Server (p. 5)).

7. Importing Data
The DBImport utility, launched from LNDB's Tools > Import Data menu item or from the
LoggerNet toolbar under the Database category, is used to import data from a data file into a
database table.

NOTE:
Files from mixed array dataloggers are not supported.
In order to be imported, a file must contain timestamps and record numbers.

LNDB 24
7.1 Database Selection
When launched for the first time, DBImport uses the database selected for LNDB. You can
change this selection using DBImport's File > Select Database menu item. The DBImport
database selection will then be independent of LNDB's database selection. The database
selection dialog (see Selecting a Database (p. 6)) is identical to the one used in LNDB. If you
select Remember and Automatically Login, the login information is only remembered for
DBImport.

7.2 Import From


The Filename field is used to indicate the file from which data is to be imported. Press the browse
button (…) to browse to the desired file.

NOTE:
Files from mixed array dataloggers are not supported.
In order to be imported, a file must contain timestamps and record numbers.

LNDB 25
7.3 TDF File
This field is only enabled when you are importing a TOA5 or TOACI1 file into a New Table. These
file formats do not store data type information in their headers. Therefore, it is recommended
that you specify a TDF file associated with the data file. This provides DBImport with the
information necessary to more accurately and efficiently map data in the data file into data types
supported by the database.
TDF stands for Table Definitions File. When a program is precompiled for a CR1000, CR3000,
CR800/850, or CR6 Series datalogger, a program_name.TDF file is created along with the
original program file. Both Short Cut and the CRBasic Editor have the option to produce a .TDF
file when a program is created or compiled. This file contains the table definitions (table size,
variable names, data types, etc.) for that program.

NOTE:
When importing a TOA5 or TOACI1 data file into a new database table, a TDF file is
particularly important if you anticipate the need to add data to the table later on via an
LNDB/LoggerNet connection.

7.4 Import Into


Select Existing Table to import the data into an existing table. The Existing Table combo box is
filled with all tables from the selected database. Select the table into which the data should be
imported.
Select New Table to import the data into a newly created table. By default, the new table will be
named stationname_datatablename. Type in a different name if desired.

NOTE:
It is important to follow the LNDB database table naming convention of stationname_
datatablename, if you anticipate the need to add data to the table later on via an
LNDB/LoggerNet connection.

7.5 Data File Columns vs Database Table


Columns
After a file is selected, the list of data fields from the file is placed in the list view under the
heading Field From File.

LNDB 26
If an existing database table is selected, the list of column names from the database table is
placed in the list view under the heading Database Column. The data file fields and database
columns are matched up. Data file fields that do not have a corresponding database column
have an attached note indicating that the "Database column is missing". Columns in the
database table that do not have a corresponding data file field have a note indicating that the
"Column does not exist in file".

7.6 Import Requirements (into existing table)


A file can be imported if all the data file fields have a corresponding database table column. This
means that there can be extra database columns that do not have a corresponding data file field.
If there are data file fields that do not have corresponding database columns, a bold note next to
the import button indicates "Fields from the file are not compatible with database table
columns". In this case, the data file cannot be imported into the database table.
No check is made to validate the columns units, process, or data type. If the data type is not
compatible, the insert will likely fail and you will be notified of the failure.

7.7 Import
Once the data file and database table are selected, press the Import button to begin importing
data. Data import will begin if the file is compatible with the selected database table as described
above.

NOTE:
The import process will slow down significantly when duplicates are encountered (between
records in the data file and records that already exist in the database) during the import
process. This is expected behavior. Just allow the import process to complete.

8. Exporting Data
The DBExport utility, launched from LNDB's Tools > Export Data menu item or from the
LoggerNet toolbar under the Database category, is used to export data from a database table
into a data file.

LNDB 27
8.1 Database Selection
When launched for the first time, DBExport launches the Selecting a Database (p. 6) dialog which
allows you to select the database from which to export data. The database selection dialog is
identical to the one used in LNDB. If you select Remember and Automatically Login, the login
information is only remembered for DBExport.
You can change the database selection at any time using DBExport's File > Select Database
menu item or by double-clicking on the database connection status panel at the bottom of the
DBExport window.

8.2 Export From


Database Table
The Database Table combo box is filled with all tables from the selected database. Select the
table from which the data should be exported.

LNDB 28
Columns
This list box contains a list of all data columns that will be exported. By default, the list contains
all columns in the selected database table. Press the Select Columns (p. 31) button to select a
custom set of columns.
Date – Time Range

Start Date/Time and End Date/ Time


These fields are used to determine what data will be exported to the file. The Start
and End controls can be set by the user. When a new database table is selected the
Start time is set to the timestamp of the oldest record for the table in the database.
The End time is set to the newest. The Lock Current Start - End Times checkbox can
be used to prevent this.
Lock Current Start – End Times
When this check box is selected, the Start and End date/time controls will not be
updated when a new table is selected. They will keep their current settings.
Include End Record
When this check box is selected, a record that matches the date and time specified in
the End control will be included in the data file. If the check box is not selected, that
record will not be included. To export the entire set of data this control should be
checked.

8.3 Export Into


Filename
The Filename field is used to indicate the file to which data should be exported. Press the browse
button (…) to browse to the desired file.
File Format
The File Format is used to select the format in which the data file should be saved. Select the
desired option from the list box:

TOACI1 - Data is stored in a comma separated format. Header information for each of
the columns is included.
TOA5 (ASCII Table Data) - Data is stored in an ASCII comma separated format.
Header information for each of the data values is included, along with field names
and units of measure if they are available. When this option is selected, the browse

LNDB 29
button to the right of the field is available. Pressing this button opens a window from
which you can specify whether timestamps and record numbers are included with
each record. You can also specify that Midnight is 2400. When this option is selected,
the timestamp will reflect midnight as the current date with 2400 for the
Hour/Minutes. Otherwise, the timestamp will reflect midnight as the next day's date,
with the Hours/Minutes as 0000.
TOB1 (Binary Table Data)- Data is stored in a binary format. Though this format saves
disk storage space, it must be converted before it is usable in other programs. When
this option is selected, the browse button to the right of the field is available.
Pressing this button opens a window from which you can specify whether timestamps
and record numbers are included with each record.
CSIXML - Data is stored in XML format with Campbell Scientific defined elements and
attributes. When this option is selected, the browse button to the right of the field is
available. Pressing this button opens a window from which you can specify whether
timestamps and record numbers are included with each record. You can also specify
that Midnight is 2400. When this option is selected, the timestamp will reflect
midnight as the current date with 2400 for the Hour/Minutes. Otherwise, the
timestamp will reflect midnight as the next day's date, with the Hours/Minutes as
0000.
Custom_CSV - Data is stored in a user-defined comma separated format. This option
can be used to produce output files from table data dataloggers that are similar to
those created by mixed array dataloggers. When this option is chosen, the Array
Compatible CSV Options (p. 32) button becomes available, so that you can
customize the data string for the CSV file.

8.4 Check for Missing Records


Select an option from this list box to determine whether DBExport checks for missing records.

No Checking– DBExport does not check for missing records.


Check Time – DBExport checks for missing records based on the data timestamps and
the interval entered in the Table Interval field.
Check Record Number – DBExport checks for missing records based on the record
number sequence.
Check Time and Record Number – DBExport checks for missing records based on
both data timestamps and record numbers.

LNDB 30
NOTE:
DBExport will not check for missing records before the first record or beyond the last record in
the database table. Therefore, if the Start Date/Time is before the first record in the database
table, records before the Start Date/Time will not be reported as missing. Likewise, if the End
Date/Time is beyond the last record in the database table, records after the End Date/Time
will not be reported as missing. DBExport will not report this as an error.

Table Interval
Specify the interval of the database table. This interval is used to check for missing records when
checking based on time.

8.5 Export
Once the database table, data file, and other options are set, press the Export button to begin
the export. While exporting is in process, you can press the Cancel button to abort the export.
While export is in process, a progress percentage will be displayed. Note that the displayed
percentage is based on the Start and End date/times selected and the timestamp of the record
currently being processed. If the Start and End date/times are in the table and there is a fairly
complete set of interval data between these times, the progress will be fairly accurate. If there are
gaps in the data, or if the Start and/or End date/times are not in the data, or if the data is event
driven (not interval based), the progress percentage may not accurately represent progress.

8.6 Select Columns


When the Select Columns button is pressed, the Select Columns dialog box appears.

LNDB 31
The Available Columns field will list all of the available data columns in the selected database
table that are not currently included for export. To choose a column to be exported, highlight it
and press the right arrow button or, alternately, double-click the column name. This moves the
column heading into the Selected Columns field. To specify that all columns are to be exported,
press the double right arrow button. When the dialog box is closed, the columns will be added to
the Columns list and will be included in the export.
Columns can be reordered in the Selected Columns field by dragging and dropping them to the
desired location.
Columns can be removed from the export by moving them back into the Available Columns field
using the left arrow button.

8.7 Array Compatible CSV Options


When File Format is set to Custom_CSV, the browse button next to the field can be pressed to
open the Array Compatible CSV Options dialog box. This dialog box is used to customize the
output file produced by DBExport. It is most often used to produce output files from table data
data loggers that are similar to those created by mixed array data loggers.

LNDB 32
If an array ID is desired, select the Include Array ID check box and enter a value into the field. The
value can range from 1 to 1023. The array ID will be the first value in the array of data.
Select the appropriate timestamp options for the type of timestamp to write to the file. Each time
element will be output as a separate data value in the array and the data values will be separated
by a comma. Selecting Year will output the year represented by four digits, YYYY (e.g., 2006). The
Day will be represented as a Julian Day. The Hour/Minutes will be represented by four digits
(hhmm). When Midnight is 2400 is selected, the timestamp will reflect midnight as the current
date with 2400 for the Hour/Minutes. Otherwise, the timestamp will reflect midnight as the next
day's date, with the Hours/Minutes as 0000.
The Max and Min Timestamp Options is used to determine the type of timestamp that will be
used for Maximum and Minimum outputs that include a timestamp along with the value. You
can choose a TOA5 format timestamp (e.g., 2008-10-27 17:17:33.7), a timestamp that includes
Hours/Minutes and Seconds (produces two values, hhmm and seconds), a timestamp that
includes Hours/Minutes only (hhmm), or a timestamp that includes Seconds only.

8.8 Representation of NULL Values


When the database table being exported contains NULL values, they will be represented as
described in the table below:

LNDB 33
NAN representation of NULL values from a database

SQL
Datalogger SQL
NAN MySQL Server
Data Example Server Oracle PostgreSQL
Value Type Compact
Type Type
Type

Positive 0x7FFFFFFFFFFFFFF BINARY_ DOUBLE


IEEE8 DOUBLE FLOAT(53) FLOAT
Max (9223372036854775807) DOUBLE PRECISION

Quiet 0x7FFFFFFF BINARY_


IEEE4 FLOAT REAL REAL REAL
NAN (2147483647) FLOAT

Negative
LONG Max -2147483648 INT INT INT Number(10,0) integer
(LONG)

Jan 1
SecNano 0 DATETIME DATETIME DATETIME TIMESTAMP timestamp
1990

BOOL False 0 BIT(1) BIT BIT Number(1,0) boolean

SMALLINT
USHORT Zero 0 INT INT Number(5,0) integer
UNSIGNED

Empty NVARCHAR NVARCHAR NVARCHAR2


string-spec TEXT text
String (MAX) (2048) (2000)

9. QuickReports
QuickReports, launched from the LNDB Tools > QuickReports menu item, is used to design
simple reports from an LNDB database. It is very simple and quick and enables you to generate a
new report with just a few mouse clicks. The report can then be printed or exported to an Acrobat
file.
The QuickReports Setup (p. 40) dialog is displayed every time a new report is created and
presents you with a few basic options such as title, time range, database table, and up to 4 data
columns. When you accept the settings in the QuickReports dialog, the report is then bound to
the selected table. You can customize the report further using each component’s property sheet.
The report can then be saved and run as a report in the Report Preview window. The Report
Preview window paginates the report and gives options to print or export to an Acrobat file.

LNDB 34
The saved report can be loaded in RTMC Pro where it can be modified with advanced features
and components. When the report is saved in RTMC Pro, it will be saved as a *.rtmc2 project file.
This file cannot be loaded in QuickReports. However, the QuickReports *.rtmq file will not be
overwritten. This file can still be loaded in QuickReports, but it will contain none of the changes
made in RTMC Pro.

9.1 Database Selection


The Database Data Source Properties dialog box comes up automatically the first time
QuickReports is opened. At other times, it can be opened from the File | Select Database menu
item or by double-clicking on the database portion of the status bar at the bottom of the
QuickReports window. This dialog box is used to set up the database source for your report.
Source Name
Designates the name that will be used for the database in QuickReports.
Type
The type of database. Choose a type from the drop-down list.
The following database types are supported in QuickReports:

l SQL Server Compact


l SQL Server
l MySQL
l Oracle
l PostgreSQL

The remaining information changes depending on the database type as described below:

LNDB 35
SQL Server Compact

The only additional information needed for a SQL Server Compact database source is the
database file to be used. Type in the name directly or press the button to the right of the field to
browse to the database file.

LNDB 36
SQL Server

To select a SQL Server database source you must select a SQL Server instance. The list of
published SQL Server instances is shown in the Data Source combo box. You can also type into
the Data Source combo box, because the desired server might not be published. Windows
Authentication or SQL Server Authentication can be selected. Windows Authentication does not
require a username and password, but rather uses Windows user accounts to authenticate valid
users. SQL Server Authentication requires a login ID and Password and is independent of
Windows user accounts. You can select the <default> database or select a specific database from
the Database combo box.
The Remember username and password checkbox can be selected to save the username and
password. If this check box is not selected and you are using SQL Server Authentication, you will
be required to enter the username and password each time a report is opened that uses this
database source.

LNDB 37
MySQL

The MySQL connection is an ODBC connection. You must use the Windows ODBC Data Source
Administrator to configure the database connection. Currently only system data sources are
supported and show in the Data Source combo box. The Username and Password may be
optional. They will be set to blank in the connection string. It has been found that when set to
blank, the login id and password configured in the ODBC Data Source Administrator are used.
You can select the <default> database (default as configured in the data source) or select a
different database.
The Remember username and password checkbox can be selected to save the username and
password. If this check box is not selected and the username and password were not configured
in the ODBC Data Source Administrator, you will be required to enter the username and
password each time a report is opened that uses this database source.

LNDB 38
Oracle

To select an Oracle database source you must enter a Hostname:Port, Username, Password, and
Service Name. The default Oracle port is 1521.
The Remember username and password checkbox can be selected to save the username and
password. If this check box is not selected, you will be required to enter the username and
password each time a report is opened that uses this database source.

LNDB 39
PostgreSQL

To select a PostgreSQl database source you must enter a Hostname:Port, Username, Password,
and Database. The default PostgreSQL port is 5432.
The Remember username and password checkbox can be selected to save the username and
password. If this check box is not selected, you will be required to enter the username and
password each time a report is opened that uses this database source.

9.2 QuickReports Setup


The QuickReports Setup window comes up automatically after a new data source has been
selected. At other times, it can be opened to edit an existing report by selecting Edit >
QuickReports Setup from the menu or by right-clicking on the chart and selecting QuickReports
Setup. It can be opened to create a new report by selecting File > New Report from the menu.
This window allows you to designate a title for your report, select the data table that will be used
for the report, select the columns of data that will be displayed, and select the date range that
will be displayed.

LNDB 40
Title
Specify the title to be displayed at the top of the report.
Data Table
Indicates the data table from which to display data values. Use the Browse button to open the
Data Source Browser and select a table.
Data Column 1 – Data Column 4
Use the drop-down lists to select up to 4 data values to be displayed. (Note that you can add
more data values later. See Customizing Your Report (p. 42).)
Begin Date/End Date
Enter the Begin Date/Time and End Date/Time to specify the time period for which data will be
displayed. The Oldest Available Date and Newest Available Date fields indicate the date range
that is in the table and able to be displayed.

NOTE:
By default, the Data Grid can display a maximum of 5000 records. If your selected date range
exceeds 5000 records, you will only see 5000 records in the Data Grid with a note at the
bottom indicating “Max Records Exceeded”. In order to view all of the records in your date
range, you will need to use the Data Grid’s property sheet to increase Max Records. (See
Customizing Your Report (p. 42) for more information on using property sheets to customize
your report.)

LNDB 41
When using the QuickReports Setup window to edit the date range for a report, you will lose
any customization you have done to chart traces. If you wish to maintain the customization,
you should edit the date range using the Report Range property sheet.

9.3 Customizing Your Report


Once you have set up a report using the QuickReports Setup dialog box, you can customize the
report using each component’s property sheets. The components on a report include the Report
Range, Report Title, Report Subtitle, Logo, Chart and Data Grid. A component’s property sheet
can be opened by double-clicking on the component, by right-clicking on the component and
selecting <Component Name> Properties or by choosing the component from the Edit menu.
For example, to edit the properties of the chart, double-click on the chart, right-click on the chart
and select Chart Properties, or select Edit > Chart Properties from the QuickReports menu.
Press the ‘?’ button at the top right of a component’s property box for additional information on
that component’s properties.

NOTE:
You can add traces to the chart using the Add button on the Series tab of the Chart property
sheet. Columns can be added to the Data Grid using the Select Columns button on the Data
Grid property sheet.

A component can be deleted from the report by right-clicking on the component and selecting
Delete <Component Name>. For example, to delete the chart, right-click on the chart and select
Delete Chart. Once a component has been deleted, it can be restored to the report by selecting
Edit > Undo from the QuickReports menu.

NOTE:
Once a report has been closed, you will not be able to restore the component.
The Undo and Redo functions in QuickReports apply only to deleting components.

9.4 Generating Your Report


Once you have set up your report and customized the components, you save and generate the
report by selecting File > Save and Generate Report from the QuickReports menu. The report is
saved as a *.rtmq file.
When a report is generated you will see a preview of the report. From the toolbar on the Report
Preview window you can print the report or export it to an Acrobat (PDF) file.

LNDB 42
10. Troubleshooting
Database already opened by a different user
The "Database already opened by a different user" error can occur if Windows UAC (User
Account Control) is on, an application with standard rights connects to the database first, and
then a second application run as an administrator attempts to connect. With UAC on, the SQL
Server CE database determines that the second application is being run by a different user. This
error can be seen with the LNDB Engine, because it always runs with certain administrative rights.
To fix this problem, all connections to the database should be closed and then the connection
can be attempted again. If the first application that connects is run with administrative rights, all
other applications with or without administrative rights can connect.

LNDB 43
Appendix A. Data Type
Mapping
Datalogger data types are mapped into database data types differently depending on the type of
database as described below.
SQL Server Compact

Datalogger Data Type SQL Server Compact Data Type Notes


IEEE8 FLOAT
IEEE4 REAL
FP2 REAL
Long INT
UINT2 INT
String NVARCHAR(2048)
Boolean BIT
Bool8 BIT
Nsec DATETIME Resolution is 3ms

SQL Server

Datalogger SQL Server Notes


Data Type Data Type
IEEE8 FLOAT(53)
IEEE4 REAL
FP2 REAL
Long INT
UINT2 INT
NVARCHAR
String
(MAX)

LNDB 44
Boolean BIT
Bool8 BIT
DATETIME or Record Timestamp is DateTime2 (resolution is 100ns). All
Nsec
DATETIME2 others are DateTime (resolution is 3ms).

MySQL

Datalogger MySQL Notes


Data Type Data Type
IEEE8 DOUBLE
MySQL FLOAT data type only stores 6 digits of
IEEE4 FLOAT
precision. The datalogger stores 7.
FP2 FLOAT
Long INT
SMALLINT
UINT2
UNSIGNED
String TEXT
Boolean BIT(1)
Bool8 BIT(1)
MySQL DATETIME does not support subsecond
Nsec DATETIME
information.

Oracle

Oracle Notes
Datalogger Data Type
Data Type
IEEE8 BINARY_DOUBLE
IEEE4 BINARY_FLOAT
FP2 BINARY_FLOAT
Long Number(10,0)
UINT2 Number(5,0)

LNDB 45
String NVARCHAR2(2000)
Boolean Number(1,0)
Bool8 Number(1,0)
Nsec TIMESTAMP Resolution is 1 microsecond

PostgreSQL

PostgreSQL Notes
Datalogger Data Type
Data Type
IEEE8 double precision
IEEE4 real
FP2 real
Long integer
UINT2 integer
String text
Boolean boolean
Bool8 boolean
Nsec timestamp Resolution is 1 microsecond

LNDB 46
Appendix B. SQL Rights
LNDB requires you to have rights to the following commands based on the database type:
SQL Server Compact
No security available.
SQL Server

Command Usage
Alter Used to add columns to existing data tables
Create
Creates meta and data tables
Table
Delete tables (only initiated by user in LNDB Manager). Also used when
Drop
creating a temporary meta table during an archive.
Delete Deletes meta table records. (Never deletes data table records.)
Insert Meta table and data table inserts.
sp_rename Stored procedure used to rename a table during an archive.
Select Meta table and data table data requests.
Update Used to update meta table records during an archive.
References Used when creating meta tables.
View
Database Used by DBExport and RTMC Pro to get the number of records in a table.
State

MySQL

Command Usage
Used to add Columns to existing data tables. Also used to rename data
Alter
tables.
Create
Creates meta and data tables
Table

LNDB 47
Delete tables (only initiated by user in LNDB Manager). Also used when
Drop
creating a temporary meta table during an archive.
Delete Deletes meta table records. (Never deletes data table records.)
Insert Meta Table and data table inserts.
Select Meta Table and data table data requests.
Update Used to update meta table records during an archive.
References Used when creating meta tables.

Oracle

Command Usage
Alter Any Used to add columns to existing data tables. Also used to rename data
Table tables.
Create Used to create unique identifiers used as primary keys within the Meta
Sequence tables.
Connect To establish a connection (Granted Role)
Create Table Create mete and data tables
Delete Any
Deletes meta table records. (Never deletes data table records.)
Table
Drop Any Delete tables (only initiated by user in LNDB Manager). Also used when
Table creating a temporary meta table during an archive.
Insert Any
Meta table and data table inserts.
Table
Select Any
Meta table and data table data requests.
Table
Update a
Used to update meta table records during an archive.
Table
Unlimited Lets the LNDB engine service create tables as needed without running
Tablespace into allocation of space issues.

LNDB 48
PostgreSQL

Command Usage
Can Login To allow the SQL user to log in to the SQL server
Connect To establish a connection
Create Creates meta and data tables
Delete Deletes meta table records. (Never deletes data table records.)
Insert Meta table and data table inserts.
Select Meta table and data table data requests.
Temporary Allows temporary files to be created to manipulate meta table records.
Update Used to update meta table records during an archive.
References Used when creating meta tables.

LNDB 49
Appendix C. Metatables
There are three metatables which contain the relationships between LoggerNet and the
database: lndbstationmeta, lndbtablemeta, and lndbcolumnmeta.

NOTE:
The metatables should not be modified by the user.

lndbstationmeta
Information for every station for which data has been or will be stored.
stationID - primary key
lnStationName - LoggerNet station name
lndbtablemeta
Information for every database data table that has been or will be written to.
tableID - primary key
LNDBStationMeta_stationID - foreign key referencing lndbstationmeta.stationId
lnTableName - LoggerNet tablename
dbTableName - database tablename
lndbcolumnmeta
Information for every database "data" column that has been or will be written to.
LNDBStationMeta_stationID - foreign key referencing lndbstationmeta.stationID.
LNDBTableMeta_tableID - foreign key referencing lndbtablemeta
lnColumnName - datalogger column name (from LoggerNet)
dbColumnName - Database column name
process - process as defined in datalogger program
units - units as defined in datalogger program
dataType - datalogger column's data type
columnOrder - actual order in datalogger table definitions
active - true if data for the column should be stored

LNDB 50
Appendix D. Unicode Support
and Upgrade Process
With LNDB versions 1.2 and later, support is provided for storing Unicode (UTF-8) strings into the
LNDB database. DBExport, DBImport, and QuickReports have also been Unicode-enabled.
LoggerNet version 4.2 or later is required to enable the Unicode features of LNDB.
UTF-8 Unicode encoding includes characters from languages such as Russian, Chinese, Japanese,
Greek, Korean, and many other languages of the world. For brevity, the UTF-8 character sets are
not shown here. For non-English UTF-8 character data to be created and stored within an LNDB
database, the CRBasic program running on a datalogger must be modified to explicitly provide
source data in the desired language using UTF-8/Unicode format.
LNDB deployments using Microsoft SQLServer databases require the Unicode-enabled versions
of LoggerNet and LNDB to be installed, and then these will store Unicode strings automatically
as soon as datalogger program modifications that use UTF-8 are implemented.
MySQL databases that are created new in LNDB v1.2 (and later) are automatically encoded using
UTF-8, and therefore will also store any UTF-8 characters that arrive from a datalogger source (as
long as a Unicode-enabled ODBC driver is used - see step 6. of the migration process below).
However, existing MySQL tables that were created using LNDB v1.0 or v1.1 are not encoded with
UTF-8, and are not automatically converted to UTF-8 when LNDB v1.2 (or later) is installed and
executed. These legacy database tables should be considered for migration to UTF-8 format,
although migration is often not necessary.

D.1 Deciding Whether to Migrate MySQL


Tables to UTF-8
If the string data to be stored in the existing MySQL tables will continue to be English, or a
language that uses predominantly English/Latin characters with only a few non-English extended
characters required, you do not need to migrate your database tables to UTF-8. This usually
applies to the use of western European languages (such as German, French, Spanish, Italian,
Dutch, etc.). You can continue to use these tables in their original format with LNDB v1.2. MySQL
has usually encoded these tables in the Latin1 character set, which is sufficient for storing the
kind of string data used in these cases.

LNDB 51
NOTE:
To determine exactly which characters are supported in legacy LNDB tables (i.e., without
migrating them to UTF-8), refer to the section below entitled Windows Code Page 1252.

However, if you will begin requiring the storage of non-English (non-Latin-based) characters
from languages such as Russian, Chinese, Japanese, Greek, Korean, and many other languages of
the world into these legacy LNDB tables, they will require migration to the UTF-8 format.
When migrating your tables to UTF-8, you should carefully follow the migration process shown
in the section below entitled Migrating Existing MySQL Tables to UTF-8. The migration process
includes these main actions:

l Performing a backup of the MySQL database.


l Upgrading LoggerNet to a Unicode-enabled version (4.2 or later).
l Upgrading LNDB to version 1.2 or later.
l Installing a 32-bt, Unicode-enabled MySQL ODBC driver and configuring LNDB to use that
driver.
l Converting the LNDB tables in the MySQL database to UTF-8 (from Latin1, etc.). (Note that
this step is performed within the LNDB Manager software.)
l Modifying the datalogger programs to use UTF-8 characters, loading the programs into the
dataloggers, and starting the programs.

D.2 Migrating Existing MySQL Tables to


UTF-8
To avoid loss of data, perform the UTF-8 table migration by following these steps in order:

1. Close the LNDB Manager, QuickReports, DBImport, and DBExport.


2. Pause the scheduled collection process in LoggerNet to avoid any writing of data into the
MySQL database. To do this, select the Status Monitor from the Main section of the
LoggerNet toolbar, and check the Pause Schedule checkbox.
3. Perform a backup of the tables stored in the MySQL database to secure against data loss.
This backup process is done using standard MySQL database administration techniques
and is not executed from within LNDB.
4. Shut down the LoggerNet Toolbar. Upgrade LoggerNet to version 4.2 or later. The latest
shipping version of LoggerNet is recommended for installation. The latest 4.x patches are

LNDB 52
available on the Campbell Scientific website.
5. Upgrade LNDB to version 1.2 or later. Check the Campbell Scientific website for the latest
version.
6. Install a 32-bit, Unicode version of the MySQL ODBC driver (v5.2.6 or later). The driver
installation software is obtained from a MySQL software provider and not from Campbell
Scientific.
7. Start the LoggerNet Toolbar. Start the LNDB Manager from the Toolbar.
a. Start the LNDB Engine service (if needed) when prompted.
b. Connect to LoggerNet as prompted.
c. In the Select Database screen, make sure the ODBC data source used by LNDB is
configured to use the newly installed 32-bit, Unicode-enabled driver. Use the ODBC
Data Source Administrator button as needed, along with the Select Database screen
itself.
8. Open the Convert MySQL tables dialog box from the Tools menu of the LNDB Manager.
Using this screen, convert the LNDB database and metadata tables to use the UTF-8
character set/encoding (instead of Latin1, for example). Refer to Convert MySQL Tables (p.
54) for further details.
9. Modify the CRBasic program running in the affected dataloggers to use the desired
Unicode (UTF-8) characters. The CRBasic Editor provided with LoggerNet 4.2 and later will
allow the native processing of UTF-8 characters on-screen. Start the Unicode-enabled
programs on the dataloggers.
10. Uncheck the Pause Schedule checkbox in the Status Monitor of LoggerNet to allow data to
be collected and sent to LNDB. Use the Connect Screen and LNDB Manager to confirm
that data is flowing from the dataloggers into LoggerNet, and from LoggerNet into LNDB.
Confirm that Unicode characters are written properly into the data tables of LNDB.

NOTE:
Make sure you do not start a datalogger program that uses Unicode characters until
LoggerNet and LNDB have been updated, the LNDB tables have been converted to UTF-8,
and the proper MySQL Unicode driver has been installed, as described above. Most Unicode
characters cannot be stored in the LNDB database until all of these actions have been
executed properly. MySQL tables that use the Latin1 character set instead of UTF-8 cannot
store Unicode characters. String data written into LNDB databases when any of the above
conditions are not satisfied may result in unrecoverable or corrupt string storage.

LNDB 53
D.3 Convert MySQL Tables
The Convert MySQL Tables dialog box, launched from LNDB's Tools > Convert MySQL Tables
menu item, is used to convert database tables and metatables in a MySQL database that have
been storing Windows code page 1252 characters (extended ASCII/Latin1/ISO 8859-1) to Unicode
(UTF-8) strings in the LNDB database.

After upgrading to LNDB 1.2, any tables that need to be converted in order to start storing
Unicode characters will be shown in the dialog box along with their current character set and
their target character set. Simple select the tables you wish to convert (or Select All to select all of
the tables) and press the Convert button. The selected tables will be converted to Unicode.

D.4 Windows Code Page 1252


MySQL tables used in LNDB 1.1 and LNDB 1.0 did not use Unicode/UTF-8 for displaying extended
(non-English) characters. They used Windows Code Page 1252 (CP1252), which is nearly identical
to ISO 8859-1, and which is sometimes called ANSI or Extended ASCII. CP1252 is shown here for
reference:

LNDB 54
To store characters that are not shown above (not a part of CP1252) with Campbell Scientific
products, it is necessary to use UTF-8 Unicode encoding.
LNDB 1.1 and 1.0 systems that used MySQL usually encoded database tables as Latin1. Latin1 is
100% compatible with the CP1252 characters shown above. If your ongoing use of LNDB 1.2 and
later does not require any more characters than those shown above, you may continue using the
Latin1 table encoding that was created by LNDB 1.0 and/or 1.1. In that case, no migration of the
table encoding and data is necessary. LoggerNet 4.2 or later and LNDB 1.2 or later can be
installed and will work properly with existing Latin1 tables (CP1252) just as they did with earlier
versions of LNDB and LoggerNet. This will not require any migration steps other than standard
upgrade installations.

LNDB 55
Campbell Scientific regional offices

Australia France Thailand


Location: Garbutt, QLD Australia Location: Vincennes, France Location: Bangkok, Thailand
Phone: 61.7.4401.7700 Phone: 0033.0.1.56.45.15.20 Phone: 66.2.719.3399
Email: [email protected] Email: [email protected] Email: [email protected]
Website: www.campbellsci.com.au Website: www.campbellsci.fr Website: www.campbellsci.asia

Brazil Germany UK
Location: São Paulo, SP Brazil Location: Bremen, Germany Location: Shepshed, Loughborough, UK
Phone: 11.3732.3399 Phone: 49.0.421.460974.0 Phone: 44.0.1509.601141
Email: [email protected] Email: [email protected] Email: [email protected]
Website: www.campbellsci.com.br Website: www.campbellsci.de Website: www.campbellsci.co.uk

Canada India USA


Location: Edmonton, AB Canada Location: New Delhi, DL India Location: Logan, UT USA
Phone: 780.454.2505 Phone: 91.11.46500481.482 Phone: 435.227.9120
Email: [email protected] Email: [email protected] Email: [email protected]
Website: www.campbellsci.ca Website: www.campbellsci.in Website: www.campbellsci.com

China South Africa


Location: Beijing, P. R. China Location: Stellenbosch, South Africa
Phone: 86.10.6561.0080 Phone: 27.21.8809960
Email: [email protected] Email: [email protected]
Website: www.campbellsci.com.cn Website: www.campbellsci.co.za

Costa Rica Spain


Location: San Pedro, Costa Rica Location: Barcelona, Spain
Phone: 506.2280.1564 Phone: 34.93.2323938
Email: [email protected] Email: [email protected]
Website: www.campbellsci.cc Website: www.campbellsci.es

You might also like