mappMotion-Backtrace

Problem description

With the current version of mappMotion (now 5.24) you do not get a lot of information from the motion alarms.
image

Solution

Fortunately, the Backtrace functionality can be implemented with a little effort using the MpAlarmXListUI() function block. The result may look like this:

When you click on the line at the top, the Backtrace information is displayed at the bottom. This often consists of several records. The information displayed is very detailed. The same information can be found in Logger or mappCockpit.

How to

Code in PLC

A task similar to this needs to be added to the PLC:

PROGRAM _INIT
    MpAlarmXCore_0.MpLink := ADR(gAlarmXCore);
    MpAlarmXCore_0.Enable := TRUE;
    MpAlarmXListUI_0.MpLink := ADR(gAlarmXCore);
    MpAlarmXListUI_0.Enable := TRUE;
    MpAlarmXListUI_0.UIConnect := ADR(MpAlarmXListUIConnect);
      
END_PROGRAM
 
PROGRAM _CYCLIC
    // backtrace for motion alarms
     
    IF MpAlarmXCore_0.PendingAlarms = 0 THEN
        // No pending alarms, reset instance id
        InstanceID := 0;
    END_IF
     
    maxIndex := SIZEOF(MpAlarmXListUIConnect.AlarmList.InstanceID) / SIZEOF(MpAlarmXListUIConnect.AlarmList.InstanceID[0]) - 1;
    FOR i := 0 TO maxIndex DO
        IF MpAlarmXListUIConnect.AlarmList.InstanceID[i] = InstanceID THEN
            MpAlarmXListUIConnect.AlarmList.SelectedIndex := i;
            EXIT;
        END_IF
    END_FOR
     
    MpAlarmXCore_0();
    MpAlarmXListUI_0();
     
END_PROGRAM

Variable definition:

VAR
    MpAlarmXCore_0 : MpAlarmXCore;
    MpAlarmXListUI_0 : MpAlarmXListUI;
    MpAlarmXListUIConnect : MpAlarmXListUIConnectType;
    InstanceID : UDINT;
    maxIndex : INT;
    i : INT;
END_VAR
Edit the visualization

When clicking on an error line in the AlarmList, write the error identifier into the InstanceID variable:

image

Backtrace information is displayed in a table. In the first column, we add the error number:

and in the second column we insert the error text:

15 Likes

Hi Jan, thanks for sharing this information about alarms.

I am working on getting the alarm on a VC screen. I succeeded but when I change my language to Dutch or French the text of the backtrace description does not change. With German it does. Is there another setting I should do or are only English and German possible as translations of an servo alarm in VC?

Hello Tom,

I am no expert in VC4 visu, but to my knowledge there are only English and German texts for this.
I tested it in mappView and again, only English and German. The system takes the information from the logger. And there are no other languages available there.

I will try find out, if you can somehow add languages to it or simply locate all of the texts somewhere (I do not know if it is possible though) and then you could translate them and then connect them to the text system, so it would be changing. That would be a working workaround.

Maybe someone in the Community knows this and can help.

Edit: so far as I know, there is no other option than English or German.

1 Like