<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss xmlns:blogChannel="http://backend.userland.com/blogChannelModule" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:pingback="http://madskills.com/public/xml/rss/module/pingback/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" version="2.0">
  <channel>
    <title>Tellingmachine</title>
    <description>Vom Hundertsten ins Tausendste</description>
    <link>http://www.tellingmachine.com/</link>
    <docs>http://www.rssboard.org/rss-specification</docs>
    <generator>BlogEngine.NET 1.6.1.0</generator>
    <language>en-US</language>
    <blogChannel:blogRoll>http://www.tellingmachine.com/opml.axd</blogChannel:blogRoll>
    <blogChannel:blink>http://www.tellingmachine.com/syndication.axd</blogChannel:blink>
    <dc:creator>Klaus Graefensteiner</dc:creator>
    <dc:title>Tellingmachine</dc:title>
    <geo:lat>33.612740</geo:lat>
    <geo:long>117.656000</geo:long>
    <atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/Tellingmachine" /><feedburner:info xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" uri="tellingmachine" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><item>
      <title>Getting started with Windows Azure Websites, Azure SQL Server, ASP.NET Web API and ASP.NET MVC 4 Mobile</title>
      <description>&lt;h1&gt;Introduction&lt;/h1&gt;  &lt;p&gt;This article is a collection of useful links that will help you hitting the ground running when learning how to build cloud based RESTful services and ASP.NET MVC 4 Mobile client applications.&lt;/p&gt;  &lt;h1&gt;&lt;a href="http://www.tellingmachine.com/image.axd?picture=Windows-Live-Writer/629bdff8048a_9FAC/DSC_3436.jpg"&gt;&lt;img title="DSC_3436" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="DSC_3436" src="http://www.tellingmachine.com/image.axd?picture=Windows-Live-Writer/629bdff8048a_9FAC/DSC_3436_thumb.jpg" width="644" height="432" /&gt;&lt;/a&gt;&lt;/h1&gt;  &lt;p&gt;&lt;strong&gt;Figure 1: Bringing out the big guns for hitting the ground running with Azure and ASP.NET Web API and MVC&lt;/strong&gt;&lt;/p&gt;  &lt;h1&gt;Tutorials&lt;/h1&gt;  &lt;h2&gt;Windows Azure Tutorials&lt;/h2&gt;  &lt;p&gt;&lt;a href="http://www.windowsazure.com/en-us/manage/services/web-sites/how-to-create-websites/"&gt;http://www.windowsazure.com/en-us/manage/services/web-sites/how-to-create-websites/&lt;/a&gt;     &lt;br /&gt;&lt;a href="http://www.windowsazure.com/en-us/develop/net/tutorials/get-started/"&gt;http://www.windowsazure.com/en-us/develop/net/tutorials/get-started/&lt;/a&gt;     &lt;br /&gt;&lt;a href="http://www.windowsazure.com/en-us/develop/net/end-to-end-Apps/"&gt;http://www.windowsazure.com/en-us/develop/net/end-to-end-Apps/&lt;/a&gt;     &lt;br /&gt;&lt;a href="http://www.windowsazure.com/en-us/develop/net/tutorials/aspnet-mvc-4-mobile-website/"&gt;http://www.windowsazure.com/en-us/develop/net/tutorials/aspnet-mvc-4-mobile-website/&lt;/a&gt;     &lt;br /&gt;&lt;a href="http://www.windowsazure.com/en-us/develop/net/tutorials/rest-service-using-web-api/"&gt;http://www.windowsazure.com/en-us/develop/net/tutorials/rest-service-using-web-api/&lt;/a&gt;     &lt;br /&gt;&lt;a href="http://www.windowsazure.com/en-us/develop/mobile/tutorials/get-started-ios/"&gt;http://www.windowsazure.com/en-us/develop/mobile/tutorials/get-started-ios/&lt;/a&gt;     &lt;br /&gt;&lt;a href="http://www.windowsazure.com/en-us/develop/nodejs/common-tasks/publishing-with-git/"&gt;http://www.windowsazure.com/en-us/develop/nodejs/common-tasks/publishing-with-git/&lt;/a&gt;&lt;/p&gt;  &lt;h2&gt;ASP.NET MVC 4 and Web API&lt;/h2&gt;  &lt;p&gt;&lt;a href="http://net.tutsplus.com/tutorials/building-an-asp-net-mvc4-application-with-ef-and-webapi/"&gt;http://net.tutsplus.com/tutorials/building-an-asp-net-mvc4-application-with-ef-and-webapi/&lt;/a&gt;     &lt;br /&gt;&lt;a href="https://github.com/jcreamer898/NetTutsMvcEf"&gt;https://github.com/jcreamer898/NetTutsMvcEf&lt;/a&gt;     &lt;br /&gt;&lt;a href="http://www.codeproject.com/Articles/344078/ASP-NET-WebAPI-Getting-Started-with-MVC4-and-WebAP"&gt;http://www.codeproject.com/Articles/344078/ASP-NET-WebAPI-Getting-Started-with-MVC4-and-WebAP&lt;/a&gt;     &lt;br /&gt;&lt;a href="http://www.asp.net/web-api/overview/creating-web-apis"&gt;http://www.asp.net/web-api/overview/creating-web-apis&lt;/a&gt;     &lt;br /&gt;&lt;a href="http://www.asp.net/mvc"&gt;http://www.asp.net/mvc&lt;/a&gt;     &lt;br /&gt;&lt;a href="http://www.asp.net/mvc/mvc4"&gt;http://www.asp.net/mvc/mvc4&lt;/a&gt; &lt;/p&gt;  &lt;h2&gt;ASP.NET Mobile&lt;/h2&gt;  &lt;p&gt;&lt;a href="http://www.hanselman.com/blog/CreateAGreatMobileExperienceForYourWebsiteTodayPlease.aspx"&gt;http://www.hanselman.com/blog/CreateAGreatMobileExperienceForYourWebsiteTodayPlease.aspx&lt;/a&gt;     &lt;br /&gt;&lt;a href="http://coding-in.net/asp-net-mvc4-create-a-mobile-application/"&gt;http://coding-in.net/asp-net-mvc4-create-a-mobile-application/&lt;/a&gt; &lt;/p&gt;  &lt;h2&gt;JQuery Mobile&lt;/h2&gt;  &lt;p&gt;&lt;a href="http://jquerymobile.com/"&gt;http://jquerymobile.com/&lt;/a&gt; &lt;/p&gt;  &lt;h2&gt;Azure DB Design&lt;/h2&gt;  &lt;p&gt;&lt;a href="http://msdn.microsoft.com/en-us/data/tools.aspx"&gt;http://msdn.microsoft.com/en-us/data/tools.aspx&lt;/a&gt;&lt;/p&gt;  &lt;h2&gt;IOS JSON Consuming App&lt;/h2&gt;  &lt;p&gt;&lt;a title="http://www.raywenderlich.com/store/ios-apprentice" href="http://www.raywenderlich.com/store/ios-apprentice"&gt;http://www.raywenderlich.com/store/ios-apprentice&lt;/a&gt; (Store Search Tutorial)     &lt;br /&gt;&lt;a title="http://www.raywenderlich.com/13511/how-to-create-an-app-like-instagram-with-a-web-service-backend-part-12" href="http://www.raywenderlich.com/13511/how-to-create-an-app-like-instagram-with-a-web-service-backend-part-12"&gt;http://www.raywenderlich.com/13511/how-to-create-an-app-like-instagram-with-a-web-service-backend-part-12&lt;/a&gt;     &lt;br /&gt;&lt;a title="http://www.raywenderlich.com/13541/how-to-create-an-app-like-instagram-with-a-web-service-backend-part-22" href="http://www.raywenderlich.com/13541/how-to-create-an-app-like-instagram-with-a-web-service-backend-part-22"&gt;http://www.raywenderlich.com/13541/how-to-create-an-app-like-instagram-with-a-web-service-backend-part-22&lt;/a&gt;&lt;/p&gt;  &lt;h1&gt;Videos&lt;/h1&gt;  &lt;h2&gt;ASP.NET MVC 4 and Web API&lt;/h2&gt;  &lt;p&gt;Building Responsive Web Applications with MVC4, WebAPI and HTML5    &lt;br /&gt;&lt;a title="https://channel9.msdn.com/Events/TechEd/Australia/2012/DEV332" href="https://channel9.msdn.com/Events/TechEd/Australia/2012/DEV332"&gt;https://channel9.msdn.com/Events/TechEd/Australia/2012/DEV332&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;ASP.NET for Mobile and Tablet Development    &lt;br /&gt;&lt;a title="http://channel9.msdn.com/Events/TechEd/NorthAmerica/2012/DEV304" href="http://channel9.msdn.com/Events/TechEd/NorthAmerica/2012/DEV304"&gt;http://channel9.msdn.com/Events/TechEd/NorthAmerica/2012/DEV304&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Building HTTP Services with ASP.NET Web API    &lt;br /&gt;&lt;a title="http://channel9.msdn.com/Events/TechEd/NorthAmerica/2012/DEV309" href="http://channel9.msdn.com/Events/TechEd/NorthAmerica/2012/DEV309"&gt;http://channel9.msdn.com/Events/TechEd/NorthAmerica/2012/DEV309&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;ASP.NET Roadmap: One ASP.NET – Web Forms, MVC, Web API, and more    &lt;br /&gt;&lt;a title="http://channel9.msdn.com/Events/TechEd/NorthAmerica/2012/DEV301" href="http://channel9.msdn.com/Events/TechEd/NorthAmerica/2012/DEV301"&gt;http://channel9.msdn.com/Events/TechEd/NorthAmerica/2012/DEV301&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Building Services for Any Client with ASP.NET Web API    &lt;br /&gt;&lt;a title="http://channel9.msdn.com/Events/Build/2012/3-036" href="http://channel9.msdn.com/Events/Build/2012/3-036"&gt;http://channel9.msdn.com/Events/Build/2012/3-036&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Bleeding edge ASP.NET: See what is next for MVC, Web API, SignalR and more…    &lt;br /&gt;&lt;a title="http://channel9.msdn.com/Events/Build/2012/3-028" href="http://channel9.msdn.com/Events/Build/2012/3-028"&gt;http://channel9.msdn.com/Events/Build/2012/3-028&lt;/a&gt;&lt;/p&gt;  &lt;h2&gt;DB Design&lt;/h2&gt;  &lt;p&gt;Microsoft SQL Server Data Tools: Database Development from Zero to Sixty    &lt;br /&gt;&lt;a title="http://channel9.msdn.com/Events/TechEd/Europe/2012/DBI311" href="http://channel9.msdn.com/Events/TechEd/Europe/2012/DBI311"&gt;http://channel9.msdn.com/Events/TechEd/Europe/2012/DBI311&lt;/a&gt;&lt;/p&gt;  &lt;h1&gt;Online Training&lt;/h1&gt;  &lt;h2&gt;ASP.NET MVC 4 and Web API&lt;/h2&gt;  &lt;p&gt;ASP.NET MVC Fundamentals    &lt;br /&gt;&lt;a title="http://www.pluralsight.com/training/Courses/TableOfContents/aspdotnet-mvc" href="http://www.pluralsight.com/training/Courses/TableOfContents/aspdotnet-mvc"&gt;http://www.pluralsight.com/training/Courses/TableOfContents/aspdotnet-mvc&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Building Applications with ASP.NET MVC 4    &lt;br /&gt;&lt;a title="http://www.pluralsight.com/training/Courses/TableOfContents/mvc4-building" href="http://www.pluralsight.com/training/Courses/TableOfContents/mvc4-building"&gt;http://www.pluralsight.com/training/Courses/TableOfContents/mvc4-building&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Introduction to the ASP.NET Web API    &lt;br /&gt;&lt;a title="http://www.pluralsight.com/training/Courses/TableOfContents/aspnetwebapi" href="http://www.pluralsight.com/training/Courses/TableOfContents/aspnetwebapi"&gt;http://www.pluralsight.com/training/Courses/TableOfContents/aspnetwebapi&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Building ASP.NET MVC Apps with EF Code First, HTML5, and jQuery    &lt;br /&gt;&lt;a title="http://www.pluralsight.com/training/Courses/TableOfContents/web-development" href="http://www.pluralsight.com/training/Courses/TableOfContents/web-development"&gt;http://www.pluralsight.com/training/Courses/TableOfContents/web-development&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;jQuery Fundamentals    &lt;br /&gt;&lt;a title="http://www.pluralsight.com/training/Courses/TableOfContents/jquery-fundamentals" href="http://www.pluralsight.com/training/Courses/TableOfContents/jquery-fundamentals"&gt;http://www.pluralsight.com/training/Courses/TableOfContents/jquery-fundamentals&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;jQuery Mobile and ASP.NET MVC 4    &lt;br /&gt;&lt;a title="http://www.pluralsight.com/training/Courses/TableOfContents/jquery-mobile" href="http://www.pluralsight.com/training/Courses/TableOfContents/jquery-mobile"&gt;http://www.pluralsight.com/training/Courses/TableOfContents/jquery-mobile&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Git Fundamentals    &lt;br /&gt;&lt;a title="http://www.pluralsight.com/training/Courses/TableOfContents/git-fundamentals" href="http://www.pluralsight.com/training/Courses/TableOfContents/git-fundamentals"&gt;http://www.pluralsight.com/training/Courses/TableOfContents/git-fundamentals&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Introduction to CSS    &lt;br /&gt;&lt;a title="http://www.pluralsight.com/training/Courses/TableOfContents/css-intro" href="http://www.pluralsight.com/training/Courses/TableOfContents/css-intro"&gt;http://www.pluralsight.com/training/Courses/TableOfContents/css-intro&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;CSS3    &lt;br /&gt;&lt;a title="http://www.pluralsight.com/training/Courses/TableOfContents/css3" href="http://www.pluralsight.com/training/Courses/TableOfContents/css3"&gt;http://www.pluralsight.com/training/Courses/TableOfContents/css3&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;HTML5 Fundamentals    &lt;br /&gt;&lt;a title="http://www.pluralsight.com/training/Courses/TableOfContents/html5-fundamentals" href="http://www.pluralsight.com/training/Courses/TableOfContents/html5-fundamentals"&gt;http://www.pluralsight.com/training/Courses/TableOfContents/html5-fundamentals&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Using HTML5 and CSS3    &lt;br /&gt;&lt;a title="http://www.pluralsight.com/training/Courses/TableOfContents/html5css3-upgrade" href="http://www.pluralsight.com/training/Courses/TableOfContents/html5css3-upgrade"&gt;http://www.pluralsight.com/training/Courses/TableOfContents/html5css3-upgrade&lt;/a&gt;&lt;/p&gt;  &lt;h1&gt;Ausblick&lt;/h1&gt;  &lt;p&gt;ASP.NET Web API is cool because, it lets you create services that can be consumed by an MVC 4 website or by an IPad app. Azure is nice, because it provides you with a free integration server for hosting your web service and your database server. And not to forget to mention the tight integration with Visual Studio and PowerShell for peace-of-mind development, testing and deployment.&lt;/p&gt;</description>
      <link>http://www.tellingmachine.com/post/getting-started-with-windows-azure-websites-azure-sql-server-asp-net-web-api-and-asp-net-mvc-4-mobile.aspx</link>
      <author>Klaus Graefensteiner</author>
      <comments>http://www.tellingmachine.com/post/getting-started-with-windows-azure-websites-azure-sql-server-asp-net-web-api-and-asp-net-mvc-4-mobile.aspx#comment</comments>
      <guid>http://www.tellingmachine.com/post.aspx?id=8213585d-8f0a-484c-a47f-d5a1c671a99d</guid>
      <pubDate>Fri, 15 Mar 2013 01:59:06 -1400</pubDate>
      <category>Visual Studio</category>
      <category>Azure</category>
      <category>ASP.NET</category>
      <category>IPhone</category>
      <category>IOS</category>
      <category>MVC</category>
      <category>Mobile</category>
      <category>ASP.NET Web API</category>
      <category>REST</category>
      <dc:publisher>Klaus Graefensteiner</dc:publisher>
      <pingback:server>http://www.tellingmachine.com/pingback.axd</pingback:server>
      <pingback:target>http://www.tellingmachine.com/post.aspx?id=8213585d-8f0a-484c-a47f-d5a1c671a99d</pingback:target>
      <slash:comments>2</slash:comments>
      <trackback:ping>http://www.tellingmachine.com/trackback.axd?id=8213585d-8f0a-484c-a47f-d5a1c671a99d</trackback:ping>
      <wfw:comment>http://www.tellingmachine.com/post/getting-started-with-windows-azure-websites-azure-sql-server-asp-net-web-api-and-asp-net-mvc-4-mobile.aspx#comment</wfw:comment>
      <wfw:commentRss>http://www.tellingmachine.com/syndication.axd?post=8213585d-8f0a-484c-a47f-d5a1c671a99d</wfw:commentRss>
    </item>
    <item>
      <title>Retrieving counter values with the Wonderware Historian Counter Retrieval Mode</title>
      <description>&lt;h1&gt;Introduction&lt;/h1&gt;  &lt;p&gt;Last week I blogged about &lt;a href="http://www.tellingmachine.com/post/SQL-Queries-for-storing-and-retrieving-real-time-data-from-the-Wonderware-Historian.aspx"&gt;how to store and retrieve time series data from the Wonderware Historian&lt;/a&gt;. The T-SQL queries in this post used “&lt;code&gt;wwRetrievalMode = &lt;/code&gt;&lt;code&gt;'Delta'”.&lt;/code&gt;The wwRetrievalMode parameter lets you specify how you would like to project the original data during the retrieval operation. There is a wide range of predefined projections. The main goal of the projections is to minimize the amount of data that needs to be sent to the client. For example, if you would like to find the max value of a tag in a specific time interval you would use the Maximum Retrieval mode instead of retrieving all values and then processing the result set to get the highest value.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://www.tellingmachine.com/image.axd?picture=Windows-Live-Writer/74d9abfd8ae6_CE7D/TheGrid_2.jpg" rel="lightbox"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="TheGrid" border="0" alt="TheGrid" src="http://www.tellingmachine.com/image.axd?picture=Windows-Live-Writer/74d9abfd8ae6_CE7D/TheGrid_thumb.jpg" width="484" height="363" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Figure 1: The Grid&lt;/strong&gt;&lt;/p&gt;  &lt;h1&gt;Historian 10 Retrieval Modes&lt;/h1&gt;  &lt;p&gt;Here is a list of the modes used in Historian 10&lt;/p&gt;  &lt;ol&gt;   &lt;li&gt;Cyclic Retrieval &lt;/li&gt;    &lt;li&gt;Delta Retrieval &lt;/li&gt;    &lt;li&gt;Full Retrieval &lt;/li&gt;    &lt;li&gt;Interpolated Retrieval &lt;/li&gt;    &lt;li&gt;“Best Fit” Retrieval &lt;/li&gt;    &lt;li&gt;Average Retrieval &lt;/li&gt;    &lt;li&gt;Minimum Retrieval &lt;/li&gt;    &lt;li&gt;Maximum Retrieval &lt;/li&gt;    &lt;li&gt;Integral Retrieval &lt;/li&gt;    &lt;li&gt;Slope Retrieval &lt;/li&gt;    &lt;li&gt;Counter Retrieval &lt;/li&gt;    &lt;li&gt;ValueState Retrieval &lt;/li&gt;    &lt;li&gt;RoundTrip Retrieval &lt;/li&gt; &lt;/ol&gt;  &lt;h1&gt;Counter Retrieval&lt;/h1&gt;  &lt;p&gt;The retrieval mode that can save a lot of headaches during data processing on the client is the Counter retrieval. Let’s for example assume that you would like to know how much water got added to your swimming pool in the last hour. You get your water meter reading before and after and calculate the difference. The counter retrieval does exactly that, but it also takes into account meters that reset themselves after their maximum counted value has been reached (counter overflow). For example the counter retrieval for the SysTimeSec system tag which represents the seconds of a wall clock would return 300 when asked for the counts during the last five minutes.&lt;/p&gt;  &lt;p&gt;Here are some sample queries:&lt;/p&gt;  &lt;pre class="brush: sql"&gt;-- Counter Retrieval
