Hi Community,
I wanted to try to use the MpAlarmXAlarmControl function block since I read that it is quicker than MpAlarmXSet that I learned during training. I’ve read the documentation for the function block in the help files but am running into error -1064116224: mpALARMX_ERR_NAME_NULL. I set the function block Enable to TRUE and set the MpLink to the corresponding gAlarmXCore file. I copied my alarm name into a string variable, and then passed ADR(variable) into the Name component of the function block.
Is there additional setup to set an alarm that I might have missed causing this error?
Can anyone help with examples of the intended usage of this function block? Is the ID field important for the functionality and how can it be used?
Thanks!
Hi!
The MpAlarmXAlarmControl function block requires the alarm name to be set on/before it is enabled (hence the “Name” input is in the “orange section”). Are you setting a non-empty alarm name before you give the “Enable”? Or are you first enabling the FB, and only then setting a name?
Some additional notes / background information:
This function block can only be faster than MpAlarmXSet because it reads the alarm it should control only once during enable. Changing the “Name” input does not have any effect (unless you disable the FB, and then re-enable it). The reason for this is that this FB remembers the configuration of a single alarm, rather than reading it every time the alarm is set (like MpAlarmXSet is doing).
Hello!
I think I understand now. I was first enabling the function block and then setting the name (which could vary in each cyclic). It seems like I would need multiple MpAlarmXAlarmControl function block instances to be able to handle all alarms instead. Alternatively, I could probably disable and re-enable the function block anytime I want to change the alarm, but this would probably negate any benefits over MpAlarmXSet.
Thanks for the clarification, Michael!