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
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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
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...
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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
Do you have something attached to OnDialogClosed for the time fields?
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
Hey,
could you provide a small example application?
I am not that good in guessing.
Best regards,
Marcel
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
A quick fix of course would be to change to
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.
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
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...
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.