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

Bug found? Weird behaviour of Combobox (Array and Integer) in CodeSys 3.5SP16 Patch 2 (64bit) Visu

  • lefish

    lefish - 2021-10-27

    Hi everyone,

    I reckon I stumbled over a bug. Sorry that I cannot show any code as this is a customers project.

    Following steps to reproduce:

    I have a Combobox (array) on a dialog. I connected the variables accordingly
    "Variable" to a UINT variable called 'ui_idx'
    "Data array" to a 0-indexed array [0..4] of STRING(50)

    I also have a few input fields on the same dialog, which are connected to i.e. TIME variables. Let's call them 't_var1', 't_var2', 't_var3'

    If I change the value of 'ui_idx' through the combobox, all the TIME variables 't_var1..3' are set to 0, although they have another initial value.
    If I change the value of 'ui_idx' through an online-write command to the same value nothing else happens, the TIME variables are left alone.

    I then moved 't_var2' to another dialog. With the effect, that 't_var1' and 't_var3' are changed to 0 while 't_var2' is left alone.

    Would you please confirm on this behaviour?

    I use CodeSys 3.5SP16 Patch 2 (64bit) and Codesyscontrol for RPi version

    Is there any chance that this bug gets fixed with a patch?


    Best regards

  • sgronchi

    sgronchi - 2021-10-27

    Do you have something attached to OnDialogClosed for the time fields?

  • lefish

    lefish - 2021-10-27

    Yes, these are actually makro frames which handle the conversion of user input in hours -> TIME.
    Therefore I do the conversion "OnDialogClosed".

    Is your thought, that these fields catch the "DialogClosed" when an item of the combobox is chosen? Of course the input of the time fields' dialogs is 0 right in this moment, so that would make sense...

    In that case: Any idea how I limit the "OnDialogClosed" catch to the frame it is specified in?
    As the input field is within a different object there might be a chance to separate by i.e. a 'local' OnDialogClosed catch...

    If you need this specific time makro frame please let me know, I can send it to you tomorrow.

    Thanks for your help!


    Last edit: lefish 2021-10-27
  • m.prestel

    m.prestel - 2021-10-28


    could you provide a small example application?
    I am not that good in guessing.

    Best regards,

    • lefish

      lefish - 2021-10-28

      I made up a short example. It just shows the basic functionality to reproduce the error.

      How to work with the example:

      Leave App as is.
      Click on the Combobox and select an item <> Testitem1
      testvar1 and testvar2 will change to 0
      Click on "Show testvar3"
      * testvar3 is unchanged

      Reset cold
      Add Testframe2 into the empty frame.
      Click on the Combobox and select an item <> Testitem1
      All testvars are changed to 0

      • lefish

        lefish - 2021-10-28

        A quick fix of course would be to change to

        IF temp_time_s <> 0 THEN
            THIS^.settime := UDINT_TO_TIME(THIS^.temp_time_s * 1000);

        to the OnDialogClosed executed ST code.

        Backdraw: 0 s as input is not possible anymore.

        Then one could change the UDINT type to DINT and set temp_time_s to -1 per default.

        Backdraw: Very high TIME values cannot be set anymore.

        • m.prestel

          m.prestel - 2021-11-02

          Seems to be that this issue was fixed with Visu

          Could you maybe update your CODESYS to use visu and check if you can still reproduce the issue?

          Best regards,

  • sgronchi

    sgronchi - 2021-10-29

    IIRC I read in this forum that the open ComboBox is implemented as a dialog and raises OnDialogClosed, and OnDialogClosed is raised for every dialog that is closed in the current visualization. But I cannot find the post...

    • m.prestel

      m.prestel - 2021-11-02

      This was a bug in the visu and was fixed with
      No dialog closed will be called in this case any more.


Log in to post a comment.