I need help in writing a script to dynamically update expression in a tag

Hello Everyone,

I need a script that will dynamically change the values of the expression tag using the dataset in a memory tag.
In this example, for PCS 23 CB10 DC current tag, I need the module # and the CT # to be updated from the dataset in the memory tag.

From the data set, "InverterNumber" is my PCS #(which is 23 in this example), "CBNumber" is my CB #, "ModuleNumer" should update the Module # in the expression and "DCInput" should update the CT # in the expression.

So for this PCS, the expression in the DC Current tag should update to Module 2 and CT 4.
I have 32 PCS the script should loop through. Thanks

Seems to me you should be using reference tags, and simply write to the source configuration property according to your dataset.

(Please edit your title to actually reflect your question.)

Looks quite clear that you're managing inverters at a utility-scale PV or BESS plant. Have you considered nesting UDTs to create these structures? It makes things much easier.

Our UDTs for a few inverter vendors use parent/child inheritance and nesting. We have namespace UDTs that are vendor-agnostic, then we have vendor-specific UDTs for PCS, Module/Inverter, and DC input (CB in your model). Then, for particular models, we have child UDTs for module (which includes n nested DC inputs of the model-specific child) and PCS (which includes x nested modules of the model-specific child). This has proven highly flexible as we integrate new models and variants from existing inverter vendors in our library.

2 Likes