SELECT DateTime, TagName, Value, Quality, QualityDetail as QD 
FROM History
WHERE TagName = 'SysTimeSec'
AND DateTime BETWEEN DATEADD(MINUTE, -10, GETDATE()) AND GETDATE() 
AND wwRetrievalMode = 'counter'
AND wwCycleCount = 1

-- Counter Retrieval Multiple Tags
SELECT DateTime, TagName, Value, Quality, QualityDetail as QD 
FROM History
WHERE TagName IN ('SysTimeSec', 'SysTimeMin')
AND DateTime BETWEEN DATEADD(MINUTE, -10, GETDATE()) AND GETDATE() 
and wwRetrievalMode = 'counter'
and wwCycleCount = 1&lt;/pre&gt;

&lt;p&gt;&lt;a href="http://www.tellingmachine.com/image.axd?picture=Windows-Live-Writer/74d9abfd8ae6_CE7D/image_2.png" rel="lightbox"&gt;&lt;img style="background-image: none; border-right-width: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://www.tellingmachine.com/image.axd?picture=Windows-Live-Writer/74d9abfd8ae6_CE7D/image_thumb.png" width="644" height="462" /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Figure 2: Retrieval of resettable counter values&lt;/strong&gt;&lt;/p&gt;

&lt;h1&gt;Ausblick&lt;/h1&gt;

