Keep PV Case to a Global volatile PV during Transfer

What about reordering of global variables, means change the order of the global variable in the variable list, is that also a reinitialization case or not?

Hi,

if I got it the following help information right, then no, reordering IEC variables inside the variable list isn’t a reinitalization case because name, datatype, scope, dimension and definition aren’t changed.

Best regards!

Thank you. Is it true, that if I set some structure member of a global struct variable in a init program of a program, and if I add an member then, automation studio does not automatically recognize that the program is dependent and does not run the init program?

So in that case, if I add an member, then I also have to make a dummy change in the program, so that AutomationStudio transfer this global struct and the program because of the change and let the init program run again?

Hi,

I’m not aware of such a behavior, but honestly spoken there could be some special things maybe because the automatic detection of changes and dependency management inside a whole project can be very complex.

What I know is: if a global variable is declared, but not referenced in any source code, then the variable itself is not installed into the target for optimisation and configuration variant reasons.

But as I understood your question, there’s a global declared complex variable and used partly in the code; and when changing then the definition of the complex variable, the compiler does not recognize that there was a change? Because a task is transferred only, if it was compiled before (and then, depending on the transfer settings you’ve choosen, INIT is executed or not).
I wasn’t able to reproduce this with a simple test, where I have a complex global variable, setting one single member of this variable in the code, and compiled - then I changed the structure definition of the variable, did another compile without changing the code, but AS detected the change of the structure and recompiled the task again as expected.

So maybe I haven’t understood the issue in detail, but in my test the behavior looked normal. In the end, as I said above: I’m not aware of such a behavior, but I can’t swear that it couldn’t happen under special circumstances.

Best regards!