# Creating MpAlarmX

**URL:** <https://community.br-automation.com/t/creating-mpalarmx/3406>\
**Category:** HMI & Visualization\
**Tags:** mapp-alarmx\
**Created:** [June 3, 2024, 11:55am UTC](https://community.br-automation.com/t/creating-mpalarmx/3406 "2024-06-03T11:55:30Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![Michael\_Rest](https://avatars.discourse-cdn.com/v4/letter/m/FF8800/32.png) [@Michael\_Rest](https://community.br-automation.com/u/Michael_Rest)\
**Post date:** [June 3, 2024, 1:32pm UTC](https://community.br-automation.com/t/creating-mpalarmx/3406/4 "2024-06-03T13:32:52Z")

</div>

Servus,  
i’d the same issues moving from VC4 to MpAlarmX, to get rid of creating each Set/Reset FUB Instance I put it into a custom Library FUB, so i “just” have to create an FUB-Instance for each alarm.

Interface is just  
MpLink to AlarmX  
sInAlarmName : Name of the Alarm  
bInAlarmSignal: Signal that activates the Alarm.

The generated AlarmID is stored in the FUB Instance

 ![Screenshot 2024-06-03 at 15.24.24](https://europe1.discourse-cdn.com/brcommunity/original/2X/b/be388e9676a0ad183eb768fd0f7b1dd7895d1e2a.png)

Here is the q&d impementation

```auto
FUNCTION_BLOCK FUB_AlarmSimple
  //Simple Alarm with automatic Reset
  //Alarms to be defined with
  // Multinstance - FALSE
  // Acknowledge - Requiered
  // Autoreset - False
  IF bInAlarmSignal THEN
    IF (udAlId = 0) THEN
			udAlId := MpAlarmXSet (MpLink, sInAlName);
		END_IF
	ELSIF (udAlId > 0) THEN
		MpAlarmXResetID (MpLink, udAlId);
		udAlId := 0;
	END_IF   
END_FUNCTION_BLOCK

```

The Alarm is callled like here

```auto
  FUBs.Alarm_EStopPanel.MpLink := gMpAlarmXCore;
  FUBs.Alarm_EStopPanel.sInAlName := 'EStopPanel';
  FUBs.Alarm_EStopPanel.bInAlarmSignal := NOT gbSInStopButtonPanel
  FUBs.Alarm_EStopPanel ();

```

I hope this helps  
regards Michi

---

_[View the full topic](https://community.br-automation.com/t/creating-mpalarmx/3406)._
