Skip to content

Commit

Permalink
Merge branch 'release/V1.5.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
langstonb committed Dec 7, 2023
2 parents 46a08fc + a7fffee commit befc0a2
Show file tree
Hide file tree
Showing 420 changed files with 41,134 additions and 31,424 deletions.
Binary file modified mappFramework/Logical/ChineseHelp/mappFramework.chm
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
ACTION AlarmHandling:

// CommissioningModeActive = TRUE will inhibit Alarms[0]. The alarm will not trigger even if the alarm condition is active.
// CommissioningModeActive = FALSE will NOT inhibit Alarms[0]. The alarm will trigger when the alarm condition is active.
// See Alarm.mpalarmxcore (must enable Advanced Features)
CommissioningModeActive;
// CommissioningModeActive = TRUE will inhibit Alarms[0]. The alarm will not trigger even if the alarm condition is active.
// CommissioningModeActive = FALSE will NOT inhibit Alarms[0]. The alarm will trigger when the alarm condition is active.
// See Alarm.mpalarmxcore (must enable Advanced Features)
CommissioningModeActive;

// Define the condition which triggers each alarm below.
Alarms[0];
// Define the condition which triggers each alarm below.
Alarms[0];

// Alarms[1] := ;
// Alarms[2] := ;
Expand Down
108 changes: 54 additions & 54 deletions mappFramework/Logical/Infrastructure/AlarmX/AlarmMgr/AlarmMgr.st
Original file line number Diff line number Diff line change
Expand Up @@ -8,39 +8,39 @@
PROGRAM _INIT

// Create folder for this component on the user file device
DirCreate_0(enable := TRUE, pDevice := ADR('mappAlarmXFiles'), pName := ADR('/'));
DirCreateAlarm(enable := TRUE, pDevice := ADR('mappAlarmXFiles'), pName := ADR('/'));

// Check if folder already exist and if so disabled the function block call
IF DirCreate_0.status = fiERR_DIR_ALREADY_EXIST THEN
DirCreate_0(enable := FALSE);
IF DirCreateAlarm.status = fiERR_DIR_ALREADY_EXIST THEN
DirCreateAlarm(enable := FALSE);
END_IF

// Call action to intialize alarm samples
AlarmSampleInit;

// Initialize mapp function blocks
MpAlarmXCore_0.Enable := TRUE;
MpAlarmXCore_0.MpLink := ADR(gMpLinkAlarmXCore);
MpAlarmXCore_0();

MpAlarmXHistory_0.Enable := TRUE;
MpAlarmXHistory_0.DeviceName := ADR('mappAlarmXFiles');
MpAlarmXHistory_0.MpLink := ADR(gMpLinkAlarmXHistory);
MpAlarmXHistory_0();

MpAlarmXListUI_0.Enable := TRUE;
MpAlarmXListUI_0.MpLink := ADR(gMpLinkAlarmXCore);
MpAlarmXListUI_0.UISetup.AlarmListScrollWindow := 10;
MpAlarmXListUI_0.UISetup.AlarmListSize := 50;
MpAlarmXListUI_0.UISetup.TimeStampPattern := '%Y %m %d %H:%M:%S';
MpAlarmXListUI_0();

MpAlarmXHistoryUI_0.Enable := TRUE;
MpAlarmXHistoryUI_0.MpLink := ADR(gMpLinkAlarmXHistory);
MpAlarmXHistoryUI_0.UISetup.AlarmListScrollWindow := 10;
MpAlarmXHistoryUI_0.UISetup.AlarmListSize := (SIZEOF(MpAlarmXListUIConnect.AlarmList.InstanceID) / SIZEOF(MpAlarmXListUIConnect.AlarmList.InstanceID[0]));
MpAlarmXHistoryUI_0.UISetup.TimeStampPattern := '%Y %m %d %H:%M:%S';
MpAlarmXHistoryUI_0();
MpAlarmXCoreMain.Enable := TRUE;
MpAlarmXCoreMain.MpLink := ADR(gMpLinkAlarmXCore);
MpAlarmXCoreMain();

MpAlarmXHistoryMain.Enable := TRUE;
MpAlarmXHistoryMain.DeviceName := ADR('mappAlarmXFiles');
MpAlarmXHistoryMain.MpLink := ADR(gMpLinkAlarmXHistory);
MpAlarmXHistoryMain();

MpAlarmXListUIMain.Enable := TRUE;
MpAlarmXListUIMain.MpLink := ADR(gMpLinkAlarmXCore);
MpAlarmXListUIMain.UISetup.AlarmListScrollWindow := 10;
MpAlarmXListUIMain.UISetup.AlarmListSize := 50;
MpAlarmXListUIMain.UISetup.TimeStampPattern := '%Y %m %d %H:%M:%S';
MpAlarmXListUIMain();

