FORUM CTRLX AUTOMATION
ctrlX World Partner Apps for ctrlX AUTOMATION
Dear Community User! We are updating our platform to a new
system.
Read more: Important
information on the platform change.
04-14-2023 09:18 AM - edited 04-14-2023 09:22 AM
Hello,
there is a strange behavior of variables.
There is a animation of analog clock. For that, system time is split in seconds, minutes, hours. With that and a factor, clockhands are simulated in a Visu (inner rotation of a line).
If using the global variable iSekundenAnzeige (used for the angle to display 0...360°) it doesn't work (since some days, before it worked).
When debugging with breakpoint the variable is written. But with next cycle of program it starts with 0. Then written again but with next cycle 0 again. At the end it keeps on 0.
The variable is read / written just one time, so there is no conflict
Renaming the variable it works.
Variable keeps its value.
Going back to the old name it doesn't work. Variable doesn't keep its value within one PLC cycle.
The issue is the same again as written above.
A similar issue was with a funciton block. Status of variables (input/output) were lost with each cycle. After renaming the instance name of function block it works.
Such isseus are very annoying and it would be helpful to know what to do.
-Clearing / clear all in editor doesn't help.
-Restarting ctrlX doesn't help.
-Shutting off and on ctrlX doesn't help.
Such unreliability of the system reduces the confidence and is very disappointing.
Solved! Go to Solution.
04-14-2023 02:07 PM
Hi alink,
could you provide an example project with this error and tell us your version?
You do not write the values from somewhere else(eg. Datalayer), or have any pointers with memory access writing in this section?
You may use Checkbounds etc. to verify it.
04-14-2023 03:29 PM
Hi,
tried to make a sample project. But then it works with this variable (within a simulation and just this part of program).
The Date/Time is from SystemTimeRTC.
This is then splitted into date and time.
The time into seconds, minutes and hours. => this all works fine!
Then, just for animation of my own clock
lines for second, minute and hour are rotating.
To get and set the current angle the seconds are multiplied with 6 => 0 sec 360°/0° and 59 sec = 354°
For minutes the same and for hours it is multiplied with 30 to get it rotateted twice a day...
So, the issue is when the current seconds are multiplied with 6 and written into the variable for the angle.
With the name 'GVL_VISU.iSekundenAnzeige' the value is lost. With another name, just of this one variable, it works.
I use a ctrlX with 1.18 and ctrlXWorks 1.18
It's a very strange issue. And as written, something similar with a own function block.
My first though, instance name has too much characters (about 20) because with less it works.
An issue I never had before, neither with ctrlX nor with MLD and XM I worked with.