amarks
December 19, 2025, 4:39pm
1
Is this going to work to have a parameter binding offset bound to another parameter?
ns=1;s=[{Device_ascpt}]{Legacy_ascpt}SLUDGE_STG_ANALOGS{Analogs_ascpt}[{Hr_Index_ascpt+{Hr_Mn_Offset_ascpt}}]
If not, how do I do this? Sometimes it’s +10, other times it’s +6
vtran
December 19, 2025, 5:04pm
2
should just be {Hr_Index_ascpt + Hr_Mn_Offset_ascpt}, I think. No need for nested curly braces
amarks
December 19, 2025, 5:07pm
3
No, I just get a general config error with that
Not sure but this might work:
{"Hr_Index_ascpt" + "Hr_Mn_Offset_ascpt"}
vtran
December 19, 2025, 5:21pm
5
Weird, seems to work fine for me
try {Hr_Index_ascpt} and {Hr_Mn_Offset_ascpt} in your binding by themself and see if you get the parameter value by them self at all?
1 Like
amarks
December 19, 2025, 5:23pm
6
Ok, ya it worked. By binding on the parent UDT was messed up. Thanks!
1 Like
Nice! I never knew this was possible
UDT parameter "bindings" like this are weird . They run way before anything else in the stack, essentially by doing literal string replacement on the raw configuration, before anything has had a chance to run.
This is both powerful, and headache inducing (see the ~bimonthly posts where someone asks why they can't use "{}".format() in a UDT script).
amarks
December 19, 2025, 10:43pm
11
everyone just ignores this, myself included
1 Like
I’d forgotten about that one. I think it’s only an issue if you put names inside the braces e.g. “{0}”.format(…) compared to "{}”.format(…)
I got Claude to find relevant posts for an example:
It seems like pythonic string formatting is broken within tag-change event scripts.
For example, writing
value = currentValue.value
ack_value = "{0}_ACK".format(str(value)) # unnecessary str() call, but used for comparison only
does not work, but
value = currentValue.value
ack_value = str(value) + "_ACK"
does. We get no errors on the gateway and cannot run any code above or below the str().format() call until it is removed. Is the Jython environment within the tag-change script a diff…