another idea.
create a new tag to have the "corected version"
so you will have two tags in your tags view:
yourOriginalTag ( data from where ever)
yourOriginalTag_corrected ( HMI tag will be changed by c#)
Code:
int minNum = 12 ;
int maxNum = 123 ;
var origTag = Globals.Tags.yourOriginalTag ;
var cappedTag = Globals.Tags.yourOriginalTag_corrected;
if (Globals.Tags.yourOriginalTag.Value < minNum )
{
Globals.Tags.yourOriginalTag.Value = minNum ;
}
if (Globals.Tags.yourOriginalTag.Value > maxNum )
{
Globals.Tags.yourOriginalTag.Value = maxNum ;
}
use the corrected in the textbox
and call that from some periodic/timed function from the screen ?