Delay management
Original instructions
Description
In the processes to which the controller addresses this controller, the delay is:
Principle
These two cases are dealt with using a register (buffer) of a size that may be parametrized. Depending on the size of this register, it will be possible to sample either all of the sample periods, or one period out of two, or one period out of three, etc.
It is possible to increase or reduce the delay T_DELAY during the execution of the program. The new delay is applied immediately, as long as it is compatible with the size of the register. The delay sampling period remains unchanged.
If the value T_DELAY becomes too great in relation to the size of the register, it becomes impossible to adequately store the input values to reach the required delay, if the sampling is carried out during the same period. The delay sampling period is therefore recalculated and the output is only valid after a period equal to a new delay. In order to avoid this problem, we advise you to size the register, taking into account any increases in the delay T_DELAY.
If the delay decreases, by default the sampling does not change. However, it is possible to command a new sampling calculation if necessary.
In the case of a dynamic modification of the time of the task or the sampling period, the output is only valid after a period equal to the delay.
Any dynamic modification T_DELAY between 0 s and 30 s is immediately taken into account without changing the sampling of the register.
Example
Calculation example
Sampling period
T_ECH = 300 ms
Size of the delay register
50
Delay
T_DELAY = 25 s
The delay register is therefore sampled every 2 T_ECH
50 x 2 x 0.3 = 30 s > 25 s