Suppose that you have created an numeric indicator i.e. K of UINT16.
At code initialization, input 0 to K.
During main code execution...
At when new K value is to be updated, simply write that computed value to K's local variable.
In other word, upon initialized the K value before the main code, simply "right-click" K and create a local variable of it. Then, update new K's value with this local variable.
PS: Global Variable could also be used in this case.