Updating External Reference Path via String in Calc Block

Have existing control modules that are doing a bunch of environmental averaging.  They are all pathed to separate modules.  I am wanting to create a composite & a custom faceplate to display all of them together.  Not sure exactly how to write to the external path in a parameter block from a Calc Block.

So what I am wanting to do is enter a tag# 123456  Then use a calc block to write that string for the 7 individual external references that I need for the associated tag.  Ex.

AI-12345/PV.CV

AI-12345-B1S/PV.CV

AI-12345-B1M/PV.CV

AI-12345-B15M/PV.CV

AI-12345-B1H/PV.CV

ETC.  I have to do this for 180+ modules and I know I can do it with a bulkedit, but want to create a composite so I can class it & they be the same for all.

I have to code to make the string and I can write it to a parameter as the string value.  But I can't figure out how to path that string to the parameter external reference so it will go get the right data.  Thanks in advance for your help.

  • There's a special type of parameter called a Dynamic Reference parameter that you have to use for this. It has a field, "$REF", that represents the address of the parameter you're looking for. If I remember correctly, it uses the full reference syntax. Using the first example parameter you provided, referencing an external module would require you write the string "//AI-12345/PV.CV" to the dynamic reference .$REF field. There's some tips in books online if you look up dynamic references.
  • In reply to MCrisler:

    Thanks for your help, that was exactly what I needed.

    my calc block has the following line of code that wrote to a input parameter set as a dynamic reference.  Then I tied an output parameter to the input parameter so I could see the live value instead of clicking the block.  Thank you sir.

    '^/PARAM1.$REF' := "//AI-" + '^/TAG.CV' + "-B15S/15SEC_AVG.CV";

    I just replicated this line with the additional tag syntax and it works great. Now I just have to  when I update the Tag.CV it propagates down.  This will make the class & dynamo a lot easier without changing any of the calc modules that environmental references.

    Much appreciated.

  • In reply to Jason.Brumfield:

    If TAG parameter is a number this won't work as shown, you will need to have TAG be a string because the controller will add .### to a number unless you do trunc and/or round to the number to integer (even if the parameter is an integer type).

    Use watchit and type in the "MODULENAME/PARAM1.$REF" and see what it shows where module name is the name of the module with this logic. It should be in a format like //AI-#####-B15S/15SEC_AVG if it is pathing to an external module.