Welcome to our new forum
All users of the legacy CODESYS Forums, please create a new account at account.codesys.com. But make sure to use the same E-Mail address as in the old Forum. Then your posts will be matched. Close

Creating modern HMI with Codesys

m-ecs
2023-02-09
2023-02-20
  • m-ecs - 2023-02-09

    Dear All,

    I'm looking for some guidance over here. In the past I used for all my project a dedicated PLC with a seperate display.
    This way I programmed my PLC with Codesys and my display in QT.
    The result was that we could build very good looking and modern HMI's, but also a longer time to market.

    For now I'm testing a display with integrated PLC (IFM CR1151).
    I wnated to start building the HMI, but I'm wondering how I can give it a modern look.
    So I have the following questions:

    1. Is there a way that I can build my own widgets?
    2. Are there third party libraries with widgets we can use?

    If there is a way to build our own widgets, I would like to make an open source library which can be used by all of us.

    Thanks in advance,
    Kind regards,
    MECS

     
  • r9guy - 2023-02-15

    Hi
    first of all with QT(in particular QML) you can make wonderful GUI applications, and time to the market is subjective to the skills and resources you have.
    in Codesys Visualization you can build a 'Frame'.
    Frame is basically a visualization which has Variable declaration section, there you can declare
    Var_in_out, Var_input, Var type variables.
    frame must not use direct any variable in your PLC code, but get this values by VAR_in_OUT(references) or VAR_INPUT(copying)
    and in your main visualization you can dump a frame control, select the created widget and assign variables for particular widget.
    but codesys doesn't support modern features like
    Layouts,
    Table component has issues with dynamic size arrays, as you cannot pass them in.
    there's a bug where alias type arrays with array dimensions set as constant are not working.
    no MVC support whatsoever.

    so there is no easy way to make really good looking HMI if you are comparing to Qt.

     
  • rickj - 2023-02-20

    I use frames to build my own widgets. Generally a widget corresponds to a function block so that I can just pas a reference to the function block and the widget then has access to all of the function blocks data. Higher level function blocks have Param and Meta data structures that are passed to popup dialogs. The popups create a temporary instances of passed in function block references, which causes us some minor problems. I create my own custom graphics and heavily use the basic geometric shapes to build up widgets. I've reached a point where I have a very productive work flow and I believe nice looking GUIs.

    I've also managed to do dynamic layouts by repositioning and resizing on screen elements base on configuration variables. Just need to pixel calculations and understand how Move Absolute and Move Relative work.

     
  • r9guy - 2023-02-20

    How exacly move absolute and move relative make layout engine if you have no information on what screen you are working?
    Also having lots of script to change dimentions and locations of objects doesnt make a layout engine, it makes mess.

     

Log in to post a comment.