Calculations on UDT parameters using binding problem

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:

{
  "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:

Tag 2 wizard created:

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?

Greetings
Michał

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.

1 Like

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

Regards
Michał

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?

It's a bug in Ignition.

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

1 Like

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.

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

1 Like

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

2 Likes

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.

1 Like