wonderware historian 2012 r2 (11.0) -...
Post on 14-Mar-2018
296 Views
Preview:
TRANSCRIPT
@InvensysOpsMgmt / #SoftwareRevolution
/InvensysVideos
social.invensys.com
WW INFO-01Wonderware Historian 2012 R2
Elliott MiddletonProduct Manager
© 2013 Invensys. All Rights Reserved. The names, logos, and taglines identifying the products and services of Invensys are proprietary marks of Invensys or its subsidiaries.All third party trademarks and service marks are the proprietary marks of their respective owners.
/Wonderware
/company/Wonderware
Look back…
© 2013 Invensys. All Rights Reserved. The names, logos, and taglines identifying the products and services of Invensys are proprietary marks of Invensys or its subsidiaries.All third party trademarks and service marks are the proprietary marks of their respective owners.
New Historian Unit Sales
In SystemPlatform
Slide 3
2006 2007 2008 2009 2010 2011 2012
StandaloneHistorian
Fiscal Year
New Standalone Historian Revenue
R-IDAS
Enterprise
Express
First Full Year OfHistorian 10.0
Growth Is EnterpriseLicenses
Slide 4
2009 2010 2011 2012
Fiscal Year
Express
Standard
New Large Tag Historian Units
150,000100,000
First Full Year OfHistorian 10.0
Slide 5
Fiscal Year
2009 2010 2011 2012
100,000
Historian Release Themes
Powerful queries
“Late” Data
Historian 9.0
“Tiered” Historians
Summary Tags
Data Cleansing
Historian 10.0
Slide 6
Powerful queries
“Late” Data
“Tiered” Historians
Summary Tags
Data Cleansing
Historian 9.0 Architecture
SQL Server
Retrieval
History Blocks
Slide 7
History Blocks
Storage
“Pull” DataAcquisition
“Push” DataAcquisition
Historian 10.0 Architecture
SQL Server
Retrieval
History BlocksStorageEngine
IDAS/SuiteLink
Slide 8
Storage
“Pull” DataAcquisition
“Push” DataAcquisition
StorageEngine
ReplicationAcquisition
New “historian”hidden within 10.0
ApplicationServer
Historian
Replication
Organized for faster retrieval
More efficient use of disk I/Ovia caching
Create tags & start collectingwhen Historian is offline
Doesn’t “fragment” onupdates
Slide 9
Organized for faster retrieval
More efficient use of disk I/Ovia caching
Create tags & start collectingwhen Historian is offline
Doesn’t “fragment” onupdates
10.0
Storage Engine Retrieval Performance
LegacyStorage
StorageEngine
>2xfaster
Slide 10
Retrieval time for 3-months of1-second data for 1 tag using “bestfit” with 1-hour period*
*YMMV
Look forward…
© 2013 Invensys. All Rights Reserved. The names, logos, and taglines identifying the products and services of Invensys are proprietary marks of Invensys or its subsidiaries.All third party trademarks and service marks are the proprietary marks of their respective owners.
The Most AmazingWonderware Historian EverContinued
• World class desktop tools
• Rich query capability
• Low management cost & effort
All new integration with Application Server
Significantly higher tag counts
Redundant Historians
SQL Server 64-bit support (2008 R2 and 2012)
New Toolkit
Cyber security changes
Slide 12
Continued
• World class desktop tools
• Rich query capability
• Low management cost & effort
All new integration with Application Server
Significantly higher tag counts
Redundant Historians
SQL Server 64-bit support (2008 R2 and 2012)
New Toolkit
Cyber security changes
Historian 2012 R2 Architecture
SQL Server
Retrieval
History BlocksStorageEngine
IDAS/SuiteLink
ApplicationServer >3.5
Most changes apply only here
Slide 13
“Push” DataAcquisition
ClassicStorage
StorageEngine
“Pull” DataAcquisition
ReplicationAcquisition
“Push” DataAcquisition
“Push” DataAcquisition
ApplicationServer <3.6
IDAS/SuiteLink
Historian
ApplicationServer >3.5
SMC Status Panel Name Changes
Historian 10.0 Historian 2012 R2
Slide 14
Upgrading
Historian 10.0ApplicationServer <3.6
1. During upgrade, Engine goes intostore-forward
2. After upgrade is complete, Engineforwards data and resumes
3. Engine continues using ClassicStorage until it is upgraded
4. After Engine upgrade, using newStorage
Upgrade Historian First1. After upgrade is complete, Engine
immediately goes into store-forward2. Remains in store-forward until
Historian is upgraded3. After Historian upgrade, using new
Storage
Upgrade Platform First
Slide 15
1. During upgrade, Engine goes intostore-forward
2. After upgrade is complete, Engineforwards data and resumes
3. Engine continues using ClassicStorage until it is upgraded
4. After Engine upgrade, using newStorage
1. After upgrade is complete, Engineimmediately goes into store-forward
2. Remains in store-forward untilHistorian is upgraded
3. After Historian upgrade, using newStorage
Not Recommended
No data loss in either scenario
But…Network/firewall challengesMust be online to startHistorian tag data not always currentHistory loss on Engine failover
Application Server: Trivial To Historize
Slide 16
But…Network/firewall challengesMust be online to startHistorian tag data not always currentHistory loss on Engine failover
Engine Data Acquisition Throughput
100,000
150,000
10.02012 R2
Slide 17
0
50,000
Sustained Burst Late
2012 R2
Values Per Second
Historian-Application Server
WonderwareHistorian
HistorianClient
What happens?
• Engine goes intostore-forward
• New attributes nothistorized
10.0
• Engine goes intostore-forward
• New attributes alsoenter store-forward
2012 R2
+
Slide 18
Control System
ApplicationServer
• Engine goes intostore-forward
• New attributes nothistorized
• Engine goes intostore-forward
• New attributes alsoenter store-forward
+
Historian-Application Server
WonderwareHistorian
HistorianClient
What happens?
• All Engines exitstore-forward atonce
• Can overwhelmserver & network
10.0
• Server managesstore-forward exit
• Preventsoverloading
2012 R2
Slide 19
ApplicationServer
• All Engines exitstore-forward atonce
• Can overwhelmserver & network
• Server managesstore-forward exit
• Preventsoverloading
1 n
Tag Meta Data
Slide 20
Tag Meta Data Updates
Slide 21
Scalability Targets150,000 values/second
500,000 tags(e.g. ~3 second update rate)
Example test load onworkstation hardware(Hyper-Threaded)
Slide 22
Example test load onworkstation hardware(Hyper-Threaded)
100120140
Reliable Data Acquisition
WonderwareHistorian
RedundantEngines
HistorianClient
On failover, history gap from:• Detecting failure• Starting engine from checkpoint*• Subscribing to I/O*• Initializing history* N/A for 2012 R2
Slide 23
020406080
100
Platform2012
SystemPlatform2012 R2
System
* Varies by number of objects
Control System
ApplicationServer
Redundant DIObjects
RedundantEngines
High Availability
WonderwareHistorian
HistorianClient Multiple Clients
StratusVMware/HyperV Cluster
ReliableAccess
Redundant Historians (2012 R2)
Slide 24
Control System
ApplicationServer
ReliableCollection
Redundant DI Objects
Redundant Engines
Slide 25
Slide25
Configuring Redundant Historians
MYHISTORIAN02
Slide 26
MYHISTORIAN01
MYHISTORIAN02
Configuring Redundant Historians
Slide 27
MYHISTORIAN01
MYHISTORIAN02
Configuring Redundant Historians
Slide 28
MYHISTORIAN01
B
How It Works
WonderwareHistorian
HistorianClient
1
A. Client retrieves “partner” nameB. On a failure, automatically switches
A
1. Engine retrieves “partner” name2. Sends same data to “partner” with
independent store-forward channels
H1 H2
2
Slide 29
Control System
ApplicationServer
1
Limitations• No “self healing” of drive, history blocks,
etc.• Updates/inserts (SQL, CSV) must be
repeated• Client won’t switch on “store-forward”
H1 & H2 can be in the same or different locations
2
(optional)
Engine Attributes
Slide 30
1Bitmask 0000000
Partner
Prim
ary
Reserved
Logical “OR”
Historian Client Properties
Name ofcurrent server
Slide 31
Has a “partner”
Using Properties Script
%tp = #aaHistClientTrend1.TagPicker;%s = %tp.CurrentServer;aahServer = %s.ServerName;aahCurrent = %s.ConnectedServer;aahHasPartner = %s.IsDualModeEnabled;aahLoggedOn = %s.LoggedOn;
InTouch
Slide 32
aahServer = aaTrendControl1.TagPicker.CurrentServer.ServerName;aahCurrent = aaTrendControl1.TagPicker.CurrentServer.ConnectedServer;aahHasPartner = aaTrendControl1.TagPicker.CurrentServer.IsDualModeEnabled;aahLoggedOn = aaTrendControl1.TagPicker.CurrentServer.LoggedOn;
ArchestrA Symbol
How Does This Compare To:High Availability Virtualization
• Con: Susceptible to software failures, OS reboots, etc.
• Con: Complex infrastructure, IT support required (SAN)
• Con: Special setup/software for geographically distributed solutions
• Neutral: License cost (more expense for geographically distributed)
Stratus FT Hardware
• Con: Susceptible to software failures, OS reboots, etc.
• Con: Premium hardware (cheaper to useconventional hardware x2)
• Con: Does not provide geographically distributed solution
• Pro: Single system to maintain
• Pro: No extra Historian license (redundant is +20%)
Slide 33
High Availability Virtualization
• Con: Susceptible to software failures, OS reboots, etc.
• Con: Complex infrastructure, IT support required (SAN)
• Con: Special setup/software for geographically distributed solutions
• Neutral: License cost (more expense for geographically distributed)
Stratus FT Hardware
• Con: Susceptible to software failures, OS reboots, etc.
• Con: Premium hardware (cheaper to useconventional hardware x2)
• Con: Does not provide geographically distributed solution
• Pro: Single system to maintain
• Pro: No extra Historian license (redundant is +20%)
Historian 2012 R2 Communications
SQL Server
Retrieval
StorageEngine
SuiteLink(Single TCP Port) Application
Server >3.5
Slide 34
Storage
StorageEngine
“Pull” DataAcquisition
ReplicationAcquisition
“Push” DataAcquisition
“Push” DataAcquisition
SuiteLink(Single TCP Port)
COM/DCOMNamed Pipes
WCF(Single TCP Port)
“Push” DataAcquisition
ApplicationServer <3.6
Historian
ApplicationServer >3.5
AppServer & Historian SecurityCan run under a different“Network Account”
Remote Galaxy user(e.g.“CORP\GalaxyUser”)• Must be able to
authenticate• Must be in a local “aa_”
group• No special rights needed
Slide 35
Can run under a different“Network Account”
Remote Galaxy user(e.g.“CORP\GalaxyUser”)• Must be able to
authenticate• Must be in a local “aa_”
group• No special rights needed
Network Account (e.g.“CORP\GalaxyUser”) must bea local administrator
“Data Compression” (aka “Filtering”)
80
Example• Every fifth value is identical
to the previous value• 25% of remaining values are
close to previous• %50 of remaining values
change at a steady rate
80
NoDeadband
Slide 36
100
80
80
Example• Every fifth value is identical
to the previous value• 25% of remaining values are
close to previous• %50 of remaining values
change at a steady rate4:5
?
Data Compression
80
NoDeadband
80
60
ValueDeadband
60
60
RateReadband
30
30
RateDeadband
30
10.0 2012 R2
Slide 37
100
80
80
100
80
60
100
80
60
100
30
30
Historian Editors In Application ServerApplication Server 2012 (3.5) Application Server 2012 R2 (3.6)
Slide 38
UnchangedObsolete Replaced New
Historian Editors: BandwidthOptimization
Saves ~20% 0 = unlimited
Slide 39
Packet = 64KB~2,000 analog values
Bandwidth Limits
300
Physical
Streaming
500
200
Unlimited (0)
175
Physical
Streaming
500
375
Will thrash in and outof store-forward
175
Physical
Streaming
500
200
Limit 375125
Limit 200
Slide 40
200
Streaming 200
Available for other applications
Inadequate bandwidth
375
200
Streaming 200
Available for store-forward
200
Limit 200
Engine Historian Editor
Slide 41
Storage Timestamp Limitations
-5:00 -0:30 “Now”
Real-time FutureExpanded Real-time
(only for “late data” tags)Late data
xThroughput ~10x
Historian 9.0
“Values in the past did not fitwithin the real-time window” “Timestamp overwritten;
values in future”
InSQL 8.0
Slide 42
xThroughput ~10x
Historian 2012 R2 (AppServer)
Time Series Data
“Now”
The “Late” Data Problem: Two Timelines
Source timestamp
Example: constant 5-minute latency
Is it important to mark disconnects?
Complete solution is a “channel status” independent of the data stream
Affordable solution is injecting a disconnect indicator
Which timestamp to use?
Still requires data to be time-ordered
8:00 8:05 8:10 8:15
Slide 43
8:00 8:05 8:10 8:15
Server Time
Is it important to mark disconnects?
Complete solution is a “channel status” independent of the data stream
Affordable solution is injecting a disconnect indicator
Which timestamp to use?
Still requires data to be time-ordered
“Late” Data: One Timeline for Storage
Source timestamp
Example: constant 5-minute latency
Stored On Disk
Store-Forward(3 minutes)
No “gap” indication stored on disk
Slide 44
8:00 8:05 8:10 8:15
Server Time
No “gap” indication stored on disk
Engine
“Real Time” Data: Two Timelines
Source timestamp
Example: constant 5-minute latency
Stored On Disk
Extended Store-Forward(2 minutes)
Store-Forward(3 minutes)
??
Slide 45
8:00 8:05 8:10 8:15
Server Time
Out Of Order??
Which timestamp for “gap”?
Why is this a challenge?
Out of sequence
EngineDo not inject channel status
Comparison: “Real Time” vs. “Late”Example: constant 5-minute latency
Stored On DiskNo “gap” indication stored on diskEngine
Slide 46
Stored On Disk
Extended Store-Forward(2 minutes)
Engine
Replication Server Changes
New
Slide 47
Works
Replication Naming Scheme
Slide 48
Hierarchical Name Functions
Slide 49
TagName/HierarchicalName Toggle 10.0 2012 R2
Query 100,000 tags
10.0
Using CSV Files For Data Acquisition
500 CSV files, each for 1,000 tags
100%
Slide 50
ProcessingTime
Retrieval Time
10.02012 R2
0%
#Streams
64-bit Microsoft SQL Server SupportHistorian Architecture
• OLE DB Provider runs in SQL Server process
• Some interprocess communication via shared memory
• 64-bit SQL Server 64-bit Historian(mostly, but not all)
Solution in Historian 2012 R2:
• Native 64-bit Microsoft SQL Server Support
• Native 64-bit Historian OLE DB Provider
• 64-bit Process Address Space
• Ability to utilize all installed RAM
Higher scalability will require 64-bit
Phasing out support for case-sensitive collation
Slide 51
Historian Architecture
• OLE DB Provider runs in SQL Server process
• Some interprocess communication via shared memory
• 64-bit SQL Server 64-bit Historian(mostly, but not all)
Solution in Historian 2012 R2:
• Native 64-bit Microsoft SQL Server Support
• Native 64-bit Historian OLE DB Provider
• 64-bit Process Address Space
• Ability to utilize all installed RAM
Higher scalability will require 64-bit
Phasing out support for case-sensitive collation
Total “On” Times For Each Of 3 Discrete TagsSELECT DateTime, TagName, StateTimeFROM HistoryWHERE TagName LIKE 'Motor%'AND DateTime > '2012-07-04 9:00'AND DateTime <= '2012-07-04 9:30'AND wwRetrievalMode='ValueState'AND wwStateCalc='Total'AND wwCycleCount=1AND Value=1
Historian 10.0 Historian 2012 R2
Slide 52
SELECT DateTime, TagName, StateTimeFROM HistoryWHERE TagName LIKE 'Motor%'AND DateTime > '2012-07-04 9:00'AND DateTime <= '2012-07-04 9:30'AND wwRetrievalMode='ValueState'AND wwStateCalc='Total'AND wwCycleCount=1AND Value=1
Total “On” Times For Each Of 3 Discrete TagsSELECT StartDateTime, EndDateTime, TagName,StateTimeTotalFROM StateSummaryHistoryWHERE TagName LIKE 'Motor%'AND StartDateTime >= '2012-07-04 9:00'AND EndDateTime <= '2012-07-04 9:30'AND wwRetrievalMode='CYCLIC'AND wwCycleCount=1AND Value=1
Historian 10.0 Historian 2012 R2
Slide 53
SELECT StartDateTime, EndDateTime, TagName,StateTimeTotalFROM StateSummaryHistoryWHERE TagName LIKE 'Motor%'AND StartDateTime >= '2012-07-04 9:00'AND EndDateTime <= '2012-07-04 9:30'AND wwRetrievalMode='CYCLIC'AND wwCycleCount=1AND Value=1
Total “On” Time For All 3 Discrete TagsSELECT DateTime Total=SUM(StateTime)FROM HistoryWHERE TagName LIKE 'Motor%'AND DateTime > '2012-07-04 9:00'AND DateTime <= '2012-07-04 9:30'AND wwRetrievalMode='ValueState'AND wwStateCalc='Total'AND wwCycleCount=1AND Value=1GROUP BY DateTime
Historian 10.0 Historian 2012 R2
Slide 54
SELECT DateTime Total=SUM(StateTime)FROM HistoryWHERE TagName LIKE 'Motor%'AND DateTime > '2012-07-04 9:00'AND DateTime <= '2012-07-04 9:30'AND wwRetrievalMode='ValueState'AND wwStateCalc='Total'AND wwCycleCount=1AND Value=1GROUP BY DateTime
CREATE PROCEDURE [dbo].[wwkbAllDiscretesOn]@startdate DATETIME2,@enddate DATETIME2,@tags NVARCHAR(MAX)
ASDECLARE @sql nvarchar(MAX)-- Generate a 'wide' query to total all the tag values, but subtract "1" from all but the last tag-- so that when all equal "1", the total will be "1"SET @sql = N'DECLARE DiscreteCursor CURSOR FAST_FORWARDFOR select DateTime, TagTotalFROM OPENQUERY(INSQL, ''SELECT DateTime, TagTotal=[' + REPLACE(@tags,',',']-1+[')+ '] FROM WideHistoryWHERE DateTime >= "' + CONVERT(varchar(26), @startdate, 121) + '"AND DateTime <= "' + CONVERT(varchar(26), @enddate, 121) + '"AND wwRetrievalMode = "delta"'')'
EXEC (@sql)
DECLARE @RowTime DATETIME2DECLARE @RowTotal INTDECLARE @LastRowTime DATETIME2DECLARE @LastRowTotal INTDECLARE @TotalTime BIGINT
SET @TotalTime = 0
OPEN DiscreteCursor
FETCH NEXT FROM DiscreteCursorINTO @RowTime, @RowTotal
WHILE @@FETCH_STATUS = 0BEGIN
IF @LastRowTotal = 1 -- All the tags = 1SET @TotalTime = @TotalTime + DATEDIFF(MILLISECOND,@LastRowTime,@RowTime)
SET @LastRowTime = @RowTimeSET @LastRowTotal = @RowTotalFETCH NEXT FROM DiscreteCursorINTO @RowTime, @RowTotal
END
IF @RowTotal = 1 AND @RowTime < @enddateSET @TotalTime = @TotalTime + DATEDIFF(MILLISECOND,@RowTime,@enddate)
CLOSE DiscreteCursorDEALLOCATE DiscreteCursor
SELECT StartDate=@startdate, EndDate=@enddate, Milliseconds=@TotalTime
GO
Time When All 3 Where “On” At Once Historian 10.0 Historian 2012 R2
Slide 55
CREATE PROCEDURE [dbo].[wwkbAllDiscretesOn]@startdate DATETIME2,@enddate DATETIME2,@tags NVARCHAR(MAX)
ASDECLARE @sql nvarchar(MAX)-- Generate a 'wide' query to total all the tag values, but subtract "1" from all but the last tag-- so that when all equal "1", the total will be "1"SET @sql = N'DECLARE DiscreteCursor CURSOR FAST_FORWARDFOR select DateTime, TagTotalFROM OPENQUERY(INSQL, ''SELECT DateTime, TagTotal=[' + REPLACE(@tags,',',']-1+[')+ '] FROM WideHistoryWHERE DateTime >= "' + CONVERT(varchar(26), @startdate, 121) + '"AND DateTime <= "' + CONVERT(varchar(26), @enddate, 121) + '"AND wwRetrievalMode = "delta"'')'
EXEC (@sql)
DECLARE @RowTime DATETIME2DECLARE @RowTotal INTDECLARE @LastRowTime DATETIME2DECLARE @LastRowTotal INTDECLARE @TotalTime BIGINT
SET @TotalTime = 0
OPEN DiscreteCursor
FETCH NEXT FROM DiscreteCursorINTO @RowTime, @RowTotal
WHILE @@FETCH_STATUS = 0BEGIN
IF @LastRowTotal = 1 -- All the tags = 1SET @TotalTime = @TotalTime + DATEDIFF(MILLISECOND,@LastRowTime,@RowTime)
SET @LastRowTime = @RowTimeSET @LastRowTotal = @RowTotalFETCH NEXT FROM DiscreteCursorINTO @RowTime, @RowTotal
END
IF @RowTotal = 1 AND @RowTime < @enddateSET @TotalTime = @TotalTime + DATEDIFF(MILLISECOND,@RowTime,@enddate)
CLOSE DiscreteCursorDEALLOCATE DiscreteCursor
SELECT StartDate=@startdate, EndDate=@enddate, Milliseconds=@TotalTime
GO
Slide 55
Time When All 3 Where “On” At OnceSELECT DateTime, AllOn=SUM(wwResolution)FROM OPENQUERY(INSQL,'
SELECT DateTime, [Motor1.State], [Motor2.State],[Motor3.State], wwResolutionFROM WideHistoryWHERE DateTime > "2012-07-04 9:00"AND DateTime <= "2012-07-04 9:30"AND wwRetrievalMode="DELTA"
')WHERE [Motor1.State]+[Motor2.State]+[Motor3.State]=3
Historian 10.0 Historian 2012 R2
Slide 56
SELECT DateTime, AllOn=SUM(wwResolution)FROM OPENQUERY(INSQL,'
SELECT DateTime, [Motor1.State], [Motor2.State],[Motor3.State], wwResolutionFROM WideHistoryWHERE DateTime > "2012-07-04 9:00"AND DateTime <= "2012-07-04 9:30"AND wwRetrievalMode="DELTA"
')WHERE [Motor1.State]+[Motor2.State]+[Motor3.State]=3
“wwResolution” For “Delta” QueriesSELECT * FROM OPENQUERY(INSQL, '
SELECT DateTime, [Motor1.State], [Motor2.State],[Motor3.State], wwResolutionFROM WideHistoryWHERE DateTime > "2012-07-04 9:00"AND DateTime <= "2012-07-04 9:30"AND wwRetrievalMode="DELTA"
')
Historian 10.0SELECT * FROM OPENQUERY(INSQL, '
SELECT DateTime, [Motor1.State], [Motor2.State],[Motor3.State], wwResolutionFROM WideHistoryWHERE DateTime > "2012-07-04 9:00"AND DateTime <= "2012-07-04 9:30"AND wwRetrievalMode="DELTA"
')
Historian 2012 R2
Difference
Exceeding A Threshold
“To Discrete”
1Level
100
Slide 58
0
Boundary
0
12
Use with “ValueState” & “RoundTrip” retrieval
select DateTime,vValue,StateTime,wwFilterfrom Historywhere TagName in ('Reactor1Level')and DateTime >= '2012-07-04 15:00:00'and DateTime <= '2012-07-04 17:00:00'and wwRetrievalMode = 'ValueState'and wwStateCalc = 'Total'and wwCycleCount = 1and wwFilter = 'ToDiscrete(12,>)'
“ToDiscrete” Filter Historian 10.0 Historian 2012 R2
Slide 59
select DateTime,vValue,StateTime,wwFilterfrom Historywhere TagName in ('Reactor1Level')and DateTime >= '2012-07-04 15:00:00'and DateTime <= '2012-07-04 17:00:00'and wwRetrievalMode = 'ValueState'and wwStateCalc = 'Total'and wwCycleCount = 1and wwFilter = 'ToDiscrete(12,>)'
Exceeding A Threshold For A Minimum Time
“To Discrete”
1
Level
100
> 5 minutes
?
Slide 60
0
Boundary
0
12
?
select DateTime,wwResolutionfrom Historywhere TagName in ('Reactor1Level')and DateTime > '2012-07-04 15:00:00'and DateTime <= '2012-07-05 17:00:00'and wwRetrievalMode = 'delta'and wwFilter = 'ToDiscrete(12,>)'and wwResolution > 5*60*1000
Exceeding A Threshold For A Minimum Time Historian 10.0 Historian 2012 R2
Slide 61
select DateTime,wwResolutionfrom Historywhere TagName in ('Reactor1Level')and DateTime > '2012-07-04 15:00:00'and DateTime <= '2012-07-05 17:00:00'and wwRetrievalMode = 'delta'and wwFilter = 'ToDiscrete(12,>)'and wwResolution > 5*60*1000
CREATE Procedure sp_GetAnalogToDiscreteData@DiscreteTag Varchar(33),
@StartDateTime DateTime,@EndDateTime DateTime,@TargetTime DateTime,@Threshold Real,@CompareOperator Char(2)
AS
IF NOT EXISTS(SELECT TABLE_NAME FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = '#DiscreteEventTable')Begin Create Table #DiscreteEventTable(
LeadingEdge DateTime NULL,TrailingEdge DateTime Null,TotalTime Real Null)
END--delete #DiscreteEventTable
DECLARE @LeadDateValue DateTimeDECLARE @TrailDateValue DateTimeDECLARE @DiffDateValue DateTimeDECLARE @DiffDateReal RealDECLARE @DateValue DateTimeDeclare @EventValue RealDeclare @EventDate Varchar (33)
-- Select data into a cursor record set
DECLARE Hist_Cursor CURSOR FORSELECT DateTime, Value FROM HistoryWHERE TagName = (@DiscreteTag)and DateTime >= @StartDateTimeand DateTime <= @EndDateTimeAND wwRetrievalMode = 'Delta'AND wwFilter = 'ToDiscrete('+ CAST(@Threshold AS Varchar(33))+ ',' + @CompareOperator +')'AND Value = 1AND wwEdgeDetection = 'Both'
OPEN Hist_CursorFETCH NEXT FROM Hist_Cursor INTO @DateValue, @EventValue-- If the first record shows the discrete is in the off state, fetch the next record
If @EventValue =0BeginFETCH NEXT FROM Hist_Cursor INTO @DateValue, @EventValue End
--Loop until end of record set
WHILE @@FETCH_STATUS = 0BEGIN
-- Map data into varaiblesSET @LeadDateValue = convert(varchar, @DateValue, 121) FETCH FROM Hist_Cursor INTO @DateValue, @EventValueSET @TrailDateValue = convert(varchar, @DateValue, 121) Set @DiffDateValue = @TrailDateValue -@LeadDateValue SET @DiffDateReal = cast(@DiffDateValue as float)
-- Insert completed data into a Temporary table IF @DiffDateReal > cast(@TargetTime as float) Begin InsertInto #DiscreteEventTable Values (@LeadDateValue, @TrailDateValue, @DiffDateReal) End-- Continue loopingFETCH NEXT FROM Hist_Cursor INTO @DateValue, @EventValue END CLOSE Hist_Cursor DEALLOCATE Hist_Cursor-- If the last record shows that the discrete is still true, then use the enddate for the trailing edge If@EventValue =1 Begin Set @TrailDateValue = @EndDateTime Set @DiffDateValue = @TrailDateValue -@LeadDateValue SET @DiffDateReal = CAST(@DiffDateValue as Float)
IF @DiffDateReal > cast(@TargetTime as float)--BeginInsert Into #DiscreteEventTableValues (@LeadDateValue, @TrailDateValue, @DiffDateReal)
--ENDEND
-- Return all data to the calling userSelect LeadingEdge, TrailingEdge, TotalTime From #DiscreteEventTable
-- Clean upDrop Table #DiscreteEventTable
Go
Exceeding A Threshold For A Minimum Time Historian 10.0 Historian 2012 R2
Slide 62
CREATE Procedure sp_GetAnalogToDiscreteData@DiscreteTag Varchar(33),
@StartDateTime DateTime,@EndDateTime DateTime,@TargetTime DateTime,@Threshold Real,@CompareOperator Char(2)
AS
IF NOT EXISTS(SELECT TABLE_NAME FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = '#DiscreteEventTable')Begin Create Table #DiscreteEventTable(
LeadingEdge DateTime NULL,TrailingEdge DateTime Null,TotalTime Real Null)
END--delete #DiscreteEventTable
DECLARE @LeadDateValue DateTimeDECLARE @TrailDateValue DateTimeDECLARE @DiffDateValue DateTimeDECLARE @DiffDateReal RealDECLARE @DateValue DateTimeDeclare @EventValue RealDeclare @EventDate Varchar (33)
-- Select data into a cursor record set
DECLARE Hist_Cursor CURSOR FORSELECT DateTime, Value FROM HistoryWHERE TagName = (@DiscreteTag)and DateTime >= @StartDateTimeand DateTime <= @EndDateTimeAND wwRetrievalMode = 'Delta'AND wwFilter = 'ToDiscrete('+ CAST(@Threshold AS Varchar(33))+ ',' + @CompareOperator +')'AND Value = 1AND wwEdgeDetection = 'Both'
OPEN Hist_CursorFETCH NEXT FROM Hist_Cursor INTO @DateValue, @EventValue-- If the first record shows the discrete is in the off state, fetch the next record
If @EventValue =0BeginFETCH NEXT FROM Hist_Cursor INTO @DateValue, @EventValue End
--Loop until end of record set
WHILE @@FETCH_STATUS = 0BEGIN
-- Map data into varaiblesSET @LeadDateValue = convert(varchar, @DateValue, 121) FETCH FROM Hist_Cursor INTO @DateValue, @EventValueSET @TrailDateValue = convert(varchar, @DateValue, 121) Set @DiffDateValue = @TrailDateValue -@LeadDateValue SET @DiffDateReal = cast(@DiffDateValue as float)
-- Insert completed data into a Temporary table IF @DiffDateReal > cast(@TargetTime as float) Begin InsertInto #DiscreteEventTable Values (@LeadDateValue, @TrailDateValue, @DiffDateReal) End-- Continue loopingFETCH NEXT FROM Hist_Cursor INTO @DateValue, @EventValue END CLOSE Hist_Cursor DEALLOCATE Hist_Cursor-- If the last record shows that the discrete is still true, then use the enddate for the trailing edge If@EventValue =1 Begin Set @TrailDateValue = @EndDateTime Set @DiffDateValue = @TrailDateValue -@LeadDateValue SET @DiffDateReal = CAST(@DiffDateValue as Float)
IF @DiffDateReal > cast(@TargetTime as float)--BeginInsert Into #DiscreteEventTableValues (@LeadDateValue, @TrailDateValue, @DiffDateReal)
--ENDEND
-- Return all data to the calling userSelect LeadingEdge, TrailingEdge, TotalTime From #DiscreteEventTable
-- Clean upDrop Table #DiscreteEventTable
Go
Script courtesy of Ray Norman
Slide 62
Historian Toolkit CompatibilityHistorian 9.0 Toolkit
• Continues to work with Historian 9.0-11.0
• No updates for this release
• Uses DCOM for communication & security
Historian 11.0 Toolkit
• Query history for all tags, including Summary Tags
• Only works with Historian 2012 R2 (aka 11.0)
• Only .NET 4.0, Application Server 2012 R2 (aka 3.6)
• Uses single TCP port for communications
• All new interface (though mapping is straightforward)
• Does not include tag listing (use SQL)
Slide 63
Historian 9.0 Toolkit
• Continues to work with Historian 9.0-11.0
• No updates for this release
• Uses DCOM for communication & security
Historian 11.0 Toolkit
• Query history for all tags, including Summary Tags
• Only works with Historian 2012 R2 (aka 11.0)
• Only .NET 4.0, Application Server 2012 R2 (aka 3.6)
• Uses single TCP port for communications
• All new interface (though mapping is straightforward)
• Does not include tag listing (use SQL)
The Most AmazingWonderware Historian Ever
All new integration with Application Server
Significantly higher tag counts
Redundant Historians
SQL Server 64-bit support (2008 R2 and 2012)
New Toolkit
Cyber security changes
Slide 64
All new integration with Application Server
Significantly higher tag counts
Redundant Historians
SQL Server 64-bit support (2008 R2 and 2012)
New Toolkit
Cyber security changes
Slide 65
Historian Client 10.1
Consistent Access To Strings Values
Slide 66
Unreachable Server
Historian Client 9.2
Slide 67
Historian Client 10.1
Q: What Is This?
<?xml version="1.0" encoding="utf-8"?><root><tagList
AAWRAPPED="5NHog3OiGJ1QEQtqWtreiKNuE+b0mZbhHmoH2UG3ZfjbtWbZetK74CZjODTXhyqugO91kNdF+E4ZshSK1MIVuLaxUZLEFZE1hvUYk7LMgc4j2C55SFyGGNhWnGQvOpxWPxGAg/QW8OGHLQJ8eX8UxZM1OTT+SnXfdl4HiH73Ucf7bFGtHkXv2mUt+zDIkNrPXYuLxyeLOeSsjxWLYRPj2nbq+UYqKZUAQTM8cuOJPCMF0z4rmEhjevmUTAC7EDWndZxeRUQZR5WjNrU94Q3TiOuLXEiMRiXalGG8Rvl7/caNJsnTS4pO+TlacgHANvFRnh4dFjwWPKK0AzaKCqo71oJLElq7WKYbkFiINHOevM48DmntsxIKUJt8Zv5AF0InJBp89fWttQ3Z8BezFfdbUrRv9fKepl/SlcAG6+taZ2dWCM2p/64W0Hs5/ipWoDpOf9oGObP7OhNGW/1fuBr9N5HuYdJ++
WYqRbG6Z/Plzi6V7nmGJzfaswijmU1ZlB+8Wm3k5/yv9K75XaDxapZXmLVE5MNViMJGZLtrAwboXG06GhgplmUkm5lgBOP2aC9SLTPJNbw1nLvQtsIIVHKlqF7Gk9H0bQMU="></tagList>
</root>
A: An “.aaTrend” File
Slide 68
<?xml version="1.0" encoding="utf-8"?><root><tagList
AAWRAPPED="5NHog3OiGJ1QEQtqWtreiKNuE+b0mZbhHmoH2UG3ZfjbtWbZetK74CZjODTXhyqugO91kNdF+E4ZshSK1MIVuLaxUZLEFZE1hvUYk7LMgc4j2C55SFyGGNhWnGQvOpxWPxGAg/QW8OGHLQJ8eX8UxZM1OTT+SnXfdl4HiH73Ucf7bFGtHkXv2mUt+zDIkNrPXYuLxyeLOeSsjxWLYRPj2nbq+UYqKZUAQTM8cuOJPCMF0z4rmEhjevmUTAC7EDWndZxeRUQZR5WjNrU94Q3TiOuLXEiMRiXalGG8Rvl7/caNJsnTS4pO+TlacgHANvFRnh4dFjwWPKK0AzaKCqo71oJLElq7WKYbkFiINHOevM48DmntsxIKUJt8Zv5AF0InJBp89fWttQ3Z8BezFfdbUrRv9fKepl/SlcAG6+taZ2dWCM2p/64W0Hs5/ipWoDpOf9oGObP7OhNGW/1fuBr9N5HuYdJ++
WYqRbG6Z/Plzi6V7nmGJzfaswijmU1ZlB+8Wm3k5/yv9K75XaDxapZXmLVE5MNViMJGZLtrAwboXG06GhgplmUkm5lgBOP2aC9SLTPJNbw1nLvQtsIIVHKlqF7Gk9H0bQMU="></tagList>
</root>
…
Historian Client 2012 R2 (10.1) Format
<?xml version="1.0" encoding="utf-8"?><root><tagList VERSION="1" GRIDCOLUMNSTATE_VERSION="10SP1" DISPLAY_SINGLE_TAG="F<retreivalOptions RETRIEVAL_STYLE_OPTION="BestFit-5" RETRIEVAL_STYLE_LAN<HierarchicalNameDisplay ENABLE="False" /><threeD ENABLE="False" POINT_DEPTH="20" POINT_GAP_DEPTH="8" ROTATION="30<cursorPen COLOR="-65536" WIDTH="1" DASH_STYLE="Solid" /><cursorPen2 COLOR="-16776961" WIDTH="1" DASH_STYLE="Solid" />
</timeAxis><valueAxis VALUES="6" SHOW_GRID="True" GRID_LINES="2" SHOW_CURSOR="False<cursorPen COLOR="-16744448" WIDTH="1" DASH_STYLE="Solid" /><cursorPen2 COLOR="-16744448" WIDTH="1" DASH_STYLE="Solid" />
</valueAxis><xValueAxis VALUES="6" GRID_LINES="3" /><dataPointLabels TYPE="None" NUMBER="6" /><traceGradient TYPE="OpacityGradient" STARTING_PERCENTAGE="20" ENDING_PE<background COLOR="-1" GRADIENT_END_COLOR="-1" IMAGE="" GRADIENT="None"
But, no documentation or support for direct XML changes
Slide 69
<?xml version="1.0" encoding="utf-8"?><root><tagList VERSION="1" GRIDCOLUMNSTATE_VERSION="10SP1" DISPLAY_SINGLE_TAG="F<retreivalOptions RETRIEVAL_STYLE_OPTION="BestFit-5" RETRIEVAL_STYLE_LAN<HierarchicalNameDisplay ENABLE="False" /><threeD ENABLE="False" POINT_DEPTH="20" POINT_GAP_DEPTH="8" ROTATION="30<cursorPen COLOR="-65536" WIDTH="1" DASH_STYLE="Solid" /><cursorPen2 COLOR="-16776961" WIDTH="1" DASH_STYLE="Solid" />
</timeAxis><valueAxis VALUES="6" SHOW_GRID="True" GRID_LINES="2" SHOW_CURSOR="False<cursorPen COLOR="-16744448" WIDTH="1" DASH_STYLE="Solid" /><cursorPen2 COLOR="-16744448" WIDTH="1" DASH_STYLE="Solid" />
</valueAxis><xValueAxis VALUES="6" GRID_LINES="3" /><dataPointLabels TYPE="None" NUMBER="6" /><traceGradient TYPE="OpacityGradient" STARTING_PERCENTAGE="20" ENDING_PE<background COLOR="-1" GRADIENT_END_COLOR="-1" IMAGE="" GRADIENT="None"
…
But, no documentation or support for direct XML changes
Some unsupported settings are exposed: Don’t change
Can still be opened by older versions
Slide 70
elliott.middleton@invensys.com
top related