&lt;p&gt;More information about Counter Retrieval can be found in the Historian Concepts User Guide.&lt;/p&gt;</description>
      <link>http://www.tellingmachine.com/post/Retrieving-counter-values-with-the-Wonderware-Historian-Counter-Retrieval-Mode.aspx</link>
      <author>Klaus Graefensteiner</author>
      <comments>http://www.tellingmachine.com/post/Retrieving-counter-values-with-the-Wonderware-Historian-Counter-Retrieval-Mode.aspx#comment</comments>
      <guid>http://www.tellingmachine.com/post.aspx?id=d86de1a3-2b1e-4d97-b0a3-f5808ff34960</guid>
      <pubDate>Mon, 20 Aug 2012 10:19:59 -1400</pubDate>
      <category>Wonderware</category>
      <category>SQL</category>
      <dc:publisher>Klaus Graefensteiner</dc:publisher>
      <pingback:server>http://www.tellingmachine.com/pingback.axd</pingback:server>
      <pingback:target>http://www.tellingmachine.com/post.aspx?id=d86de1a3-2b1e-4d97-b0a3-f5808ff34960</pingback:target>
      <slash:comments>1</slash:comments>
      <trackback:ping>http://www.tellingmachine.com/trackback.axd?id=d86de1a3-2b1e-4d97-b0a3-f5808ff34960</trackback:ping>
      <wfw:comment>http://www.tellingmachine.com/post/Retrieving-counter-values-with-the-Wonderware-Historian-Counter-Retrieval-Mode.aspx#comment</wfw:comment>
      <wfw:commentRss>http://www.tellingmachine.com/syndication.axd?post=d86de1a3-2b1e-4d97-b0a3-f5808ff34960</wfw:commentRss>
    </item>
    <item>
      <title>SQL Queries for storing and retrieving real time data from the Wonderware Historian</title>
      <description>&lt;h1&gt;Wonderware Historian = SQL Server Mod for real time data&lt;/h1&gt;  &lt;p&gt;You can think of the &lt;a href="http://global.wonderware.com/EN/Pages/WonderwareHistorian.aspx"&gt;Wonderware Historian&lt;/a&gt; to be an extension of Microsoft SQL Server to handle large amounts of time series data efficiently. It is optimized to store and retrieve time series data. The data is actually not stored in SQL Server tables, but in files called History Blocks. The Wonderware Historian has an OLE DB Provider to interface with the storage and retrieval system. This blog posts shows some simple queries to store and retrieve an analog value using T-SQL.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://www.tellingmachine.com/image.axd?picture=Windows-Live-Writer/8c7cf35829b2_51ED/Wonderware%20Historian%20Management%20Console%20Status%20Pane_2.png" rel="lightbox"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="Wonderware Historian Management Console Status Pane" border="0" alt="Wonderware Historian Management Console Status Pane" src="http://www.tellingmachine.com/image.axd?picture=Windows-Live-Writer/8c7cf35829b2_51ED/Wonderware%20Historian%20Management%20Console%20Status%20Pane_thumb.png" width="624" height="484" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Figure 1: Wonderware Historian System Management Console&lt;/strong&gt;&lt;/p&gt;  &lt;h1&gt;Wonderware Historian Clients = Tools for analyzing time series data&lt;/h1&gt;  &lt;p&gt;The &lt;a href="http://global.wonderware.com/EN/Pages/WonderwareHistorianClients.aspx"&gt;Wonderware Historian Clients&lt;/a&gt; are a set of tools that help to visualize and analyze time series data. The Trend application (below) visualizes the values that got stored by one of the T-SQL queries.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://www.tellingmachine.com/image.axd?picture=Windows-Live-Writer/8c7cf35829b2_51ED/Wonderware%20Historian%20Client_2.png" rel="lightbox"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="Wonderware Historian Client" border="0" alt="Wonderware Historian Client" src="http://www.tellingmachine.com/image.axd?picture=Windows-Live-Writer/8c7cf35829b2_51ED/Wonderware%20Historian%20Client_thumb.png" width="644" height="456" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Figure 2: Trend Client&lt;/strong&gt;&lt;/p&gt;  &lt;h1&gt;T-SQL Queries for storing and retrieving data from the Wonderware Historian&lt;/h1&gt;  &lt;p&gt;Here is a set of queries that show how easy it is to store and retrieve time series and real time data from the Wonderware Historian.&lt;/p&gt;  &lt;h1&gt;&lt;/h1&gt;  &lt;pre class="brush: sql"&gt;USE Runtime
