<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" 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:dc="http://purl.org/dc/elements/1.1/" version="2.0">
  <channel>
    <title>ControlSystemWorks Blog - demo</title>
    <link>http://www.controlsystemworks.com/blog/</link>
    <description>Of CSWorks and software development</description>
    <language>en-us</language>
    <copyright>ControlSystemWorks.com</copyright>
    <lastBuildDate>Thu, 02 Sep 2010 20:08:52 GMT</lastBuildDate>
    <generator>newtelligence dasBlog 2.3.9074.18820</generator>
    <managingEditor>support@ControlSystemWorks.net</managingEditor>
    <webMaster>support@ControlSystemWorks.net</webMaster>
    <item>
      <trackback:ping>http://www.controlsystemworks.com/blog/Trackback.aspx?guid=e65f3561-1c32-4f28-9bfb-af42a9fcc594</trackback:ping>
      <pingback:server>http://www.controlsystemworks.com/blog/pingback.aspx</pingback:server>
      <pingback:target>http://www.controlsystemworks.com/blog/PermaLink,guid,e65f3561-1c32-4f28-9bfb-af42a9fcc594.aspx</pingback:target>
      <dc:creator>Sergey Sorokin</dc:creator>
      <wfw:comment>http://www.controlsystemworks.com/blog/CommentView,guid,e65f3561-1c32-4f28-9bfb-af42a9fcc594.aspx</wfw:comment>
      <wfw:commentRss>http://www.controlsystemworks.com/blog/SyndicationService.asmx/GetEntryCommentsRss?guid=e65f3561-1c32-4f28-9bfb-af42a9fcc594</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">Some people who are willing to try CSWorks
have no possibility or desire to install IIS (Internet Information Services). Starting
today, to make their lives a bit easier, we offer a special distribution of CSWorks
called "CSWorks Light" that <b>does not require IIS</b>. A couple of highlights:<br /><ul><li>
this distribution uses <a href="http://www.controlsystemworks.com/articles/UsingCassiniWebServer.html">Microsoft
Cassini</a> web server - a very simple and limited-functionality, lightweight alternative
to IIS;</li><li>
this distribution misses some samples that work with IIS-hosted CSWorks;</li><li>
this distribution <b>should not be used in production environment</b>, it is for demo
purposes only.</li></ul>
Cassini-based deployment has the following limitations:<br /><ul><li>
it can host only one ASP.NET application per port;</li><li>
it does not support HTTPS;</li><li>
it does not support authentication;</li><li>
it responds only to localhost requests.</li></ul>
Cassini was designed as a simple tool for debugging .NET applications and it is not
officially supported by Microsoft (read full story <a href="http://www.controlsystemworks.com/articles/UsingCassiniWebServer.html">here</a>),
so please do not expect stellar performance and production-grade reliability from
CSWorks Light.<br /><br />
The link to CSWorks Light download will be provided in the email you will receive
after submitting our <a href="http://www.controlsystemworks.com/DownloadDescription.aspx">download
form</a>.<br /><br /><br /><br /><br /><p></p><img width="0" height="0" src="http://www.controlsystemworks.com/blog/aggbug.ashx?id=e65f3561-1c32-4f28-9bfb-af42a9fcc594" /></body>
      <title>CSWorks Light - no IIS required</title>
      <guid isPermaLink="false">http://www.controlsystemworks.com/blog/PermaLink,guid,e65f3561-1c32-4f28-9bfb-af42a9fcc594.aspx</guid>
      <link>http://www.controlsystemworks.com/blog/2010/09/02/CSWorksLightNoIISRequired.aspx</link>
      <pubDate>Thu, 02 Sep 2010 20:08:52 GMT</pubDate>
      <description>Some people who are willing to try CSWorks have no possibility or desire to install IIS (Internet Information Services). Starting today, to make their lives a bit easier, we offer a special distribution of CSWorks called "CSWorks Light" that &lt;b&gt;does
not require IIS&lt;/b&gt;. A couple of highlights:&lt;br&gt;
&lt;ul&gt;
&lt;li&gt;
this distribution uses &lt;a href="http://www.controlsystemworks.com/articles/UsingCassiniWebServer.html"&gt;Microsoft
Cassini&lt;/a&gt; web server - a very simple and limited-functionality, lightweight alternative
to IIS;&lt;/li&gt;
&lt;li&gt;
this distribution misses some samples that work with IIS-hosted CSWorks;&lt;/li&gt;
&lt;li&gt;
this distribution &lt;b&gt;should not be used in production environment&lt;/b&gt;, it is for demo
purposes only.&lt;/li&gt;
&lt;/ul&gt;
Cassini-based deployment has the following limitations:&lt;br&gt;
&lt;ul&gt;
&lt;li&gt;
it can host only one ASP.NET application per port;&lt;/li&gt;
&lt;li&gt;
it does not support HTTPS;&lt;/li&gt;
&lt;li&gt;
it does not support authentication;&lt;/li&gt;
&lt;li&gt;
it responds only to localhost requests.&lt;/li&gt;
&lt;/ul&gt;
Cassini was designed as a simple tool for debugging .NET applications and it is not
officially supported by Microsoft (read full story &lt;a href="http://www.controlsystemworks.com/articles/UsingCassiniWebServer.html"&gt;here&lt;/a&gt;),
so please do not expect stellar performance and production-grade reliability from
CSWorks Light.&lt;br&gt;
&lt;br&gt;
The link to CSWorks Light download will be provided in the email you will receive
after submitting our &lt;a href="http://www.controlsystemworks.com/DownloadDescription.aspx"&gt;download
form&lt;/a&gt;.&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.controlsystemworks.com/blog/aggbug.ashx?id=e65f3561-1c32-4f28-9bfb-af42a9fcc594" /&gt;</description>
      <comments>http://www.controlsystemworks.com/blog/CommentView,guid,e65f3561-1c32-4f28-9bfb-af42a9fcc594.aspx</comments>
      <category>demo</category>
      <category>news</category>
      <category>setup</category>
    </item>
    <item>
      <trackback:ping>http://www.controlsystemworks.com/blog/Trackback.aspx?guid=dcf0c93f-e666-40b4-88e1-fa2ff2e16edb</trackback:ping>
      <pingback:server>http://www.controlsystemworks.com/blog/pingback.aspx</pingback:server>
      <pingback:target>http://www.controlsystemworks.com/blog/PermaLink,guid,dcf0c93f-e666-40b4-88e1-fa2ff2e16edb.aspx</pingback:target>
      <dc:creator>Sergey Sorokin</dc:creator>
      <wfw:comment>http://www.controlsystemworks.com/blog/CommentView,guid,dcf0c93f-e666-40b4-88e1-fa2ff2e16edb.aspx</wfw:comment>
      <wfw:commentRss>http://www.controlsystemworks.com/blog/SyndicationService.asmx/GetEntryCommentsRss?guid=dcf0c93f-e666-40b4-88e1-fa2ff2e16edb</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
Silverlight 4 supports the resolution of relative service addresses. Provided the
Silverlight XAP package is hosted at http://somesite.com/application/ClientBin/Application.xap,
the following address resolve as indicated: 
</p>
        <p>
"../Service1/Service.asmx" resolves to “http://somesite.com/application/Service1/Service.asmx” 
</p>
        <p>
For you, CSWorks users out there, it means one good thing: no more ServiceReferences.ClientConfig
hassle, see <a href="http://www.controlsystemworks.com/blog/2010/02/25/RunningCSWorksDemoApplicationsFromRemoteClients.aspx">Running
CSWorks demo applications from remote clients</a> post for details. Now you can simply
specify relative service addres as follows: 
</p>
        <p>
&lt;endpoint address="../LiveDataWebService/Service.asmx" ...&gt;
</p>
        <p>
and your CSWorks application will work from any website you deploy it to. Switching
to Silverlight 4 pays off!
</p>
        <img width="0" height="0" src="http://www.controlsystemworks.com/blog/aggbug.ashx?id=dcf0c93f-e666-40b4-88e1-fa2ff2e16edb" />
      </body>
      <title>Silverlight 4 - relative web service address support</title>
      <guid isPermaLink="false">http://www.controlsystemworks.com/blog/PermaLink,guid,dcf0c93f-e666-40b4-88e1-fa2ff2e16edb.aspx</guid>
      <link>http://www.controlsystemworks.com/blog/2010/06/25/Silverlight4RelativeWebServiceAddressSupport.aspx</link>
      <pubDate>Fri, 25 Jun 2010 16:59:41 GMT</pubDate>
      <description>&lt;p&gt;
