Skip to content

HMI Bug: Two-dimensional array references with index as variable

The HMI-application crashes when attempting to reference a variable which is an array like this:


MyArray[M][1] where M is a parameter input to a HMI page:


A dynamic is used to launch an HMI-page as a dialog. The parameter M is used to customize the dialog to one particular module (nr 4 in this case).


A standard button (or any other symbol) is used to reference the array: (in this particular example I am working on debugging code where I can bypass parts of a start-sequence, hence the "cheat"-variable name. In case you were curious).

Replacing the parameter M with a number 1 will prevent the crash.



The resulting crash:


@Martin PLCnext Team please dispatch this to the HMI team, along with the other bug i recently reported.

Comments

  • The funny thing is that this two-dimensional array is a work-around for the previous bug which prevents me from accessing bits in a word, so this is getting frustrating.

    Originally, I would have created an array of Words and accessed each bit like this MyWord[M].%X0, but as this doesn't work, I had to translate the word into an array (where MyWord[M].%x0 becomes MyArray[M][0]), but now this also fails.

    Now it seems like I have to create individual bits or some other code to bypass these bugs.

  • Further troubleshooting has revealed that Dialogs in general have an issue with variables:

    If an HMI-page is loaded as a page, there are no problems, but if it is loaded as a dialog, it cannot refer to non-parameter variables:

    • In the below example, there is a symbol which takes a boolean parameter as argument.
    • The symbol is used in an HMI-page loaded as a dialog.
    • The parameter has a variable inside it, namely the M used to define the array index
    • The M-parameter is a parameter to the HMI-page being loaded as a dialog
    • I suspect that the M-parameter is not read or interpreted and that the HMI engine tries to parse it before the variable is ready, hence crashing the HMI application when attempting to load the dialog



Sign In or Register to comment.