MpAlarmXHistoryUIMain.Enable := TRUE;
MpAlarmXHistoryUIMain.MpLink := ADR(gMpLinkAlarmXHistory);
MpAlarmXHistoryUIMain.UISetup.AlarmListScrollWindow := 10;
MpAlarmXHistoryUIMain.UISetup.AlarmListSize := (SIZEOF(MpAlarmXListUIConnect.AlarmList.InstanceID) / SIZEOF(MpAlarmXListUIConnect.AlarmList.InstanceID[0]));
MpAlarmXHistoryUIMain.UISetup.TimeStampPattern := '%Y %m %d %H:%M:%S';
MpAlarmXHistoryUIMain();

END_PROGRAM

Expand Down Expand Up @@ -72,50 +72,50 @@ PROGRAM _CYCLIC
END_IF

// Error reset
IF NOT MpAlarmXCore_0.Error THEN
MpAlarmXCore_0.ErrorReset := FALSE;
IF NOT MpAlarmXCoreMain.Error THEN
MpAlarmXCoreMain.ErrorReset := FALSE;
END_IF
IF NOT MpAlarmXListUI_0.Error THEN
MpAlarmXListUI_0.ErrorReset := FALSE;
IF NOT MpAlarmXListUIMain.Error THEN
MpAlarmXListUIMain.ErrorReset := FALSE;
END_IF
IF NOT MpAlarmXHistory_0.Error THEN
MpAlarmXHistory_0.ErrorReset := FALSE;
IF NOT MpAlarmXHistoryMain.Error THEN
MpAlarmXHistoryMain.ErrorReset := FALSE;
END_IF
IF NOT MpAlarmXHistoryUI_0.Error THEN
MpAlarmXHistoryUI_0.ErrorReset := FALSE;
IF NOT MpAlarmXHistoryUIMain.Error THEN
MpAlarmXHistoryUIMain.ErrorReset := FALSE;
END_IF

// Assign MpLinks & address references
MpAlarmXCore_0.MpLink := ADR(gMpLinkAlarmXCore);
MpAlarmXListUI_0.MpLink := ADR(gMpLinkAlarmXCore);
MpAlarmXListUI_0.UIConnect := ADR(MpAlarmXListUIConnect);
MpAlarmXHistory_0.MpLink := ADR(gMpLinkAlarmXHistory);
MpAlarmXHistory_0.DeviceName := ADR('mappAlarmXFiles');
MpAlarmXHistoryUI_0.MpLink := ADR(gMpLinkAlarmXHistory);
MpAlarmXHistoryUI_0.UIConnect := ADR(MpAlarmXHistoryUIConnect);
MpAlarmXCoreMain.MpLink := ADR(gMpLinkAlarmXCore);
MpAlarmXListUIMain.MpLink := ADR(gMpLinkAlarmXCore);
MpAlarmXListUIMain.UIConnect := ADR(MpAlarmXListUIConnect);
MpAlarmXHistoryMain.MpLink := ADR(gMpLinkAlarmXHistory);
MpAlarmXHistoryMain.DeviceName := ADR('mappAlarmXFiles');
MpAlarmXHistoryUIMain.MpLink := ADR(gMpLinkAlarmXHistory);
MpAlarmXHistoryUIMain.UIConnect := ADR(MpAlarmXHistoryUIConnect);

// Call function blocks
MpAlarmXCore_0();
MpAlarmXListUI_0();
MpAlarmXHistory_0();
MpAlarmXHistoryUI_0();
MpAlarmXCoreMain();
MpAlarmXListUIMain();
MpAlarmXHistoryMain();
MpAlarmXHistoryUIMain();

END_PROGRAM

PROGRAM _EXIT

// Disable the function blocls to unlink the MpLinks
MpAlarmXCore_0.Enable := FALSE;
MpAlarmXListUI_0.Enable := FALSE;
MpAlarmXHistory_0.Enable := FALSE;
MpAlarmXHistoryUI_0.Enable := FALSE;
QueryActiveAlarms_0.Enable := FALSE;
MpAlarmXCoreMain.Enable := FALSE;
MpAlarmXListUIMain.Enable := FALSE;
MpAlarmXHistoryMain.Enable := FALSE;
MpAlarmXHistoryUIMain.Enable := FALSE;
QueryActiveAlarms.Enable := FALSE;

