Logging Historical Data with the Citadel Database (DSC Module)

LabVIEW 2017 Datalogging and Supervisory Control Module Help

Edition Date: March 2017

Part Number: 371618K-01

»View Product Info
Download Help (Windows Only)

The NI Citadel historical database is a database that the LabVIEW Datalogging and Supervisory Control (DSC) Module and other NI products use. This database efficiently stores data that applications acquire and process. The DSC Module uses the Citadel historical database to log shared variable data from the Shared Variable Engine (SVE). The DSC Module also includes the Citadel ODBC driver, which contains special commands to perform data transforms, so you can retrieve, manipulate, and analyze historical data automatically from outside the LabVIEW environment.

Note  If you have applications that use the Classic Historical Trend Viewer (HTV) from a previous version of the DSC Module, you still can use the HTV in the previous applications. Do not use the HTV in new applications with the latest DSC Module.

Data processed by the SVE is contained in memory; LabVIEW does not create a file to hold the data. When you run an application configured to log data, LabVIEW logs data from the SVE to the Citadel historical database. You cannot log data when the SVE is stopped.

The Citadel historical database includes an ODBC driver, which enables other applications to directly retrieve data from a Citadel database using SQL queries. The Citadel 5 ODBC driver is compliant with SQL 92 and ODBC 2.5 standards. All clients that follow these standards can retrieve data from a Citadel 5 database. ADO clients can use the ODBC driver through the Microsoft OLE DB Provider for ODBC Drivers to access the Citadel 5 database. MS Query wizard can be used to build-up queries. The Citadel database runs on Windows as a service.

The maximum size for alarm and event data in a Citadel database is 10 GB. You can upgrade to the full version of SQL Server 2008 R2 to remove the size limit for alarm and event data. There is no size limit for historical data.

Caution  Do not stop Citadel database services while the DSC Module or the SVE is running. If you stop these services, you cannot log or retrieve data or alarms.
Note  If an application that accesses the Citadel database crashes or incorrectly stops, the next time you try to log data to the Citadel database, an alarm occurs stating that the Citadel database index is being rebuilt. Rebuilding the Citadel database index takes some time. During this time, you might not be able to log data.

The data you log to a Citadel database resides in a set of files in the target directory you set for logging. This data can include shared variable values from the application as well as alarms and events. You determine the data that is logged to a specific location when you configure shared variables and alarm and event logging for shared variables. Shared variable data that logs to the Citadel database is called a trace. A trace contains the data type, data values, timestamps, and qualities of the shared variable. Each shared variable logs to an independent trace. You also can log data in sets.

You can log data to the local computer or to a remote computer on the network, but the directory to which you want to log must be writable from the computer running the SVE. You determine the logging location when you enable logging for processes.

Note  If you log data to a Touch Panel target, ensure this Touch Panel target has enough free space to log the data. The SVE stops logging new data when the Touch Panel target does not have enough free space.

You can access Citadel data through the Historical Data Viewer, Historical VIs, SQL queries, or any other ODBC-compliant application such as Microsoft Query, Microsoft Access, or Microsoft Excel.

Specifying an Appropriate Database Location

To ensure that data logging to the Citadel database is successful, you must specify an appropriate database location to which the DSC Module has full access.

By default, the DSC Module configures appropriate access rights for the labview\data folder and stores the database in that folder. If you want to store the database in a different folder, ensure that the folder meets the following requirements:

  • The database folder is readable by all members of the USERS group. The Citadel database is a shared resource and must be available to all users of the system. Alarm logging fails if the database folder is not readable to all users.
  • The database folder is writable by the user who wants to log data.
  • The database folder is readable and writable by the SYSTEM user. The Citadel service runs as a SYSTEM user and must have sufficient access rights to manage the database files.
  • The database folder is writable by the NETWORK SERVICE user. By default, the folders under the C:\Users directory and the top-level folders that the NETWORK SERVICE user creates are writable by that user.

If you do not store the database in the labview\data folder, NI recommends that you place the database under the Windows Public user directory, located at C:\Users\Public. This folder always meets the requirements above. Do not use the following folders to store the database:

  • C:\Windows—The system has highly restricted access to this folder.
  • C:\Users\Username—This folder is visible only to the owning user, so the system has restricted access to this folder.

WAS THIS ARTICLE HELPFUL?

Not Helpful