Hello,
I do not think that writing to the gMechDimensions via a Variable is a good idea.
You do not have any control about the synchronicity of the Variable write and the internal calls of the transformation, which with multicore available will also maybe on different cores.
How to use global variable for my custom mechanical system function - Ask Questions / Mechatronics & Motion - B&R Community
In this previous thread i recommended to use the tool-word to pass the information to the system, becuase the system has to expect that if the tool changes the data of transformation changes, and so the call of the Transformations and Tool-Word must be internaly synchnised and they have to cosider this.
If you do only write to a variable, i do not know how the internal dataflow will consider this change.
You have to expect that a lot of calculations are done in parallel with a lot of transformation calls. They are definitly run in parallel in background for different parts of the programm, the pre calculation lookahed is already some lines ahead, maybe with different tool, while the path planer still works on lines with an older tool.
You can try to use a G172 for synchonisation of the interpreter to check if you issue is maybe a timing issue with the change of the value of MethodNumber and the calls timings of the transformation inside the system.
But i would recomment to switch the Value passing via the tool-word.
It is definitly a not supported use case to change gMechDimensions during Runtime from the CNC Program.
Would be interessting if G172 will make any difference to the situation
N41 MethodNumber = 1
N41 G172
Greetings
Michael Bertsch