// Call function blocks
MpAlarmXCore_0();
MpAlarmXListUI_0();
MpAlarmXHistory_0();
MpAlarmXHistoryUI_0();
QueryActiveAlarms_0();
MpAlarmXCoreMain();
MpAlarmXListUIMain();
MpAlarmXHistoryMain();
MpAlarmXHistoryUIMain();
QueryActiveAlarms();

END_PROGRAM
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
(*Function Blocks*)
VAR
MpAlarmXHistory_0 : MpAlarmXHistory; (*MpAlarmXHistory instance*)
MpAlarmXHistoryUI_0 : MpAlarmXHistoryUI; (*MpAlarmXHistoryUI instance*)
MpAlarmXListUI_0 : MpAlarmXListUI; (*MpAlarmXList instance*)
MpAlarmXCore_0 : MpAlarmXCore; (*MpAlarmXCore instance*) (*ChangeStyleAlarmButton : USINT := 0; (*changeStyle of a AlarmFlyout in mappView*)
MpAlarmXControlExample_0 : {REDUND_UNREPLICABLE} MpAlarmXAlarmControl; (*MpAlarmXAlarmControl instance*)
QueryActiveAlarms_0 : {REDUND_UNREPLICABLE} MpAlarmXQuery; (*MpAlarmXQuery instance*)
DirCreate_0 : DirCreate; (*DirCreate instance*)
MpAlarmXHistoryMain : MpAlarmXHistory; (*MpAlarmXHistory instance*)
MpAlarmXHistoryUIMain : MpAlarmXHistoryUI; (*MpAlarmXHistoryUI instance*)
MpAlarmXListUIMain : MpAlarmXListUI; (*MpAlarmXList instance*)
MpAlarmXCoreMain : MpAlarmXCore; (*MpAlarmXCore instance*) (*ChangeStyleAlarmButton : USINT := 0; (*changeStyle of a AlarmFlyout in mappView*)
MpAlarmXControlExample : {REDUND_UNREPLICABLE} MpAlarmXAlarmControl; (*MpAlarmXAlarmControl instance*)
QueryActiveAlarms : {REDUND_UNREPLICABLE} MpAlarmXQuery; (*MpAlarmXQuery instance*)
DirCreateAlarm : DirCreate; (*DirCreate instance*)
END_VAR
(*Constants*)
VAR CONSTANT
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ ACTION AlarmSampleFub:
// Typically this function is called from other tasks within the application (decentralized).
// For example, if you have an error in the recipe system, you can trigger it directly in the recipe task.
// Therefore, copy/paste this example to other places in the application as needed.
MpAlarmXControlExample_0.MpLink := ADR(gMpLinkAlarmXCore);
MpAlarmXControlExample_0.Enable := TRUE;
MpAlarmXControlExample_0.Name := ADR('MpAlarmXControlExample');
MpAlarmXControlExample_0.Set := AlarmExamples.SetControlExample;
MpAlarmXControlExample_0();
MpAlarmXControlExample.MpLink := ADR(gMpLinkAlarmXCore);
MpAlarmXControlExample.Enable := TRUE;
MpAlarmXControlExample.Name := ADR('MpAlarmXControlExample');
MpAlarmXControlExample.Set := AlarmExamples.SetControlExample;
MpAlarmXControlExample();

END_ACTION
Original file line number Diff line number Diff line change
@@ -1,47 +1,47 @@
ACTION ExecuteQuery:

// Initialize mapp function block
QueryActiveAlarms_0.MpLink := ADR(gMpLinkAlarmXCore);
QueryActiveAlarms_0.Enable := TRUE;
QueryActiveAlarms_0.Name := ADR('ActiveAlarms');
QueryActiveAlarms_0.Language := ADR('en');
QueryActiveAlarms_0();
QueryActiveAlarms.MpLink := ADR(gMpLinkAlarmXCore);
QueryActiveAlarms.Enable := TRUE;
QueryActiveAlarms.Name := ADR('ActiveAlarms');
QueryActiveAlarms.Language := ADR('en');
QueryActiveAlarms();

CASE (AlarmQuery.State) OF
ACTIVE_ALARM_WAIT:
// Wait until the RunQuery command is triggered from the HMI.
// If you prefer that the query runs anytime new data is available, then uncomment line 15 and comment out line 16 and delete
// the "Run query" button from the HMI.
//IF (AlarmQuery.LastUpdateCount <> AlarmQuery.UpdateCount) THEN
IF (HmiAlarmX.Commands.RunQuery = TRUE) THEN
IF (HmiAlarmX.Commands.RunQuery) THEN
brsmemset(ADR(AlarmQuery.Alarms[0]), 0, SIZEOF(AlarmQuery.Alarms));
AlarmQuery.LastUpdateCount := AlarmQuery.UpdateCount;
QueryActiveAlarms_0.Execute := TRUE;
QueryActiveAlarms.Execute := TRUE;
HmiAlarmX.Commands.RunQuery := FALSE;
AlarmQuery.State := ACTIVE_ALARM_QUERY;
END_IF

ACTIVE_ALARM_QUERY:
// If the number of query results is less than MAX_QUERY_RESULTS, return to the wait state
IF ((QueryActiveAlarms_0.CommandDone = TRUE) AND (QueryActiveAlarms_0.Info.HasMoreRows = FALSE)) THEN
QueryActiveAlarms_0.Execute := FALSE;
QueryActiveAlarms_0.Next := FALSE;
IF (QueryActiveAlarms.CommandDone AND (NOT QueryActiveAlarms.Info.HasMoreRows)) THEN
QueryActiveAlarms.Execute := FALSE;
QueryActiveAlarms.Next := FALSE;
AlarmQuery.State := ACTIVE_ALARM_WAIT;
// If the number of query results is more than MAX_QUERY_RESULTS, then query the next set of results
ELSIF ((QueryActiveAlarms_0.CommandDone = TRUE) AND (QueryActiveAlarms_0.Info.HasMoreRows = TRUE)) THEN
QueryActiveAlarms_0.Next := FALSE;
ELSIF ((QueryActiveAlarms.CommandDone) AND (QueryActiveAlarms.Info.HasMoreRows)) THEN
QueryActiveAlarms.Next := FALSE;
AlarmQuery.State := ACTIVE_ALARM_NEXT;
END_IF

ACTIVE_ALARM_NEXT:
IF (AlarmQuery.Next = TRUE) THEN
IF (AlarmQuery.Next) THEN
// By default, AlarmQuery.Alarms has 20 elements, so it can hold 20 query results at a time (MAX_QUERY_RESULTS = 19).
// If AlarmQuery.Next is true, this means the query result is more than 20 alarms.
// If you want to save the data for the first 20 alarms, add code here to copy AlarmQuery.Alarms to another location.
// Otherwise, the older alarms in the query will get overwritten with the newest entries here.
brsmemset(ADR(AlarmQuery.Alarms[0]), 0, SIZEOF(AlarmQuery.Alarms));
AlarmQuery.Next := FALSE;
QueryActiveAlarms_0.Next := TRUE;
QueryActiveAlarms.Next := TRUE;
AlarmQuery.State := ACTIVE_ALARM_QUERY;
END_IF
END_CASE
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ ACTION GetBacktraceInformation:
MaxIndex := (SIZEOF(MpAlarmXListUIConnect.AlarmList.InstanceID)/SIZEOF(MpAlarmXListUIConnect.AlarmList.InstanceID[0])) - 1;
// Find selected alarm in order to show backtrace information
FOR i := 0 TO MaxIndex DO
IF (MpAlarmXCore_0.PendingAlarms = 0) THEN
IF (MpAlarmXCoreMain.PendingAlarms = 0) THEN
// No pending alarms, reset instance id
HmiAlarmX.Parameters.InstanceID := 0;
EXIT;
Expand All @@ -16,7 +16,7 @@ ACTION GetBacktraceInformation:
END_IF

IF (MpAlarmXListUIConnect.AlarmList.InstanceID[i] = 0) THEN
IF (MpAlarmXCore_0.PendingAlarms > i) THEN
IF (MpAlarmXCoreMain.PendingAlarms > i) THEN
// Alarm not found, list can page up
MpAlarmXListUIConnect.AlarmList.PageUp := TRUE;
END_IF
Expand Down Expand Up @@ -46,12 +46,12 @@ END_ACTION

ACTION ExportAlarms:

IF (HmiAlarmX.Commands.ExportAlarms = TRUE) THEN
MpAlarmXHistory_0.Export := TRUE;
IF (HmiAlarmX.Commands.ExportAlarms) THEN
MpAlarmXHistoryMain.Export := TRUE;
END_IF

IF ((MpAlarmXHistory_0.Export = TRUE) AND (MpAlarmXHistory_0.CommandDone = TRUE)) THEN
MpAlarmXHistory_0.Export := FALSE;
IF ((MpAlarmXHistoryMain.Export) AND (MpAlarmXHistoryMain.CommandDone)) THEN
MpAlarmXHistoryMain.Export := FALSE;
HmiAlarmX.Commands.ExportAlarms := FALSE;
HmiAlarmX.Status.AlarmExportDone := TRUE;
END_IF
Expand Down
Loading

0 comments on commit befc0a2

Please sign in to comment.