Silverlight 4 supports the resolution of relative service addresses. Provided the
Silverlight XAP package is hosted at http://somesite.com/application/ClientBin/Application.xap,
the following address resolve as indicated: 
&lt;/p&gt;
&lt;p&gt;
"../Service1/Service.asmx" resolves to “http://somesite.com/application/Service1/Service.asmx” 
&lt;/p&gt;
&lt;p&gt;
For you, CSWorks users out there, it means one good thing: no more ServiceReferences.ClientConfig
hassle, see &lt;a href="http://www.controlsystemworks.com/blog/2010/02/25/RunningCSWorksDemoApplicationsFromRemoteClients.aspx"&gt;Running
CSWorks demo applications from remote clients&lt;/a&gt; post for details. Now you can simply
specify relative service addres as follows: 
&lt;/p&gt;
&lt;p&gt;
&amp;lt;endpoint address="../LiveDataWebService/Service.asmx" ...&amp;gt;
&lt;/p&gt;
&lt;p&gt;
and your CSWorks application will work from any website you deploy it to. Switching
to Silverlight 4 pays off!
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.controlsystemworks.com/blog/aggbug.ashx?id=dcf0c93f-e666-40b4-88e1-fa2ff2e16edb" /&gt;</description>
      <comments>http://www.controlsystemworks.com/blog/CommentView,guid,dcf0c93f-e666-40b4-88e1-fa2ff2e16edb.aspx</comments>
      <category>demo</category>
      <category>wcf</category>
    </item>
    <item>
      <trackback:ping>http://www.controlsystemworks.com/blog/Trackback.aspx?guid=bd94790d-4950-4407-94a4-9bd146090266</trackback:ping>
      <pingback:server>http://www.controlsystemworks.com/blog/pingback.aspx</pingback:server>
      <pingback:target>http://www.controlsystemworks.com/blog/PermaLink,guid,bd94790d-4950-4407-94a4-9bd146090266.aspx</pingback:target>
      <dc:creator>Sergey Sorokin</dc:creator>
      <wfw:comment>http://www.controlsystemworks.com/blog/CommentView,guid,bd94790d-4950-4407-94a4-9bd146090266.aspx</wfw:comment>
      <wfw:commentRss>http://www.controlsystemworks.com/blog/SyndicationService.asmx/GetEntryCommentsRss?guid=bd94790d-4950-4407-94a4-9bd146090266</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
          <font size="4">Resizable controls - what's the problem? </font>
        </p>
        <p>
To save HMI screen space, application developers may want to make some controls resizable.
Applying ScaleTransform is not a problem and is a good solution in many cases. See
Pipes and Tanks Demo for example - it uses ScaleTransform and redraws screen content
when a user changes browser window size. 
</p>
        <p>
Unfortunately, ScaleTransform is not an optimal solution when dealing with complex
UI elements, especially those containing some amount of text - some pieces may look
ugly, some may become too small to be useful. The only solution is to make complex
controls able to react to the 'SizeChanged' event and recalculate internal layout
at runtime. Latest version of Alarm Summary and Trend Control can do that, and this
post shows how application developers can use this functionality. 
</p>
        <p>
We will need a container control that lets user change its size, and a piece of code
that passes the changes to CSWorks controls. You can develop your own container control
(there are a lot of examples available in the web) or use an existing third-party
container control for that. I will use RadWindow from Telerik in this example - it
serves the purpose quite well. 
</p>
        <p>
          <font size="4">Resizable Alarm Demo </font>
        </p>
        <p>
