2008/04/27

GE iFix - Scheduled Task - Architectural Patterns

Summary

iFix is a SCADA software used in industrial application to write the supervisory applications and sometimes simple process control(http://www.gefanuc.com/as_en/products_solutions/hmi_scada/products/proficy_ifix.html)

In these kind of application, sometimes (...very often) you need to write code for delivering background processing, event-management, implementing watch-dog, storing report informations and so on..

Scenario

There are different features in iFix which could be leveraged but all of them are based on the "concept" of schedule.

An schedule is like an event for form-based applications and could be on timely bases, or triggered by a real world event (ie an alarm, a tag treeshold passed, etc.)

An schedule is implemented through VBA script (in iFIx v4.0)

The schedule could be hosted by different iFix modules (I'm considering a complex iFix deploy with Terminal Server)

  • iFix Workspace (on users sessions)
  • iFix Workspace (on a dedicated protected session)
  • iFix Background Server

iFix Background Server is a dedicated host tailored for background processing because it's like and iFix Workspace lacking of all user interface features so that the process footprint is very light.

We could think to an iFix Workspace like a Windows Form application, and iFix Background Server like a Windows Service.

The development of background processing in iFix is very hard and challenging due to iFix architecture.

Both iFix Workspace and iFix Background Server use Microsoft VBA as a script languages platform development and execution.

VBA is very easy to use so that people which hasn't good programming skill could write iFix application but that's also a BIG drawback when server code has to be delivered!

VBA has been created to delivery macro functionalities to Word/Excel not to write server application and the engine is for single threaded.

This mean that each event has to be singly processed by the hosting iFix process, so possibily issues could arise:

  • Memory Leaks due to COM object (each object must be explicity deallocated with Set x = Nothing)
  • DB Connection management
  • Performance on each I/O operation (ie DB). If a query needs 2 sec to be completed, no more scripts could be processed
  • Exception Management

To avoid this problem you need to decouple the iFix hosting process from the event management scripts.

Architectural Pattern

The interaction betwen the VBA scripts and iFix is done through COM objects which exposes iFix functionalities. So you could create and external application in .Net and through interop leverage the iFix COM objects.

The requirement is that the external application is deployed in the same machines where iFix is running

COM+

  • Creates a .Net library component and register it in COM+
  • Implements a method for each event management script using iFix COM objects (ie EDA)
  • When the script is raised from an iFix host (Workspace or Background Server), from the VBA code invoke the .Net method.
  • The .Net method should be asynchrounous and must use the .Net threading pool to complete the event management. In this way the method completed immediately, enabling the the iFix host to continuee the event management.

External Agent

  • Creates a .Net Win32 service which will be executed on the same machine of iFix
  • Creates a library component proxy to send message to the Win32 agent
    • This component could be a .Net component which send data using different kind of queue (msmq, sql server 2005 broker, etc...)
    • A VBA custom function to send message to .Net component in an easier way (SQL Server tables, files, etc..)
  • When the script is raised from an iFix host (Workspace or Background Server), from the VBA a message will be sent to the agent which will be asynchrously processed
  • In this solution, comparing it to the COM+ approach, it's not possibile to send COM object as parameters to the external hosts! So the COM+ approach it's the better one.

2008/04/26

One of the worst errors a project manager could do...

I've always thinked that a good manager is someone which doesn't appear to be a manager...

  • He should drive the team but the team must not understand that it's driven by him
  • He should trust and encourage the member of the team delegating charges and duties more as possible 
  • He should get the top performance more as possibile from his team members (...and he isn't supposed to directly do the job, well I guess that's not a priority, the focus should be on team members)

There is a bright phrase to describe the manager charges (ehm..the bright phrase is still mine...):

You cannot taste the wind, you cannot see it and maybe you cannot hear it but wind is there and it silently boost boats. A good manager is like the wind, he boost the team from behind the scenes.

Probably that's all true but there is a huge error that a manager, a project manager, *MUST* avoid!

One thing is trust and delegation style, one thing is an agnostic tasks assignment style.

From my perspective, an agnostic tasks assigment style is when the manager works just as a task dispatcher, considering efforts, critical paths, etc. but simply assuming that there is a task and that someone will consume that tasks. The manager isn't worried from "how" but just from "when".

In this way the manager work as an "accountant", assigning, checking but not governing the processes!

In the trust and delegations style the manager still dispatches tasks and assignment, still consider effort, critical paths and so on and still check the tasks are being done...

Where is the difference? It's in the style, I think that an in agnostic task assignment a manager is..., what I could say, well he's lazy. The style is assign and forget (well that's also a design pattern in software architectures, fire and forget but it's other stuff).

In trust and delegation style the manager *must* be part of the processes critically checking, reviewing and supporting team members decisions

He should empower the team, explaining and suggesting on the basis of his knowledge and thats totally different from imposing decisions.

So what's the error to avoid, "one of the worst errors a project manager could do"?

Obviously it's the agnostic task assignment style (and too much often I do this error). Trust and delegation is very challenging and hard because it's also needed a deeply knowledge of the approached scenarios and sometimes you've to admit you errors if you've convinced team members to change their decisions (yes, I've just said to you) , but IT'S ALWAYS THE WINNING ONE!

2008/04/24

Tools: http://www.datadefractor.com

Seems to be a nice tool to import ed export BI data (OLAP cubes) leveraging Excel.

Thanks again to Mimmo!

It might be used to create small and independent datamart to be distributed to users on a periodically basis (for example a report with kpi about sales performances).

2008/04/22

OPC Server Platforms

I've just finished a technical proposal for a big migration project of a Level 2 and Supervision platform from UX System V to Windows Server 2008/.Net

Level 1 to Level 2 process control will be connected through our proxy (which guarantees high performances). The supervision system will be connected to Level 2 through OPC.

I'm evaluating 2 OPC servers:

From a technical perspective, the architecture are differents but the features are quite the same.

From a sales perspective, the proposal is easier to build using kepware offering (too many options in matrikon price-list) :-)

2008/04/19

Some speeches

The next month I will have some speeches:

  • AIST 2008 @ Pittsuburgh (http://www.aist.org/aistech/)
    • Monday 05th May
      • Data Warehouse and Mining Tools for Steel Production Control
      • Plant Vehicles Tracking With GPS/DGPS/GPRS Technologies
    • Tuesday 06th May
      • BAM Applications and Steel Production — Getting Business Value From Tracking Information
  • The Developers Group Meeting @ Microsoft Victoria, London (http://www.ukbug.co.uk/)
    • Wednesday 15th May
      • Introduction to SharePoint Services and MOSS

Incremental User Interface

Some interesting considerations:

http://www.codinghorror.com/blog/archives/000887.html

I think we're closer to new improvements to user experiences (like integration of Speech Server and voice recognition). Incremental Search is an enabling technologies to improve productivity in user interaction.

(Thanks Mimmo for having posted me the link)

Vista SP1 - Training

Good idea for users training to new product features...

http://www.istartedsomething.com/20080416/internal-vista-sp1-promo-rockin-our-sales/

How could I say... It's mnemonic.