News:

  • October 13, 2026, 07:28:50 AM

Login with username, password and session length

Author Topic: Cross References for UDT arrays  (Read 10916 times)

ATU

  • Internal Dev
  • Hero Member
  • ****
  • Posts: 2126
  • YKPAIHA
    • ATU, Inc.
Cross References for UDT arrays
« on: June 10, 2020, 10:56:20 AM »
Unless I am missing something,  array variables that have a  variable for an index in the program don't show up in the cross reference.  I noticed this  for a UDT, didn't check other types.  It works for the find, but not in the Xref that I can tell. Didn't see any options to enable that.

franji1

  • Bit Weenie
  • Host Moderator
  • Hero Member
  • *****
  • Posts: 3848
    • Host Engineering
Re: Cross References for UDT arrays
« Reply #1 on: June 10, 2020, 01:09:46 PM »
I could not duplicate it.  I created a UDT called MyStruct with 2 fields (bit, numeric), a block called MyBlock, and a heap-item called MyHeapItem of that UDT.  Make sure your XRef View scoping is set up properly (see attachment).

ATU

  • Internal Dev
  • Hero Member
  • ****
  • Posts: 2126
  • YKPAIHA
    • ATU, Inc.
Re: Cross References for UDT arrays
« Reply #2 on: June 10, 2020, 02:17:11 PM »
Oh wait, the logic was in a subroutine. Try that.

franji1

  • Bit Weenie
  • Host Moderator
  • Hero Member
  • *****
  • Posts: 3848
    • Host Engineering
Re: Cross References for UDT arrays
« Reply #3 on: June 10, 2020, 03:09:25 PM »
Worked fine in 2.7.4.  Check your XRef View scope settings.  Show a picture of the whole XRef view so I can see if you are scoping the XRef filter mechanism.  See my picture's toolbar group and make sure all the buttons are pressed like I have them.

Also, the logic must be ACCEPTed to be in the XRef View.  Until you Accept successfully, the XRef does not look at edited rungs.

ATU

  • Internal Dev
  • Hero Member
  • ****
  • Posts: 2126
  • YKPAIHA
    • ATU, Inc.
Re: Cross References for UDT arrays
« Reply #4 on: June 10, 2020, 03:46:26 PM »
I think I see my issue. When I put my cursor on MyBlock[V0].bit  it looks specifically for that pointer in the cross reference. But  I put the cursor on MyBlock1.bit and I only got the references to index 1. I was expecting that plus any MyBlock[xx].bit references in the program.  Other PLC programing packages give you that and that is what I expected to see.

franji1

  • Bit Weenie
  • Host Moderator
  • Hero Member
  • *****
  • Posts: 3848
    • Host Engineering
Re: Cross References for UDT arrays
« Reply #5 on: June 10, 2020, 03:51:18 PM »
That's what I said originally.  Make sure the scope of your XRef View is correct (see the highlighted button state in my picture).  You can have it report focus on the block cursor, or just show reference within the current rung, etc.

Not the first time someone has ran into this.  I typically like a full XRef.  You can actually change those defaults in the XRef view Options dialog.  I highly recommend it so this does not happen in the future (unless you like the block cursor position only reporting and/or limited logic scoping).

franji1

  • Bit Weenie
  • Host Moderator
  • Hero Member
  • *****
  • Posts: 3848
    • Host Engineering
Re: Cross References for UDT arrays
« Reply #6 on: June 10, 2020, 03:54:32 PM »
Probably what you want (see attachment, and I mean it this time :D)

ATU

  • Internal Dev
  • Hero Member
  • ****
  • Posts: 2126
  • YKPAIHA
    • ATU, Inc.
Re: Cross References for UDT arrays
« Reply #7 on: June 10, 2020, 04:07:29 PM »
It was there, I had it turned on , but I didn't scroll down in the list to find it.  I didn't expect to see it listed that way.  I expected to see it listed with the individual index.  I have 32 positions in the array and the indexed instances are listed after #32. I didn't think to keep scrolling. I had not looked at this program in months, its pretty large and had no idea where to look.

Suggestion, maybe if there are variable indexed references, it would convenient to have a link on the last line of the references for the individual indices,  stating that there are "Other possible array references" and clicking on it takes you to the first one in the cross reference for that variable.  That would notify me that hey I used this with a pointer and its in other places.