# Calculations on UDT parameters using binding problem

**URL:** <https://forum.inductiveautomation.com/t/calculations-on-udt-parameters-using-binding-problem/86828>\
**Category:** Ignition\
**Created:** [March 5, 2024, 2:41pm UTC](https://forum.inductiveautomation.com/t/calculations-on-udt-parameters-using-binding-problem/86828 "2024-03-05T14:41:33Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Michal\_Goralczyk](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/michal_goralczyk/32/55564_2.png) [@Michal\_Goralczyk](https://forum.inductiveautomation.com/u/Michal_Goralczyk)\
**Post date:** [March 5, 2024, 2:41pm UTC](https://forum.inductiveautomation.com/t/calculations-on-udt-parameters-using-binding-problem/86828/1 "2024-03-05T14:41:33Z")

</div>

Hello,

I have created a UDT that has several parameters by which the appropriate register for modbus addressing in Tag is calculated.

When the UDT is used and I create a manual instance, I can see in the path that the address is ok. I tried to generate several instances using wizard but noticed that for the same parameters the address is different. What I mean is that the ending ".0" appears in the path.

I have no idea what it is caused by. I have tried several times to create UDT from scratch and trestart the gateway and I don't know why it keeps appearing.

Formula;  
[Driver]HR{TCU\_Data\_reg+18+TCU\_regs\_qty\*(TCU\_number-1)}

UDT:

```auto
{
  "name": "UDT_Sample",
  "parameters": {
    "TCU_number": {
      "dataType": "Integer"
    },
    "TCU_LastCom_reg": {
      "dataType": "Integer",
      "value": 29500
    },
    "TCU_Data_reg": {
      "dataType": "Integer",
      "value": 30500
    },
    "Modbus_ID": {
      "dataType": "Integer",
      "value": 1
    },
    "TCU_regs_qty": {
      "dataType": "Integer",
      "value": 22
    }
  },
  "tagType": "UdtType",
  "tags": [
    {
      "name": "AI",
      "tagType": "Folder",
      "tags": [
        {
          "opcItemPath": {
            "bindType": "parameter",
            "binding": "[Driver]HR{TCU_Data_reg+16+TCU_regs_qty*(TCU_number-1)}"
          },
          "valueSource": "opc",
          "name": "BatteryVoltage",
          "tagGroup": "Odczyt_10s",
          "tagType": "AtomicTag",
          "engUnit": "mV",
          "opcServer": "Ignition OPC UA Server"
        },
        {
          "opcItemPath": {
            "bindType": "parameter",
            "binding": "[Driver]HR{TCU_Data_reg+18+TCU_regs_qty*(TCU_number-1)}"
          },
          "valueSource": "opc",
          "name": "BatteryCurrent",
          "tagGroup": "Odczyt_10s",
          "tagType": "AtomicTag",
          "opcServer": "Ignition OPC UA Server"
        }
      ]
    }
  ]
}

```

Tag 1 instance created:

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/3/b/3ba7fec8401ddb64e17737ceff976dab7af87bf5.png)

Tag 2 wizard created:

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/d/8/d8a4c3d0e288e3de441920709bffff03d4e792b2.png)

I noticed that in the parameters there is a difference involving the separation of thousands I also tried to enter it interchangeably and the result is different again, I do not know why?

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/c/c/cc430ee8de25e8447cf9bcaebbdca16255664c01.png)

Greetings  
Michał

---

<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:** [March 5, 2024, 3:04pm UTC](https://forum.inductiveautomation.com/t/calculations-on-udt-parameters-using-binding-problem/86828/2 "2024-03-05T15:04:54Z")

</div>

How are you creating the instance? Perhaps with `system.tag.configure()` ?

If so, you must not include your parameters in the `.configure` operation, but use `system.tag.writeBlocking()` afterwards. `.configure()` screws up parameter overrides, changing their data types.

---

<div class="post-metadata">

**Author:** ![Michal\_Goralczyk](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/michal_goralczyk/32/55564_2.png) [@Michal\_Goralczyk](https://forum.inductiveautomation.com/u/Michal_Goralczyk)\
**Post date:** [March 6, 2024, 8:20am UTC](https://forum.inductiveautomation.com/t/calculations-on-udt-parameters-using-binding-problem/86828/3 "2024-03-06T08:20:23Z")

</div>

I use the simplest ways to create a single instance as well as multiple instances.

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/8/6/86ca9b584231659aefcf965c4330216923f80211.png)

Regards  
Michał

---

<div class="post-metadata">

**Author:** ![Michal\_Goralczyk](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/michal_goralczyk/32/55564_2.png) [@Michal\_Goralczyk](https://forum.inductiveautomation.com/u/Michal_Goralczyk)\
**Post date:** [March 6, 2024, 10:06am UTC](https://forum.inductiveautomation.com/t/calculations-on-udt-parameters-using-binding-problem/86828/4 "2024-03-06T10:06:12Z")

</div>

I was discover that UDT instances generated using instance wizard have different type of parameters which may cause the problem. Does anyone know a solution for this?

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/a/d/ad3a82e1c4031d22a74e1f73fbc66ddd220ee2dd.png)

---

<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:** [March 6, 2024, 1:08pm UTC](https://forum.inductiveautomation.com/t/calculations-on-udt-parameters-using-binding-problem/86828/5 "2024-03-06T13:08:23Z")

</div>

> [@Michal\_Goralczyk](#):
>
> different type of parameters

It's a bug in Ignition.

> [@Michal\_Goralczyk](#):
>
> a solution for this?

My prior comment offers a work-around: Use `.configure()` in a script without including parameters. Use `.writeBlocking()` to then set the parameters.

---

<div class="post-metadata">

**Author:** ![Michal\_Goralczyk](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/michal_goralczyk/32/55564_2.png) [@Michal\_Goralczyk](https://forum.inductiveautomation.com/u/Michal_Goralczyk)\
**Post date:** [March 6, 2024, 1:28pm UTC](https://forum.inductiveautomation.com/t/calculations-on-udt-parameters-using-binding-problem/86828/6 "2024-03-06T13:28:57Z")

</div>

Thank you, I will try to do it. I have hundreds of instances so single creation is a torment. Too bad the wizard doesn't work, someone should do something about it.

---

<div class="post-metadata">

**Author:** ![lrose](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/lrose/32/62724_2.png) [@lrose](https://forum.inductiveautomation.com/u/lrose)\
**Post date:** [March 6, 2024, 1:51pm UTC](https://forum.inductiveautomation.com/t/calculations-on-udt-parameters-using-binding-problem/86828/7 "2024-03-06T13:51:34Z")

</div>

> [@Michal\_Goralczyk](#):
>
> single creation is a torment

You can write a script to do the creation for you.

---

<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:** [March 6, 2024, 2:04pm UTC](https://forum.inductiveautomation.com/t/calculations-on-udt-parameters-using-binding-problem/86828/8 "2024-03-06T14:04:16Z")

</div>

The wizard's patterns are so limited that I can't remember it **ever** suiting my needs, buggy or not.

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [March 6, 2024, 5:03pm UTC](https://forum.inductiveautomation.com/t/calculations-on-udt-parameters-using-binding-problem/86828/9 "2024-03-06T17:03:09Z")

</div>

Good news: We're very close to finishing up a revamp of the multi-instance wizard that dramatically increases its flexibility. Will be an 8.3 feature, but it should be a lot more useful.
