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...

Parents
  • 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)
Reply
  • 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)
Children
No Data