Blog

How to Program WinCC OA Message Catalogs

How to Program WinCC OA Message Catalogs

Orginal author: Oliver Reed

Message Catalogs is a feature in WinCC OA that is often forgotten. This feature is used when the application needs to support different languages, but it’s also a great resource for simple error messaging or centralizing strings of text that are used throughout the program.

To use the Message Catalog, you must first create a folder in your program structure.

Within that folder, you can add the different language folders. I have yet to implement a multi-language project, but this is in part how that would be done.

Once the folder is in place, you can add your own message catalogs. The catalogs are organized by a keyword and the corresponding text (as seen below).

In order to access the text in the message catalog, use this function:

                   getCatStr("CatalogName","KeywordName");

Further, If you want to create a pop-up error/alert window to use inconjunction with the built in MessageWarning panel, simply add in something like the following:

                   string sMessageText=getCatStr("CustomAlerts","overweight");

                   ChildPanelOnCentral("vision/MessageWarning",getCatStr("general","warning"),makeDynString(sMessageText));

Now, whenever this script is run, you will get a popup that looks like the following:

Find out more about WinCC OA Programming and contact us with any inquiries.

Comments

There are currently no comments, be the first to post one.

Post a comment

Name (required)

Email (required)

CAPTCHA image
Enter the code shown above:

Related Blog Posts