Archive for the ‘Information’ Category

How to create an event driven report with zenon Analyzer using a VSTA macro in the zenon runtime and send it optionally as an email attachment with message control

Wednesday, May 22nd, 2013

zenon Analyzer not only offers manual report generation, it enables the creation of reports based on schedules and can generate them event-driven. The event-driven report generation is able to create reports based on external events, such as the end of a lot production. In this case, the zenon Runtime works hand-in-hand with the zenon Analyzer.

General description:

zenon AnalyzerThis functionality needs to be implemented in zenon using a VSTA macro. The triggering event starts this macro which sets the parameters like report template name, rendering format (e.g. pdf, jpg, html, …), time filters, event classes, … to the zenon Analyzer, using the Reporting Services Web service interface. The zenon Analyzer processes the report and returns the rendered report to the VSTA macro of the runtime for further processing. The VSTA macro can store the report in a file share or send it by message control as an email attachment.

Detailed description:

1. Information collection:

First the required parameters, which are needed to call up the VSTA macro, are determined. Two different types of parameters exist. Those which are necessary for the report itself and those which give additional information and control the report generation.

Report parameter:
In order to be sure about the report parameters, we suggest to open the report in the Microsoft SQL Server Report Builder 3.0 and check them in the parameters section.

Other parameters;
Are rendering methods and project name.

2. VSTA programming:

Creating a Web service reference:
To create the required reference you can use the VSTA-Editor or the wsdl.exe (Web Services Description Language), provided by several Microsoft SDKs (.NET SDK, Windows SDK, Visual Studio, …)

C#-code:
It is important that the macro is running in its own thread, otherwise the runtime will be blocked and a deadlock is created!

In the C#-code the following parameters are passed to the zenon Analyzer:

    • rendering method
    • project
    • report execution parameters (e.g. time filters, …)

Now the VSTA macro waits for the report to be processed from the zenon Analyzer and be returned to the runtime. The macro now can save the report under any name on the hard drive or send it as an email extension with message control.

3. Finally the C#-code needs to be saved as a ProjectAddin.

 

Possible usages:

  • manual activation with a button in the runtime
  • automatic activation for violated limits
  • automatic activation using scheduler or Production & Facility Scheduler
  • automatic activation using a time control function

 

Although the C#-code has a limited length, it would exceed the scope of this blog.
For implementation comprehensive documentation, including code samples, is available.

 

zenon Batch Control – let’s go!

Monday, May 6th, 2013

Batch_Control_ScreenWelcome to the first blog entry on zenon’s ‘Batch Control’ module. Let us get the feeling of the next generation of automation, and see how batch control fits in zenon, and where zenon fits in batch control.

Flexible process control

One principal entity of the ISA 88 compliant batch control is that the process engineering and the equipment automation is kept separate. Having equipment control blocks (called phases) which can be flexibly placed, moved and modified in the process flow; opens up the equipment to a multitude of process combinations and thereby enables a wide selection of product possibilities.

The equipment control links the hardware together and controls this collection of hardware to obtain a certain state. For example, in a reactor there are temperature, pressure, and agitation control loops. The PLC knows which hardware is used and how to control the equipment to obtain a certain temperature, pressure or agitation speed.

The Batch Control module then uses ‘Recipes’ to describe the production control, and choose where in relation with other equipment in the process, these control loops are used. Each phase includes parameters which defines how the equipment will control this loop, and when the phase has completed with the ‘Phase done condition’

The Batch Control module is fully integrated into the zenon Supervisor SCADA software; here the full complement of functionality, flexibility and possibilities are available. More importantly it makes use of the extensive communication possibilities, where any equipment hardware can be connected and tightly controlled – whether standalone or distributed solutions are needed, from ERP to sensor.

Conclusion -
Continuous improvement in compliance with ISA 88

The Batch Control module and zenon’s mature functionality bring process automation to life, adding the dimension of flexibility and continuous improvement to distributed or standalone solutions.

My next entry will be about communication and connectivity in zenon’s Batch Control module.

 

zenon 7.10 and native Windows 8 Multi-Touch features – Part 3

