[{"data":1,"prerenderedAt":744},["ShallowReactive",2],{"blog-\u002Fblog\u002F2025\u002F09\u002Fusing-modbus-with-flowfuse":3},{"id":4,"title":5,"body":6,"description":12,"extension":733,"meta":734,"navigation":739,"path":740,"seo":741,"stem":742,"__hash__":743},"blog\u002Fblog\u002F2025\u002F09\u002Fusing-modbus-with-flowfuse.md","Modbus RTU (RS485\u002FRS422\u002FRS232) Communications with FlowFuse",{"type":7,"value":8,"toc":719},"minimark",[9,13,16,21,29,32,37,40,68,74,78,81,101,111,118,122,125,129,132,191,195,198,228,239,310,318,328,332,339,342,474,490,494,501,526,537,542,607,610,623,633,637,640,672,676,683,700,707,715],[10,11,12],"p",{},"Modbus RTU is one of the most widely used communication protocols in industrial automation. It allows you to read sensor data, monitor equipment status, and control devices through a simple master-slave architecture. This guide will walk you through everything you need to know to start reading and writing industrial data with FlowFuse (a platform built around Node-RED with enterprise-level capabilities).",[10,14,15],{},"Whether you're connecting a single sensor or building a comprehensive industrial monitoring system, this step-by-step guide will show you how to leverage FlowFuse's powerful capabilities to bridge the gap between legacy industrial devices and modern data systems.",[17,18,20],"h2",{"id":19},"understanding-modbus-rtu-basics","Understanding Modbus RTU Basics",[10,22,23,24,28],{},"Modbus RTU operates on a ",[25,26,27],"strong",{},"master–slave system",". Unlike its TCP counterpart, it runs over serial connections (RS485\u002FRS422\u002FRS232), making it extremely reliable in environments where network connectivity may be unstable. The protocol has been battle-tested in harsh conditions for decades, which is why it is still used in everything from simple temperature sensors to complex PLCs.",[10,30,31],{},"In a FlowFuse setup, the instance acts as the master, initiating all communication. Devices such as sensors, meters, and controllers act as slaves, responding only when addressed. Each slave has a unique address from 1 to 247, with 0 reserved for broadcast messages. Communication follows a simple pattern: the master sends a request, the addressed slave responds, and the master processes the response before moving to the next device.",[33,34,36],"h3",{"id":35},"device-data-types","Device Data Types",[10,38,39],{},"Devices organize data into four main types, each with a specific purpose:",[41,42,43,50,56,62],"ul",{},[44,45,46,49],"li",{},[25,47,48],{},"Coils (Digital Outputs)"," – Remote switches you can turn on\u002Foff from FlowFuse, used for motors, pumps, relays, or alarms.",[44,51,52,55],{},[25,53,54],{},"Discrete Inputs (Digital Inputs)"," – Read-only status points that indicate the state of buttons, doors, or alarms.",[44,57,58,61],{},[25,59,60],{},"Input Registers (Analog Inputs)"," – Read-only values representing measurements such as temperature, pressure, or flow.",[44,63,64,67],{},[25,65,66],{},"Holding Registers (Analog Outputs\u002FSettings)"," – Read\u002Fwrite values for setpoints, timers, and configuration parameters.",[10,69,70,73],{},[25,71,72],{},"Note:"," Coils and discrete inputs are single-bit (ON\u002FOFF), while registers store 16-bit values that may require scaling depending on the device.",[33,75,77],{"id":76},"register-addressing","Register Addressing",[10,79,80],{},"Addressing can be confusing because manufacturers document it differently:",[41,82,83,89,95],{},[44,84,85,88],{},[25,86,87],{},"Zero-based"," – Modbus standard (first register = 0).",[44,90,91,94],{},[25,92,93],{},"One-based"," – Some manuals start counting at 1 (subtract 1 in FlowFuse).",[44,96,97,100],{},[25,98,99],{},"Offset-based"," – Registers like 40001 or 30001 require subtracting the base number to get the actual address.",[10,102,103,106,107,110],{},[25,104,105],{},"Example:"," If a manual shows “Temperature = 40001,” FlowFuse should use address ",[25,108,109],{},"0",". Always refer to the device’s “Register Map” for clarity.",[10,112,113,114,117],{},"By understanding the ",[25,115,116],{},"master-slave control, data types, and addressing",", you can reliably communicate with your devices and make the most of Modbus RTU in FlowFuse.",[17,119,121],{"id":120},"getting-started","Getting Started",[10,123,124],{},"Let’s start by setting up the basics before connecting Modbus RTU devices to FlowFuse.",[33,126,128],{"id":127},"prerequisites","Prerequisites",[10,130,131],{},"Before diving in, make sure you have the following ready:",[41,133,134,153,164,170],{},[44,135,136,139,140,147,148,152],{},[25,137,138],{},"Node-RED instance"," – A running Node-RED instance. The quickest way to get one ready for production is with FlowFuse. Simply ",[141,142,146],"a",{"href":143,"rel":144},"https:\u002F\u002Fapp.flowfuse.com\u002Faccount\u002Fcreate",[145],"nofollow","sign up"," and ",[141,149,151],{"href":150},"\u002Fblog\u002F2025\u002F09\u002Finstalling-node-red\u002F","create and set up a remote instance",", and you’ll have a managed Node-RED environment running in minutes.",[44,154,155,158,159,163],{},[25,156,157],{},"Node-RED Modbus nodes"," – Installable via the Palette Manager (",[160,161,162],"code",{},"node-red-contrib-modbus",").",[44,165,166,169],{},[25,167,168],{},"Modbus-enabled device"," – Such as a sensor, PLC, or meter, along with its register map documentation.",[44,171,172,175,176,147,179,182,183,186,187,190],{},[25,173,174],{},"Serial interface"," – For example, a USB-to-RS485 converter to physically connect your Modbus devices. Connect the ",[25,177,178],{},"A (+)",[25,180,181],{},"B (–)"," terminals of the RS485 adapter to the device, add termination resistors if the line is long or has multiple devices, and note the serial port path (e.g., ",[160,184,185],{},"\u002Fdev\u002FttyUSB0"," on Linux or ",[160,188,189],{},"COM1"," on Windows).",[17,192,194],{"id":193},"reading-data","Reading Data",[10,196,197],{},"Reading data from Modbus slaves in FlowFuse is straightforward. The process is the same regardless of which data type you want to read.",[199,200,201],"ol",{},[44,202,203,204,207,208,211,212,215,216,219,220,223,224,227],{},"Drag the ",[25,205,206],{},"Modbus Read"," node onto the FlowFuse canvas. Double-click it to open the configuration. Enter the ",[25,209,210],{},"Unit ID"," (slave address), select the ",[25,213,214],{},"data type"," you want to read, specify the ",[25,217,218],{},"starting address",", set the ",[25,221,222],{},"quantity"," of values to read, and define the ",[25,225,226],{},"poll rate"," (how often data should be read).",[10,229,230,236],{},[231,232],"img",{"alt":233,"dataZoomable":234,"src":235},"Modbus Read node configured to read data from a slave device.","","\u002Fblog\u002F2025\u002F09\u002Fimages\u002Fmodbus-read.png",[237,238,233],"em",{},[199,240,242,253],{"start":241},2,[44,243,244,245,248,249,252],{},"Click the ",[25,246,247],{},"+"," icon next to the ",[237,250,251],{},"Server"," field to add Modbus connection details.",[44,254,255,256,306,309],{},"In the server configuration window:",[41,257,258,269,281],{},[44,259,260,261,264,265,268],{},"Set ",[25,262,263],{},"Type"," to ",[237,266,267],{},"Serial",".",[44,270,271,272,275,276,186,278,280],{},"In the ",[25,273,274],{},"Serial Port"," field, use the dropdown or search option to see all available ports (e.g., ",[160,277,185],{},[160,279,189],{}," on Windows). Select the port to which your Modbus device is connected.",[44,282,283,284],{},"Configure the communication settings to match your device:",[41,285,286,291,296,301],{},[44,287,288],{},[25,289,290],{},"Baud Rate",[44,292,293],{},[25,294,295],{},"Data Bits",[44,297,298],{},[25,299,300],{},"Stop Bits",[44,302,303],{},[25,304,305],{},"Parity",[307,308],"br",{},"These values must match exactly with the Modbus device’s configuration; otherwise, the communication will fail.",[10,311,312,316],{},[231,313],{"alt":314,"dataZoomable":234,"src":315},"Serial port and communication settings for the Modbus device.","\u002Fblog\u002F2025\u002F09\u002Fimages\u002Fmodbus-configuration.png",[237,317,314],{},[199,319,321],{"start":320},4,[44,322,323,324,327],{},"Connect the Modbus Read node to a ",[25,325,326],{},"Debug"," node and deploy your flow. If everything is set up correctly, you will start seeing live data from your Modbus device in the debug sidebar.",[17,329,331],{"id":330},"writing-data","Writing Data",[10,333,334,335,338],{},"Modbus RTU allows you to ",[25,336,337],{},"write data back to devices",", enabling control of motors, relays, setpoints, and other outputs directly from FlowFuse.",[10,340,341],{},"Follow these steps to configure and test writing:",[199,343,344,350,420,468],{},[44,345,203,346,349],{},[25,347,348],{},"Modbus Write"," node onto the canvas. This node will send data to your Modbus device.",[44,351,352,353,404,406,410,412,414,418],{},"Double-click the node and set:",[41,354,355,360,392,398],{},[44,356,357,359],{},[25,358,210],{}," – the slave address of your device.",[44,361,362,365,366],{},[25,363,364],{},"Data type"," – choose one of:",[41,367,368,374,380,386],{},[44,369,370,373],{},[237,371,372],{},"Force Single Coil"," – write one digital output.",[44,375,376,379],{},[237,377,378],{},"Force Multiple Coils"," – write several digital outputs at once.",[44,381,382,385],{},[237,383,384],{},"Preset Single Register"," – write one analog\u002Fconfig value.",[44,387,388,391],{},[237,389,390],{},"Force Multiple Registers"," – write several analog values at once.",[44,393,394,397],{},[25,395,396],{},"Address"," – the target coil or register.",[44,399,400,403],{},[25,401,402],{},"Quantity"," – only for multiple writes, set the number of values you will send.",[307,405],{},[231,407],{"alt":408,"dataZoomable":234,"src":409},"Writing a single coil using the Modbus Write node.","\u002Fblog\u002F2025\u002F09\u002Fimages\u002Fwrite-single-coil.png",[237,411,408],{},[307,413],{},[231,415],{"alt":416,"dataZoomable":234,"src":417},"Writing multiple coils using the Modbus Write node.","\u002Fblog\u002F2025\u002F09\u002Fimages\u002Fwrite-multi-coils.png",[237,419,416],{},[44,421,422,423,426,427,449,451,454],{},"Connect an ",[25,424,425],{},"Inject"," node to the Modbus Write node to send values:",[41,428,429,443],{},[44,430,431,434,435,438,439,442],{},[25,432,433],{},"Single Coil\u002FRegister:"," send a boolean (",[160,436,437],{},"true","\u002F",[160,440,441],{},"false",") for coils or a number for registers.",[44,444,445,448],{},[25,446,447],{},"Multiple Coils\u002FRegisters:"," send an array corresponding to each value.",[307,450],{},[25,452,453],{},"Examples:",[41,455,456,462],{},[44,457,458,461],{},[160,459,460],{},"[true, false, true]"," → Coils 0, 1, 2",[44,463,464,467],{},[160,465,466],{},"[25, 50, 75]"," → Holding Registers 0, 1, 2",[44,469,470,471,473],{},"Deploy the flow and press ",[25,472,425],{},". The Modbus device should update immediately.",[10,475,476,479,480,483,484,489],{},[25,477,478],{},"Tip:"," Use a ",[25,481,482],{},"UI input (slider, switch, or numeric box)"," from the ",[141,485,488],{"href":486,"rel":487},"https:\u002F\u002Fdashboard.flowfuse.com\u002F",[145],"FlowFuse Dashboard"," instead of an Inject node for real-time control via a web interface.",[17,491,493],{"id":492},"scaling-and-interpreting-values","Scaling and Interpreting Values",[10,495,496,497,500],{},"Raw Modbus values often don’t make sense until you apply ",[25,498,499],{},"scaling factors"," or unit conversions.",[41,502,503,513,523],{},[44,504,505,506,509,510,268],{},"A temperature register might return ",[160,507,508],{},"235",", which actually means ",[25,511,512],{},"23.5 °C",[44,514,515,516,519,520,268],{},"An energy meter might output ",[160,517,518],{},"12345",", representing ",[25,521,522],{},"12.345 kWh",[44,524,525],{},"A pressure sensor could use two consecutive registers (32-bit values) that need decoding.",[10,527,528,529,532,533,536],{},"You can handle these conversions with simple ",[25,530,531],{},"Function nodes"," or ",[25,534,535],{},"Change nodes"," in FlowFuse.",[10,538,539],{},[25,540,541],{},"Example Function Node:",[543,544,548],"pre",{"className":545,"code":546,"language":547,"meta":234,"style":234},"language-javascript shiki shiki-themes github-light github-dark","\u002F\u002F Convert raw register value to temperature in °C\nlet raw = msg.payload[0];\nmsg.payload = raw \u002F 10;\nreturn msg;\n","javascript",[160,549,550,559,581,599],{"__ignoreMap":234},[551,552,555],"span",{"class":553,"line":554},"line",1,[551,556,558],{"class":557},"sJ8bj","\u002F\u002F Convert raw register value to temperature in °C\n",[551,560,561,565,569,572,575,578],{"class":553,"line":241},[551,562,564],{"class":563},"szBVR","let",[551,566,568],{"class":567},"sVt8B"," raw ",[551,570,571],{"class":563},"=",[551,573,574],{"class":567}," msg.payload[",[551,576,109],{"class":577},"sj4cs",[551,579,580],{"class":567},"];\n",[551,582,584,587,589,591,593,596],{"class":553,"line":583},3,[551,585,586],{"class":567},"msg.payload ",[551,588,571],{"class":563},[551,590,568],{"class":567},[551,592,438],{"class":563},[551,594,595],{"class":577}," 10",[551,597,598],{"class":567},";\n",[551,600,601,604],{"class":553,"line":320},[551,602,603],{"class":563},"return",[551,605,606],{"class":567}," msg;\n",[10,608,609],{},"This takes the raw register, divides it by 10, and gives you a clean, human-readable temperature.",[10,611,612,614,615,618,619,268],{},[25,613,478],{}," You do not need to know JavaScript — simply use the ",[25,616,617],{},"FlowFuse Expert",", which can generate a Function node for you from plain English instructions. For the most accurate results, provide sample data along with the scaling you want to achieve. You can learn more in this article: ",[141,620,622],{"href":621},"\u002Fblog\u002F2025\u002F07\u002Fflowfuse-ai-assistant-better-node-red-manufacturing\u002F","FlowFuse Expert for Manufacturing",[10,624,625,628,629,632],{},[25,626,627],{},"Best Practice:"," Always keep a copy of the device’s ",[25,630,631],{},"Register Map documentation"," handy. It tells you which addresses map to which variables, and how to interpret them.",[17,634,636],{"id":635},"troubleshooting-tips","Troubleshooting Tips",[10,638,639],{},"If things do not work on the first attempt, avoid frustration. Modbus is straightforward, but even small configuration mismatches can disrupt communication.",[41,641,642,649,656,662,669],{},[44,643,644,645,648],{},"Verify the ",[25,646,647],{},"serial port"," is correct and not already in use.",[44,650,651,652,655],{},"Double-check ",[25,653,654],{},"baud rate, data bits, stop bits, and parity",". Even a single mismatch will block communication.",[44,657,658,659,661],{},"Ensure the ",[25,660,210],{}," matches your device’s slave address.",[44,663,664,665,668],{},"Keep your wiring neat. For longer cables, use ",[25,666,667],{},"termination resistors"," and twisted-pair shielded cables.",[44,670,671],{},"Use a Modbus simulator or diagnostic tool to test the setup if the hardware isn’t responding.",[17,673,675],{"id":674},"conclusion","Conclusion",[10,677,678,679,682],{},"Modbus RTU has stood the test of time in industrial automation because it’s simple, reliable, and built for harsh environments. With FlowFuse, you can take this legacy protocol and give it ",[25,680,681],{},"modern superpowers",":",[41,684,685,688,691,694],{},[44,686,687],{},"Collect real-time data from sensors and machines.",[44,689,690],{},"Control devices directly from a web dashboard.",[44,692,693],{},"Combine Modbus with MQTT, REST APIs, or databases to share data across your entire organization.",[44,695,696,697,268],{},"Scale from a single sensor to a ",[25,698,699],{},"factory-wide monitoring and control system",[10,701,702,703,706],{},"The real value comes when you stop treating Modbus as just a communication protocol and start using FlowFuse as the ",[25,704,705],{},"bridge between industrial devices and enterprise systems",". From dashboards to alerts, from analytics to cloud integration — the possibilities are endless once the data is in your hands.",[10,708,709,710,714],{},"Modbus is one of several protocols FlowFuse uses to connect PLCs — see ",[141,711,713],{"href":712},"\u002Flanding\u002Fplc\u002F","how FlowFuse connects any PLC to MQTT, cloud, and enterprise systems"," for the full picture.",[716,717,718],"style",{},"html pre.shiki code .sJ8bj, html code.shiki .sJ8bj{--shiki-default:#6A737D;--shiki-dark:#6A737D}html pre.shiki code .szBVR, html code.shiki .szBVR{--shiki-default:#D73A49;--shiki-dark:#F97583}html pre.shiki code .sVt8B, html code.shiki .sVt8B{--shiki-default:#24292E;--shiki-dark:#E1E4E8}html pre.shiki code .sj4cs, html code.shiki .sj4cs{--shiki-default:#005CC5;--shiki-dark:#79B8FF}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}",{"title":234,"searchDepth":241,"depth":241,"links":720},[721,725,728,729,730,731,732],{"id":19,"depth":241,"text":20,"children":722},[723,724],{"id":35,"depth":583,"text":36},{"id":76,"depth":583,"text":77},{"id":120,"depth":241,"text":121,"children":726},[727],{"id":127,"depth":583,"text":128},{"id":193,"depth":241,"text":194},{"id":330,"depth":241,"text":331},{"id":492,"depth":241,"text":493},{"id":635,"depth":241,"text":636},{"id":674,"depth":241,"text":675},"md",{"navTitle":5,"excerpt":735},{"type":7,"value":736},[737],[10,738,12],{},true,"\u002Fblog\u002F2025\u002F09\u002Fusing-modbus-with-flowfuse",{"title":5,"description":12},"blog\u002F2025\u002F09\u002Fusing-modbus-with-flowfuse","u_LGqE80F8Qo6VeoN-LcMHnPjvfYrjmlGi8DRicyWT8",1780070553441]