# Modbus server with flex-server

**URL:** <https://discourse.nodered.org/t/modbus-server-with-flex-server/70311>\
**Category:** General\
**Tags:** modbus\
**Created:** [9 November 2022 09:23 UTC](https://discourse.nodered.org/t/modbus-server-with-flex-server/70311 "2022-11-09T09:23:05Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![crashoverhead](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/crashoverhead/32/44849_2.png) [@crashoverhead](https://discourse.nodered.org/u/crashoverhead)\
**Post date:** [9 November 2022 09:23 UTC](https://discourse.nodered.org/t/modbus-server-with-flex-server/70311/1 "2022-11-09T09:23:05Z")

</div>

HI all, i need of a modbus server and im using Modbus-flex server.  
the server is configured as figure below

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/0/a/0a633f946639f40ccd80d4790b3bb43531f1e773.png)

and i write the data in to the holding register  
msg.pv=msg.payload.PV  
msg.SP=msg.payload.SP  
msg.PV\_BK=msg.payload.PV\_BACK

msg.payload = {  
'value': [Math.round(msg.pv),Math.round(msg.SP),Math.round(msg.PV\_BK)],  
'register': 'holding',  
'address': 0 ,  
'disableMsgOutput' : 0  
};  
return msg;

and i see it from the debug of server  
{"type":"holding","message":{"payload":{"value":[464,465,455],"register":"holding","address":0,"disableMsgOutput":0},"topic":"","\_msgid":"b5e2ad2aeca32b6c","pv":464,"SP":464.99957275390625,"PV\_BK":454.79998779296875,"bufferAddress":0,"bufferPayload":{"0":208,"1":209,"2":199},"bufferData":[208,209,199],"wasMultipleWrite":true},"payload":[208,209,199,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],"\_msgid":"b58c502bce7a1edb"}

but when i read the value from it the result is not the same  
[51200,0,0,0,0,0]

Why ?

Maybe the problem is the datatype of number that i put in to the register?

Anyone know the flex modbus server how it work?

thanks in advantage!

---

<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:** [8 January 2023 09:23 UTC](https://discourse.nodered.org/t/modbus-server-with-flex-server/70311/2 "2023-01-08T09:23:24Z")

</div>

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