# Modbus write to register 8601 value 6,7.15

**URL:** https://discourse.nodered.org/t/modbus-write-to-register-8601-value-6-7-15/25518
**Category:** General
**Created:** [26 April 2020 05:08 UTC](https://discourse.nodered.org/t/modbus-write-to-register-8601-value-6-7-15/25518 "2020-04-26T05:08:48Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![Heineken](https://avatars.discourse-cdn.com/v4/letter/h/c37758/32.png) [@Heineken](https://discourse.nodered.org/u/Heineken)
#### Post date: [26 April 2020 05:08 UTC](https://discourse.nodered.org/t/modbus-write-to-register-8601-value-6-7-15/25518/1 "2020-04-26T05:08:48Z")

</div>

Dear community members, I am trying to write to modbus register to control a vsd via ModBus serial using raspberry pi and node red , i can read values from vsd but I do not know how to write to register containing multiple bits in one register i am using node-red-contrib-modbus flow

this is the info i have .  
ADD= Modbus address 1 thru 127  
Tbr= network speed baud rate 19.2  
tFO= Format 8E1  
trO= Timeout 10 seconds  
Writing speed in RPM’s  
CMD word is 8601 is the start and stop  
CMD word is 8501 is the start and stop  
To start the drive you write a Dec 6, then 7 then 15 to 8601 or 8501 ( Check for offset values)

| CMD | | bit 0: | = 1 : Switch on |
| --- | --- | --- | --- |
| bit 1: | = 0 : Disable voltage | | |
| bit 2: | = 0 : Quick stop/Emergency stop | | |
| bit 3: | = 1 : Enable operation/Run command | | |
| bit 4: | Reserved (set to 0). | | |
| bit 5: | Reserved (set to 0). | | |
| bit 6: | Reserved (set to 0). | | |
| bit 7: | Fault reset/Fault acknowledgment active on 0 V 1 rising edge | | |
| bit 8: | = 0 : RUN asked, 1 : STOP asked | | |
| bit 9: | Reserved (set to 0). | | |
| bit 10: | Reserved (set to 0). | | |
| bit 11: | Direction of rotation command = | | |
| 0: Forward rotation | | | |
| 1: Reverse rotation. Default value, this bit can be assigned to another command. | | | |
| bit 12: | Reserved (set to 0). | | |
| bit 13: | Reserved (set to 0). | | |
| bit 14: | Reserved (set to 0). | | |
| bit 15: | Reserved (set to 0). | | |

please guys any help would be appreciated thank you

---

<div class="post-metadata">

### Author: ![Heineken](https://avatars.discourse-cdn.com/v4/letter/h/c37758/32.png) [@Heineken](https://discourse.nodered.org/u/Heineken)
#### Post date: [26 April 2020 05:36 UTC](https://discourse.nodered.org/t/modbus-write-to-register-8601-value-6-7-15/25518/2 "2020-04-26T05:36:00Z")

</div>

Hi Guys i think it would be something like this but not sure how to adress each bit in register

inject node /////////////////////  
msg.payload = [6,7,15];  
return msg;  
///////////////////////////////////////  
function node /////////////////////////////  
msg.payload = { value: msg.payload , 'fc': 5, 'unitid': 1, 'address': 8601 , 'quantity': 1 }  
return msg;  
/////////////////////////////////////////////////////////////////////  
thank you

---

<div class="post-metadata">

### Author: ![rromele](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/rromele/32/18431_2.png) [@rromele](https://discourse.nodered.org/u/rromele)
#### Post date: [26 April 2020 21:10 UTC](https://discourse.nodered.org/t/modbus-write-to-register-8601-value-6-7-15/25518/3 "2020-04-26T21:10:04Z")

</div>

Hi,  
try this as a starting point for your tests.

```auto
[{"id":"aeba0ad7.26add8","type":"modbus-response","z":"8057eee0.47ef7","name":"","registerShowMax":20,"x":650,"y":140,"wires":[]},{"id":"a46fe485.2e1ec8","type":"inject","z":"8057eee0.47ef7","name":"6 ?","topic":"","payload":"6","payloadType":"num","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":130,"y":80,"wires":[["bbe1397b.961208"]]},{"id":"bbe1397b.961208","type":"modbus-write","z":"8057eee0.47ef7","name":"","showStatusActivities":false,"showErrors":false,"unitid":"1","dataType":"HoldingRegister","adr":"8601","quantity":"1","server":"98defed2.95a52","emptyMsgOnFail":false,"x":400,"y":140,"wires":[["aeba0ad7.26add8"],[]]},{"id":"6b3bdce4.baf964","type":"inject","z":"8057eee0.47ef7","name":"switch On","topic":"","payload":"7","payloadType":"num","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":140,"y":120,"wires":[["bbe1397b.961208"]]},{"id":"70cd9d8c.e71454","type":"inject","z":"8057eee0.47ef7","name":"Run","topic":"","payload":"15","payloadType":"num","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":130,"y":160,"wires":[["bbe1397b.961208"]]},{"id":"98defed2.95a52","type":"modbus-client","z":"","name":"","clienttype":"serial","bufferCommands":true,"stateLogEnabled":false,"queueLogEnabled":false,"tcpHost":"127.0.0.1","tcpPort":"502","tcpType":"DEFAULT","serialPort":"/dev/ttyUSB","serialType":"RTU-BUFFERD","serialBaudrate":"19200","serialDatabits":"8","serialStopbits":"1","serialParity":"none","serialConnectionDelay":"100","unit_id":"1","commandDelay":"1","clientTimeout":"1000","reconnectOnTimeout":true,"reconnectTimeout":"2000","parallelUnitIdsAllowed":true}]

```

---

<div class="post-metadata">

### Author: ![Heineken](https://avatars.discourse-cdn.com/v4/letter/h/c37758/32.png) [@Heineken](https://discourse.nodered.org/u/Heineken)
#### Post date: [26 April 2020 22:22 UTC](https://discourse.nodered.org/t/modbus-write-to-register-8601-value-6-7-15/25518/4 "2020-04-26T22:22:07Z")

</div>

Hi, there thank you for the help i think we are on the right track but the drive still don't seem to start.

i will try changing setting on the ATV12 vsd....

---

<div class="post-metadata">

### Author: ![rromele](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/rromele/32/18431_2.png) [@rromele](https://discourse.nodered.org/u/rromele)
#### Post date: [26 April 2020 22:49 UTC](https://discourse.nodered.org/t/modbus-write-to-register-8601-value-6-7-15/25518/5 "2020-04-26T22:49:07Z")

</div>

![00](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/6/2/62eb23d6ae5fe5dc1dc79f3731130b1f6734495d.jpeg)

---

<div class="post-metadata">

### Author: ![Heineken](https://avatars.discourse-cdn.com/v4/letter/h/c37758/32.png) [@Heineken](https://discourse.nodered.org/u/Heineken)
#### Post date: [26 April 2020 23:08 UTC](https://discourse.nodered.org/t/modbus-write-to-register-8601-value-6-7-15/25518/6 "2020-04-26T23:08:27Z")

</div>

H Rromele thank you for the help i got it to work by , by setting the FR1 value to modbus i can now stop, start and set speed .

---

<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: [25 June 2020 23:21 UTC](https://discourse.nodered.org/t/modbus-write-to-register-8601-value-6-7-15/25518/7 "2020-06-25T23:21:56Z")

</div>

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