Create Array Tag from AB Logix PLC in NI OPC Server

Updated Apr 20, 2023

Environment

Software

  • OPC Servers

Other

  • Allen-Bradley Logix 5000 PLC
  • RSLogix 5000 PLC

I am able to auto-generate tags in NI OPC Server for my Logix5000 PLC.  It pulls in all the tags, but for arrays I have created in RSLogix, it pulls the array in as a tag group and then within that tag group there are tags generated for each element of the array.  I want to be able to read in the whole array from my Logix5000 PLC instead of reading in each element individually.

  1. Since you already have auto-generated tags in NI OPC Servers for the array of interest, open up one of the tags for an element of the array.  For example, if we had an array called FlowArray, we may see something like the image below. 
  2. Copy the address field of this array-element tag.  In the image from step 1, you would copy Program:MainProgram.FlowArray_x[0] 
  3. Right-click on the Device in NI OPC Servers and create New Tag
  4. In the Tag Properties window, paste in the address you copied from step 2.  Based on the image in step 2, that would look like Program:MainProgram.FlowArray_x[0]. 
  5. Delete the square brackets and number within the square bracket.  Replace it with curly brackets and the length of the array within the curly brackets.  For example, if FlowArray_x had 50 elements in it, the address will look like Program:MainProgram.FlowArray_x{50}.  
  6. Click Apply and OK.
  7. Open Quick Client to check that the array is being read in from the PLC correctly.
  8. If the tags are not reading in correctly in Quick Client, check the Driver Help to make sure your syntax is correct for the Data Type used: 
    1. Help >> Driver Help... 
    2. Select Allen-Bradley ControlLogix Ethernet >> OK 
    3. Navigate to Allen-Bradley ControlLogix Ethernet >> Address Descriptions >> Logix Tag-Based Addressing >> Address Usage >> Logix Advanced Addressing

Additional Information

The Logix5000 PLC uses tag-based addressing, so there are no address locations used to identify where each tag is located.  Instead, the tags are abstracted into their tag names.  This is why the addressing for the Logix5000 is different than other address-based PLCs when it comes to creating tags in NI OPC Server.