Hello,
I’m trying to setup multiple popup messages such that the message comes up when an error occurs in a Structured Text code, and the clicking the “OK” Button makes the Popup message disappear. As I result, I set the variable to 1 to hiVde the message and then to 0 to display the message. The Popup messages were created from the “Common Layers” in “Visu”. An example of the Popup message (see attached image)
This works well when there is only one popup message configuration on an HMI page. However, when the configured popup messages are more than one, the other popups refuse to disappear when the OK Button is clicked. Does anyone know how this can be resolved?
It’s hard to pinpoint a specific cause from only the information here, but I have a few ideas.
I’m assuming that each popup is its own layer and that you’re showing and hiding layers with the StatusDatapoint. If the StatusDatapoint is 1, the layer will be hidden and if it is 0 the layer will be shown. You can use the watch window to verify the status of these variables. Here are some other things to check:
- Make sure that each layer is bound to the StatusDatapoint variable that you expect it to be; it’s easy to forget to re-map variables after copying and pasting things
- It’s possible that something (i.e. another layer) is covering the OK button you’re trying to press. In this case, the button won’t actually be pressed. Make sure that the button is on top when the popup is shown.
- Test the code that corresponds to the button by setting the variable mapped to the OK button in the watch window. It’s possible that an IF statement is getting missed or the layer is getting shown immediately after it’s hidden. This is especially possible if the StatusDatapoint is set in multiple places.
Thank you very much for the quick response and for the various areas pointed out.
I checked these points and the mapping was done correctly.
Yes, each popup has its unique layer and the StatusDatapoint is used for hiding and displaying the layer.
However, I have this same issue even when I try to use a popup message twice on the same HMI. It works well in the first case where the popup occurs within the code, but when the popup comes up in the second case, the OK Button variable refuses to change from 0 to 1, even when I tried to change it from the Watch Window.
To check if the particular IF statement works properly, I tried displaying other messages at this second point where the popup occurs and the message is displayed correctly. So I’m not exactly sure why the OK button of the popup message at the second point of use on the same HMI page does not work properly.
If the value is not possible to change even from watch, then very likely you have a application bug in your code and the value is cyclically force somewhere in your code. Disable all tasks and test it again.
You can also use Ctrl+Shift+F to search for all instances of the variable name throughout your project. If you select the wildcard category “*” this will search the visualization as well.
Hi Foluke,What is the status of your topic? Could you please update us and close it if a solution has been found?