Wednesday, April 24th, 2013

zenon_general_Alarmlist-w-HandLast time we went through the native Multi-Touch capabilities in zenon 7.10 for

cialis prix

dynamic elements and the screens. This time we will focus on the new Multi-Touch features in the Alarm Message List, Chronological Event List, Extended Trend Module and the new touch-optimized time filter controls.

Alarm Message List / Chronological Event List

One main goal was to make our most important lists – the Alarm Message List and the Chronological Event List – Multi-Touch capable. You now can navigate and interact in the list directly with your fingers, making extra buttons for navigation etc. unnecessary.

The Reactions for Manipulation (allowing scrolling horizontally and/or vertically) are configurable as well as the reactions for “tap” and “double tap”:

  • no reaction
  • selection (tap only)
  • execute zenon function
  • acknowledge alarm (double tap only)
  • execute alarm function (double tap only)
  • open help for alarm (double tap only)
  • start/stop list

    (double tap only)

For the Chronological Event List the same possibilities are available for navigating the list and for “tapping”, just as in the Alarm Message List.

Extended Trend Module

The Extended Trend Module now offers the possibility to natively zoom and scroll and set the reactions for “double tap” and “tap and hold”:

  • no reaction
  • execute zenon function
  • zoom to 100% (double tap only; also available as button now)
  • step back (double tap only)

Time Filter

Another goal was to make our time filters more touch-friendly. New controls are now available for the Time Filter, Alarm Message List Filter and Chronological Event List Filter screens, which are highly configurable in terms of Multi-Touch as well as graphically, e.g. with line height.

My next entry will include the options for customized zenon Multi-Touch implementations in VSTA.

 

Visual Basic for Applications version 7.1, 32Bit and 64 Bit

Wednesday, June 27th, 2012

Introduction

The next version of zenon will be available in 32 and 64 bit. Therefore the included Visual Basic for Applications package will be upgraded from the 6.5 (32Bit) to 7.1 (32 and 64Bit). When using the 32Bit version of zenon none of the existing code needs to be modified, workspace and runtime projects can stay the way they are. But to take full advantage of the available memory and hardware the 64

canadian viagra

Bit version is obviously the better choice.

Changes

When using the 64 Bit version of zenon, VBA 7.1 will also run in 64 Bit mode. To differentiate between the 32 and 64 Bit version quite a few keywords, defines and declarations have been introduced to VBA.

Any existing API declarations have to be modified in order to be used in 64 Bit mode. For example the API-function “FindWindow” (which can be used to find a window by use of its class name and window name) used to be defined like this in a 32Bit VBA project:

Private DeclareFunction FindWindow Lib "USER32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long

Whereas the 64 Bit version of this declaration needs to be:

Private Declare PtrSafe Function FindWindow Lib "USER32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As LongPtr

NOTE: The 64 Bit declaration will work for the 32 Bit version mode of VBA 7.1 as well.
Since Microsoft currently does not include a 64Bit version of the “Microsoft Common Controls”, objects from this package cannot be used in the 64 Bit mode. This  package includes the CommonDialog-Controls often used for “File-Open” and “Color-Picking”-Dialogs.

Additions and mixing

Microsoft introduced two new conditional compilation constants: “VBA7” and “Win64”. The VBA7 constant can be used to determine whether the project is running under VBA7 or on an older version. This constant is useful for backwards compatibility, and prevents the requirement for separate

generic viagra online

“pre-7” and “7”-versions of custom created classes.

#If VBA7 Then
    'Use VBA7 functionality
#Else
    'Stick to old VBA solution
#End If

The Win64 constant enables a separation between the 32 and 64 bit version of VBA and can be used to ensure that code is only executed when VBA runs in the correct mode.

How to adapt a VSTA-Form to appear as a VSTA-Wizard in the Wizard dialog (VB.Net)

Wednesday, May 16th, 2012

