Applies To:
  • CitectSCADA 5.xx, 6.XX
  • CitectHMI 5.xx, 6.XX

Summary:
The Cicode function PageSummary() cannot be used with the xp_style Alarm template, which is stored in the CSV_Include project. It was found that the first Cicode Object f(x) used in the xp_style Alarm template has an AN number of 250 whereas the first Cicode Object f(x) used in the Standard or other style Alarm template has an AN number of 21. This Cicode Object f(x) used in the Standard or other style Alarm template with an AN number of 21 is hard coded in the Cicode function AlarmSetInfo() that is used when calling the PageSummary() function, hence the Cicode Object f(x) used in the xp_style Alarm template with an AN number of 250 will not work.
 

Solution:
Create your own Cicode functions by changing the names of the original functions so that there isn't any conflict with the CSV_Include or Include projects, which are included by default.

Example 1:
Hardcode the AN number of the Cicode object f(x) used in the xp_style Alarm template, which is 250, in the Cicode function AlarmSetInfo(...) that is used in both Cicode functions _PageSummary() and CSV_MM_PageSummary(). The Cicode functions would look something like this:

FUNCTION

MyPageSummary(
INT nCategory = 0)

    STRING sCSVMode;
    sCSVMode =
ParameterGet("Startup", "InitMultiMonitors", "0");

    IF sCSVMode = "0" THEN
        _MyPageSummary(nCategory);
    ELSE 
        TaskNew("MyCSV_MM_PageSummary","^"" + IntToStr(nCategory) + "^"",0);
    END

END

FUNCTION
_MyPageSummary(
INT category = 0)

    INT ret=0;

    ret = PageDisplay(SummaryPage);

    SELECT CASE (ret)
        CASE 0
            AlarmSetInfo(250, 2, category);

        CASE 267, 277
            ;
// out of user area, or insufficient priv (message shown by PageDisplay)

        CASE ELSE
            Message("Configuration Error", sConfigErrMsg("Summary"), 0); // ret = 261 if page does not exist.

    END SELECT

END

FUNCTION
MyCSV_MM_PageSummary(
INT category = 0)

    INT iError;

    iError = CSV_MM_PageDisplay(msSummaryPage);

    IF iError = 0 THEN
        AlarmSetInfo(250, 2, category);
    END

END

Example2:
If you are using an Alarm template for both the xp_style and any other style within one project then you will need a more universal solution by passing the AN number as an argument into the functions. The Cicode functions would then look something like this:

FUNCTION

MyPageSummary(
INT nCategory = 0, INT AN_Number)

    STRING sCSVMode;

    sCSVMode = ParameterGet("Startup", "InitMultiMonitors", "0");

    IF sCSVMode = "0" THEN
        _MyPageSummary(nCategory, AN_Number);
    ELSE
        TaskNew("MyCSV_MM_PageSummary","^"" + IntToStr(nCategory) + "^", AN_Number",0);
    END

END

FUNCTION
_MyPageSummary(
INT category = 0, INT AN_Number)

    INT ret=0;

    ret = PageDisplay(SummaryPage);

    SELECT CASE (ret)

        CASE 0
                AlarmSetInfo(AN_Number, 2, category);

        CASE 267, 277
            ;
// out of user area, or insufficient priv (message shown by PageDisplay)

        CASE ELSE
            Message("Configuration Error", sConfigErrMsg("Summary"), 0); // ret = 261 if page does not exist.

    END SELECT

END

FUNCTION
MyCSV_MM_PageSummary(
INT category = 0, INT AN_Number)

    INT iError;

    iError = CSV_MM_PageDisplay(msSummaryPage);

    IF iError = 0 THEN
        AlarmSetInfo(AN_Number, 2, category);
    END

END

 

Keywords:
PageSummary,CSV_MM_PageSummary, AlarmSetInfo, xp_style  

Attachments