# Modbus address Scanner

**URL:** <https://forum.inductiveautomation.com/t/modbus-address-scanner/58132>\
**Category:** Ignition\
**Tags:** ignition81\
**Created:** [April 6, 2022, 10:06pm UTC](https://forum.inductiveautomation.com/t/modbus-address-scanner/58132 "2022-04-06T22:06:16Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![OscarJ](https://avatars.discourse-cdn.com/v4/letter/o/e8c25b/32.png) [@OscarJ](https://forum.inductiveautomation.com/u/OscarJ)\
**Post date:** [April 6, 2022, 10:06pm UTC](https://forum.inductiveautomation.com/t/modbus-address-scanner/58132/1 "2022-04-06T22:06:16Z")

</div>

I am having problems reading the data that my scanner takes, it is connected via MODBUS and in Ignition it tells me that it is connected but when trying to read it through a tag it is difficult for me to write its address.

The scanner is PowerScan 9500 Series.

This is the information that comes in the manual.

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/e/e/ee8c39838ce94f5deb1f28603f50de75eda9a1c4.jpeg)

I tried like this but the tag reads it as ‘bad’  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/f/5/f5c08d91574458ae38375432dd51f2901fa158f2.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:** [April 6, 2022, 10:08pm UTC](https://forum.inductiveautomation.com/t/modbus-address-scanner/58132/2 "2022-04-06T22:08:12Z")

</div>

Try these addresses and see if anything changes:

- `[Scanner_RTV]HR242`
- `[Scanner_RTV]1.HR242`
- `[Scanner_RTV]1.HR4242`

---

<div class="post-metadata">

**Author:** ![josborn](https://avatars.discourse-cdn.com/v4/letter/j/4bbf92/32.png) [@josborn](https://forum.inductiveautomation.com/u/josborn)\
**Post date:** [April 7, 2022, 12:50am UTC](https://forum.inductiveautomation.com/t/modbus-address-scanner/58132/3 "2022-04-07T00:50:39Z")

</div>

I think i see your issue, you have a data type of string, but you are not using the right string addressing.

`HRS FORMAT: HRS<Modbus address>:<length>`  
If it really is a string, try these but substitute ### with the actual length.

- `[Scanner_RTV]HRS242:###`
- `[Scanner_RTV]1.HRS242:###`
- `[Scanner_RTV]1.HRS4242:###`

---

<div class="post-metadata">

**Author:** ![OscarJ](https://avatars.discourse-cdn.com/v4/letter/o/e8c25b/32.png) [@OscarJ](https://forum.inductiveautomation.com/u/OscarJ)\
**Post date:** [April 12, 2022, 4:04pm UTC](https://forum.inductiveautomation.com/t/modbus-address-scanner/58132/4 "2022-04-12T16:04:57Z")

</div>

Thanks to your answers my tag no longer shows bad but now it only shows ‘0’ in the value, I have been testing but I don’t know what is the error in my addressing.

![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/9/0/901ae41ad11b06c275dc8b8ee6bc1c63fc2dbfcf.png)  
Value = 0

![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/b/9/b9479e0dfab2d7328792ffcf975910916da333ce.png)  
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:** [April 12, 2022, 4:36pm UTC](https://forum.inductiveautomation.com/t/modbus-address-scanner/58132/5 "2022-04-12T16:36:23Z")

</div>

The presence of sequence numbers in the address table suggests that you might have to perform some acknowledgement handshake (writes to other addresses) to get the next buffered item to show up. Link to the manual, please?

(A zero in the 16-bit register is a pair of null characters, so an empty string is expected at that point.)

---

<div class="post-metadata">

**Author:** ![OscarJ](https://avatars.discourse-cdn.com/v4/letter/o/e8c25b/32.png) [@OscarJ](https://forum.inductiveautomation.com/u/OscarJ)\
**Post date:** [April 12, 2022, 4:45pm UTC](https://forum.inductiveautomation.com/t/modbus-address-scanner/58132/6 "2022-04-12T16:45:36Z")

</div>

This is the manual:

> **[BC9180%20manual.pdf](https://www.sensorcentre.com/uploads/manuals/BC9180%20manual.pdf)**
>
> 1487.81 KB

---

<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:** [April 12, 2022, 5:05pm UTC](https://forum.inductiveautomation.com/t/modbus-address-scanner/58132/7 "2022-04-12T17:05:18Z")

</div>

OK. You _ **do** _ need a handshake. Also, you need to be looking for your scan data in the Fragment Data section, `HRS9:450`. After reading any particular scan/fragment combination, you need to echo `HR5` & `HR6` over to `HR236` and `HR237`. That tells the scanner to load the next item, if already scanned, into the input buffer. (Input is to you, Output is to the scanner.)

{ See the fragmentation example on page 39. }

---

<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:** [April 12, 2022, 5:08pm UTC](https://forum.inductiveautomation.com/t/modbus-address-scanner/58132/8 "2022-04-12T17:08:52Z")

</div>

Also, if you expect to be scanning true binary data, you will not be able to use the HRS data type, as that expects encoded characters for string data, and stops on null values. To handle raw binary, you would read the 225 16-bit registers as a group, render them into a suitable buffer, and extract the raw bytes. Kinda’ ugly.

---

<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:** [April 12, 2022, 5:10pm UTC](https://forum.inductiveautomation.com/t/modbus-address-scanner/58132/9 "2022-04-12T17:10:07Z")

</div>

Man… this seems like something you could have a custom driver for in about a days work.

---

<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:** [April 12, 2022, 5:12pm UTC](https://forum.inductiveautomation.com/t/modbus-address-scanner/58132/10 "2022-04-12T17:12:54Z")

</div>

The modbus is just tacked onto the EtherNet/IP support. Same buffer and timing expectations. I already offer a driver for EtherNet/IP scanning. (:

I also have another driver that could handle the raw binary via `system.device.rawModbus()`. (:

---

<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:** [April 12, 2022, 5:15pm UTC](https://forum.inductiveautomation.com/t/modbus-address-scanner/58132/11 "2022-04-12T17:15:16Z")

</div>

Oooh! Maybe I should offer an `HRB` type in my Advanced Modbus Driver, with syntax like HRS but dealing with byte arrays. That would be rather easy.