1. Download Rad Controls for Silverlight trial package from www.telerik.com (DLLs
only). 
<br />
2. Unzip downloaded archive to "C:\Program Files\CSWorks\Demo\Src\tps\Telerik". Telerik
DLLs will be unpacked to "C:\Program Files\CSWorks\Demo\Src\tps\Telerik\Binaries\Silverlight\". 
<br />
3. Open Alarm Demo project ("C:\Program Files\CSWorks\Demo\Src\AlarmDemo\") in Visual
Studio. 
<br />
4. We will use RadWindow control implemented in Telerik.Windows.Controls.Navigation.dll.
Add Telerik.Windows.Controls.Navigation.dll and Telerik.Windows.Controls.dll to the
reference list for Alarm Demo project. 
<br />
5. Open Page.xaml file. Add 'telerik' namespace to the UserControl element: 
<br /><br /><font color="#0000ff" size="1">&lt;UserControl ...<br />
  xmlns:telerik="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.Navigation"<br />
... &gt; </font><br /><br />
6. Replace control content with a grid that contains RawWindow that contains CSWorks
Alarm Summary, and add SizeChanged event handler for RadWindow: 
<br /><grid><br /><font color="#0000ff" size="1">&lt;Grid&gt;<br />
  &lt;telerik:RadWindow x:Name="radWindow" SizeChanged="OnSizeChanged"&gt;<br />
    &lt;telerik:RadWindow.Header&gt;<br />
      &lt;TextBlock Text="Alarm Demo"/&gt;<br />
    &lt;/telerik:RadWindow.Header&gt;<br />
    &lt;alarm:AlarmSummary ... /&gt;<br />
  &lt;/telerik:RadWindow&gt;<br />
&lt;/Grid&gt;</font><br /><br />
7. Open Page.xaml.cs file, implement SizeChanged event handler that adjusts AlarmSummary
height and width when RadWindow size is changed: 
</grid></p>
        <p>
          <grid>
            <font color="#0000ff" size="1">private void OnSizeChanged(object sender, SizeChangedEventArgs
e)<br />
{<br />
  GeneralTransform gtGlobal = alarmSummary.TransformToVisual(radWindow);<br />
  Point leftTopGlobal = gtGlobal.Transform(new Point(0, 0));<br /><br />
  alarmSummary.Height = radWindow.Height - radWindow.BorderThickness.Bottom
- leftTopGlobal.Y - 4.0;<br />
  alarmSummary.Width = radWindow.Width - leftTopGlobal.X * 2;<br />
}</font>
            <br />
            <br />
8. Update Loaded event handler so RadWindow shows itself after page is loaded:<br /><br /><font color="#0000ff" size="1">private void Page_Loaded(object sender, RoutedEventArgs
e)<br />
{<br />
  ...<br />
  radWindow.Show();<br />
}</font><br /><br />
9. Rebuild the project and run Alarm Demo from Start Menu. Resize RadWindow and watch
Alarm Summary changing its layout:
</grid>
        </p>
        <p>
          <grid>
            <a target="_blank" href="content/binary/2010-04-19-ResizableAlarm-big.gif">
              <img src="content/binary/2010-04-19-ResizableAlarm.gif" border="0" />
            </a>
          </grid>
        </p>
        <font size="4">Resizable Trend </font>
        <p>
        </p>
        <p>
You can do the same to CSWorks Trend control. 
</p>
        <p>
1. Open Trend Demo project ("C:\Program Files\CSWorks\Demo\Src\TrendDemo\TrendDemo.Sample.csproj") 
<br />
2. Add Telerik.Windows.Controls.Navigation.dll and Telerik.Windows.Controls.dll to
the reference list. 
<br />
3. Open MainPage.xaml file. Add 'telerik' namespace as shown above. 
<br />
4. Change xaml so RadWindow contains TrendControl: 
<br /><br /><font color="#0000ff" size="1">&lt;Grid&gt;<br />
  &lt;telerik:RadWindow x:Name="radWindow" SizeChanged="OnSizeChanged"&gt;<br />
    &lt;telerik:RadWindow.Header&gt;<br />
      &lt;TextBlock Text="Trend Demo"/&gt;<br />
    &lt;/telerik:RadWindow.Header&gt;<br />
    &lt;t:Trend ...&gt;<br />
      ...<br />
    &lt;/t:Trend&gt;<br />
  &lt;/telerik:RadWindow&gt;<br />
&lt;/Grid&gt;</font><br /><br />
5. Open MainPage.xanl.cs. Add OnSizeChanged handler:
</p>
        <p>
          <font color="#0000ff" size="1">private void OnSizeChanged(object sender, SizeChangedEventArgs
e)<br />
{<br />
  GeneralTransform gtGlobal = _demoTrend.TransformToVisual(radWindow);<br />
  Point leftTopGlobal = gtGlobal.Transform(new Point(0, 0));<br /><br />
  _demoTrend.Height = radWindow.Height - radWindow.BorderThickness.Bottom
- leftTopGlobal.Y - 4.0;<br />
  _demoTrend.Width = radWindow.Width - leftTopGlobal.X * 2;<br />
}</font>
          <br />
          <br />
6. Show RadWindow on startup:
</p>
        <p>
          <font color="#0000ff" size="1">void MainPage_Loaded(object sender, RoutedEventArgs
e)<br />
{<br />
  ...<br />
  radWindow.Show();<br />
}</font>
          <br />
          <br />
7. Rebuild the project and run Trend Demo from Start Menu. Resize RadWindow and watch
Trend control changing its layout: 
</p>
        <p>
          <br />
          <a target="_blank" href="content/binary/2010-04-19-ResizableTrend-big.gif">
            <img src="content/binary/2010-04-19-ResizableTrend.gif" border="0" />
          </a>
        </p>
        <img width="0" height="0" src="http://www.controlsystemworks.com/blog/aggbug.ashx?id=bd94790d-4950-4407-94a4-9bd146090266" />
      </body>
      <title>Resizable Alarm Summary and Trend</title>
      <guid isPermaLink="false">http://www.controlsystemworks.com/blog/PermaLink,guid,bd94790d-4950-4407-94a4-9bd146090266.aspx</guid>
      <link>http://www.controlsystemworks.com/blog/2010/04/19/ResizableAlarmSummaryAndTrend.aspx</link>
      <pubDate>Mon, 19 Apr 2010 21:11:23 GMT</pubDate>
      <description>&lt;p&gt;
&lt;font size="4"&gt;Resizable controls - what's the problem? &lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
To save HMI screen space, application developers may want to make some controls resizable.
Applying ScaleTransform is not a problem and is a good solution in many cases. See
Pipes and Tanks Demo for example - it uses ScaleTransform and redraws screen content
when a user changes browser window size. 
&lt;/p&gt;
&lt;p&gt;
Unfortunately, ScaleTransform is not an optimal solution when dealing with complex
UI elements, especially those containing some amount of text - some pieces may look
ugly, some may become too small to be useful. The only solution is to make complex
controls able to react to the 'SizeChanged' event and recalculate internal layout
at runtime. Latest version of Alarm Summary and Trend Control can do that, and this
post shows how application developers can use this functionality. 
&lt;/p&gt;
&lt;p&gt;
We will need a container control that lets user change its size, and a piece of code
that passes the changes to CSWorks controls. You can develop your own container control
(there are a lot of examples available in the web) or use an existing third-party
container control for that. I will use RadWindow from Telerik in this example - it
serves the purpose quite well. 
&lt;/p&gt;
&lt;p&gt;
&lt;font size="4"&gt;Resizable Alarm Demo &lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
1. Download Rad Controls for Silverlight trial package from www.telerik.com (DLLs
only). 
&lt;br&gt;
2. Unzip downloaded archive to "C:\Program Files\CSWorks\Demo\Src\tps\Telerik". Telerik
DLLs will be unpacked to "C:\Program Files\CSWorks\Demo\Src\tps\Telerik\Binaries\Silverlight\". 
&lt;br&gt;
3. Open Alarm Demo project ("C:\Program Files\CSWorks\Demo\Src\AlarmDemo\") in Visual
Studio. 
&lt;br&gt;
4. We will use RadWindow control implemented in Telerik.Windows.Controls.Navigation.dll.
Add Telerik.Windows.Controls.Navigation.dll and Telerik.Windows.Controls.dll to the
reference list for Alarm Demo project. 
&lt;br&gt;
5. Open Page.xaml file. Add 'telerik' namespace to the UserControl element: 
&lt;br&gt;
&lt;br&gt;
&lt;font color="#0000ff" size="1"&gt;&amp;lt;UserControl ...&lt;br&gt;
&amp;nbsp;&amp;nbsp;xmlns:telerik="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.Navigation"&lt;br&gt;
... &amp;gt; &lt;/font&gt;
&lt;br&gt;
&lt;br&gt;
6. Replace control content with a grid that contains RawWindow that contains CSWorks
Alarm Summary, and add SizeChanged event handler for RadWindow: 
&lt;br&gt;
&lt;grid&gt;
&lt;br&gt;
&lt;font color="#0000ff" size="1"&gt;&amp;lt;Grid&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;lt;telerik:RadWindow x:Name="radWindow" SizeChanged="OnSizeChanged"&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;telerik:RadWindow.Header&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;TextBlock Text="Alarm Demo"/&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;/telerik:RadWindow.Header&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;alarm:AlarmSummary ... /&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;lt;/telerik:RadWindow&amp;gt;&lt;br&gt;
&amp;lt;/Grid&amp;gt;&lt;/font&gt;
&lt;br&gt;
&lt;br&gt;
7. Open Page.xaml.cs file, implement SizeChanged event handler that adjusts AlarmSummary
height and width when RadWindow size is changed:&amp;nbsp;
&lt;/grid&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;grid&gt;
&lt;font color="#0000ff" size="1"&gt;private void OnSizeChanged(object sender, SizeChangedEventArgs
e)&lt;br&gt;
{&lt;br&gt;
&amp;nbsp;&amp;nbsp;GeneralTransform gtGlobal = alarmSummary.TransformToVisual(radWindow);&lt;br&gt;
&amp;nbsp;&amp;nbsp;Point leftTopGlobal = gtGlobal.Transform(new Point(0, 0));&lt;br&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp;alarmSummary.Height = radWindow.Height - radWindow.BorderThickness.Bottom
- leftTopGlobal.Y - 4.0;&lt;br&gt;
&amp;nbsp;&amp;nbsp;alarmSummary.Width = radWindow.Width - leftTopGlobal.X * 2;&lt;br&gt;
}&lt;/font&gt; 
&lt;br&gt;
&lt;br&gt;
8. Update Loaded event handler so RadWindow shows itself after page is loaded:&lt;br&gt;
&lt;br&gt;
&lt;font color="#0000ff" size="1"&gt;private void Page_Loaded(object sender, RoutedEventArgs
e)&lt;br&gt;
{&lt;br&gt;
&amp;nbsp;&amp;nbsp;...&lt;br&gt;
&amp;nbsp;&amp;nbsp;radWindow.Show();&lt;br&gt;
}&lt;/font&gt;
&lt;br&gt;
&lt;br&gt;
9. Rebuild the project and run Alarm Demo from Start Menu. Resize RadWindow and watch
Alarm Summary changing its layout:
&lt;/grid&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;grid&gt;
&lt;a target="_blank" href="content/binary/2010-04-19-ResizableAlarm-big.gif"&gt;&lt;img src="content/binary/2010-04-19-ResizableAlarm.gif" border="0"&gt;&lt;/a&gt; 
&lt;/grid&gt;
&lt;/p&gt;
&lt;font size="4"&gt;Resizable Trend &lt;/font&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;p&gt;
You can do the same to CSWorks Trend control. 
&lt;/p&gt;
&lt;p&gt;
1. Open Trend Demo project ("C:\Program Files\CSWorks\Demo\Src\TrendDemo\TrendDemo.Sample.csproj") 
&lt;br&gt;
2. Add Telerik.Windows.Controls.Navigation.dll and Telerik.Windows.Controls.dll to
the reference list. 
&lt;br&gt;
3. Open MainPage.xaml file. Add 'telerik' namespace as shown above. 
&lt;br&gt;
4. Change xaml so RadWindow contains TrendControl: 
&lt;br&gt;
&lt;br&gt;
&lt;font color="#0000ff" size="1"&gt;&amp;lt;Grid&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;lt;telerik:RadWindow x:Name="radWindow" SizeChanged="OnSizeChanged"&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;telerik:RadWindow.Header&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;TextBlock Text="Trend Demo"/&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;/telerik:RadWindow.Header&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;t:Trend ...&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;...&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;/t:Trend&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;lt;/telerik:RadWindow&amp;gt;&lt;br&gt;
&amp;lt;/Grid&amp;gt;&lt;/font&gt;
&lt;br&gt;
&lt;br&gt;
5. Open MainPage.xanl.cs. Add OnSizeChanged handler:
&lt;/p&gt;
&lt;p&gt;
&lt;font color="#0000ff" size="1"&gt;private void OnSizeChanged(object sender, SizeChangedEventArgs
e)&lt;br&gt;
{&lt;br&gt;
&amp;nbsp;&amp;nbsp;GeneralTransform gtGlobal = _demoTrend.TransformToVisual(radWindow);&lt;br&gt;
&amp;nbsp;&amp;nbsp;Point leftTopGlobal = gtGlobal.Transform(new Point(0, 0));&lt;br&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp;_demoTrend.Height = radWindow.Height - radWindow.BorderThickness.Bottom
- leftTopGlobal.Y - 4.0;&lt;br&gt;
&amp;nbsp;&amp;nbsp;_demoTrend.Width = radWindow.Width - leftTopGlobal.X * 2;&lt;br&gt;
}&lt;/font&gt; 
&lt;br&gt;
&lt;br&gt;
6. Show RadWindow on startup:
&lt;/p&gt;
&lt;p&gt;
&lt;font color="#0000ff" size="1"&gt;void MainPage_Loaded(object sender, RoutedEventArgs
e)&lt;br&gt;
{&lt;br&gt;
&amp;nbsp;&amp;nbsp;...&lt;br&gt;
&amp;nbsp;&amp;nbsp;radWindow.Show();&lt;br&gt;
}&lt;/font&gt;
&lt;br&gt;
&lt;br&gt;
7. Rebuild the project and run Trend Demo from Start Menu. Resize RadWindow and watch
Trend control changing its layout:&amp;nbsp;
&lt;/p&gt;
&lt;p&gt;
&lt;br&gt;
&lt;a target="_blank" href="content/binary/2010-04-19-ResizableTrend-big.gif"&gt;&lt;img src="content/binary/2010-04-19-ResizableTrend.gif" border="0"&gt;&lt;/a&gt; 
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.controlsystemworks.com/blog/aggbug.ashx?id=bd94790d-4950-4407-94a4-9bd146090266" /&gt;</description>
      <comments>http://www.controlsystemworks.com/blog/CommentView,guid,bd94790d-4950-4407-94a4-9bd146090266.aspx</comments>
      <category>demo</category>
      <category>third-party</category>
    </item>
    <item>
      <trackback:ping>http://www.controlsystemworks.com/blog/Trackback.aspx?guid=4e880e6a-bfd0-4e97-9914-d0d5cf246475</trackback:ping>
      <pingback:server>http://www.controlsystemworks.com/blog/pingback.aspx</pingback:server>
      <pingback:target>http://www.controlsystemworks.com/blog/PermaLink,guid,4e880e6a-bfd0-4e97-9914-d0d5cf246475.aspx</pingback:target>
      <dc:creator>Sergey Sorokin</dc:creator>
      <wfw:comment>http://www.controlsystemworks.com/blog/CommentView,guid,4e880e6a-bfd0-4e97-9914-d0d5cf246475.aspx</wfw:comment>
      <wfw:commentRss>http://www.controlsystemworks.com/blog/SyndicationService.asmx/GetEntryCommentsRss?guid=4e880e6a-bfd0-4e97-9914-d0d5cf246475</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
CSWorks client framework is all about third-party UI components. As of this writing,
all major Silverlight component providers have come up with their versions of the
Gauge control. In this example, I will show how you can integrate Telerik and/or ComponentOne
gauge controls into CSWorks Pipes and Tanks Demo application. The result will look
like this:<br /><br /><img src="content/binary/2010-03-15-ThirdPartyGauges.png" /><br /><br />
Here are the steps to make it work.<br /><br />
1. Download Telerik Silverlight controls (dlls only) and ComponentOne Studio Trial
Package for Silverlight.<br />
2. Create a folder for third-party controls - C:\Program Files\CSWorks\ThirdParty.<br />
3. Unpack downloaded Telerik archive and install ComponentOne package.<br />
4. Copy Telerik assemblies (Telerik.Windows.Controls.Gauge.dll, Telerik.Windows.Controls.dll,
Telerik.Windows.Data.dll) and ComponentOne assemblies (C1.Silverlight.dll, C1.Silverlight.Gauge.dll)
to ThirdParty folder.<br />
5. Open C:\Program Files\CSWorks\Demo\Src\PipesAndTanksDemo\PipesAndTanksDemo.Sample.csproj
in Visual Studio.<br />
6. Add all copied third party assemblies to the project reference list.<br />
7. Open Page.xaml and add third-party namespaces to the namespace list:<br /><br /><font color="#0000ff" size="1">&lt;UserControl x:Class="CSWorks.Client.PipesAndTanksDemo.Page"<br />
  ...<br /><b>  xmlns:tcontrol="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.Gauge"<br />
  xmlns:tgauge="clr-namespace:Telerik.Windows.Controls.Gauges;assembly=Telerik.Windows.Controls.Gauge"<br />
  xmlns:c1gauge="clr-namespace:C1.Silverlight.Gauge;assembly=C1.Silverlight.Gauge"</b><br />
  ...&gt;</font><br /><br />
8. Add gauge controls to the page and bind them to LeftPumpSpeed and RightPumpSpeed
data items:<br /><br /><font color="#0000ff" size="1">&lt;controls:TabItem Header="HMI Controls View"&gt;<br />
    &lt;Canvas&gt;<br />
        ...<br />
        &lt;Grid ...&gt;<br />
            ...<br />
            &lt;Border ...&gt;<br />
              ...<br />
            &lt;/Border&gt;<br /><br /><b>            &lt;!-- Telerik
Gauge for left pump --&gt;<br />
            &lt;Border Grid.Row="1"
Grid.Column="5" Grid.RowSpan="1" Grid.ColumnSpan="3" Background="White" BorderBrush="Black"
BorderThickness="1" CornerRadius="5" Padding="5,0,5,0" Margin="0,10,0,-10"&gt;<br />
               
&lt;StackPanel Orientation="Vertical"&gt;<br />
                   
&lt;TextBlock Text="Telerik Gauge" Foreground="Black" FontSize="8" HorizontalAlignment="Center"/&gt;<br />
                   
&lt;tcontrol:RadGauge x:Name="radGauge" VerticalAlignment="Bottom" &gt;<br />
                       
&lt;tgauge:RadialGauge  &gt;<br />
                           
&lt;tgauge:RadialScale Min="0" Max="200" LabelRotationMode="None" FontSize="7"&gt;<br />
                               
&lt;tgauge:RadialScale.Label&gt;<br />
                                   
&lt;tgauge:LabelProperties FontSize="4.5"/&gt;<br />
                               
&lt;/tgauge:RadialScale.Label&gt;<br />
                               
&lt;tgauge:RangeList&gt;<br />
                                   
&lt;tgauge:RadialRange Min="0" Max="100" StartWidth="0.05" EndWidth="0.05" Background="Green"/&gt;<br />
                                   
&lt;tgauge:RadialRange Min="100" Max="160" StartWidth="0.05" EndWidth="0.05" Background="Orange"/&gt;<br />
                                   
&lt;tgauge:RadialRange Min="160" Max="200" StartWidth="0.05" EndWidth="0.05" Background="Red"
/&gt;<br />
                               
&lt;/tgauge:RangeList&gt;<br />
                               
&lt;tgauge:IndicatorList&gt;<br />
                                   
&lt;tgauge:Needle Value="{Binding Value, Mode=OneWay, Source={StaticResource LeftPumpSpeed}}"/&gt;<br />
                               
&lt;/tgauge:IndicatorList&gt;<br />
                           
&lt;/tgauge:RadialScale&gt;<br />
                       
&lt;/tgauge:RadialGauge&gt;<br />
                   
&lt;/tcontrol:RadGauge&gt;<br />
                   
&lt;TextBlock Text="rpm" Foreground="White" FontSize="7" HorizontalAlignment="Center"
VerticalAlignment="Bottom"  Margin="0,-30,0,30"/&gt;<br />
               
&lt;/StackPanel&gt;<br />
            &lt;/Border&gt;<br /><br />
            &lt;!-- ComponentOne
Gauge for right pump --&gt;<br />
            &lt;Border Grid.Row="1"
Grid.Column="9" Grid.RowSpan="1" Grid.ColumnSpan="3" Background="White" BorderBrush="Black"
BorderThickness="1" CornerRadius="5" Padding="5,0,5,0" Margin="0,10,0,-10"&gt;<br />
               
&lt;StackPanel Orientation="Vertical"&gt;<br />
                   
&lt;TextBlock Text="C1 Gauge" Foreground="Black" FontSize="8" HorizontalAlignment="Center"/&gt;<br />
                   
&lt;c1gauge:C1RadialGauge  Minimum="0" Maximum="200" Value="{Binding Value, Mode=OneWay,
Source={StaticResource RightPumpSpeed}}"&gt;<br />
                       
&lt;c1gauge:C1GaugeLabel Interval="20" Foreground="Black" Format="#" FontSize="6"
FontWeight="200" Location="0.85"/&gt;<br />
                       
&lt;c1gauge:C1GaugeRange From="0" To="100"  Fill="Green" Location="0.45"/&gt;<br />
                       
&lt;c1gauge:C1GaugeRange From="100" To="160"  Fill="Orange" Location="0.45"/&gt;<br />
                       
&lt;c1gauge:C1GaugeRange From="160" To="200"  Fill="Red" Location="0.45"/&gt;<br />
                       
&lt;c1gauge:C1GaugeMark Interval="20" /&gt;<br />
                   
&lt;/c1gauge:C1RadialGauge&gt;<br />
                   
&lt;TextBlock Text="rpm" Foreground="Black" FontSize="7" HorizontalAlignment="Center"
VerticalAlignment="Bottom"  Margin="0,-30,0,30"/&gt;<br />
               
&lt;/StackPanel&gt;<br />
            &lt;/Border&gt;</b><br /><br />
            &lt;TextBlock Text="All
UI elements ..." .../&gt;<br />
          &lt;/Grid&gt;<br />
          ...<br />
    &lt;/Canvas&gt;<br />
&lt;/controls:TabItem&gt;</font><br /><br />
9. Build the project and start Pipes and Tanks Demo from your start menu. Enjoy professional-looking
controls in action.
</p>
        <img width="0" height="0" src="http://www.controlsystemworks.com/blog/aggbug.ashx?id=4e880e6a-bfd0-4e97-9914-d0d5cf246475" />
      </body>
      <title>Using third-party controls</title>
      <guid isPermaLink="false">http://www.controlsystemworks.com/blog/PermaLink,guid,4e880e6a-bfd0-4e97-9914-d0d5cf246475.aspx</guid>
      <link>http://www.controlsystemworks.com/blog/2010/03/15/UsingThirdpartyControls.aspx</link>
      <pubDate>Mon, 15 Mar 2010 17:47:19 GMT</pubDate>
      <description>&lt;p&gt;
CSWorks client framework is all about third-party UI components. As of this writing,
all major Silverlight component providers have come up with their versions of the
Gauge control. In this example, I will show how you can integrate Telerik and/or ComponentOne
gauge controls into CSWorks Pipes and Tanks Demo application. The result will look
like this:&lt;br&gt;
&lt;br&gt;
&lt;img src="content/binary/2010-03-15-ThirdPartyGauges.png"&gt;
&lt;br&gt;
&lt;br&gt;
Here are the steps to make it work.&lt;br&gt;
&lt;br&gt;
1. Download Telerik Silverlight controls (dlls only) and ComponentOne Studio Trial
Package for Silverlight.&lt;br&gt;
2. Create a folder for third-party controls - C:\Program Files\CSWorks\ThirdParty.&lt;br&gt;
3. Unpack downloaded Telerik archive and install ComponentOne package.&lt;br&gt;
4. Copy Telerik assemblies (Telerik.Windows.Controls.Gauge.dll, Telerik.Windows.Controls.dll,
Telerik.Windows.Data.dll) and ComponentOne assemblies (C1.Silverlight.dll, C1.Silverlight.Gauge.dll)
to ThirdParty folder.&lt;br&gt;
5. Open C:\Program Files\CSWorks\Demo\Src\PipesAndTanksDemo\PipesAndTanksDemo.Sample.csproj
in Visual Studio.&lt;br&gt;
6. Add all copied third party assemblies to the project reference list.&lt;br&gt;
7. Open Page.xaml and add third-party namespaces to the namespace list:&lt;br&gt;
&lt;br&gt;
&lt;font color="#0000ff" size="1"&gt;&amp;lt;UserControl x:Class="CSWorks.Client.PipesAndTanksDemo.Page"&lt;br&gt;
&amp;nbsp; ...&lt;br&gt;
&lt;b&gt;&amp;nbsp; xmlns:tcontrol="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.Gauge"&lt;br&gt;
&amp;nbsp; xmlns:tgauge="clr-namespace:Telerik.Windows.Controls.Gauges;assembly=Telerik.Windows.Controls.Gauge"&lt;br&gt;
&amp;nbsp; xmlns:c1gauge="clr-namespace:C1.Silverlight.Gauge;assembly=C1.Silverlight.Gauge"&lt;/b&gt;
&lt;br&gt;
&amp;nbsp; ...&amp;gt;&lt;/font&gt;
&lt;br&gt;
&lt;br&gt;
8. Add gauge controls to the page and bind them to LeftPumpSpeed and RightPumpSpeed
data items:&lt;br&gt;
&lt;br&gt;
&lt;font color="#0000ff" size="1"&gt;&amp;lt;controls:TabItem Header="HMI Controls View"&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Canvas&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ...&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Grid ...&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ...&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Border ...&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ...&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/Border&amp;gt;&lt;br&gt;
&lt;br&gt;
&lt;b&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;!-- Telerik
Gauge for left pump --&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Border Grid.Row="1"
Grid.Column="5" Grid.RowSpan="1" Grid.ColumnSpan="3" Background="White" BorderBrush="Black"
BorderThickness="1" CornerRadius="5" Padding="5,0,5,0" Margin="0,10,0,-10"&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&amp;lt;StackPanel Orientation="Vertical"&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&amp;lt;TextBlock Text="Telerik Gauge" Foreground="Black" FontSize="8" HorizontalAlignment="Center"/&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&amp;lt;tcontrol:RadGauge x:Name="radGauge" VerticalAlignment="Bottom" &amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&amp;lt;tgauge:RadialGauge&amp;nbsp; &amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&amp;lt;tgauge:RadialScale Min="0" Max="200" LabelRotationMode="None" FontSize="7"&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&amp;lt;tgauge:RadialScale.Label&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&amp;lt;tgauge:LabelProperties FontSize="4.5"/&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&amp;lt;/tgauge:RadialScale.Label&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&amp;lt;tgauge:RangeList&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&amp;lt;tgauge:RadialRange Min="0" Max="100" StartWidth="0.05" EndWidth="0.05" Background="Green"/&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&amp;lt;tgauge:RadialRange Min="100" Max="160" StartWidth="0.05" EndWidth="0.05" Background="Orange"/&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&amp;lt;tgauge:RadialRange Min="160" Max="200" StartWidth="0.05" EndWidth="0.05" Background="Red"
/&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&amp;lt;/tgauge:RangeList&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&amp;lt;tgauge:IndicatorList&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&amp;lt;tgauge:Needle Value="{Binding Value, Mode=OneWay, Source={StaticResource LeftPumpSpeed}}"/&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&amp;lt;/tgauge:IndicatorList&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&amp;lt;/tgauge:RadialScale&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&amp;lt;/tgauge:RadialGauge&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&amp;lt;/tcontrol:RadGauge&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&amp;lt;TextBlock Text="rpm" Foreground="White" FontSize="7" HorizontalAlignment="Center"
VerticalAlignment="Bottom"&amp;nbsp; Margin="0,-30,0,30"/&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&amp;lt;/StackPanel&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/Border&amp;gt;&lt;br&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;!-- ComponentOne
Gauge for right pump --&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Border Grid.Row="1"
Grid.Column="9" Grid.RowSpan="1" Grid.ColumnSpan="3" Background="White" BorderBrush="Black"
BorderThickness="1" CornerRadius="5" Padding="5,0,5,0" Margin="0,10,0,-10"&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&amp;lt;StackPanel Orientation="Vertical"&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&amp;lt;TextBlock Text="C1 Gauge" Foreground="Black" FontSize="8" HorizontalAlignment="Center"/&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&amp;lt;c1gauge:C1RadialGauge&amp;nbsp; Minimum="0" Maximum="200" Value="{Binding Value, Mode=OneWay,
Source={StaticResource RightPumpSpeed}}"&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&amp;lt;c1gauge:C1GaugeLabel Interval="20" Foreground="Black" Format="#" FontSize="6"
FontWeight="200" Location="0.85"/&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&amp;lt;c1gauge:C1GaugeRange From="0" To="100"&amp;nbsp; Fill="Green" Location="0.45"/&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&amp;lt;c1gauge:C1GaugeRange From="100" To="160"&amp;nbsp; Fill="Orange" Location="0.45"/&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&amp;lt;c1gauge:C1GaugeRange From="160" To="200"&amp;nbsp; Fill="Red" Location="0.45"/&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&amp;lt;c1gauge:C1GaugeMark Interval="20" /&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&amp;lt;/c1gauge:C1RadialGauge&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&amp;lt;TextBlock Text="rpm" Foreground="Black" FontSize="7" HorizontalAlignment="Center"
VerticalAlignment="Bottom"&amp;nbsp; Margin="0,-30,0,30"/&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&amp;lt;/StackPanel&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/Border&amp;gt;&lt;/b&gt;
&lt;br&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;TextBlock Text="All
UI elements ..." .../&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/Grid&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ...&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/Canvas&amp;gt;&lt;br&gt;
&amp;lt;/controls:TabItem&amp;gt;&lt;/font&gt;
&lt;br&gt;
&lt;br&gt;
9. Build the project and start Pipes and Tanks Demo from your start menu. Enjoy professional-looking
controls in action.
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.controlsystemworks.com/blog/aggbug.ashx?id=4e880e6a-bfd0-4e97-9914-d0d5cf246475" /&gt;</description>
      <comments>http://www.controlsystemworks.com/blog/CommentView,guid,4e880e6a-bfd0-4e97-9914-d0d5cf246475.aspx</comments>
      <category>demo</category>
      <category>third-party</category>
    </item>
    <item>
      <trackback:ping>http://www.controlsystemworks.com/blog/Trackback.aspx?guid=1baf1a31-3801-4fa9-98e2-ab245a5f8e48</trackback:ping>
      <pingback:server>http://www.controlsystemworks.com/blog/pingback.aspx</pingback:server>
      <pingback:target>http://www.controlsystemworks.com/blog/PermaLink,guid,1baf1a31-3801-4fa9-98e2-ab245a5f8e48.aspx</pingback:target>
      <dc:creator>Sergey Sorokin</dc:creator>
      <wfw:comment>http://www.controlsystemworks.com/blog/CommentView,guid,1baf1a31-3801-4fa9-98e2-ab245a5f8e48.aspx</wfw:comment>
      <wfw:commentRss>http://www.controlsystemworks.com/blog/SyndicationService.asmx/GetEntryCommentsRss?guid=1baf1a31-3801-4fa9-98e2-ab245a5f8e48</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
