# Modbus Communication With Gateway

**URL:** <https://forum.inductiveautomation.com/t/modbus-communication-with-gateway/91755>\
**Category:** Ignition\
**Tags:** ignition81\
**Created:** [June 12, 2024, 4:11pm UTC](https://forum.inductiveautomation.com/t/modbus-communication-with-gateway/91755 "2024-06-12T16:11:42Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Zachary\_Ray](https://avatars.discourse-cdn.com/v4/letter/z/dec6dc/32.png) [@Zachary\_Ray](https://forum.inductiveautomation.com/u/Zachary_Ray)\
**Post date:** [June 12, 2024, 4:11pm UTC](https://forum.inductiveautomation.com/t/modbus-communication-with-gateway/91755/1 "2024-06-12T16:11:43Z")

</div>

Ignition 8.1.39 - Windows 10

Hello, I am trying to talk to an old Motorola MOSCAD controller which has been using Modbus RTU communications on an old iFix system.

The MOSCAD controller is (as far as I can tell) the master of the Modbus RTU communication protocol. It issues read/write requests to several remote stations to pull alarm data, etc.

When we decided to upgrade to Ignition, we opted for a Modbus gateway (SGW-MB1524-T) which converts the traffic between Modbus TCP and Modbus RTU.

I'm having some trouble getting any information read in from the MOSCAD controller at this time. Ignition is connected to the Modbus gateway with no issues.

Here is the old iFix configuration:

\*\* General \*\*  
Device Driver: Modbus RTU Serial  
Name: Device0  
ID: 1 (Decimal)

\*\* Settings \*\*  
Settings \> Data Access  
Zero based addressing enabled  
Zero based bit addressing within registers enabled  
Using modbus function 06 for single register values  
Using modbus function 05 for single coil writes

Settings \> Data Encoding  
Using default modbus Byte order  
Using first word low in 32 bit data types  
Using First Dword low in 64 bit data types

\*\* Block Sizes \*\*  
Output Coils: 32  
Input Coils: 32

Internal Registers: 32  
Holding Registers: 32

\*\* Channel Properties \*\*  
ID: COM 3 (This PC running Ignition is entirely seperate from the one running iFix so not sure if this applies)  
Baud Rate: 9600  
Data bits: 8  
Parity: None  
Stop Bits: 1  
Flow Control: None

Here are some images of the Modbus Gateway configuration web portal:

 ![mbGateway_DevInfoPNG](https://us1.discourse-cdn.com/inductiveautomation/original/3X/1/2/1245b4e9ddebceb1670bdbda0ac90dffdb2fb3c2.png)  
 ![mbGateway_NetSettings](https://us1.discourse-cdn.com/inductiveautomation/original/3X/b/3/b3aa1fc8cb2c8fd7d58dc4346ddf4a1950870c74.png)  
 ![mbGateway_OpSettings](https://us1.discourse-cdn.com/inductiveautomation/original/3X/a/8/a8e8d83227aed1549f7cd6bd367bf7a6b05688be.png)  
 ![mbGateway_SerSettings](https://us1.discourse-cdn.com/inductiveautomation/original/3X/7/4/74bded1bd2143e9c8453597e93506f79cc793a0c.png)

Here is how I have attempted to set up the device in Ignition:

 ![Ignition_OPCsettings](https://us1.discourse-cdn.com/inductiveautomation/original/3X/5/5/555695f0cddd92edb416084630fdba779408efa6.png)

Finally, here is a Wireshark Capture which displays **Error:Gateway target device failed to respond.**

 ![wireshark_cap](https://us1.discourse-cdn.com/inductiveautomation/original/3X/f/5/f538c631dfe3ba9225d51b6211690b3031fe947a.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:** [June 12, 2024, 4:28pm UTC](https://forum.inductiveautomation.com/t/modbus-communication-with-gateway/91755/2 "2024-06-12T16:28:02Z")

</div>

Ignition's driver uses unit ID 0 by default, but it looks like your serial device is unit ID 1.

Prefix the unit ID on all your addresses like this:

```python
[DeviceName]1.C1
[DeviceName]1.HR1

```

etc...

---

<div class="post-metadata">

**Author:** ![Zachary\_Ray](https://avatars.discourse-cdn.com/v4/letter/z/dec6dc/32.png) [@Zachary\_Ray](https://forum.inductiveautomation.com/u/Zachary_Ray)\
**Post date:** [June 12, 2024, 4:38pm UTC](https://forum.inductiveautomation.com/t/modbus-communication-with-gateway/91755/3 "2024-06-12T16:38:27Z")

</div>

> [@Kevin.Herron](#):
>
> Ignition's driver uses unit ID 0 by default, but it looks like your serial device is unit ID 1.

I've added this to my tags and I now see in Wireshark that it is requesting the correct unit, however, I still cannot see values from this controller.

I'm getting the same Modbus exception code as before: **Gateway target device failed to respond**

---

<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:** [June 12, 2024, 4:42pm UTC](https://forum.inductiveautomation.com/t/modbus-communication-with-gateway/91755/4 "2024-06-12T16:42:20Z")

</div>

This is the gateway telling you the downstream device didn’t respond. If the address and unit are definitely correct you’ll have to troubleshoot the gateway instead. Make sure the serial settings are correct, etc…

---

<div class="post-metadata">

**Author:** ![Zachary\_Ray](https://avatars.discourse-cdn.com/v4/letter/z/dec6dc/32.png) [@Zachary\_Ray](https://forum.inductiveautomation.com/u/Zachary_Ray)\
**Post date:** [June 12, 2024, 4:52pm UTC](https://forum.inductiveautomation.com/t/modbus-communication-with-gateway/91755/5 "2024-06-12T16:52:45Z")

</div>

Thank you for the response.

Is Ignition always going to be the master device under a Modbus communication scheme?

---

<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:** [June 12, 2024, 5:01pm UTC](https://forum.inductiveautomation.com/t/modbus-communication-with-gateway/91755/6 "2024-06-12T17:01:33Z")

</div>

Yes. There is a third party module offered by @pturmel that offers a Modbus slave/server option as well, but it seems clear from everything you've posted that's not what you need here.

---

<div class="post-metadata">

**Author:** ![Zachary\_Ray](https://avatars.discourse-cdn.com/v4/letter/z/dec6dc/32.png) [@Zachary\_Ray](https://forum.inductiveautomation.com/u/Zachary_Ray)\
**Post date:** [June 12, 2024, 5:47pm UTC](https://forum.inductiveautomation.com/t/modbus-communication-with-gateway/91755/7 "2024-06-12T17:47:21Z")

</div>

Thank you for the response.

I messed around with some settings and I was able to read values from holding registers, input registers, and discrete inputs, however, for whatever reason I still cannot read from a coil.
