# Specific integer within an OPCarray

**URL:** <https://forum.inductiveautomation.com/t/specific-integer-within-an-opcarray/95332>\
**Category:** Ignition\
**Created:** [August 29, 2024, 4:09pm UTC](https://forum.inductiveautomation.com/t/specific-integer-within-an-opcarray/95332 "2024-08-29T16:09:29Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jonathan\_Golden1](https://avatars.discourse-cdn.com/v4/letter/j/34f0e0/32.png) [@Jonathan\_Golden1](https://forum.inductiveautomation.com/u/Jonathan_Golden1)\
**Post date:** [August 29, 2024, 4:09pm UTC](https://forum.inductiveautomation.com/t/specific-integer-within-an-opcarray/95332/1 "2024-08-29T16:09:29Z")

</div>

I have an array inside my OPC that I am currently pulling the entire array to my edge node and then to utilizing reference tags to get the data from the array.

How can I pull a specific integer from the array without utilizing the reference tags?

Example of my reference tag:

```python
{
  "valueSource": "reference",
  "rawHigh": 100.0,
  "scaleMode": "Off",
  "opcItemPath": "[~]New Folder/Generator Modbus Array 2[6]",
  "dataType": "Float4",
  "sourceTagPath": "[~]New Folder/Generator Modbus Array 2[6]",
  "name": "Apparent Power",
  "tagType": "AtomicTag",
  "scaledHigh": 10.0,
  "opcServer": "PLC Next"
}

```

Example of my array tag:

```python
{
  "valueSource": "opc",
  "opcItemPath": "nsu\u003dhttp://phoenixcontact.com/OpcUA/PLCnext/GlobalDataSpace/;s\u003dArp.Plc.Eclr/G250_Mapping1.G250_RegisterValue2",
  "dataType": "Int4Array",
  "name": "Generator Modbus Array 2",
  "tagType": "AtomicTag",
  "opcServer": "PLC Next"
}

```

I would like to get the integer at address 6 from the array, is that possible?

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [August 29, 2024, 4:38pm UTC](https://forum.inductiveautomation.com/t/specific-integer-within-an-opcarray/95332/2 "2024-08-29T16:38:34Z")

</div>

Does the server expose the array elements as their own tags?

---

<div class="post-metadata">

**Author:** ![Jonathan\_Golden1](https://avatars.discourse-cdn.com/v4/letter/j/34f0e0/32.png) [@Jonathan\_Golden1](https://forum.inductiveautomation.com/u/Jonathan_Golden1)\
**Post date:** [August 29, 2024, 4:49pm UTC](https://forum.inductiveautomation.com/t/specific-integer-within-an-opcarray/95332/3 "2024-08-29T16:49:48Z")

</div>

Unfortunately it does not. I am not able to expose them as their own tag.

Utilizing OPC expert I can see the values inside the array however.

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [August 29, 2024, 4:50pm UTC](https://forum.inductiveautomation.com/t/specific-integer-within-an-opcarray/95332/4 "2024-08-29T16:50:07Z")

</div>

What's wrong with the reference tag approach?

---

<div class="post-metadata">

**Author:** ![Jonathan\_Golden1](https://avatars.discourse-cdn.com/v4/letter/j/34f0e0/32.png) [@Jonathan\_Golden1](https://forum.inductiveautomation.com/u/Jonathan_Golden1)\
**Post date:** [August 29, 2024, 5:00pm UTC](https://forum.inductiveautomation.com/t/specific-integer-within-an-opcarray/95332/5 "2024-08-29T17:00:29Z")

</div>

The PLC is having issues with the large data pull. This is an operating system so I'm trying to avoid any online logic changes.

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [August 29, 2024, 5:03pm UTC](https://forum.inductiveautomation.com/t/specific-integer-within-an-opcarray/95332/6 "2024-08-29T17:03:05Z")

</div>

Reference tags aren't adding any load. You're already reading the whole array, at once as one tag. That's your only option if the server doesn't expose the elements as their own Nodes in the address space.

---

<div class="post-metadata">

**Author:** ![Jonathan\_Golden1](https://avatars.discourse-cdn.com/v4/letter/j/34f0e0/32.png) [@Jonathan\_Golden1](https://forum.inductiveautomation.com/u/Jonathan_Golden1)\
**Post date:** [August 29, 2024, 5:10pm UTC](https://forum.inductiveautomation.com/t/specific-integer-within-an-opcarray/95332/7 "2024-08-29T17:10:15Z")

</div>

That's what I was afraid of.

I was hoping to not read the entire array and only the values necessary.

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [August 29, 2024, 5:18pm UTC](https://forum.inductiveautomation.com/t/specific-integer-within-an-opcarray/95332/8 "2024-08-29T17:18:11Z")

</div>

Unless the server supports some hidden syntax (like appending `.0` or `[0]` to the end of the OPC Item Path (NodeId) I don't think you'll be able to.

Ideally you would have some control over how the data is modeled in the server and do something better than dump modbus registers into a large array, even if the elements are exposed.

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [August 29, 2024, 5:23pm UTC](https://forum.inductiveautomation.com/t/specific-integer-within-an-opcarray/95332/9 "2024-08-29T17:23:36Z")

</div>

When something is described as a "modbus array", I'd be inclined to try the modbus driver.
