Register Logger Points

Enabling the Application Logger

The application logger has to be activated in the project in order to be used. To accomplish this, the method RegisterCommunicationService of the global interface GVL.G_ifApplicationlogger has to be called once at the beginning of your program.

The logger messages can be read via EcoStruxure Machine Expert by adding the object Application logger to the Devices tree (Classic Navigators view) or to the Applications tree (Navigators view).

Register Logger Points

The application logger works slightly differently from other loggers. It is not possible to give logger messages directly to the application logger.

Instead, the application logger collects the logger messages that are given to the logger points that are distributed over the project. Therefore the messages can be simplified because the context in which they were given is clearer.

If there are, for example, two identical POUs in your project, then you have to provide the information on which instance of the module has sent the logger message to get a clear picture on what has happened. With the application logger, you assign a logger point to each POU. By doing this, then it is clear which program part is affected if you send a message such as "Product is not available".

A logger point is an instance of the function block FB_LoggerPoint. To send a logger message via a logger point, you have to register the logger point to the application logger first. This is done by calling the method RegisterLoggerPoint of the FB_LoggerPoint once. The method needs the following information as input:

1. i_ifParent: This input specifies the logger object under which the logger point has to be registered.

The first logger point has to be registered below the application logger which is represented by the global interface GVL.G_ifApplicationLogger. The next logger points can be registered underneath the application logger or below other logger points in order to build a logger point tree.

See "Building logger point trees".

2. i_sName: This input specifies the name of the logger point.

Every logger message that is sent via this logger point is connected to this logger point. The logger point has to represent a part of the machine or project or a special functionality. In order to help prevent confusion, the name of a logger point has to be unique in the project.

3. i_sType: This input specifies the kind of machine part (for example AxisModule, FillingModule) the logger point represents. This information has to be defined here since the name of the logger point does not always provide the information.

Logger points that are part of Schneider Electric libraries set the name of the function block type that they are representing.

4. i_sSource: This input specifies where the program part comes from. For example, which library contains the function block that provides the logger messages. This information can be used to identify non-unique information such as the enumeration ET_DiagExt of a library.

Logger points that are part of Schneider Electric libraries set the namespace of the library to which they belong.

The following example registers a logger point for the MainMachine of the template demo project:

fbLoggerPointMainMachine.RegisterLoggerPoint(   i_ifParent := APL.G_ifApplicationLogger,
                                                i_sName := 'Machine name',
                                                i_sType := 'MainMachine',
                                                i_sSource := 'Project',
                                                q_etDiag => ,
                                                q_etDiagExt => );

Building Logger Point Trees

With an increasing project size, the internal structure of the project becomes more complex. In order to illustrate the project structure inside the logging, the application logger gives the possibility to register one or more logger points underneath another logger point. This way it is possible to build a logger point tree that represents the structure of the project.

A logger point can only be registered under an already registered logger point. To register the new logger point underneath another logger point, the method RegisterLoggerPoint has to be called. By calling the method at the input i_ifParent the already registered logger point has to be given, under which the logger point has to be registered.

The following example registers a logger point for the Alpha module of the template demo project below the already registered MainMachine logger point.

fbLoggerPointAlpha.RegisterLoggerPoint(   i_ifParent := fbLoggerPointMainMachine,
                                          i_sName := 'Machine name',
                                          i_sType := 'MainMachine',
                                          i_sSource := 'Project',
                                          q_etDiag => ,
                                          q_etDiagExt => );

The registered logger points of a project has to represent the project structure.

G-SE-0064741.2.gif-high.gif

 

 

Registering Logger Points That Are Inside Schneider Electric Library Function Blocks

If a function block shall support logger messages, it creates an instance of FB_LoggerPoint via which it sends the logger messages. In order to register the logger point instance, the function block supports a RegisterLoggerPoint method. This method resembles the RegisterLog­gerPoint method of the FB_LoggerPoint, but it does not support the inputs i_sType and i_sSource.

When using a Schneider Electric library function block, the unavailable inputs i_sType and i_sSource are set to fixed values according to the type of the function block.