After installing CSWorks, many of you are tempted to connect it to your OPC data source.
Here is a quick step-by-step guide how you can do that in five minutes.<br /><br />
In this example, I will assume we are dealing with Matrikon OPC Simulation Server
- you can download it for free from Matrikon website. After installing Matrikon components,
you can start tweaking CSWorks Pipes and Tank Demo so it uses data from Matrikon OPC
Server.<br /><br /><b>Add new data source to LiveData Service configuration</b><br /><br />
Add a few lines to C:\Program Files\CSWorks\Framework\Server\CSWorks.Server.LiveDataService.exe.config:<br /><br /><font color="#0000ff" size="1">    &lt;opcLiveDataSources type="CSWorks.Server.DataSource.Opc.OpcLiveDataSource,
CSWorks.Server.OpcProvider"&gt;<br />
      ...<br /><b>      &lt;opcLiveDataSource name="OpcMatrikon" sampleBufferLength="16"
hostName="localhost" progId="Matrikon.OPC.Simulation.1" subscriptionUpdateRate="250"&gt;<br />
        &lt;templates&gt;<br />
          &lt;template name="matrikonBoolTag"
type="Boolean" readPath="Random.Boolean" canWrite="true"/&gt;<br />
        &lt;/templates&gt;<br />
      &lt;/opcLiveDataSource&gt;</b><br />
    &lt;/opcLiveDataSources&gt;</font><br /><br />