Introduction Although most .Net solution are developed using c#, in some cases porting existing old code (from vba) to VB.Net might be more efficient than starting from scratch in c#. This blog entry explains which methods and functions are to be implemented in order to have a VB.Net Wizard displayed in the zenon Wizard dialog which pops up when creating a new project. Similar, yet different in small details compared to the c# scenario. Integrating VSTA-Code into the wizard dialog In order for VSTA-C ode to be available in the wizard dialog the automation code needs to be contained (implemented) into a Windows-Form. Additionally the Form-Class needs to

popular pills online

implement the following set of static functions (all without parameters): Public Shared Function GetWizardName() As String Return the name of the wizard, displayed as “Name of the wizard” in the wizard dialog. Public Shared Function GetWizardInfo()

purchase viagra

As String Return a description of the wizard, shown as “A more detailed description of the wizard.” in the wizard dialog. Public Shared Function GetWizardCategory() As String Returns the category of the wizard and is displayed as “Wizard category” in the wizard dialog. Note: An existing category can be used here. And a VSTA and a VBA wizard can reside in the same category. Public Shared Function IsZenOnWizard() As Boolean This function determines whether the wizard should appear in the dialog. It offers the possibility to stop a wizard from appearing without having to delete all functions or removing it from the Addin. Public Shared Function GetWizardVersion() As Integer This function returns the version number of the wizard, indicated next to the wizard information. Public Sub StartWizard() This method is called when the wizard has been selected in the wizard dialog and confirmed with “OK”. NOTE: It’s not allowed to have any functions with the same name inside of the wizard class, not even if their return type of parameter count is different from the “Wizard-Functions”.

