Tag Clamping / value limiting

I have an OPC tag referencing your SLC simulator driver as follows:

I am setting the tag value through a numeric text field component.
I want to limit the timer’s preset range to 0-30 seconds.
I seem to be able to enter larger values, regardless of the high eng unit value or the scaling and clamping settings.

Shouldn’t one or the other limit the values I can enter for the tag?

Is there another preferred mechanism for limiting available entry ranges from the HMI?

The engineering unit on the tag is simply just extra meta information and doesn’t affect the behaviour of the tag. However, if you have scaling and clamping setup the clamping should force the value to be within range.

The recommended way of configuring this is to use the min max range of the numeric text field or other entry component. That way it can show an error or not allow values outside of the range to get written down. You can bind the eng high and low meta properties of the tag to the min and max properties of the numeric text field so that you can edit the low and high on the tag rather than the component. If you drag the tag into the screen and create a numeric text field it will setup the binding automatically for you.

Raw and Scaled ranges both set 0-30, with linear scaling and clamped mode=“Both”. In this case it still allows me to set the tag value to 35 secs, etc.

I tried dragging the tag into the window as you suggest, but I don’t see that it created any automatic bindings to the min/max parameters of the numeric text field component. It works the same as my other one.
I’ll keep trying.

How do I access the min/max parameters of the numeric text field to create a binding? The property editor window for it seems to only allow access to a very limited subset of the available parameters.


OK - I found the filter control in the property editor. That makes the other properties available. The bindings were set automatically for the dragged-in tag, but Use Bounds defaulted to False. Now that I’ve turned that on, the entry limiting works as I expect.

So that resolves my issue, but I still don’t understand why the clamping feature isn’t working.

Yeah, I will look into the clamping issue. Glad you got it working and thanks for the report. :smiley:


Yes, it turns out that clamping isn’t quite working correctly right now. What you tried to do should work- and it has been fixed for 7.2. The problem was that if Raw==Scaled, it figured there was nothing to do, and avoided performing the scaling to increase performance. Unfortunately it didn’t take into account the clamp mode.

As a work around, you can make your scaled value very very slightly different, not enough to really modify your value, and it should work. For example, instead of “30” for your raw high, make it “30.00001”.