Restart LiveData Service so your changes take effect and the service connects to the
data source.<br /><br /><b>Add new data source to LiveData Server topology configuration</b><br /><br />
Add one line to C:\Program Files\CSWorks\Demo\Web\LiveDataWebService\web.config:<br /><br /><font color="#0000ff" size="1">  &lt;liveDataTopology&gt;<br />
    &lt;liveDataPartitions&gt;<br />
      &lt;liveDataPartition name="partition1" primaryLiveDataServer="liveDataServer_1_primary"
secondaryLiveDataServer=""&gt;<br />
        &lt;dataSources&gt;<br />
          ...<br /><b>          &lt;dataSource name="OpcMatrikon"/&gt;</b><br />
        &lt;/dataSources&gt;<br />
      &lt;/liveDataPartition&gt;<br />
    &lt;/liveDataPartitions&gt;<br />
  &lt;/liveDataTopology&gt;</font><br /><br />
Now LiveData Web Service knows where to get data for OpcMatrikon data source.<br /><br /><b>Modify demo application</b><br /><br />
Run Microsoft Visual Studio and open Pipes and Tanks Demo project at C:\Program Files\CSWorks\Demo\Src\PipesAndTanksDemo\PipesAndTanksDemo.Sample.csproj.
Let's make several additions to the Page.xaml file.<br /><br />
Add a new data item that gets data from the boolean tag configured for Matrikon OPC
Server:<br /><br /><font color="#0000ff" size="1">    &lt;UserControl.Resources&gt;<br />
        ...<br />
        <b>&lt;d:BoolDataItem x:Key="TestValve"
