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
2021-10-27
2021-11-02
  • 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 4.0.1.0

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

    Thanks!

    Best regards
    LeFish

     
  • sgronchi - 2021-10-27

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

     
  • 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 - 2021-10-28

    Hey,

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

    Best regards,
    Marcel

     
    • 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:

      Testcase1:
      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

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

       
      • 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);
        END_IF
        

        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 - 2021-11-02

          Seems to be that this issue was fixed with Visu 4.1.0.0.

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

          Best regards,
          Marcel

           
  • 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 - 2021-11-02

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

       

Log in to post a comment.