National Instruments BridgeVIEW Benutzerhandbuch
Appendix B
Citadel and Open Database Connectivity
B-4
© National Instruments Corporation
How Do You Access Citadel Data?
The ODBC driver presents Citadel data to other applications as a Threads
table. The table contains a field or column for each data member logged to
the Citadel database.
table. The table contains a field or column for each data member logged to
the Citadel database.
Threads Table
The Threads table contains three fields you can use to specify query criteria
and to time-stamp retrieved data:
and to time-stamp retrieved data:
Interval
,
LocalTime
, and
UTCTime
.
Interval allows you to specify the query value sample rate. Interval can
range from 10ms to several years. By default, Interval is 1 (one day).
range from 10ms to several years. By default, Interval is 1 (one day).
Remember, Citadel only logs a value when the value changes (it is
event-driven). But using Interval, you can query Citadel for values evenly
spaced over a period of time.
event-driven). But using Interval, you can query Citadel for values evenly
spaced over a period of time.
LocalTime and UTCTime indicate the time-stamps of when values are
logged. Citadel actually stores the time in UTCTime format and derives
LocalTime from the stored time. When you do not specify a time, Citadel
assumes midnight of the current day.
logged. Citadel actually stores the time in UTCTime format and derives
LocalTime from the stored time. When you do not specify a time, Citadel
assumes midnight of the current day.
The following where clause from a query takes advantage of Interval
and
LocalTime to select data over a specified time at one minute intervals.
Notice that time and date formats are the same as those used in
BridgeVIEW.
Notice that time and date formats are the same as those used in
BridgeVIEW.
SELECT * FROM Threads
WHERE LocalTime > "12/1 10:00"
AND LocalTime < "12/2 13:00"
AND Interval = "1:00"
Data Transforms
Your queries can include special commands that perform data transforms,
making it easy to manipulate and analyze historical data. The following
table lists data transform commands.
making it easy to manipulate and analyze historical data. The following
table lists data transform commands.