# Opc rate Write data for 10ms

**URL:** <https://forum.inductiveautomation.com/t/opc-rate-write-data-for-10ms/66181>\
**Category:** Module Development\
**Tags:** ignition81\
**Created:** [November 7, 2022, 11:40am UTC](https://forum.inductiveautomation.com/t/opc-rate-write-data-for-10ms/66181 "2022-11-07T11:40:34Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![448719222](https://avatars.discourse-cdn.com/v4/letter/4/71e660/32.png) [@448719222](https://forum.inductiveautomation.com/u/448719222)\
**Post date:** [November 7, 2022, 11:40am UTC](https://forum.inductiveautomation.com/t/opc-rate-write-data-for-10ms/66181/1 "2022-11-07T11:40:34Z")

</div>

```auto
            UaVariableNode node = UaVariableNode.builder(getNodeContext()).setNodeId(deviceContext.nodeId(nodeId)).setBrowseName(deviceContext.qualifiedName(formattedName)).setDisplayName(new LocalizedText(formattedName)).setDataType(v.getNodeId()).setTypeDefinition(Identifiers.BaseDataVariableType).setAccessLevel(AccessLevel.READ_ONLY).setUserAccessLevel(AccessLevel.READ_ONLY).build();

```

```auto
      new Thread(() -> {
                    for (int i = 0; i < 100000; i++) {
                        node.setValue(new DataValue(new Variant(-i)));
                        try {
                            Thread.sleep(10);
                        } catch (InterruptedException e) {
                            throw new RuntimeException(e);
                        }
                    }

                }).start();

```

When reading the tag value, it is not timely. How to achieve this

---

<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:** [November 7, 2022, 1:15pm UTC](https://forum.inductiveautomation.com/t/opc-rate-write-data-for-10ms/66181/2 "2022-11-07T13:15:30Z")

</div>

I've not had _ **consistent** _ success running anything that fast in Ignition. If you are willing to accept occasional longer hiccups from garbage collection, 10-20ms pace should be do-able.

However, I think your real problem is that you are writing values directly into the node. I've only done similar high-speed operations writing to a driver's `SubscriptionItem`. Without a subscription (tag group pace) to indicate the allowed timing, your writes are probably not propagating. (Subscription pace is defined to mean _ **no faster** _ than given, not _ **this fast** _.)

---

<div class="post-metadata">

**Author:** ![448719222](https://avatars.discourse-cdn.com/v4/letter/4/71e660/32.png) [@448719222](https://forum.inductiveautomation.com/u/448719222)\
**Post date:** [November 7, 2022, 1:38pm UTC](https://forum.inductiveautomation.com/t/opc-rate-write-data-for-10ms/66181/3 "2022-11-07T13:38:14Z")

</div>

There are only a few opc points, but the response is required to be fast. Now the write value is missing in the tag,

Where is the SubscriptionItem configured

---

<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:** [November 7, 2022, 1:51pm UTC](https://forum.inductiveautomation.com/t/opc-rate-write-data-for-10ms/66181/4 "2022-11-07T13:51:25Z")

</div>

You don't create or configure a SubscriptionItem in your driver. Your driver is _ **given** _ a SubscriptionItem by the OPC Server. That item will include the pace you are expected to use.

Your driver should be adding a listener to the `DriverSubscriptionModel` to be informed when OPC tags are created/destroyed that point at your driver.

---

<div class="post-metadata">

**Author:** ![448719222](https://avatars.discourse-cdn.com/v4/letter/4/71e660/32.png) [@448719222](https://forum.inductiveautomation.com/u/448719222)\
**Post date:** [November 7, 2022, 2:04pm UTC](https://forum.inductiveautomation.com/t/opc-rate-write-data-for-10ms/66181/5 "2022-11-07T14:04:28Z")

</div>

Where is DriverSubscriptionModel configured

---

<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:** [November 7, 2022, 2:05pm UTC](https://forum.inductiveautomation.com/t/opc-rate-write-data-for-10ms/66181/6 "2022-11-07T14:05:06Z")

</div>

> [@pturmel](#):
>
> Your driver should be adding a listener to the `DriverSubscriptionModel` to be informed when OPC tags are created/destroyed that point at your driver.

This is legacy driver API stuff. In the new Device API it's part of the Device interface.

> <https://github.com/inductiveautomation/ignition-sdk-examples/blob/4c4552578fec89082a207cca68f36d27e920c7d1/opc-ua-device/opc-ua-device-gateway/src/main/java/com/inductiveautomation/ignition/examples/tagdriver/ExampleDevice.java#L190-L208>

---

<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:** [November 7, 2022, 2:07pm UTC](https://forum.inductiveautomation.com/t/opc-rate-write-data-for-10ms/66181/7 "2022-11-07T14:07:10Z")

</div>

@448719222 I'm not sure you understand how OPC UA subscriptions work.

The client requests a publishing interval for the subscription and a sampling interval for the items. When Ignition is the client these parameters are controlled by the rate of Tag Group the OPC tags are in. You will not see values update faster than this.

---

<div class="post-metadata">

**Author:** ![448719222](https://avatars.discourse-cdn.com/v4/letter/4/71e660/32.png) [@448719222](https://forum.inductiveautomation.com/u/448719222)\
**Post date:** [November 7, 2022, 2:19pm UTC](https://forum.inductiveautomation.com/t/opc-rate-write-data-for-10ms/66181/8 "2022-11-07T14:19:16Z")

</div>

![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/d/1/d165d9c713811603015a15be88ed84c5e2c1bcc5.png)  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/3/e/3e5865943fae4560744a8d1425789050843625aa.png)  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/0/e/0e4fc221279f4a0152537afbcbaf06ceb6efae09.png)  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/4/f/4f581bf59a604a8a4c959c2588a8cd5b5bfe07dc.png)  
Where can I subscribe

---

<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:** [November 7, 2022, 2:41pm UTC](https://forum.inductiveautomation.com/t/opc-rate-write-data-for-10ms/66181/9 "2022-11-07T14:41:44Z")

</div>

You already subscribed when you created the "test" tag in the Ignition tag browser.

It subscribed at the rate dictated by the tag group it belongs to.

Your script is just reading the current _Ignition_ tag value, which is only going to update as fast as the tag group rate in the best case. You are not reading directly from the OPC server. If you changed the script to use `system.opc.readValue` instead you would see the value update more frequently.

---

<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:** [November 7, 2022, 2:47pm UTC](https://forum.inductiveautomation.com/t/opc-rate-write-data-for-10ms/66181/10 "2022-11-07T14:47:01Z")

</div>

> [@Kevin.Herron](#):
>
> the new Device API

I'll get there before too long. 😅

---

<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:** [November 7, 2022, 2:48pm UTC](https://forum.inductiveautomation.com/t/opc-rate-write-data-for-10ms/66181/11 "2022-11-07T14:48:31Z")

</div>

Probably just in time for it to change in a backwards incompatible way 😛

---

<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:** [November 7, 2022, 2:50pm UTC](https://forum.inductiveautomation.com/t/opc-rate-write-data-for-10ms/66181/12 "2022-11-07T14:50:43Z")

</div>

Heh. I'll take my lumps. The OPC interfaces are the easiest parts of my drivers. Doesn't look like that is changing.

---

<div class="post-metadata">

**Author:** ![448719222](https://avatars.discourse-cdn.com/v4/letter/4/71e660/32.png) [@448719222](https://forum.inductiveautomation.com/u/448719222)\
**Post date:** [November 7, 2022, 2:54pm UTC](https://forum.inductiveautomation.com/t/opc-rate-write-data-for-10ms/66181/13 "2022-11-07T14:54:55Z")

</div>

> [@Kevin.Herron](#):
>
> system.opc.readValue

i see
