WinCC 6.0 alarm messages

J

Thread Starter

Janette

When getting certain alarms, I'm using GMsgFunc() to write lines to a .txtfile. My problem is that I need to get more info to the file. I've found out how to get time, alarmnr, type (came in or went out etc.). Info of MSG_RTDATA_STRUCT is in Online help, but how do I get the alarmtext? Does anyone have info/documentation of MSRTGetxxx-functions? I've searched the siemens support and Online help with no result.

//Janette
 
P
Janette:

The following function does this, or at least did it in WinCC 5.1 (I haven't tried it in 6.0, but I expect that it will work). The function returns the message text for the indicated alarm message number, using ODK functions to pull the data out of the Text Library.

TCHAR sz_GetAlmMsgText[MSG_MAX_TEXTLEN+1];

TCHAR* GetAlarmMessage(int iMsgNr) { MSG_TEXT_STRUCT MsgText; MSG_CSDATA_STRUCT MsgCSData; CMN_ERROR CErr; BOOL bRet;

//get alarm configuration data for alarm number if (!MSRTGetMsgCSData((DWORD)iMsgNr, &MsgCSData, &CErr)) return NULL; //main alarm message = block #1. Text Library entry number in MsgCSData.dwTextID[0] if (!MSRTGetMsgText(1, MsgCSData.dwTextID[0], &MsgText, &CErr)) return NULL; strcpy(sz_GetAlmMsgText, MsgText.szText); return sz_GetAlmMsgText; }
 
Top