# Wednesday, May 26, 2010

A few CSWorks educational videos are available on YouTube. Watch them in high-definition mode (1280x720):

CSWorks - creating your first application

CSWorks - using third-party OPC servers

Sergey Sorokin   Wednesday, May 26, 2010 4:07:28 PM (Pacific Daylight Time, UTC-07:00)  #     |  Comments [0]  | 
# Tuesday, May 25, 2010
What's new:
  • Server requires .NET 4.0
  • Client requires Silverlight 4
  • Client development: integration with Visual Studio 2010
  • Trend Control: specify date range explicitly
  • Delayed alarms to avoid noise

Sergey Sorokin   Tuesday, May 25, 2010 2:11:01 PM (Pacific Daylight Time, UTC-07:00)  #     |  Comments [0]  | 
# Wednesday, May 19, 2010

If you are curious about the number of Trend controls you can run against your CSWorks server infrastructure, you may find this post interesting. We will make minor changes to historical data server configuration, run a few Trend control clients against it and analyze what we see.

Environment

CSWorks 1.2.3800.0
Server: Intel Core 2 Duo @ 2.40GHz, 2 GB RAM, Windows Server 2008
Client: Intel Core 2 Duo T5300 @ 1.73GHz (notebook), 2 GB RAM, Windows XP SP3
Network: Wireless 54 Mbps

Server Configuration

1. As usual, we have to configure History Recorder so it uses some scalable database. Install SQL Server 2008 Express on your server machine.

2. Create database "CSWorks"

3. Create HistoricalData table - see "createCommand" parameter of <dbtarget ...="" name="Standard SQLServer DbTarget"> in CSWorks.Server.HistoryRecorderService.exe.config.

4. Configure SQL Server data source and make it active in CSWorks.Server.HistoryRecorderService.exe.config:

<dbTargetConfig>
  <dbTargets activeDbTarget="Standard SQLServer DbTarget">
    <dbTarget name="Standard SQLite DbTarget" ...
      ...
    />
    <dbTarget name="Standard SQLServer DbTarget"
      providerInvariantName="System.Data.SqlClient"
      connectionString="Data Source=localhost\sqlexpress; Initial Catalog=CSWorks;user id=sa;password=...;"
      ...
    />
  </dbTargets>
</dbTargetConfig>


5. Configure HistoryReaderWebService to read historical data from this database. In the web.config, assign SQLServer target to the primary partition and specify correct connection string:

  <historyTopology>
    <historyPartitions>
      <historyPartition name="partition1" primaryDbTarget="partition1 Primary DbTarget (SQLServer)" secondaryDbTarget="">
        ..
      </historyPartition>
    </historyPartitions>
  </historyTopology>

  <dbTargetConfig>
    <dbTargets>
      ...
      <dbTarget name="partition1 Primary DbTarget (SQLServer)"
                providerInvariantName="System.Data.SqlClient"
                connectionString="Data Source=localhost\sqlexpress; Initial Catalog=CSWorks;user id=sa;password=...;"
                ...
                />
    </dbTargets>
  </dbTargetConfig>

6. Restart HistoryRecorder service and verify that it writes observation to the newly configured database.

Running clients

Before running the clients, make sure you have prepared *.clientConfig in CSWorks.Client.TrendDemo.xap to run from a remote machine. Please see this post for details.

Now run a few Trend clients on your client machine using this command:

start iexplore "http://myserver/CSWorksDemo/TrendDemo.html"

I ran 25 instances, increasing the load by 5-instance chunks.

Results

All 25 clients run without problems, trending data (both live and historical) arrives without delays, server seems to be perfoming fine. Here is a screenshot made on the server machine. Clients consume about 200K of live and historical data every second, server machine uses about 35% of its CPU capacity. SQL Server and ASP.NET worker process are working hard (14% and 18%, respectively) to deliver historical data to the clients.

The spikes in data transfer rates mark moments when Trend control were re-querying bigger amounts of historical data - View->Tracking setting were set to On for all Trend control instances, and all instances were refreshing the whole picture synchronously (well, in chunks of 5 instances, of course).

The spikes in CPU consumption mark moments when I ran chunks of 5 IE instances.

Summary

Not bad for a commodity server box that runs every piece of the deployment: all CSWorks services (LiveData, Alarm, HistoryRecorder), web services and database engine. Potential bottlenecks are:
- the database - not surprising;
- web service layer - but we can scale it out using web farm.

Sergey Sorokin   Wednesday, May 19, 2010 2:18:06 PM (Pacific Daylight Time, UTC-07:00)  #     |  Comments [0]  | 
# Thursday, May 06, 2010
What's new:
  • History Reader web service: historical data point areas
  • Alarm web service: alarm areas
  • Trend Control: color picker
  • Trend Control: load/save pen configuration
  • Trend Control: line/bar/HLC pens, cursor and tooltips
  • Alarm Summary: edit/load/save subscription configuration
  • Alarm Summary: ack/shelve buttons and hot keys
  • Alarm Summary: sort on-the-fly setting
  • LiveData items and live pens: ScaleFactor attribute
  • Pipes And Tanks Demo: customizable trend control
  • Alarm Demo: passing alarm events to subscribers

Sergey Sorokin   Thursday, May 06, 2010 2:54:50 PM (Pacific Daylight Time, UTC-07:00)  #     |  Comments [0]  |