Id="type in new guid here" DataSource="OpcMatrikon" TemplateName="matrikonBoolTag"
Parameters=""/&gt;</b><br />
    &lt;/UserControl.Resources&gt;</font><br /><br /><br />
Add a few visual elements to the upper left corner of the screen and bind them to
the new data item:<br /><br /><font color="#0000ff" size="1">        &lt;controls:TabControl...&gt;<br />
            &lt;controls:TabItem
Header="HMI Controls View"&gt;<br />
               
&lt;Canvas&gt;<br />
                   
...<br />
                   
&lt;Grid ...&gt;<br />
                         
...<br />
                     
&lt;/Grid.ColumnDefinitions&gt;</font></p>
        <p>
          <font color="#0000ff" size="1">                        <b>&lt;pipes:RightValve
Grid.Row="0" Grid.Column="3" IsOpen="{Binding Value, Mode=OneWay, Source={StaticResource
TestValve}}" OpenColor="Black" ClosedColor="Black" IsEnabled="False" Margin="-16,0,16,0"/&gt;<br />
                       
&lt;PipesAndTanksDemo:Wireframe Grid.Row="0" Grid.Column="3" Status="{Binding Status,
Mode=OneWay, Source={StaticResource TestValve}}" Margin="-16,0,16,0"/&gt;<br />
                       
&lt;pipes:RightTWay Grid.Row="0" Grid.Column="2" IsFilled="{Binding Value, Mode=OneWay,
Source={StaticResource TestValve}}" FillColor="Coral" Margin="-16,0,16,0"/&gt;<br />
                       
&lt;PipesAndTanksDemo:Wireframe Grid.Row="0" Grid.Column="2" Status="{Binding Status,
Mode=OneWay, Source={StaticResource TestValve}}" Margin="-16,0,16,0"/&gt;</b><br />
                       
...</font>
          <br />
          <br />
