# Modbus Flex Write Error

**URL:** https://discourse.nodered.org/t/modbus-flex-write-error/58613
**Category:** General
**Tags:** modbus
**Created:** [18 February 2022 16:47 UTC](https://discourse.nodered.org/t/modbus-flex-write-error/58613 "2022-02-18T16:47:55Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![fedex03](https://avatars.discourse-cdn.com/v4/letter/f/da6949/32.png) [@fedex03](https://discourse.nodered.org/u/fedex03)
#### Post date: [18 February 2022 16:47 UTC](https://discourse.nodered.org/t/modbus-flex-write-error/58613/1 "2022-02-18T16:47:55Z")

</div>

Hi there,

I'm working on a project that involves the Modbus Node.

Since I need to write several coil and register into a modbus server, I used the Modbus-Flex-Write node to collect every "write" message.

Unfortunately, I get this error:

> TypeError: Cannot read property 'getMachineState' of undefined

Anybody can help me to understand this error?

I see the modbus queue that grow up because something goes wrong.

Thanks for the help!

Best regards,  
Federico

---

<div class="post-metadata">

### Author: ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)
#### Post date: [18 February 2022 17:07 UTC](https://discourse.nodered.org/t/modbus-flex-write-error/58613/2 "2022-02-18T17:07:26Z")

</div>

Are you sure it is coming from the modbus node?

---

<div class="post-metadata">

### Author: ![fedex03](https://avatars.discourse-cdn.com/v4/letter/f/da6949/32.png) [@fedex03](https://discourse.nodered.org/u/fedex03)
#### Post date: [21 February 2022 07:34 UTC](https://discourse.nodered.org/t/modbus-flex-write-error/58613/3 "2022-02-21T07:34:57Z")

</div>

> [@Colin](#):
>
> e it is coming from the modbus node?

Yes it comes from Modbus Write Node

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/1/1/11ecb27e87532dce00710faa7379f71f203c5395.png)

I don't know what does it means, it seems something related to the server status.

From the catch node, I get this output

> TypeError: Cannot read property 'getMachineState' of undefined at Object.\_inputCallback (/opt/node-red/node\_modules/node-red-contrib-modbus/modbus/maps/modbus-flex-write.js:52:5) at Object.Node.\_emitInput (/opt/node-red/node\_modules/@node-red/runtime/lib/nodes/Node.js:199:18) at Immediate.\_onImmediate (/opt/node-red/node\_modules/@node-red/runtime/lib/nodes/Node.js:179:33) at processImmediate (internal/timers.js:439:21)

Any ideas?

Thank you

---

<div class="post-metadata">

### Author: ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)
#### Post date: [21 February 2022 08:24 UTC](https://discourse.nodered.org/t/modbus-flex-write-error/58613/4 "2022-02-21T08:24:40Z")

</div>

What version of node-red and nodejs are you using. For the latter, use  
`node -v`  
If that is V12, 14, or 16 then that should be ok. If you are using a recent version of node red then probably best to post an issue on the node's GitHub page.

---

<div class="post-metadata">

### Author: ![fedex03](https://avatars.discourse-cdn.com/v4/letter/f/da6949/32.png) [@fedex03](https://discourse.nodered.org/u/fedex03)
#### Post date: [21 February 2022 08:51 UTC](https://discourse.nodered.org/t/modbus-flex-write-error/58613/5 "2022-02-21T08:51:19Z")

</div>

My node-red version in "1.0.3: Maintenance Release"

This is an industrial device an I cannot access to command line to get the nodej version.

This kind of error could be related to the modbus server that does not offer the missing properties?

Thanks

---

<div class="post-metadata">

### Author: ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)
#### Post date: [21 February 2022 11:20 UTC](https://discourse.nodered.org/t/modbus-flex-write-error/58613/6 "2022-02-21T11:20:23Z")

</div>

Put an issue on the node's GitHub page, I think only the author can answer this.

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)
#### Post date: [22 April 2022 11:21 UTC](https://discourse.nodered.org/t/modbus-flex-write-error/58613/7 "2022-04-22T11:21:14Z")

</div>

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.