-- IMPORTANT -&amp;gt; START HISTORIAN (STORAGE)

-- Insert new real time value
INSERT AnalogHistory (DateTime, TagName, 
Value, QualityDetail, wwVersion) 
VALUES(null, 'EFAnalogManual001', 52, 192, 'REALTIME') --Null for time stamp -&amp;gt; Historian sets the timestamp

-- Get original value from in memory cache (Active Image)
SELECT TagName, Value 
FROM Live
WHERE TagName = 'EFAnalogManual001'

-- Get original value for current time
SELECT DateTime, Sec = DATEPART(ss, DateTime), TagName, Value, Quality, QualityDetail
FROM History
WHERE TagName = 'EFAnalogManual001'
AND DateTime = GETDATE()
AND wwRetrievalMode = 'Delta'

-- Get original values for the last 10 minutes
SELECT DateTime, Sec = DATEPART(ss, DateTime), TagName, Value, Quality, QualityDetail
FROM History
WHERE TagName = 'EFAnalogManual001'
AND DateTime BETWEEN DATEADD(MINUTE, -10, GETDATE()) AND GETDATE() 
AND wwRetrievalMode = 'Delta'
ORDER BY DateTime&lt;/pre&gt;

&lt;p&gt;&lt;a href="http://www.tellingmachine.com/image.axd?picture=Windows-Live-Writer/8c7cf35829b2_51ED/Querying%20Wonderware%20Historian%20from%20SQL%20Server%202012%20Management%20Studio_5.png" rel="lightbox"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="Querying Wonderware Historian from SQL Server 2012 Management Studio" border="0" alt="Querying Wonderware Historian from SQL Server 2012 Management Studio" src="http://www.tellingmachine.com/image.axd?picture=Windows-Live-Writer/8c7cf35829b2_51ED/Querying%20Wonderware%20Historian%20from%20SQL%20Server%202012%20Management%20Studio_thumb_1.png" width="625" height="484" /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Figure 3: Query results&lt;/strong&gt;&lt;/p&gt;

