Get tagname as a string from partial tag assignment in popup

I'm using equipment (not that it really matters) and citect 8.0.

I have a single function that opens my popups (can you format code on this forum?):

```

INT
FUNCTION
DspEquipPopup(STRING sEquipName)
  STRING sEquipType
  STRING sPopupWindow

  sEquipType = EquipGetProperty(sEquipName, "Type")

  SELECT CASE sEquipType
    CASE "Unit"
      sPopupWindow = "!Unit"
    CASE "AnalogueInput"
      sPopupWindow = "!AnalogueInput"
  END SELECT

  IF sPopupWindow = "" THEN
    Message("Display Popup", "Could not find a popup window to display for equipment.", 48)
    RETURN -1
  END

  Ass(-2, "Equip", sEquipName, 0) // THIS IS REALLY THE ONLY PART OF INTEREST
  DspPopupCursor(sPopupWindow, 2 + 4 + 8 + 64 + 256 + 512 + 1024)
  WinTitle(sEquipName)
END

```

In my components, I would the use something like `?Equip?_STS` to read the tags for that device/equipment.

What I want to know though, is how can I get that tag name as a string? E.g. if the sEquipName passed in is "SE_AV_01" then I need to produce the string: "SE_AV_01_STS".

I've tried many different things:

AssGetProperty(?Equip?_STS, "TagName")

?STRING Equip? + "_STS"

and other (dumber) variants. I'm out of ideas...

  • Nevermind, I'm an idiot.

    `AssGetProperty("?Equip?_STS", "TagName")`
  • Just out of curiosity. Why still work work with tagbased association? You can now use the equipment.item notation. On the popup use for instance: ?__EquipmentRef?.AutoCmd
    Before opening the popup, just use Ass(-2, "__EquipmentRef", sEquipment, 0). If you start using this ?__EquipmentRef?, upgrade and start using the V2018 Workspace, the popup is automatically associated. This could remove a lot of Cicode (depending on the number of typicals you have of course)

    If you really want the name of the tag, just use:
    sTag = AssInfoEx("?__EquipmentRef?.AutoCmd", 0)
    sEquipment = AssInfoEx("?__EquipmentRef?.AutoCmd", 22)
    sItem = AssInfoEx("?__EquipmentRef?.AutoCmd", 25)
  • I would normally use this, however this project is still mostly using the old standards without equipment, so using the tag name is far more flexible and will work with both equipment and non-equipment tags, if I needed to use any of my new popups with the old tags.

    Also, by the same token, why are you still using the old `AssInfoEx` function, as opposed to the new `AssGetProperty`? https://softwareforums.aveva.com/cfs-file/__key/system/emoji/1f609.svg (these old MSN-emoticons are a bit of a blast from the past!)

    Unknown said:
    Before opening the popup, just use Ass(-2, "__EquipmentRef", sEquipment, 0). If you start using this ?__EquipmentRef?, upgrade and start using the V2018 Workspace, the popup is automatically associated. This could remove a lot of Cicode (depending on the number of typicals you have of course)

    This function is basically doing just that, except it's a single function that I plan to use to open popups for any and all equipment types. Hence it first looks up the equipment type and assigns the popup window name associated with it. Unless I mis-understand what you mean? (I haven't used Citect for a little while since this project) Other SCADAs are far more user and integrator-friendly..