# How to read 48 bit (3 words) via ModBus into a tag

**URL:** <https://forum.inductiveautomation.com/t/how-to-read-48-bit-3-words-via-modbus-into-a-tag/63802>\
**Category:** Ignition\
**Created:** [September 6, 2022, 8:43pm UTC](https://forum.inductiveautomation.com/t/how-to-read-48-bit-3-words-via-modbus-into-a-tag/63802 "2022-09-06T20:43:56Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Billy\_Elliott](https://avatars.discourse-cdn.com/v4/letter/b/c37758/32.png) [@Billy\_Elliott](https://forum.inductiveautomation.com/u/Billy_Elliott)\
**Post date:** [September 6, 2022, 8:43pm UTC](https://forum.inductiveautomation.com/t/how-to-read-48-bit-3-words-via-modbus-into-a-tag/63802/1 "2022-09-06T20:43:56Z")

</div>

I’m trying to read data from an Eaton 93M UPS and it has a “Date” type that is 6 bytes (3 words) long? Any ideas on how to read that data in? The format is ymdHMS, and the value when I export from the device is like this: 2022-08-31T07:08:00Z.  
I’m guessing I’m going to have to read it into 3 HRUS (16 bit holding registers) and then use an expression to combine them into one tag? Not sure how to do that.

I appreciate any help.

---

<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:** [September 6, 2022, 8:47pm UTC](https://forum.inductiveautomation.com/t/how-to-read-48-bit-3-words-via-modbus-into-a-tag/63802/2 "2022-09-06T20:47:12Z")

</div>

Do you know if the bytes are BCD or binary?

---

<div class="post-metadata">

**Author:** ![Billy\_Elliott](https://avatars.discourse-cdn.com/v4/letter/b/c37758/32.png) [@Billy\_Elliott](https://forum.inductiveautomation.com/u/Billy_Elliott)\
**Post date:** [September 6, 2022, 9:33pm UTC](https://forum.inductiveautomation.com/t/how-to-read-48-bit-3-words-via-modbus-into-a-tag/63802/3 "2022-09-06T21:33:46Z")

</div>

I really don’t. I think binary, I tried a HRI\_64 and it came the closest to being correct.

---

<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:** [September 6, 2022, 9:47pm UTC](https://forum.inductiveautomation.com/t/how-to-read-48-bit-3-words-via-modbus-into-a-tag/63802/4 "2022-09-06T21:47:35Z")

</div>

Do you have a manual? You already know the general approach that will be needed, but knowing how to combine them in the expression is going to require we know how the date is encoded in the first place.

---

<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:** [September 6, 2022, 10:01pm UTC](https://forum.inductiveautomation.com/t/how-to-read-48-bit-3-words-via-modbus-into-a-tag/63802/5 "2022-09-06T22:01:26Z")

</div>

If you show us the current integer values using the three HRUI formats, we can probably decipher it.

---

<div class="post-metadata">

**Author:** ![Billy\_Elliott](https://avatars.discourse-cdn.com/v4/letter/b/c37758/32.png) [@Billy\_Elliott](https://forum.inductiveautomation.com/u/Billy_Elliott)\
**Post date:** [September 6, 2022, 10:28pm UTC](https://forum.inductiveautomation.com/t/how-to-read-48-bit-3-words-via-modbus-into-a-tag/63802/6 "2022-09-06T22:28:55Z")

</div>

It won’t let me upload a file, but all I have is a CSV file the device let’s me download with all the Modbus registers. I’ll try and paste everything I can.  
Parameter Name,Display Name,Base Address (1-based),Discrete,Units,Type,Size (bytes),Is Timestamp,Bit Offset,Swap Bytes,Swap Words,Divider,Multiplier,Date Spec,Alarm On,False,Writable,Modbus Value,Possible Values,Description  
sLastBatteryTest1,Datetime Of Last Battery Test 1,17047,No,no-units,DATE,6,No,No,No,ymdHMS,No,2000-01-01T00:00:00Z

Sorry it’s so hard to read, but not much there. Basically it’s 6 bytes long, ymdHMS format, current value is 2000-01-01T00:00:00Z  
I tried setting it as a HRUS and binary type but it returns an Array[32] so I need to figure out how to print out the binary value?

---

<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:** [September 6, 2022, 11:32pm UTC](https://forum.inductiveautomation.com/t/how-to-read-48-bit-3-words-via-modbus-into-a-tag/63802/7 "2022-09-06T23:32:07Z")

</div>

Integer type.

---

<div class="post-metadata">

**Author:** ![Billy\_Elliott](https://avatars.discourse-cdn.com/v4/letter/b/c37758/32.png) [@Billy\_Elliott](https://forum.inductiveautomation.com/u/Billy_Elliott)\
**Post date:** [September 6, 2022, 11:42pm UTC](https://forum.inductiveautomation.com/t/how-to-read-48-bit-3-words-via-modbus-into-a-tag/63802/8 "2022-09-06T23:42:10Z")

</div>

Not sure I understand? An integer is 16,32,or 64 bits? I need 48, so I either read too few or too many?

---

<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:** [September 6, 2022, 11:49pm UTC](https://forum.inductiveautomation.com/t/how-to-read-48-bit-3-words-via-modbus-into-a-tag/63802/9 "2022-09-06T23:49:34Z")

</div>

You can’t use 64. You need to read exactly 48 or the extra 16 will corrupt the value. You need to read three 16 bit values separately, as integers. Then we can decipher those and just those.

Configure three tags to read the three consecutive registers starting with the indicated one, as integers. HRUI17047, HRUI17048, and HRUI17049, presumably. Show us the values.

Consider also trying HRBCD17047 through HRBCD17049. That might shortcut some of the math.

---

<div class="post-metadata">

**Author:** ![Billy\_Elliott](https://avatars.discourse-cdn.com/v4/letter/b/c37758/32.png) [@Billy\_Elliott](https://forum.inductiveautomation.com/u/Billy_Elliott)\
**Post date:** [September 7, 2022, 1:53pm UTC](https://forum.inductiveautomation.com/t/how-to-read-48-bit-3-words-via-modbus-into-a-tag/63802/10 "2022-09-07T13:53:45Z")

</div>

Ok, here is what I got back  
HRUI17047 - 257  
HRUI17048 - 16842752  
HRUI17049 - 0  
HRBCD17047 - 0  
HRBCD17048 - 101  
HRBDC17049 - 0

Another question, what is the path to UDT’s? I want to use system.tag.editTag to update a bunch of tags. 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:** [September 7, 2022, 1:58pm UTC](https://forum.inductiveautomation.com/t/how-to-read-48-bit-3-words-via-modbus-into-a-tag/63802/11 "2022-09-07T13:58:59Z")

</div>

Can you re-address those as `HRUS` or just `HR` instead of `HRUI` - `HRUI` is 32-bit type.

---

<div class="post-metadata">

**Author:** ![Billy\_Elliott](https://avatars.discourse-cdn.com/v4/letter/b/c37758/32.png) [@Billy\_Elliott](https://forum.inductiveautomation.com/u/Billy_Elliott)\
**Post date:** [September 7, 2022, 3:56pm UTC](https://forum.inductiveautomation.com/t/how-to-read-48-bit-3-words-via-modbus-into-a-tag/63802/12 "2022-09-07T15:56:59Z")

</div>

Absolutely!  
HRUS17047 - 0  
HRUS17048 - 257  
HRUS17049 - 0

HR17047 - 0  
HR17048 - 257  
HR17049 - 0

---

<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:** [September 7, 2022, 5:39pm UTC](https://forum.inductiveautomation.com/t/how-to-read-48-bit-3-words-via-modbus-into-a-tag/63802/13 "2022-09-07T17:39:11Z")

</div>

> [@Kevin.Herron](#):
>
> `HRUI` is 32-bit type.

Whoops! 🙄

---

<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:** [September 7, 2022, 6:17pm UTC](https://forum.inductiveautomation.com/t/how-to-read-48-bit-3-words-via-modbus-into-a-tag/63802/14 "2022-09-07T18:17:33Z")

</div>

I don’t know. I’m not really interested in trying to decode or reverse engineer this format, I’d rather see the manual.

If you squint you can maybe see something, though:

```auto
2000-01-01T00:00:00Z
00 00 01 01 00 00 

```

Not sure of 2000 is the epoch or where millis would come from…

---

<div class="post-metadata">

**Author:** ![Billy\_Elliott](https://avatars.discourse-cdn.com/v4/letter/b/c37758/32.png) [@Billy\_Elliott](https://forum.inductiveautomation.com/u/Billy_Elliott)\
**Post date:** [September 7, 2022, 6:58pm UTC](https://forum.inductiveautomation.com/t/how-to-read-48-bit-3-words-via-modbus-into-a-tag/63802/15 "2022-09-07T18:58:33Z")

</div>

I found this, not sure if they are correct?

 ![DateTime](https://us1.discourse-cdn.com/inductiveautomation/original/3X/f/9/f9ccc6e02b3401654b881e0476be462c17657068.jpeg)  
 ![DateTime2](https://us1.discourse-cdn.com/inductiveautomation/original/3X/5/4/541f38f80c5531d9ab2db46f5b00b0825244e49f.jpeg)

---

<div class="post-metadata">

**Author:** ![Billy\_Elliott](https://avatars.discourse-cdn.com/v4/letter/b/c37758/32.png) [@Billy\_Elliott](https://forum.inductiveautomation.com/u/Billy_Elliott)\
**Post date:** [September 7, 2022, 6:59pm UTC](https://forum.inductiveautomation.com/t/how-to-read-48-bit-3-words-via-modbus-into-a-tag/63802/16 "2022-09-07T18:59:32Z")

</div>

Those are two different manuals. I appreciate the help!

---

<div class="post-metadata">

**Author:** ![Steveee](https://avatars.discourse-cdn.com/v4/letter/s/b5a626/32.png) [@Steveee](https://forum.inductiveautomation.com/u/Steveee)\
**Post date:** [September 8, 2022, 8:00am UTC](https://forum.inductiveautomation.com/t/how-to-read-48-bit-3-words-via-modbus-into-a-tag/63802/17 "2022-09-08T08:00:10Z")

</div>

Hi, Is this the correct device/manual?

[Modbus MS Card](https://www.eaton.com/content/dam/eaton/products/backup-power-ups-surge-it-power-distribution/power-management-software-connectivity/eaton-network-and-modbus-card-ms/eaton-modbus-ms-card-user-guide-34009048xt.pdf.pdf)

---

<div class="post-metadata">

**Author:** ![Billy\_Elliott](https://avatars.discourse-cdn.com/v4/letter/b/c37758/32.png) [@Billy\_Elliott](https://forum.inductiveautomation.com/u/Billy_Elliott)\
**Post date:** [September 8, 2022, 12:51pm UTC](https://forum.inductiveautomation.com/t/how-to-read-48-bit-3-words-via-modbus-into-a-tag/63802/18 "2022-09-08T12:51:01Z")

</div>

No it’s a Gateway card for a Eaton Power Xpert Meter 2260, but the card is really just a network card. I found another manual that gives another description.

 ![DateTime3](https://us1.discourse-cdn.com/inductiveautomation/original/3X/9/8/98fb61ba5ee08d10276115c0595666684e5d53fa.jpeg)

I guess the short answer is I will have to read it in as 3 seperate registers to get the data in and then decode it. I’m just not very good at slicing and dicing the registers once I get them in.

---

<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:** [September 8, 2022, 2:16pm UTC](https://forum.inductiveautomation.com/t/how-to-read-48-bit-3-words-via-modbus-into-a-tag/63802/19 "2022-09-08T14:16:28Z")

</div>

It doesn’t look like the values you read match that format 😕

You read:

```auto
00 00 01 01 00 00

```

which would mean, according to these docs:

```auto
Y=00
M=00
D=01
H=01
M=00
S=00

```

It seems… shifted by one byte, assuming the date value you gave us (2000-01-01T00:00:00Z) is correct.

---

<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:** [September 8, 2022, 2:26pm UTC](https://forum.inductiveautomation.com/t/how-to-read-48-bit-3-words-via-modbus-into-a-tag/63802/20 "2022-09-08T14:26:58Z")

</div>

The latest document has a different set of three registers.

[Next page](https://forum.inductiveautomation.com/t/how-to-read-48-bit-3-words-via-modbus-into-a-tag/63802.md?page=2)
