Reference alias in another unit

Is it possible to reference and use an alias in another unit other than where your sequence exists at? I  want to be able to use that alias as I would with an alias in the same unit where my sequence exists (i.e. not using dynamic references).

Here's my situation:

I have two units with aliases. I’m running a SFC with those aliases.  UNIT_A and UNIT_B.  The sequence exists in UNIT_B though I need to use an alias in UNIT_A.  I have hundreds of aliases so I don’t want to duplicate them in UNIT_B.

UNIT_A has a an valve that I wish to use and its alias is VLV1.

Inside UNIT_B I created an alias for UNIT_A so I can reference VLV1 from my sequence located in UNIT_B.

I’m able to resolve the name of VLV1 in UNIT_A from my sequence in UNIT_B but I don’t want to use dynamic references as I need to reference 5-6 parameters for  hundreds of valves/controllers.

‘//#UNIT_A#/VLV1.CV’ resolves what VLV1 is configured to which doesn’t help me but I know I can reference items on UNIT_A from UNIT_B.

 

I also tried the following but failed:

‘//#UNITA#/#VLV1#/PV’ – Trying to reference VLV1 with the alias for UNIT_A.  UNITA alias in UNIT_B is configured to UNIT_A.

I also tried to reference VLV1 via an external reference and failed.

‘//UNIT_A/#VLV1#/PV’

I can always create another unit class with the aliases that I need though its not the preferred path forward as i'm duplicating aliases. I don't  want to use module blocks due to the number of modules I reference and not all of my parameters that I need are on the top level.

Any other suggestions if the posted question isn't possible?

Mike

  • Mike,

    One possible solution may be to create one single Alias in Unit_B and have that Alias bound to the CM or EM that resides in Unit_A that you wish to use. This method binds to the actual CM not the alias so it may not work for your application. You can have an Alias in Unit_A and one Alias in Unit_B that reference the same CM or EM. I have done this with two different units referencing the same EM.

    There would be an issue with ownership but as long as you're not trying to use the device or EM at the same time you should be OK.

    Hopefully this helps.

    James
  • Aliases are resolved when the "code" is generated and downloaded to the controller and don't function like dynamic references as I think you are wanting them to work.

    Aliases need to reside on the Unit that the object is located under (Phase, EM, CM, etc) so you would need VLV1 to be alias on UNIT_B as well and resolved like it is done on UNIT_A.

    You could get what the alias is resolved to on UNIT_A by using '//UNIT_A/VLV1.CV' but you can't use that as an alias from UNIT_A in UNIT_B logic unless you use this reference to setup dynamic reference(s).

    You could have a single Unit Class with all the possible aliases or you need to duplicate the aliases for both unit classes if you can't put into a single class, otherwise you are back to the dynamic references which I would highly discourage for this need.