Displaying Messages
In the previous step we learned how to trigger messages and saw how HELIO displays them as a dialog. But how can we display the list of active or archived messages? Or just the number of active messages? We'll get to the bottom of these questions in this next step.
1. Display Active And Archived Messages
First, we want to visualize the Active Messages for our operators so they can see how much and which messages are currently active. They should also be able to browse through the Message Archive to see what happened on the machine while they were away.
- Add a
Message Page
Displaying a list of active and archived messages is actually quite easy in HELIO, since there is a ready-made page for it: the Message Page, which already contains the right tools to browse these messages and is fully connected to the Messaging Storage.
- Switch to the Content View.
- And add a Message Page to your HMI.
Make sure to reset the two triggers we defined in the previous step, then no more messages should be active and your page should look like this:
- Add a
Header Cell
to open Messages from any page in your HMI
Messages are really important, so it's crucial they're super easy to reach. One of the simplest ways to achieve this is to add a cell to your header that allows operators to open the message page from any other page within your HMI. Does that sound good? Then let's make it happen!
- Add a Header Cell to the header of your HMI.
- Choose a nice
Icon
that communicates what operators are going to see when they activate this header. - Finally, choose the Open Page as Overlay Action to respond to the On click event and select the page we've created before.
Your project should now be looking something like this:
2. Add a Global Active Message Indicator
There is one final touch that makes our messaging setup really useful to our operators: We need to show them if there are currently active messages because someone might have just closed an active message, but the main issue that caused that message hasn't been fixed yet.
- Activate and Configure the Badge
- Activate the
Badge
property of the Header Cell element. - Use the Dynamic Property Number of Active Messages and configure it to count all the messages, no matter which status or level.
- Have Fun With Messages!
All right, everyone, this is it! We've been working towards this moment for a reason. This is when we get to see all the configured elements in action, interacting and simulating messages:
That's it! This is all you need to configure in order to get a full featured messaging with a built-in message archive.