# Modbus TCP write error

**URL:** <https://forum.inductiveautomation.com/t/modbus-tcp-write-error/36636>\
**Category:** Ignition\
**Created:** [July 13, 2020, 1:53pm UTC](https://forum.inductiveautomation.com/t/modbus-tcp-write-error/36636 "2020-07-13T13:53:17Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![akettner](https://avatars.discourse-cdn.com/v4/letter/a/ac8455/32.png) [@akettner](https://forum.inductiveautomation.com/u/akettner)\
**Post date:** [July 13, 2020, 1:53pm UTC](https://forum.inductiveautomation.com/t/modbus-tcp-write-error/36636/1 "2020-07-13T13:53:17Z")

</div>

I have set up a Modbus TCP device, with the default settings, and can read any tag, but when I try to write to one I get error screen showing Error writing to 1\_SP62.Value: Bad; unspecified and in the logs, Response fields did not mirror request fields. The value in the device does actually change but I would like to not have this error.

---

<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:** [July 13, 2020, 1:57pm UTC](https://forum.inductiveautomation.com/t/modbus-tcp-write-error/36636/2 "2020-07-13T13:57:29Z")

</div>

You’ll have to use scripting to do the write and suppress any errors yourself.

What’s happening is this device is not returning the correct response according to the Modbus spec. There’s no way to get the driver to ignore this and not return a bad quality in response to the write.

---

<div class="post-metadata">

**Author:** ![akettner](https://avatars.discourse-cdn.com/v4/letter/a/ac8455/32.png) [@akettner](https://forum.inductiveautomation.com/u/akettner)\
**Post date:** [July 13, 2020, 2:01pm UTC](https://forum.inductiveautomation.com/t/modbus-tcp-write-error/36636/3 "2020-07-13T14:01:08Z")

</div>

Thanks for the reply.  
I thought that this would be the case. I did try to suppress the error with a try, but I still get the error popup.

---

<div class="post-metadata">

**Author:** ![Gratliff](https://avatars.discourse-cdn.com/v4/letter/g/a5b964/32.png) [@Gratliff](https://forum.inductiveautomation.com/u/Gratliff)\
**Post date:** [August 28, 2020, 10:24pm UTC](https://forum.inductiveautomation.com/t/modbus-tcp-write-error/36636/4 "2020-08-28T22:24:18Z")

</div>

I am having this same issue. I’ve tried this with a simple script using try/except but this doesn’t suppress the error. Is there another way to suppress the error?

---

<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:** [August 28, 2020, 10:57pm UTC](https://forum.inductiveautomation.com/t/modbus-tcp-write-error/36636/5 "2020-08-28T22:57:51Z")

</div>

Beware: jython's Exception class is not related to java.lang.Exception, so if you specify one of them, you won't catch the other. You often need two `except` clauses. Start here:

> [@Capture JythonExecException in script?](http://forum.inductiveautomation.com/t/capture-jythonexecexception-in-script/37225):
>
> I can’t seem to figure out how to capture a Jython Exception in a try…except. I have tried this format and it works for capturing database exceptions. import java.lang.Exception try: # something something something except Exception, e: # jython exception except java.lang.Exception, e: # java exception I have never been able to capture a JythonExecException. Like a divide by zero, or an exception with Sepasoft API, or an invalid reference or datatype passed into a function. Is it pos…

---

<div class="post-metadata">

**Author:** ![akettner](https://avatars.discourse-cdn.com/v4/letter/a/ac8455/32.png) [@akettner](https://forum.inductiveautomation.com/u/akettner)\
**Post date:** [August 31, 2020, 1:22pm UTC](https://forum.inductiveautomation.com/t/modbus-tcp-write-error/36636/6 "2020-08-31T13:22:01Z")

</div>

I was never able to suppress the error. I doesn’t cause any problems and it does write the value.

---

<div class="post-metadata">

**Author:** ![Spencer\_Odom](https://avatars.discourse-cdn.com/v4/letter/s/b2d939/32.png) [@Spencer\_Odom](https://forum.inductiveautomation.com/u/Spencer_Odom)\
**Post date:** [June 7, 2025, 9:11pm UTC](https://forum.inductiveautomation.com/t/modbus-tcp-write-error/36636/7 "2025-06-07T21:11:35Z")

</div>

When reviewing the logs, the received message appears to mirror the request, even though Ignition is saying it didn't mirror request fields, unless I am missing something. This was with 8.1 using ModSim32 as the test device, which has worked flawlessly for me for over 10 years on other systems.

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/e/1/e16ae67d48f3dcaebe9955c36d69771c40702554.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 7, 2025, 10:41pm UTC](https://forum.inductiveautomation.com/t/modbus-tcp-write-error/36636/8 "2025-06-07T22:41:28Z")

</div>

It’s not mirrored, the request has an 0A in it and the response has 00 in the same 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:** [June 7, 2025, 10:41pm UTC](https://forum.inductiveautomation.com/t/modbus-tcp-write-error/36636/9 "2025-06-07T22:41:49Z")

</div>

They look different to me. That's an error in ModSim32.
