# Modbus Write Specific Function Code 42

**URL:** <https://discourse.nodered.org/t/modbus-write-specific-function-code-42/58791>\
**Category:** General\
**Created:** [22 February 2022 03:18 UTC](https://discourse.nodered.org/t/modbus-write-specific-function-code-42/58791 "2022-02-22T03:18:40Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [23 February 2022 09:49 UTC](https://discourse.nodered.org/t/modbus-write-specific-function-code-42/58791/5 "2022-02-23T09:49:43Z")

</div>

The underlying modbus node package does not support custom FCs.

Your choices are...

- raise a "Feature Request" on the github repo + cross your finger 🤞
- fork, add "custom FC feature", publish a PR (pull request), wait for developer to merge an release.
- fork, add "custom FC feature", publish an alternative node in NPM.
- DIY it - [here](https://discourse.nodered.org/t/how-to-create-an-modbus-tcp-alarm-status-dashboard/43041/14) is the basis for a DIY solution

* * *

### As for your error...

You have asked Buffer Parser to use 6 bytes (but only supply it with 4 bytes)

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/5/d/5d6f4c66a4a8701847f7bc562cc82aee58b94eaa.png)

The proper solution to convert a buffer of bytes into an array of integers is to use the length -1 (it is documented in the built in help)

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/3/c/3c5068a7f89ca6ac15dafbf8e6197e05b02ad3af.png)  
Y

---

_[View the full topic](https://discourse.nodered.org/t/modbus-write-specific-function-code-42/58791)._
