Only declare the variables first, then connect them in an initialization method.
The idea is the following:
In the VAR section you should only have declarations like:
elapsedTimeProvider : MeasuredTimeProvider; dynamic : PID_Dynamic; controller : DynamicController;
Then in a method of the class, for example Init, you link them together:
dynamic.elapsedTimeProvider := elapsedTimeProvider; controller.openDynamic := dynamic;
You placed something like dynamic.setK(1.0) inside VAR_GLOBAL. Code cannot be executed there. That block only allows variable declarations, so the parser expects ; and throws an error when it encounters ..
Where to set the parameters: Calls such as setK, Ki, Kd, or limits should also be placed in an initialization method like Init, or in the cyclic execution logic. For example you can configure the PID parameters in Init and then call the controller cyclically with something like controller.Next().
How to create multiple objects: Instead of using globals, put the PID logic inside a class or FB and keep dynamic and elapsedTimeProvider as members. Each instance will then have its own controller, allowing you to create multiple PID controllers from the same implementation.
If the cycle time is constant, a lighter option is to use ConstantTimeProvider instead of MeasuredTimeProvider and simply set the cycle time in seconds.
If this resolves your issue, please mark the answer as accepted.
So this configuration should work inside the class.