# Weintek cMT2078x Modbus Addressing Help

**URL:** <https://forum.inductiveautomation.com/t/weintek-cmt2078x-modbus-addressing-help/80649>\
**Category:** Ignition\
**Tags:** ignition81\
**Created:** [October 18, 2023, 2:45pm UTC](https://forum.inductiveautomation.com/t/weintek-cmt2078x-modbus-addressing-help/80649 "2023-10-18T14:45:46Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![dkhayes117](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/dkhayes117/32/68344_2.png) [@dkhayes117](https://forum.inductiveautomation.com/u/dkhayes117)\
**Post date:** [October 18, 2023, 2:45pm UTC](https://forum.inductiveautomation.com/t/weintek-cmt2078x-modbus-addressing-help/80649/1 "2023-10-18T14:45:47Z")

</div>

I've got a new machine in the plant that I'm trying to get Modbus TCP setup on. The OEM sent me some information on the setup, for example

```auto
READ 100 RECORDS STARTING FROM 400
ReadValues = modbusClient.ReadInputRegisters(400, 100)

MACHINE STATUS
REGISTER 400 -> 1=RUN 2=STOP

```

Based on a Weintek PDF I found online input registers are `3x`, so my Ignition OPC tag path is `ns=1;s=[Silo A]3x400` which gives me a bad quality. What am I missing?

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/9/5/956f8a54eddb8e409ea27bb2d2ab6d507c6246a8.png)

---

<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:** [October 18, 2023, 2:51pm UTC](https://forum.inductiveautomation.com/t/weintek-cmt2078x-modbus-addressing-help/80649/2 "2023-10-18T14:51:28Z")

</div>

> [@dkhayes117](#):
>
> so my Ignition OPC tag path is `ns=1;s=[Silo A]3x400` which gives me a bad quality. What am I missing?

If that's the literal address you're using you missed the part where you read the Ignition user manual to understand the Modbus address syntax. `3x400` is not a valid address.

It would maybe be something like `[Silo A]IR400`.

[https://docs.inductiveautomation.com/display/DOC81/Modbus+Addressing#ModbusAddressing-ModbusSpecificAddressing](https://docs.inductiveautomation.com/display/DOC81/Modbus+Addressing#ModbusAddressing-ModbusSpecificAddressing)

---

<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:** [October 18, 2023, 3:26pm UTC](https://forum.inductiveautomation.com/t/weintek-cmt2078x-modbus-addressing-help/80649/3 "2023-10-18T15:26:33Z")

</div>

Weintek has gone out on a limb defining non-existent address types. There's no such thing as a 5x address, though the functionality described can be configured on an Ignition driver. The protocol spec has a totally different definition for 6x addresses, with dedicated function codes.

---

<div class="post-metadata">

**Author:** ![dkhayes117](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/dkhayes117/32/68344_2.png) [@dkhayes117](https://forum.inductiveautomation.com/u/dkhayes117)\
**Post date:** [October 18, 2023, 3:33pm UTC](https://forum.inductiveautomation.com/t/weintek-cmt2078x-modbus-addressing-help/80649/4 "2023-10-18T15:33:43Z")

</div>

> [@Kevin.Herron](#):
>
> If that's the literal address you're using you missed the part where you read the Ignition user manual to understand the Modbus address syntax. `3x400` is not a valid address.

I read the manual first. I took it that 3x was the prefix, and using the device address mapping tool generated the `ns=1;s=[Silo A]3x400`, which I see is wrong now. 3x just means the 30000 range.

I tried the manual address of `[Silo A]IR400` but it didn't work.

---

<div class="post-metadata">

**Author:** ![dkhayes117](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/dkhayes117/32/68344_2.png) [@dkhayes117](https://forum.inductiveautomation.com/u/dkhayes117)\
**Post date:** [October 18, 2023, 6:17pm UTC](https://forum.inductiveautomation.com/t/weintek-cmt2078x-modbus-addressing-help/80649/5 "2023-10-18T18:17:36Z")

</div>

I figured it out 🙂 I was able to _hack_ the admin password into the Weintek HMI. With easybuilder pro, I downloaded the project from the HMI, and decompiled it. They had the Modbus unit id set to 1 where I was trying to use unit id 0.

---

<div class="post-metadata">

**Author:** ![dkhayes117](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/dkhayes117/32/68344_2.png) [@dkhayes117](https://forum.inductiveautomation.com/u/dkhayes117)\
**Post date:** [October 18, 2023, 7:57pm UTC](https://forum.inductiveautomation.com/t/weintek-cmt2078x-modbus-addressing-help/80649/6 "2023-10-18T19:57:45Z")

</div>

@Kevin.Herron Seems I need a little help on string conversion.

IR480-499 are being read as 16int. I set up a tag with path `[Silo A]1.HRS480:20`

- Without any string handling options I get an empty string.
- With reverse byte order, I get **Z**
- With read raw string checked, I get **Z Pillow 4**
- Change path to `[Silo A]1.HRS480:40`, I get **Z Pillow 43OZCAC`**

The manual says that each word is 2 characters, but best I can tell I only have one char per word.

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

---

<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:** [October 18, 2023, 8:01pm UTC](https://forum.inductiveautomation.com/t/weintek-cmt2078x-modbus-addressing-help/80649/7 "2023-10-18T20:01:26Z")

</div>

What string are you expecting? You may have some trouble here, the Modbus driver doesn't so Strings in any kind of sane manner.

---

<div class="post-metadata">

**Author:** ![dkhayes117](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/dkhayes117/32/68344_2.png) [@dkhayes117](https://forum.inductiveautomation.com/u/dkhayes117)\
**Post date:** [October 18, 2023, 8:03pm UTC](https://forum.inductiveautomation.com/t/weintek-cmt2078x-modbus-addressing-help/80649/8 "2023-10-18T20:03:32Z")

</div>

Sorry, I meant to include that in the last post  
`Z Pillow 43 OZ` is the correct value

---

<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:** [October 18, 2023, 8:09pm UTC](https://forum.inductiveautomation.com/t/weintek-cmt2078x-modbus-addressing-help/80649/9 "2023-10-18T20:09:44Z")

</div>

`[Silo A]1.HRS480:40` is probably closest to what you want.

This means read 40 bytes, aka 20 registers. The string either has to be fixed width or null terminated.

edit: if you're expecting null-terminated, make sure the raw strings option is false.

---

<div class="post-metadata">

**Author:** ![dkhayes117](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/dkhayes117/32/68344_2.png) [@dkhayes117](https://forum.inductiveautomation.com/u/dkhayes117)\
**Post date:** [October 18, 2023, 8:20pm UTC](https://forum.inductiveautomation.com/t/weintek-cmt2078x-modbus-addressing-help/80649/10 "2023-10-18T20:20:10Z")

</div>

I think it is null terminated, 0 in ascii should be null; therefore the null would be `RecipeName15`

hmm, I reloaded the recipe name on the HMI, and it started acting completely different. I had to reverse the byte order and then uncheck the raw string option and it worked as expected 🤷‍♂️

---

<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:** [October 18, 2023, 8:23pm UTC](https://forum.inductiveautomation.com/t/weintek-cmt2078x-modbus-addressing-help/80649/11 "2023-10-18T20:23:13Z")

</div>

> [@dkhayes117](#):
>
> it started acting completely different

Eww. That suggests that different parts of its code do strings differently.

---

<div class="post-metadata">

**Author:** ![dkhayes117](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/dkhayes117/32/68344_2.png) [@dkhayes117](https://forum.inductiveautomation.com/u/dkhayes117)\
**Post date:** [October 18, 2023, 8:31pm UTC](https://forum.inductiveautomation.com/t/weintek-cmt2078x-modbus-addressing-help/80649/12 "2023-10-18T20:31:00Z")

</div>

Weird, with `HRS480:40` the string must be **over** 20 chars long for it to read correctly. If I do 20 chars or less, it only shows the very first character in the string. So weird.