&lt;h1&gt;Ausblick&lt;/h1&gt;

&lt;p&gt;This is the first of a series of blog post about the Wonderware Historian. In one of the next posts I’d like to demonstrate how to write .NET applications that interface with the real-time storage via the &lt;a href="http://msdn.microsoft.com/en-us/data/ef.aspx"&gt;Microsoft Entity Framework&lt;/a&gt;.&lt;/p&gt;</description>
      <link>http://www.tellingmachine.com/post/SQL-Queries-for-storing-and-retrieving-real-time-data-from-the-Wonderware-Historian.aspx</link>
      <author>Klaus Graefensteiner</author>
      <comments>http://www.tellingmachine.com/post/SQL-Queries-for-storing-and-retrieving-real-time-data-from-the-Wonderware-Historian.aspx#comment</comments>
      <guid>http://www.tellingmachine.com/post.aspx?id=b7981fa6-3b88-4950-9d97-2c3fd5bf59e7</guid>
      <pubDate>Tue, 14 Aug 2012 22:54:53 -1400</pubDate>
      <category>Wonderware</category>
      <category>SQL</category>
      <dc:publisher>Klaus Graefensteiner</dc:publisher>
      <pingback:server>http://www.tellingmachine.com/pingback.axd</pingback:server>
      <pingback:target>http://www.tellingmachine.com/post.aspx?id=b7981fa6-3b88-4950-9d97-2c3fd5bf59e7</pingback:target>
      <slash:comments>4</slash:comments>
      <trackback:ping>http://www.tellingmachine.com/trackback.axd?id=b7981fa6-3b88-4950-9d97-2c3fd5bf59e7</trackback:ping>
      <wfw:comment>http://www.tellingmachine.com/post/SQL-Queries-for-storing-and-retrieving-real-time-data-from-the-Wonderware-Historian.aspx#comment</wfw:comment>
      <wfw:commentRss>http://www.tellingmachine.com/syndication.axd?post=b7981fa6-3b88-4950-9d97-2c3fd5bf59e7</wfw:commentRss>
    </item>
  </channel>
</rss>
