Download SQL Exercises - RADE

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts
no text concepts found
Transcript
SQL Toolkit
Extract signal data from LHC Logging database
Goal
Getting signal data from LHC Logging database using the SQL Toolkit.
Scenario
SQL toolkit provides access to CERN databases. It allows to query to CERN
databases and get signal data from LHC Logging and Measurement databases.
Figure 1 SQL Toolkit
Design
Implement data extraction from LHC Logging database using SQL_MA.vi from
SQL Toolkit.
Implementation
1. Open ExtractSignalData.vi from the <RADE-exercises>\SQL.
Figure 2 and Figure 3 show the front panel and block diagram.
Figure 2 ExtractSignalData.vi front panel
1
Figure 3 ExtractSignalData.vi block diagram
Implement getting a signal data from Logging database
1. Modify the block diagram to extract signal data from the Logging database.
You will modify the “getFromLogging” state as shown in Figure 4.
Figure 4 Extracting a signal data from Logging database

Add SQL_MA.vi from SQL palette to the block diagram.

Connect input connectors for SQL_MA.vi:
o Function
o Client app info
o DB selector
o Signal
o Date start
2
o
o
NOTE
Date end
Statistics
The DB selector value is “lhclog” for the Logging database and “measdb” for the
Measurement database.

Connect outputs for SQL_MA.vi:
o Rows number
o Statistic
o Signal description
o Table
o Error out
2. Save the VI.
Testing
1. Extract data of a signal:
 Run VI
 Press “Get signal data” button
 Change “Signal” control, either clicking the orange buttons or manually
 Try changing “Start date” and “Stop date”
 Press “Get signal data” button again to retrieve the signal
TIP
If you receive no data try to setup another date in “Start date” and “Stop date”
IMPORTANT!
It is not allowed to request data of more than 7-days time interval.
It can take a some time to extract data for time-interval of more than a few
hours.
2. “VAR_NUMERIC_DATA_V” and “VAR_NUMERIC_DATA_OR_LAST_DATA”
functions:
 Set the function to “VAR_NUMERIC_DATA_V”
 Find a time period with ”row number = 0”, for example, set the same
date in “Start date” and “Stop date”
 Set the function to “VAR_NUMERIC_DATA_OR_LAST_DATA”
 If there is no data in a time period set, the last signal data is returned
TIP
If you need to extract the last data point from a signal, set “Start date” and
“Stop date” to the same date.
3. Get statistics of a signal for the time period:
 Enable “Show statistics”
 Try getting statistics for a signal for a different time period from the
database
INFO
You can retrieve only statistics or signal data at the same time. When
“Statistics” is enabled, no data is available. The reason is that the “Statistics”
mode is really faster, especially when extracting big time intervals.
NOTE
Measurement database contains only data taken in the last week for a small
subset of Logging database signals.
3
Related documents