Now we have a valve and a t-way joint that supply some coral-colored liquid to Tank
1. Also, we have added a couple of Wireframe elements that will tell us if something
is wrong with Matrikon boolean tag.<br /><br />
Time to tell DataManager that we have a new data item. Add a command to the Page_Loaded()
handler in Page.xaml.cs:<br /><br /><font color="#0000ff"><font size="1">        void
Page_Loaded(object sender, RoutedEventArgs e)<br />
        {<br />
          ...<br />
          <b>dataManager.DataItems.Add(Resources["TestValve"]
as DataItem);</b></font><br /></font><br />
Do not forget to update the id of the datamanager in the Page.xaml, otherwise LiveData
Service will keep using cached list of required data items and Matrikon tag value
will never be returned:<br /><font size="1"><br /></font><font color="#0000ff" size="1">        &lt;d:DataManager
x:Key="DataManager" Id="<b>type in new guid here</b>" /&gt;</font><br /><br />
We are done. Build client application and run it at http://localhost/CSWorksDemo/PipesAndTanksDemo.html
(or click Start menu and choose All Programs -&gt; CSWorks -&gt;  Client Samples
-&gt; Pipes and Tanks Demo). The left upper corner of the screen will have some new
visual elements - <a href="content/binary/2010-03-08-MatrikonValve.png">see screenshot</a>.
</p>
        <p>
          <b>Security Issues</b>
        </p>
        <p>
In the case of Matrikon Simulation OPC Server, we did not have any issues with COM/DCOM
security, because Matrikon installer lets everyone access this OPC Server. You can
verify it by running dcomcnfg.exe tool and checking out Matrikon Simulation OPC Server
configuration - it explicitly says that "Everyone" has "Launch and Activation" and
"Access" permissions for this component, <a href="content/binary/2010-03-08-MatrikonSecurity.png">see
screenshot</a>.
</p>
        <p>
This cannot be considered safe practice, but makes casual user's life a bit easier.
Not all OPC server providers write installers that allow the whole world to access
their components. In some cases, you may get notorious "Access Denied" COM/DCOM error
0x80070005 when CSWorks accesses OPC server. Stay tuned - there will be a post dedicated
to COM/DCOM security.<br /></p>
        <img width="0" height="0" src="http://www.controlsystemworks.com/blog/aggbug.ashx?id=1baf1a31-3801-4fa9-98e2-ab245a5f8e48" />
      </body>
      <title>CSWorks demo and your OPC data source</title>
      <guid isPermaLink="false">http://www.controlsystemworks.com/blog/PermaLink,guid,1baf1a31-3801-4fa9-98e2-ab245a5f8e48.aspx</guid>
      <link>http://www.controlsystemworks.com/blog/2010/03/08/CSWorksDemoAndYourOPCDataSource.aspx</link>
      <pubDate>Mon, 08 Mar 2010 19:48:03 GMT</pubDate>
      <description>&lt;p&gt;
After installing CSWorks, many of you are tempted to connect it to your OPC data source.
Here is a quick step-by-step guide how you can do that in five minutes.&lt;br&gt;
&lt;br&gt;
In this example, I will assume we are dealing with Matrikon OPC Simulation Server
- you can download it for free from Matrikon website. After installing Matrikon components,
you can start tweaking CSWorks Pipes and Tank Demo so it uses data from Matrikon OPC
Server.&lt;br&gt;
&lt;br&gt;
&lt;b&gt;Add new data source to LiveData Service configuration&lt;/b&gt;
&lt;br&gt;
&lt;br&gt;
Add a few lines to C:\Program Files\CSWorks\Framework\Server\CSWorks.Server.LiveDataService.exe.config:&lt;br&gt;
&lt;br&gt;
&lt;font color="#0000ff" size="1"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;opcLiveDataSources type="CSWorks.Server.DataSource.Opc.OpcLiveDataSource,
CSWorks.Server.OpcProvider"&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ...&lt;br&gt;
&lt;b&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;opcLiveDataSource name="OpcMatrikon" sampleBufferLength="16"
hostName="localhost" progId="Matrikon.OPC.Simulation.1" subscriptionUpdateRate="250"&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;templates&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;template name="matrikonBoolTag"
type="Boolean" readPath="Random.Boolean" canWrite="true"/&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/templates&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/opcLiveDataSource&amp;gt;&lt;/b&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/opcLiveDataSources&amp;gt;&lt;/font&gt;
&lt;br&gt;
&lt;br&gt;
Restart LiveData Service so your changes take effect and the service connects to the
data source.&lt;br&gt;
&lt;br&gt;
&lt;b&gt;Add new data source to LiveData Server topology configuration&lt;/b&gt;
&lt;br&gt;
&lt;br&gt;
Add one line to C:\Program Files\CSWorks\Demo\Web\LiveDataWebService\web.config:&lt;br&gt;
&lt;br&gt;
&lt;font color="#0000ff" size="1"&gt;&amp;nbsp; &amp;lt;liveDataTopology&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;liveDataPartitions&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;liveDataPartition name="partition1" primaryLiveDataServer="liveDataServer_1_primary"
secondaryLiveDataServer=""&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;dataSources&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ...&lt;br&gt;
&lt;b&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;dataSource name="OpcMatrikon"/&amp;gt;&lt;/b&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/dataSources&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/liveDataPartition&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/liveDataPartitions&amp;gt;&lt;br&gt;
&amp;nbsp; &amp;lt;/liveDataTopology&amp;gt;&lt;/font&gt;
&lt;br&gt;
&lt;br&gt;
Now LiveData Web Service knows where to get data for OpcMatrikon data source.&lt;br&gt;
&lt;br&gt;
&lt;b&gt;Modify demo application&lt;/b&gt;
&lt;br&gt;
&lt;br&gt;
Run Microsoft Visual Studio and open Pipes and Tanks Demo project at C:\Program Files\CSWorks\Demo\Src\PipesAndTanksDemo\PipesAndTanksDemo.Sample.csproj.
Let's make several additions to the Page.xaml file.&lt;br&gt;
&lt;br&gt;
Add a new data item that gets data from the boolean tag configured for Matrikon OPC
Server:&lt;br&gt;
&lt;br&gt;
&lt;font color="#0000ff" size="1"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;UserControl.Resources&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ...&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;b&gt;&amp;lt;d:BoolDataItem x:Key="TestValve"
Id="type in new guid here" DataSource="OpcMatrikon" TemplateName="matrikonBoolTag"
Parameters=""/&amp;gt;&lt;/b&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/UserControl.Resources&amp;gt;&lt;/font&gt;
&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
Add a few visual elements to the upper left corner of the screen and bind them to
the new data item:&lt;br&gt;
&lt;br&gt;
&lt;font color="#0000ff" size="1"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;controls:TabControl...&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;controls:TabItem
Header="HMI Controls View"&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&amp;lt;Canvas&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
...&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&amp;lt;Grid ...&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
...&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&amp;lt;/Grid.ColumnDefinitions&amp;gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font color="#0000ff" size="1"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;b&gt;&amp;lt;pipes:RightValve
Grid.Row="0" Grid.Column="3" IsOpen="{Binding Value, Mode=OneWay, Source={StaticResource
TestValve}}" OpenColor="Black" ClosedColor="Black" IsEnabled="False" Margin="-16,0,16,0"/&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&amp;lt;PipesAndTanksDemo:Wireframe Grid.Row="0" Grid.Column="3" Status="{Binding Status,
Mode=OneWay, Source={StaticResource TestValve}}" Margin="-16,0,16,0"/&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&amp;lt;pipes:RightTWay Grid.Row="0" Grid.Column="2" IsFilled="{Binding Value, Mode=OneWay,
Source={StaticResource TestValve}}" FillColor="Coral" Margin="-16,0,16,0"/&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&amp;lt;PipesAndTanksDemo:Wireframe Grid.Row="0" Grid.Column="2" Status="{Binding Status,
Mode=OneWay, Source={StaticResource TestValve}}" Margin="-16,0,16,0"/&amp;gt;&lt;/b&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
...&lt;/font&gt;
&lt;br&gt;
&lt;br&gt;
Now we have a valve and a t-way joint that supply some coral-colored liquid to Tank
1. Also, we have added a couple of Wireframe elements that will tell us if something
is wrong with Matrikon boolean tag.&lt;br&gt;
&lt;br&gt;
Time to tell DataManager that we have a new data item. Add a command to the Page_Loaded()
handler in Page.xaml.cs:&lt;br&gt;
&lt;br&gt;
&lt;font color="#0000ff"&gt;&lt;font size="1"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; void
Page_Loaded(object sender, RoutedEventArgs e)&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ...&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;b&gt;dataManager.DataItems.Add(Resources["TestValve"]
as DataItem);&lt;/b&gt;&lt;/font&gt;
&lt;br&gt;
&lt;/font&gt;
&lt;br&gt;
Do not forget to update the id of the datamanager in the Page.xaml, otherwise LiveData
Service will keep using cached list of required data items and Matrikon tag value
will never be returned:&lt;br&gt;
&lt;font size="1"&gt;
&lt;br&gt;
&lt;/font&gt;&lt;font color="#0000ff" size="1"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;d:DataManager
x:Key="DataManager" Id="&lt;b&gt;type in new guid here&lt;/b&gt;" /&amp;gt;&lt;/font&gt;
&lt;br&gt;
&lt;br&gt;
We are done. Build client application and run it at http://localhost/CSWorksDemo/PipesAndTanksDemo.html
(or click Start menu and choose All Programs -&amp;gt; CSWorks -&amp;gt;&amp;nbsp; Client Samples
-&amp;gt; Pipes and Tanks Demo). The left upper corner of the screen will have some new
visual elements - &lt;a href="content/binary/2010-03-08-MatrikonValve.png"&gt;see screenshot&lt;/a&gt;.
&lt;/p&gt;
&lt;p&gt;
&lt;b&gt;Security Issues&lt;/b&gt;
&lt;/p&gt;
&lt;p&gt;
In the case of Matrikon Simulation OPC Server, we did not have any issues with COM/DCOM
security, because Matrikon installer lets everyone access this OPC Server. You can
verify it by running dcomcnfg.exe tool and checking out Matrikon Simulation OPC Server
configuration - it explicitly says that "Everyone" has "Launch and Activation" and
"Access" permissions for this component, &lt;a href="content/binary/2010-03-08-MatrikonSecurity.png"&gt;see
screenshot&lt;/a&gt;.
&lt;/p&gt;
&lt;p&gt;
This cannot be considered safe practice, but makes casual user's life a bit easier.
Not all OPC server providers write installers that allow the whole world to access
their components. In some cases, you may get notorious "Access Denied" COM/DCOM error
0x80070005 when CSWorks accesses OPC server. Stay tuned - there will be a post dedicated
to COM/DCOM security.&lt;br&gt;
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.controlsystemworks.com/blog/aggbug.ashx?id=1baf1a31-3801-4fa9-98e2-ab245a5f8e48" /&gt;</description>
      <comments>http://www.controlsystemworks.com/blog/CommentView,guid,1baf1a31-3801-4fa9-98e2-ab245a5f8e48.aspx</comments>
      <category>demo</category>
      <category>opc</category>
    </item>
    <item>
      <trackback:ping>http://www.controlsystemworks.com/blog/Trackback.aspx?guid=09a1c584-4532-4bea-8904-36a127bf2829</trackback:ping>
      <pingback:server>http://www.controlsystemworks.com/blog/pingback.aspx</pingback:server>
      <pingback:target>http://www.controlsystemworks.com/blog/PermaLink,guid,09a1c584-4532-4bea-8904-36a127bf2829.aspx</pingback:target>
      <dc:creator>Sergey Sorokin</dc:creator>
      <wfw:comment>http://www.controlsystemworks.com/blog/CommentView,guid,09a1c584-4532-4bea-8904-36a127bf2829.aspx</wfw:comment>
      <wfw:commentRss>http://www.controlsystemworks.com/blog/SyndicationService.asmx/GetEntryCommentsRss?guid=09a1c584-4532-4bea-8904-36a127bf2829</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
When someone runs CSWorks Pipes and Tanks Demo application for the first time, the
first question is: where all this data for pipes, tanks and valves comes from?<br /><br />
CSWorks installation package includes LiveData Emulator OPC Server component that
simulates mixing process and accepts input from the user when he/she opens and closes
the valves and changes mixing speed. LiveData Emulator OPC Server is useless for real-world
applications but works well as a simple data source for the demo.<br /><br />
In order to make sure that CSWorks displays actual data supplied by this OPC data
source, you may want to set up a quick demonstration and see how numbers are changing
simultaneously in the demo and in your favourite OPC viewer application.<br /><br />
First off, if you just run OPC viewer on the demo machine and connect it to CSWorks
LiveData Emulator OPC Server you will see some tags changing, but those changes won't
be in sync with the demo values. This happens because of the way COM/DCOM (and OPC)
works.<br /><br />
Unless you configured it otherwise, CSWorks LiveData Service runs under Network Service
user account - a special Windows account many system services run under. When CSWorks
LiveData Service is being told to access an OPC server (Emulator OPC Server in our
case), it instantiates it through COM/DCOM infrastructure. By default, a COM server
is started as a separate process on behalf of the launching user - Network Service.
If you have a look at the process list while CSWorks demo is running you will see
LiveData Emulator process running under Network Service account.<br /><br />
Now you run an OPC viewer application and connect it to CSWorks LiveData Emulator
OPC Server. Have a quick look at the process list again - you will see that now you
have another instance of LiveData Emulator process running under your personal account.
So you have two emulators supplying different data to CSWorks and to the OPC viewer.<br /><br />
Let's make both CSWorks and OPC viewer use the same instance of the emulator. Please
use Windows Service Manager to configure CSWorks LiveData Service so it runs under
you personal account (say, Administrator). Also use DCOM configuration tool (dcomcnfg.exe)
to make sure that LiveData OPC Emulator:<br /><br /></p>
        <ul>
          <li>
can be launched (Properties - Security - Launch and Activation Permissions) and accessed
(Properties - Security - Access Permissions) by your personal account;</li>
          <li>
is instantiated runs under interactive user account (Properties - Identity).</li>
        </ul>
        <p>
          <br />
          <a href="content/binary/2010-03-05-InteractiveUser.gif">This screenshot</a> shows
