IAlarmNotifier - cannot get message from itfAlarm.GetMessage

  • DavidCozens

    DavidCozens - 2013-09-11

    I have a function block that implements the IAlarmNotifier interface, I have it doing most of what I want, but I cannot get the alarm message. The key part of the execute method is below. Any ideas why GetMessage always returns a null string. I am successfully getting the name of the AlarmGroup and the AlarmClass it is just this interface function that is tripping me up.
    {attribute '''DOCU__COMMENT' := ' Executes the action.'}
    ( Executes the action.)
    METHOD Execute
    ( The currently processed alarm state transition. This will be
    evaluated in order to determine, whether the action has to be
    executed or not
    eCurrTransition : AlarmStateTransition;
    ( The alarm, for which the action has to be performed)
    itfAlarm : IAlarm;
    ( An optional pointer to a structure variable containing
    additional parameter
    pbyAdditionalData : POINTER TO BYTE;
    cbpMessage: AlarmManager.CharBufferPtr; ( for holding the AlarmMessage )

    cbpMessage := itfAlarm.GetMessage(__SYSTEM.TYPE_CLASS.TYPE_STRING);

  • eschwellinger

    eschwellinger - 2013-09-12

    Hi David,
    The message text is empty because no visualization occurs in the project.

    Without visualization, the text lists are not transferred to the control, and therefore the text can not be determined.
    This is as designed, to fix that you Need to add a visu to your project.


  • DavidCozens

    DavidCozens - 2013-09-12

    Thanks Edwin - that worked a treat. I would never have guessed that


Log in to post a comment.