How to adapt a VSTA-Form to appear as a VSTA-Wizard in the Wizard dialog (C#)

Thursday, March 1st, 2012

Introduction

In average day working with the zenon Editor quite a few actions are required for each project. Actions like creating a default set of users, common drivers, default templates, etc. can be time consuming. Obviously these actions can be replaced and automated by use of VSTA-code in the editor. But if

price of viagra

these actions are to be performed for each new project, it would be more efficient if the actions could be triggered in a more comfortable way: By use of the integrated Wizard dialog which pops up when creating a new project in zenon.

Integrating VSTA-Code into the wizard dialog

In order for VSTA-Code to be available in the wizard dialog the automation code

cheap viagra

needs to be contained (implemented) into a Windows-Form. Additionally the Form needs to implement the following set of static functions (all without parameters):

static public string GetWizardName ()
Return the name of the wizard, displayed as “Name of the wizard” in the wizard dialog.

static public string GetWizardInfo ()
Return a description of the wizard, shown as “A more detailed description of the wizard.” in the wizard dialog.

static public string GetWizardCategory ()
Returns the category of the wizard, shown as “Wizard category” in the wizard dialog.
Note: An existing category can be used here. And a VSTA and a VBA wizard can reside in the same category.

static public bool IsZenOnWizard ()
This function determines whether the wizard should appear in the dialog. It offers the possibility to stop a wizard from appearing without having to delete all functions or removing it from the Addin.

static public int GetWizardVersion ()
This function returns the version number of the wizard, indicated next to the wizard information.

NOTE: It’s not allowed to have any functions with the same name inside of the wizard class, not even if their return type of parameter count is different from the “Wizard-Functions”. If all functions are correctly implemented and the Addin has been successfully compiled, the Form will appear in the wizard dialog.

Link VBA with Straton WB by using StratOnCom interface

Tuesday, January 3rd, 2012

Link VBA with Straton WB by using StratOnCom interface

This topic describes how to configure the VBA editor to connect with the Straton Workbench and how to use the StratOnCom interface. First of all you need a Straton Workbench Project. Create one.

Open the VBA Editor and select "myWorkspace" and click on the meneu "Extras/References" and set the "StratOnCom" active.

Now you can use the Straton Com Interface for your VBA Project

This code sample shows us how to initialize the com interface for your project:

Attention! The VBA access to the straton workbench just works in the zenon workpace (zenon Editor)!

Public Sub

comprare viagra

StratonTest()


'Create a new instanz on the SratOnCom Object
Dim myStraton As New StratOnCom.Project
Dim myPath As String

'Path to the Straton Path
myPath = "C:\ProgramData\COPA-DATA\SQL\ff8cdbaa-47f3-44e8-bd33-1c582fd4cadc\FILES\straton\Project"

'Set the entry point to your straton project
myStraton.ProjectPath = myPath

'Show straton path again
Debug.Print myStraton.ProjectPath
'Count all my Straton Programs
Debug.Print myStraton.Programs.Count
'Show the name of the first program
Debug.Print myStraton.Programs.Item(0).Name

'Show the first global Variable
Debug.Print myStraton.GlobalVariables.Item(0).Name

'Show some details of the first retain variable
Debug.Print myStraton.RetainVariables.Item(0).Name
Debug.Print myStraton.RetainVariables.Item(0).Comment
Debug.Print myStraton.RetainVariables.Item(0).EmbedSymbol
Debug.Print myStraton.RetainVariables.Item(0).InitValue
Debug.Print myStraton.RetainVariables.Item(0).Tag

End Sub

The following list shows the objects available

for both VBA and VSTA.

- StratonCom
- Project
- GlobalVariables
- Variables
- Variable
- VarProps
- VarProperty
- RetainVariables
- Variables
- Variable
- VarProps
- VarProperty
- Programs
- Variables
- Variable
- VarProps
- VarProperty
- ProgramContent
- ProgramObjects
- GraphicalObject
- ProgramLines
- LineObject

Move free definable screens via VSTA

Friday, December 16th, 2011

Introduction

When you try to move free defineable screens via the mouse, you will figure out that those screens have no titlebar where you can move it. Can I move screens without title bar in zenon? A quick answer YES. You can achieve this functionality for example via VSTA.

How to move the window

The window can easily be moved via VSTA by using the IDynPicture.Move Method.

zenon project backup for further investigation.

DependencyProperties for zenon WPF controls

Wednesday, September 28th, 2011

Introduction:

When you begin to develop WPF controls for zenon, you will soon stumble across DependencyProperties. What are dependency properties? The quick definition from the MSDN documentation says that a dependency property is a "property that is backed by the WPF property system." They are quite similar to normal .NET properties, but the concept behind DependencyProperties is much more complex and powerful. It gives you a bunch of infrastructure to do all things you often want to do with a normal property: validate it, coerce it into a proper range, give out change notifications and a number of other aspects. A normal .NET property is read directly from a private member in your class, whereas the value of a DependencyProperty is resolved dynamically when calling the GetValue() method that is inherited from DependencyObject.

Advantages of DependencyProperties:

  • Reduce memory footprint
  • Value inheritance
  • Change notification
  • Value validation

How to create a DependencyProperty:

To create a DependencyProperty, you have simply to add a static field of type DepdencyProperty to your type and call DependencyProperty.Register() to create an instance of a dependency property. The naming convention of DependencyProperties fields is important. The name of the fields is always the name of the property, with the suffix Property appended. To make it accessible like a normal .NET property you need to append a property wrapper. This wrapper does nothing else than internally getting and setting the value by using the GetValue() and SetValue()

usa pharmacy

Methods inherited from DependencyObject and passing the DependencyProperty as key. HINT: If you are using Visual Studio, you can type propdp and hit 2x TAB to create a dependency property.

// Dependency Property
public static readonly DependencyProperty LastNameProperty =
     DependencyProperty.Register( "LastName", typeof(String),
     typeof(MyControl));
 
// .NET Property wrapper
public String LastName
{
    get { return (String)GetValue(LastNameProperty); }
    set { SetValue(LastNameProperty, value); }
}

Each DependencyProperty provides callbacks for change notification, value coercion and validation. These callbacks are easily registered on the dependency property with

cheap generic cialis

FrameworkPropertyMetadata.

// FrameworkPropertyMetadata
new FrameworkPropertyMetadata( "zenon",
    OnCurrentTimePropertyChanged,  
    OnCoerceCurrentTimeProperty,
    OnValidateCurrentTimeProperty);

Status update MELSECA driver

Monday, September 5th, 2011

Situation:

Mitsubishi

Tags:
Posted in Information | No Comments »