what has to be done.<br /><br />
After doing that, restart CSWorks LiveData Service and your OPC viewer, so they start
using properly configured LiveData OPC Emulator server. <a href="content/binary/2010-03-05-Tank1.gif">The
screenshot</a> shows three application windows: two Internet Explorer instances with
CSWorks demo application, and a third-party OPC viewer that is configured to receive
updates for "storage.numeric.reg01" tag. This is the item that CSWorks demo application
uses to store Tank 1 fill level. 
<br /><br />
As CSWorks LiveData Emulator changes Tank 1 fill level, you see it changing in all
three windows simultaneously. Perfect, we get the same data in all three windows.<br /><br />
After demonstrating CSWorks live data in action, do not forget to revert all changes
made in DCOM configuration and service manager.
</p>
        <img width="0" height="0" src="http://www.controlsystemworks.com/blog/aggbug.ashx?id=09a1c584-4532-4bea-8904-36a127bf2829" />
      </body>
      <title>CSWorks Demo and LiveData Emulator OPC Server</title>
      <guid isPermaLink="false">http://www.controlsystemworks.com/blog/PermaLink,guid,09a1c584-4532-4bea-8904-36a127bf2829.aspx</guid>
      <link>http://www.controlsystemworks.com/blog/2010/03/05/CSWorksDemoAndLiveDataEmulatorOPCServer.aspx</link>
      <pubDate>Fri, 05 Mar 2010 22:07:31 GMT</pubDate>
      <description>&lt;p&gt;
When someone runs CSWorks Pipes and Tanks Demo application for the first time, the
first question is: where all this data for pipes, tanks and valves comes from?&lt;br&gt;
&lt;br&gt;
CSWorks installation package includes LiveData Emulator OPC Server component that
simulates mixing process and accepts input from the user when he/she opens and closes
the valves and changes mixing speed. LiveData Emulator OPC Server is useless for real-world
applications but works well as a simple data source for the demo.&lt;br&gt;
&lt;br&gt;
In order to make sure that CSWorks displays actual data supplied by this OPC data
source, you may want to set up a quick demonstration and see how numbers are changing
simultaneously in the demo and in your favourite OPC viewer application.&lt;br&gt;
&lt;br&gt;
First off, if you just run OPC viewer on the demo machine and connect it to CSWorks
LiveData Emulator OPC Server you will see some tags changing, but those changes won't
be in sync with the demo values. This happens because of the way COM/DCOM (and OPC)
works.&lt;br&gt;
&lt;br&gt;
Unless you configured it otherwise, CSWorks LiveData Service runs under Network Service
user account - a special Windows account many system services run under. When CSWorks
LiveData Service is being told to access an OPC server (Emulator OPC Server in our
case), it instantiates it through COM/DCOM infrastructure. By default, a COM server
is started as a separate process on behalf of the launching user - Network Service.
If you have a look at the process list while CSWorks demo is running you will see
LiveData Emulator process running under Network Service account.&lt;br&gt;
&lt;br&gt;
Now you run an OPC viewer application and connect it to CSWorks LiveData Emulator
OPC Server. Have a quick look at the process list again - you will see that now you
have another instance of LiveData Emulator process running under your personal account.
So you have two emulators supplying different data to CSWorks and to the OPC viewer.&lt;br&gt;
&lt;br&gt;
Let's make both CSWorks and OPC viewer use the same instance of the emulator. Please
use Windows Service Manager to configure CSWorks LiveData Service so it runs under
you personal account (say, Administrator). Also use DCOM configuration tool (dcomcnfg.exe)
to make sure that LiveData OPC Emulator:&lt;br&gt;
&lt;br&gt;
&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
can be launched (Properties - Security - Launch and Activation Permissions) and accessed
(Properties - Security - Access Permissions) by your personal account;&lt;/li&gt;
&lt;li&gt;
is instantiated runs under interactive user account (Properties - Identity).&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;
&lt;br&gt;
&lt;a href="content/binary/2010-03-05-InteractiveUser.gif"&gt;This screenshot&lt;/a&gt; shows
what has to be done.&lt;br&gt;
&lt;br&gt;
After doing that, restart CSWorks LiveData Service and your OPC viewer, so they start
using properly configured LiveData OPC Emulator server. &lt;a href="content/binary/2010-03-05-Tank1.gif"&gt;The
screenshot&lt;/a&gt; shows three application windows: two Internet Explorer instances with
CSWorks demo application, and a third-party OPC viewer that is configured to receive
updates for "storage.numeric.reg01" tag. This is the item that CSWorks demo application
uses to store Tank 1 fill level. 
&lt;br&gt;
&lt;br&gt;
As CSWorks LiveData Emulator changes Tank 1 fill level, you see it changing in all
three windows simultaneously. Perfect, we get the same data in all three windows.&lt;br&gt;
&lt;br&gt;
After demonstrating CSWorks live data in action, do not forget to revert all changes
made in DCOM configuration and service manager.
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.controlsystemworks.com/blog/aggbug.ashx?id=09a1c584-4532-4bea-8904-36a127bf2829" /&gt;</description>
      <comments>http://www.controlsystemworks.com/blog/CommentView,guid,09a1c584-4532-4bea-8904-36a127bf2829.aspx</comments>
      <category>demo</category>
      <category>opc</category>
    </item>
    <item>
      <trackback:ping>http://www.controlsystemworks.com/blog/Trackback.aspx?guid=2baf405e-0bda-4684-b1d2-ff2fa01e1a44</trackback:ping>
      <pingback:server>http://www.controlsystemworks.com/blog/pingback.aspx</pingback:server>
      <pingback:target>http://www.controlsystemworks.com/blog/PermaLink,guid,2baf405e-0bda-4684-b1d2-ff2fa01e1a44.aspx</pingback:target>
      <dc:creator>Sergey Sorokin</dc:creator>
      <wfw:comment>http://www.controlsystemworks.com/blog/CommentView,guid,2baf405e-0bda-4684-b1d2-ff2fa01e1a44.aspx</wfw:comment>
      <wfw:commentRss>http://www.controlsystemworks.com/blog/SyndicationService.asmx/GetEntryCommentsRss?guid=2baf405e-0bda-4684-b1d2-ff2fa01e1a44</wfw:commentRss>
      <title>Running CSWorks demo applications from remote clients</title>
      <guid isPermaLink="false">http://www.controlsystemworks.com/blog/PermaLink,guid,2baf405e-0bda-4684-b1d2-ff2fa01e1a44.aspx</guid>
      <link>http://www.controlsystemworks.com/blog/2010/02/25/RunningCSWorksDemoApplicationsFromRemoteClients.aspx</link>
      <pubDate>Thu, 25 Feb 2010 00:24:27 GMT</pubDate>
      <description>&lt;p&gt;
One of the first things I would do after installing CSWorks is to open a browser on
another machine in the network and type in "http://MyTestBox/CSWorksDemo/PipesAndTanksDemo.html",
where MyTestBox is the name of the machine where I installed CSWorks.&lt;br&gt;
&lt;br&gt;
This doesn't work. And it's not supposed to work because of the cross-domain web service
call restrictions imposed by your browser. If you have a look at ServiceReferences.ClientConfig
file in the Pipes and Tanks Demo xap package (CSWorks.Client.PipesAndTanksDemo.xap
in your CSWorksDemo/ClientBin folder; don't worry it's just a ZIP file with XAP extension),
you will find endpoint description for LiveData web service calls that looks as follows:&lt;br&gt;
&lt;br&gt;
&lt;endpoint address="http://localhost/CSWorksDemo/LiveDataWebService/Service.asmx" ... /&gt;
&lt;br&gt;
&lt;br&gt;
In our case, when Silverlight is trying to make a web service call to http://localhost/CSWorksDemo/LiveDataWebService/Service.asmx,
the browser checks the URL of the application which happens to start with "http://MyTestBox".
Since it doesn't start with "http://localhost", the browser considers this a potential
security threat and blocks the call.&lt;br&gt;
&lt;br&gt;
To make things work, just replace "localhost" in the config file with the name (or
IP address) of your CSWorks server:&lt;br&gt;
&lt;br&gt;
&lt;endpoint address="http://MyTestBox/CSWorksDemo/LiveDataWebService/Service.asmx" ... /&gt;
&lt;br&gt;
&lt;br&gt;
and save updated config to the xap file. Now refresh the page in the browser on the
remote machine - Pipes and Tanks Demo should work fine.
&lt;/p&gt;
&lt;p&gt;
&lt;strong&gt;Update (June 25, 2010):&lt;/strong&gt;
&lt;/p&gt;
&lt;p&gt;
with Silverlight 4, you can use relative web service addresses, see &lt;a href="http://www.controlsystemworks.com/blog/2010/06/25/Silverlight4RelativeWebServiceAddressSupport.aspx"&gt;this
post&lt;/a&gt; for details.
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.controlsystemworks.com/blog/aggbug.ashx?id=2baf405e-0bda-4684-b1d2-ff2fa01e1a44" /&gt;</description>
      <comments>http://www.controlsystemworks.com/blog/CommentView,guid,2baf405e-0bda-4684-b1d2-ff2fa01e1a44.aspx</comments>
      <category>demo</category>
      <category>security</category>
    </item>
  </channel>
</rss>