Posts Tagged ‘Message-Control’

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

cialis order

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, …)

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.


Mysteries about special characters in SMS

Thursday, August 18th, 2011


Sometime it is necessary to send a SMS containing some special characters via Message-Control e.g. Especially this is the case if one has to send a Cyrillic or Greek SMS. Unfortunately this is not straight forward usually and provides some traps.


Due to design of SMS service in GSM networks the encoding of the sent text can either be on codepage basis with 7-Bit characters or as Unicode text with 16-Bit characters (UCS2). Unfortunately many phones do not support all available codepages and the available number of codepages is strictly limited. Often the used codepage is hardwired in the phone according to the country it was sold. So playing with the used codepage and 7-Bit characters would be possible in principle but often does not really work independently of the receiving phone. So using Unicode character set is the better solution usually. But this brings us to the second handicap of the old SMS service. The length of a single SMS message is strictly limited to 160 7-Bit characters. This length is cut more than half again, if 16-Bit Unicode characters are used. So the maximum length of a Unicode SMS is only 70 characters.

Our approach:

To provide an optimal balance between functionality an efficiency we decided to go the following way in our message control: If the SMS only contains characters that can be mapped to standard codepage, the SMS is sent as normal 7-Bit character SMS. We did not face any compatibility problems with that in the past and we are able to use the “huge” 160 character size. If the SMS contains special characters the message control automatically switches to Unicode mode and sends out a Unicode SMS. To achieve this there are some additional requirements. First of course the used GSM modem must be able to send out Unicode SMS using the so called PDU mode. To enable the message control to use the PDU mode in property-page “Interfaces” in GSM service configuration modem type WAVECOM must be selected. And last but not least in “Services” property-page in GSM service configuration the “Numbering” checkbox in “Splitting” setting has to be disabled.

This feature is available since 6.51SP0+Build5.