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

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


Feedback


Yes No

Related Categories

Related Links - Developer Zone

Related Links - Products and Services

Accessing Citadel 4 Data from Microsoft Query

12 ratings | 3.08 out of 5
Print
1. Launch Microsoft Query.

a. Launch Excel

b. Select Data»Get External Data»New Database Query.

2. Choose File»New. If the Citadel data source is not visible, you must create it. If it is visible, skip to step 3.

a. Select the <New Data Source> entry in the Databases tab. Make sure the Use the Query Wizard to create/edit queries option is not selected.


b. The Create New Data Source dialog box appears. Fill in the fields as shown in the following illustration.


c. Click on the Connect button. The National Instruments Citadel ODBC Setup dialog box appears. Fill in the fields as shown in the following illustration. Enter the location of your database in the Database Path field. Make sure the Convert special characters option is selected as seen below.


d. Click on OK. The Create New Data Source dialog box reappears, and should look like the following illustration.



e. Do not select a default table or save your ID and password. Click on OK. The Choose Data Source dialog box appears, this time with the Citadel database as one of your data source choices. Choose Citadel as your data source and click on OK.




3. Select the Citadel data source. Do not select Use the Query Wizard to create/edit queries option.

    Note: If Microsoft Query is unable to connect to Citadel, make sure you have logged data to Citadel and entered the correct database path in the ODBC Setup dialog box.


    Note: If Citadel is not listed in the Data Source dialog box, make sure you have created Citadel as a data source.



4. In the Add Tables dialog box, double-click Traces or Points, depending on whether you want to view raw data (Points) or interpolated data (Traces).


5. Close the dialog box.

Microsoft Query presents the full Query Window with the Traces and Points tables. The names in these tables are a comprehensive list of all name values that have been logged to Citadel.


6. To view a trace, double-click or drag the field you want to view to a blank column in the data pane. In the figure , LocalTime and "\\PAROIKOS\My_Server\PLC_Simulator@amplitude" have been dragged down.

7. To view a data transform value, enter the function directly into a blank column. For example, to view the minimum value of PLC_Simulator.amplitude, you would enter “min{\\PAROIKOS\My_Server\PLC_Simulator@amplitude}”. You must include the quotation marks and brackets.

The data set in the figure was retrieved using no specific criteria, so the ODBC driver used the default. Although there are several ways to specify criteria, this example uses the Criteria Pane.

8. Click on the View Criteria button. The pane appears in the Query window.

9. Add a field to the Criteria Pane by dragging it to the blank column in the Criteria Pane then type in the Value. In the following example, an Interval criteria of one minute was chosen.


As soon as you specify criteria, Microsoft Query retrieves the specified data. You can save your query at any stage of development, and as you build your query, the application builds an SQL statement.

10. Click on the SQL button to view or edit the query statement.



12 ratings | 3.08 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/).