# Configuring clamp using member within UDT

**URL:** <https://forum.inductiveautomation.com/t/configuring-clamp-using-member-within-udt/33175>\
**Category:** Ignition\
**Created:** [March 17, 2020, 6:42pm UTC](https://forum.inductiveautomation.com/t/configuring-clamp-using-member-within-udt/33175 "2020-03-17T18:42:52Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ijustdunnoaname1](https://avatars.discourse-cdn.com/v4/letter/i/c67d28/32.png) [@ijustdunnoaname1](https://forum.inductiveautomation.com/u/ijustdunnoaname1)\
**Post date:** [March 17, 2020, 6:42pm UTC](https://forum.inductiveautomation.com/t/configuring-clamp-using-member-within-udt/33175/1 "2020-03-17T18:42:52Z")

</div>

I’m using a UDT with the following members:  
Setpoint  
SP\_HiLimit  
SP\_LoLimit

Within the UDT, I’d like to set the “EngHigh” property equal to the tag SP\_HiLimit and I’d like to set the “EngLow” property equal to the tag SP\_LoLimit.value

I’ve tried to do this within the UDT by doing the following:  
In the configuration for the member “Setpoint” , I’ve bound “EngHigh” to {SP\_HiLimit} and “EngLow” to {SP\_LoLimit}. I’ve also tried {SP\_HiLimit.value} and {SP\_LoLimit.value}. Neither of which worked.

I’ve verified the value for the high limit tag is 450, but when I enter any setpoint over 100, I’m getting an out of range alarm. It doesn’t appear to be recognizing the {tag} as a numeric value.

---

<div class="post-metadata">

**Author:** ![Brian](https://avatars.discourse-cdn.com/v4/letter/b/97f17d/32.png) [@Brian](https://forum.inductiveautomation.com/u/Brian)\
**Post date:** [April 4, 2020, 10:07pm UTC](https://forum.inductiveautomation.com/t/configuring-clamp-using-member-within-udt/33175/2 "2020-04-04T22:07:45Z")

</div>

I’m not on V8, so I don’t know if the tag system allows binding like that in the new version, but on 7.9 it doesn’t.

I think what I’d do is use a tag change script on the SP\_HiLimit and SP\_LowLimit tags that would use something like `system.tag.writeAsyc(tagpath/Setpoint.EngHigh, tagpath/SP_HiLimit)` to change the appropriate property on the Setpoint tag.

---

<div class="post-metadata">

**Author:** ![JordanCClark](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jordancclark/32/83362_2.png) [@JordanCClark](https://forum.inductiveautomation.com/u/JordanCClark)\
**Post date:** [April 6, 2020, 4:32pm UTC](https://forum.inductiveautomation.com/t/configuring-clamp-using-member-within-udt/33175/3 "2020-04-06T16:32:15Z")

</div>

@Brian is correct that you can’t directly bind those to other tags, and that a tag change script in SP\_HiLimit and SP\_LoLimit would be in order. In v8 you would use:

For SP\_HiLimit

```python
system.tag.writeBlocking(["[.]Setpoint.EngHigh"], [currentValue.value])

```

For SP\_LoLimit

```python
system.tag.writeBlocking(["[.]Setpoint.EngLow"], [currentValue.value])

```

If you want to avoid the Out of Range error and have Setpoint actually clamp the value at the limits, then you would skip both of the above, and have this tag change script in Setpoint:

```python
	hiLimit, loLimit = [tag.value for tag in system.tag.readBlocking(['[default]test/Clamp Test/SP_HiLimit', '[default]test/Clamp Test/SP_LoLimit'])]
	value = currentValue.value
	if value < LoLimit:
		system.tag.writeBlocking([tagPath], [loLimit])
	if value > hiLimit:
		system.tag.writeBlocking([tagPath], [hiLimit]) 

```

EDIT: Forgot to mention that you would turn clamping off in the tag. 😉
