Skip to content

HMI dynamics, need to enter variable in Dynamic properties

Hi,


I am working on a symbol which displays a "progress bar" for a numerical value. This symbol should be somewhat universal and include min/max-value for boundaries, alarm levels, signal tag, engineering unit and so forth.

The parameter input to this symbol is a structure which contains all these details.

My problem is that I cannot make the symbol universal if the scaling properties are not possible to use with variables. In the screenshot below, the values for "low range" and "high range" are given inside the structure I provide as a parameter, but as it is not possible to enter variables in these fields, they are kind of useless.

It IS possible to put these values as parameters for the entire symbol (but still only for fixed numbers, not variables). In my application the symbol is also used in dialog boxes (pop up windows) which also are dynamic; hence it inherits values from an array of structures used for many different signals (all analog signals for instance).


For context, this is how the symbol looks (bear with me, it's not finished):

All values are given by the structure, and if some alarm levels are not in use, they are invisible.

The scaling function is used to make the green bar fill the rectangle at the correct ratio as some analog values are scaled 0-100, some are -50 - 150 and so forth.


PS: the same problem applies to the color fill-settings where only numerical values are allowed for the different thresholds where the symbol changes color.

I have bypassed this by hardcoding the thresholds 1-2-3-4 and programmed that if HH-level is reached, then set the number to 4 which is a red color.

This works, but I don't like it.

I guess the same strategy can be applied for the scaling and make everything fit inside a hardcoded scaling from 0-100, but that makes for lot of re-calculations everywhere there is a numerical value which are to be displayed in such a progress bar.


Comments

    1. If you press right mouse button on the parameter field, it could be added to "Settings" tab of symbol properties in main window


    You can try to normalize color value inside of the symbol itself.

    Best regards

  • Thanks for your reply @Oleksandr Guminskiy .

    I am aware of the option to forward the setting to the symbol's settings. It is still required to be a fixed number and not a variable.

    For many cases, where the symbol usage is hardcoded this is a valid solution.

    In my case, the symbol is used dynamically and is called in a dialog box which calls a structure with a specific array index. In short, the dialog box is using a different value with different min/max-scaling depending on how you opened the dialog box.

    This is the reason i need to use variable in the dynamic's settings.

  • Hi!

    You still can normalize value to boundaries inside of the symbol.

    Please, find sample attached.

    Best regards.


  • Yes.

    This is my current workaround. But as I was planning to use this symbol as a multipurpose for all kinds of analog values in my application, I was hoping that I didn't have to re-calculate normalized values as the structure I was using already has variables for scaling and limits in engineering units. Now those also has to be normalized (actually I made it in percent and not in per-unit, but same same).

    I like to have my code as short and clean as possible, so adding more code as a workaround for a (in my mind) missing feature is a setback.

Sign In or Register to comment.