Our Help describes how it could be done for the SMS to show specific messages. But this also applies for emails when using the hook functionality!
See the help under Add-ons -> Communciation Center -> Adaptivity of the Communication Center -> Modification of SMS texts before sending.
This can be done in following way for the DP and DPE etc...
1) Copy and paste the cc.cat (from the WinCC OA version) into your msg folder of the project.
2) In the cc.cat file in your project, search the MsgTemplate and add your addional keywords like "{AlertSYS}"for system and/OR "{AlertDPE}" for DPE and/or "{AlertDP}" for the DP.
The change in the cc.cat file would look like this:
Code: Select all
MsgTemplate,{AlertSYS}{AlertDPE} [AlertDescription] [AlertText] [AlertState] um [AlertTime], Wert ist [AlertValue]. [MsgState]The hook.ctl should look like this:
Code: Select all
void hook_ccModifyMessageText(string &text, atime alertTime)
{
// Retreive the information for the place holders
string aId = getAIdentifier(alertTime); // Alert identifier
string dp = dpSubStr(aId, DPSUB_DP); // Alert datapoint
string dpe = dpSubStr(aId, DPSUB_DP_EL); // Alert datapoint + element
string sys = dpSubStr(aId, DPSUB_SYS); // Alert system name
// Replace the place holders with the actual values
strreplace(text, "{AlertDP}", dp);
strreplace(text, "{AlertDPE}", dpe);
strreplace(text, "{AlertSYS}", sys);
DebugFN("CCHOOK", __FUNCTION__ + "(..., " + (string)alertTime + ") Returning: " + text);
}5) Stop the WinCC OA project.
6) Load the created CTRL library by setting the entry( either in the /config/config.level file or the /config/config of the project directory):
Code: Select all
[ctrl_X] #X stands for the number of the CTRL managerwhich executes the ccController.ctl
LoadCtrlLibs = "hook.ctl" 7) Start the WinCC OA project.
Please see attached the hook.ctl and a small demo project, which was done for 3.13, to give you a guidence how and where to make the changes.
https://www.winccoa.com/fileadmin/image ... nter_3.zip https://www.winccoa.com/fileadmin/image ... ccHook.ctl