Configuring clamp using member within UDT

I’m using a UDT with the following members:

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.

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.

@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

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

For SP_LoLimit

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:

	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. :wink: