Academic Company Events NI Developer Zone Support Solutions Products & Services Contact NI MyNI

Document Type: Tutorial
NI Supported: Yes
Publish Date: Sep 6, 2006

Merging Two Databases Using the Historical Data Viewer in MAX for the LabVIEW DSC Module 7.0

2 ratings | 5.00 out of 5
Print
The purpose of this tutorial is to show how to merge two Citadel databases using the Historical Data Viewer installed in Measurement and Automation Explorer (MAX) by the LabVIEW Datalogging and Supervisory Control (DSC) Module 7.0.
    You might want to merge Citadel databases because you have multiple DSC Module applications running on more than one computer. Even though you would have independent databases for each of the applications, you might also like to have a merged database that contains data from both databases. Complete the following steps to merge two databases.

    NOTE: Throughout this document, the database copied from the remote computer is referred to as remotedatabasenew, and the local database that data will be merged into is referred to as data. Depending on the hard drive location of these databases, their complete name in MAX may vary slightly. In our examples, both folders are located directly off the C drive, and because of this, they show up in MAX as C__remotedatabasenew and C__data, respectively.

    1. Copy the remote Citadel database directory to the local computer. For this tutorial, the new folder on the local computer was named remotedatabasenew.

    IMPORTANT: To manually copy a database directory, you must stop the DSC Module Tag Engine and the Logos services. In the Windows 2000/NT/XP Task Manager, these services appear as nicitdl5.exe, lkads.exe, and lktsrv.exe and run automatically. The DSC Module also installs the Microsoft SQL Server Desktop Engine, which appears as msde.exe. To interact with these services, use the Services utility found in Start»Settings»Control Panel»Services. If you create the database copy while a service is running, you might get an inconsistent copy of the database.

    2. Launch MAX so that you can create a new database link to the database copied from the remote computer.

    3. With the Historical Data category expanded and Citadel 5 Universe selected, right-click your computer name in the Databases view and select Create/Attach Database.

    Figure 1.
      4. Enter the path to the copied database or click the ... button to browse to the copied database, remotedatabasenew.


      Figure 2.


      5. Click OK to attach the remotedatabasenew database to view and manage in the Historical Data Viewer.
        6. Right-click the logging computer icon of the remotedatabasenew database and select Rename. Change the name to match the logging computer name of the database you are merging to. In this case, the logging computer name of remotedatabasenew starts out as machineB. We need to change this to machineA so that it matches the logging computer name of our data database. This changes the names of the traces in the remotedatabasenew database to match the names of the traces in the data database.



        Figure 3.

        7. Right-click Citadel 5 Universe and select New»Trace View to create a new trace view for the remotedatabasenew database.


        Figure 4.


        8. Browse to and select the traces that you want to have in this view and click the Add button to add the traces to the view. Then click OK.



        [+] Enlarge Image
        Figure 5.
          Now you have a view of the traces in the remotedatabasenew database, and you are ready to merge this database with the data database. To merge the remotedatabasenew database with the data database, archive the trace view you created in step 8. To keep the data in the data database intact, create a backup of the database first.
            9. Archive the copied database.
                a. Right-click the New Trace View and select Archive.


                Figure 6.

                b. Select the data to archive and click Add. The data in the trace view is already added to the archive operation. Click Next.



                Figure 7.

                c. Browse to and select the database to archive the new trace view data to, data, and click Next.



                Figure 8.

                d. Configure archive options in the next dialog box. Do not enter a Start Time or End Time to archive all of the data you selected to archive.
                e. Click OK and then Close.
              The trace data archived from the trace view for the remotedatabasenew database is merged with the trace data contained in the data database. You can now create a new trace view to view data in the merged databases.

              Related Links:
              Merging Two Databases in the LabVIEW DSC Module Using the Citadel Historical VIs
              Merging Two Databases Using the Historical Data Viewer in MAX for Lookout and the LabVIEW DSC Module 6.1

              2 ratings | 5.00 out of 5
              Print

              Reader Comments | Submit a comment »

               

              Legal
              This tutorial (this "tutorial") was developed by National Instruments ("NI"). Although technical support of this tutorial may be made available by National Instruments, the content in this tutorial may not be completely tested and verified, and NI does not guarantee its quality in any way or that NI will continue to support this content with each new revision of related products and drivers. THIS TUTORIAL IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND AND SUBJECT TO CERTAIN RESTRICTIONS AS MORE SPECIFICALLY SET FORTH IN NI.COM'S TERMS OF USE (http://ni.com/legal/termsofuse/unitedstates/us/).