Templates
File name
The structure of the file names must follow the following structure:
{Eventklasse}(-{Status})(-Extended)-{Sprache}.html
Event class:
The event class for which the template is to apply is entered here.
In addition to the event classes defined in the PLC, there are the following internal notification classes and associated states:
- Connection problems
- Present: Connection was interrupted
- Gone: Connection has been restored
- HMI-Extension Monitoring
- Present: A monitored extension is not running
- Maintenance Mode
- Present: Maintenance mode is enabled
- Gone: Maintenance mode has been disabled
Status (optional):
The status for which the template is used is defined here. Possible states are:
- Present
- PresentAck
- Gone
- GoneAck
Extended (optional):
A user receives this template if the "Additional Information" option is set in the HMI configuration for the user for the respective event class. This makes it possible to create a simple and an informative template for the same event.
Language:
The following languages are currently supported:
- de
- en
Default
Instead of an explicit event class, the "default" template can also be used. This template is used automatically if no specific event class template is found.
The default templates have the following structure:
- Default-{language}.html
If this template is also not found, the text and the subject are generated statically.
Event summaries
The templates Summary-{Sprache}.html and MultiSummary-{Sprache}.html are required in order to be able to send collective notifications in a clear manner.
The placeholder (see Placeholder / Summaries) for the notifications contains all events that will be sent as a collection in their respective templates. Consequently, for each event contained, the corresponding template for the individual notification is resolved and the placeholders are replaced by the values.
A summary is created if the number of events exceeds the value in the configuration ("Common settings" → "Notification flood suppression" → "Count of messages overall allowed") or if the event occurs more than once in the time defined in the configuration ("Common settings" → "Notification flood suppression" → "Delay in seconds").
If an event is triggered repeatedly, the template Summary-{Sprache}.html is used.
If several events are triggered repeatedly, the template MultiSummary-{Sprache}.html is used.
Structure of a template
The template consists of three parts: the subject, content and footer. These parts are separated from each other as HTML tags. What is used is what is inside the tags. The subject and content should be present, otherwise they will be generated statically.
Subject
The email subject is defined between the tag <subject> and </subject>.
For collective notifications, this tag is only taken into account by the template for the collective notification. This means that in the case of a collective notification, the subject from the template of the collective notification is used instead of the subject of the event classes concerned.
Content (template)
The email content is defined between the tag <template> and </template>.
Since emails are based on HTML, simple HTML tags can be used.
A guide can be found on the Mailchimp website.
This content is used in the listing for collective notifications.
Footer
The email footer is defined between the tag <footer> and </footer>.
This is used to display information only once in the email, even for collective notifications. This means that in a collective notification, this tag is only used from the template of the collective notification.
The tag from the individual event templates is ignored.
Placeholder
For all events
Placeholder | Meaning |
|---|---|
EventClass | The event class. |
Description | The description of the event class. |
DeviceName | Name of the device on which the event was triggered. |
DeviceAddress | Address of the device on which the event was triggered. |
DevicePort | Port of the application of the device on which the event was triggered. |
DeviceProjectName | Name of the project in which the event was triggered. |
Device | Information about the device in the following syntax: |
Date | Date of the event in the format "D" (see Microsoft documentation "standard-date-and-time-format-strings#LongDate"). |
Time | Time of the event in the format "T" (see Microsoft documentation "the-long-time-t-format-specifier"). |
DateTime | Date and time of the event in the standard format of the respective language (see Microsoft documentation "how-standard-format-strings-work"). |
HmiLink | The link to the HMI. Is configured in the Config page of the HMI server. |
SubscribedEventClassId | The event class for which the user is being notified. This may differ if the user is entered under the event class -99: "Receive all". Then this value is -99, for example. |
SubscribedEventClassDescription | The description of the event class for which the user is being notified. |
State | The state of the event. For example Present, Present|Ack, Gone, Gone|Ack. |
Symbol | The symbol that triggered the event. |
TimeCaptured | A list of all the times at which this event occurred. If it is not a summary of a flood of notifications, this placeholder is replaced with a date in the format "O". In the case of a collective notification, the placeholder is replaced with a list of the data in the format "O". |
Errors | If unexpected operating behaviors have occurred, these are inserted as enumerated text. |
Subject | A brief description of the event |
Internal events:
- Connection
This template should contain information to restore the connection (see table above). - HMI Extensions:
Placeholder | Meaning |
|---|---|
HMI.ConfigVersion | Config version of the HMI extension that triggered the event |
HMI.DebuggerAttached | Indicates whether a debugger is attached to the HMI extension. Language-dependent. |
HMI.Error | Provides information on the "Error" property of the HMI extension that triggered the event. |
HMI.ExtensionName | Name of the HMI extension that triggered the event. |
HMI.Guid | Guid of the HMI extension that triggered the event. |
HMI.Licensed | Indicates whether the HMI extension is licensed. Language-dependent. |
HMI.PackageVersion | Package version of the HMI extension that triggered the event. |
HMI.Remote | Indicates whether the HMI extension is "Remote". Language-dependent. |
HMI.Required | Indicates whether the HMI extension is "Required". Language-dependent. |
HMI.State | The state of the HMI extension that triggered the event. |
HMI.ThirdParty | Indicates whether the HMI extension is from a third-party provider. Language-dependent. |
HMI.Updated | Indicates when the HMI extension was updated. |
HMI.Version | The version of the HMI extension that triggered the event. |
HMI.Visibility | Specifies the visibility of the HMI extension that triggered the event. |
- Maintenance
Placeholder | Meaning |
|---|---|
Maintenance.ShutoffDate | The date and time at which maintenance mode is automatically disabled in the format of the respective language. |
PLC Events
Placeholder | Meaning |
|---|---|
TF8040.ObjectName | Object name of the symbol that triggered the event. |
TF8040.ObjectDescription | Object description of the symbol that triggered the event. |
TF8040.MessageEventTexts | "MessageEventText" of the symbol that triggered the event. |
TF8040.StatusFlags | "Status flags" of the symbol that triggered the event. |
TF8040.SymbolPath | Symbol path of the symbol that triggered the event. |
TF8040.LockPrio | "Lock prio" of the symbol that triggered the event. |
TF8040.Versions | Versions of the runtime of the symbol that triggered the event. These are output in tabular form. The style cannot be changed. |
TF8040.BuildingName | Building name assigned to the device in the configuration. |
PLC events have the numbers 0-254.
Summaries
Basis
Placeholder | Meaning |
|---|---|
Summary.counter | How often was the event triggered? |
Summary.LastRisen | When the event was last triggered. Is specified as a date with the format "O". |
Summary.Events | Replaces this placeholder with the template(s) for the event(s) that were triggered repeatedly. |
Summary of an event class-state combination
Placeholder | Meaning |
|---|---|
Summary.FirstOccurrence | The date in the respective language on which the event was triggered for the first time in this sequence. |
Summary.LastOccurrence | The date in the respective language on which the event was triggered for the last time in this sequence. |
Multiple event summaries
Placeholder | Meaning |
|---|---|
Summary.EventClasses | All event classes of the summarized events, sorted and listed. |
Storage location of the templates
The templates are supplied as part of the NuGet package.
These are delivered at {HMI-Projekt-Ordner}\BaMessageSystem\Templates and attached to the project.
A 'UserTemplates' folder is also created. This is prioritized in the choice of templates. Templates can be copied and changed in this folder.
Changes in this folder are retained even if the NuGet package is removed or updated.
Templates in the 'Template' folder should not be edited, as changes here only remain until the package is changed.
Example of file name resolution
Event class 30, Present, Extended Information and German
Processing is carried out chronologically according to the following points:
- The file name '30-Present-Extended-de.html' is searched for.
- The file name '30-Present-de.html' is searched for.
- The file name '30-de.html' is searched for.
- If this does not exist, the file name 'Default-de.html' is searched for.
- Finally, the email is generated statically.