[{"data":1,"prerenderedAt":1053},["ShallowReactive",2],{"blog-\u002Fblog\u002F2025\u002F10\u002Fhow-to-log-plc-data-csv-files":3},{"id":4,"title":5,"body":6,"description":12,"extension":1043,"meta":1044,"navigation":283,"path":1049,"seo":1050,"stem":1051,"__hash__":1052},"blog\u002Fblog\u002F2025\u002F10\u002Fhow-to-log-plc-data-csv-files.md","How to Log PLC Data to CSV Files",{"type":7,"value":8,"toc":1025},"minimark",[9,13,16,19,22,30,41,46,49,67,71,74,79,82,85,93,106,110,113,152,155,159,162,166,169,172,175,178,182,185,189,192,207,211,214,225,439,444,455,459,462,492,500,503,507,510,540,548,551,554,558,561,564,572,924,944,947,951,954,957,971,974,979,984,988,991,994,997,1000,1003,1010,1021],[10,11,12],"p",{},"CSV files have been recording manufacturing data since the mid-1980s, over 40 years of continuous use across every industry. Logging to databases like InfluxDB, TimescaleDB, or PostgreSQL is excellent for real-time analytics, complex queries, and large-scale operations. But many organizations still rely on CSV files for good reasons: regulatory compliance, legacy system integration, offline analysis, or simply because it's the format their teams know and trust. If you're reading this, you're likely one of them and need a reliable solution.",[10,14,15],{},"CSV files offer something databases can't always guarantee: universal compatibility and permanence. Excel opens them instantly, databases import them natively, and analysis tools expect them. No licensing, no vendor tie-ins, no format obsolescence. Data captured decades ago is still perfectly readable today and will be readable decades from now, regardless of what systems you're using.",[10,17,18],{},"The truth is, most manufacturers use both for distinct purposes. CSVs remain the standard on the shop floor for data loggers that write locally during network outages, regulatory submissions requiring immutable audit trails, batch documentation archived for decades, and data exchange with suppliers and auditors.",[10,20,21],{},"Meanwhile, databases handle real-time monitoring and automated alerts, cross-functional analytics, high-frequency sensor queries, and dynamic relationships across materials and equipment.",[10,23,24,25,29],{},"This isn't an either\u002For choice. It's a dual-track system where databases provide operational speed and CSVs provide the permanence layer, ensuring your compliance records and critical data outlive any technology stack.\nThis guide shows how to implement PLC data logging with ",[26,27,28],"strong",{},"FlowFuse"," in a way that keeps running, stable, resilient, and production-ready.",[10,31,32,38],{},[33,34],"img",{"alt":35,"dataZoomable":36,"src":37},"Image showing FlowFuse collecting data from a PLC using OPC UA and logging it to a CSV file.","","\u002Fblog\u002F2025\u002F10\u002Fimages\u002Fplc-to-csv.gif",[39,40,35],"em",{},[42,43,45],"h2",{"id":44},"prerequisites","Prerequisites",[10,47,48],{},"Before getting started, make sure you have:",[50,51,52],"ul",{},[53,54,55,58,59,66],"li",{},[26,56,57],{},"A running FlowFuse instance"," – If you don’t have one yet, ",[60,61,65],"a",{"href":62,"rel":63},"https:\u002F\u002Fapp.flowfuse.com\u002Faccount\u002Fcreate",[64],"nofollow","sign up"," for FlowFuse and set up an instance on your edge device. This device will manage data collection and logging from your PLC using Node-RED.",[42,68,70],{"id":69},"step-1-setting-up-plc-communication-in-flowfuse","Step 1: Setting Up PLC Communication in FlowFuse",[10,72,73],{},"Before logging data, you need a stable connection to your PLC. FlowFuse uses Node-RED under the hood, which supports every major industrial protocol through community-maintained packages. This means you can connect to any equipment—regardless of age or manufacturer.",[75,76,78],"h3",{"id":77},"choosing-your-protocol","Choosing Your Protocol",[10,80,81],{},"The right protocol depends on what your PLC supports.",[10,83,84],{},"Modern PLCs typically offer open standards like OPC UA, Modbus TCP, or EtherNet\u002FIP. These protocols work across different manufacturers and give you the most flexibility.",[10,86,87,88,92],{},"If your PLC supports OPC UA, that is likely your best option. It is becoming the common language across industrial equipment—Siemens, Rockwell, Schneider, and most other manufacturers support it. This is also the option I used in the demo I prepared for this article. For more information on how to use OPC UA with your PLC, you can refer to ",[60,89,91],{"href":90},"\u002Fblog\u002F2025\u002F07\u002Freading-and-writing-plc-data-using-opc-ua\u002F","this article",".",[10,94,95,96,100,101,105],{},"Legacy systems use vendor-specific protocols: ",[60,97,99],{"href":98},"\u002Fblog\u002F2025\u002F01\u002Fintegrating-siemens-s7-plcs-with-node-red-guide\u002F","S7"," for Siemens, MC Protocol for Mitsubishi, FINS for Omron, and ",[60,102,104],{"href":103},"\u002Fblog\u002F2025\u002F10\u002Fusing-ethernet-ip-with-flowfuse\u002F","EtherNet\u002FIP"," for Allen-Bradley. If your PLC only speaks its native language, Node-RED has dedicated nodes for each one.",[75,107,109],{"id":108},"installing-the-right-node","Installing the Right Node",[10,111,112],{},"Node-RED's package ecosystem includes nodes for virtually every industrial protocol. The most common ones are:",[50,114,115,122,128,134,140,146],{},[53,116,117,121],{},[118,119,120],"code",{},"node-red-contrib-modbus"," – Modbus RTU\u002FTCP devices",[53,123,124,127],{},[118,125,126],{},"node-red-contrib-s7"," – Siemens S7-300\u002F400\u002F1200\u002F1500",[53,129,130,133],{},[118,131,132],{},"node-red-contrib-opcua"," – OPC UA servers",[53,135,136,139],{},[118,137,138],{},"node-red-contrib-cip-ethernet-ip"," – Allen-Bradley PLCs",[53,141,142,145],{},[118,143,144],{},"node-red-contrib-mcprotocol"," – Mitsubishi Q\u002FL series",[53,147,148,151],{},[118,149,150],{},"node-red-contrib-omron-fins"," – Omron PLCs",[10,153,154],{},"To install a package in FlowFuse, go to the palette manager (hamburger menu → Manage palette → Install) and search for the node you need. Installation takes seconds.",[75,156,158],{"id":157},"configuring-your-connection","Configuring Your Connection",[10,160,161],{},"Drag the appropriate input node onto your canvas and configure it according to the node's documentation.",[75,163,165],{"id":164},"verifying-data-quality","Verifying Data Quality",[10,167,168],{},"Before building your logging flow, verify you're getting clean, consistent data. Connect a debug node to your PLC input, deploy, and watch the incoming messages.",[10,170,171],{},"You should see values updating at your configured interval with consistent structure and sensible numbers. No connection errors, timeouts, or garbage data.",[10,173,174],{},"If something's wrong—intermittent connections, bad values, protocol errors—fix it now. Connection problems multiply when you add logging logic on top.",[10,176,177],{},"A stable PLC connection is the foundation. Get this right, and the rest is straightforward.",[42,179,181],{"id":180},"step-2-building-the-basic-csv-logging-flow","Step 2: Building the Basic CSV Logging Flow",[10,183,184],{},"With a stable PLC connection verified, you can now build the flow that writes data to CSV files.",[75,186,188],{"id":187},"understanding-the-data-flow","Understanding the Data Flow",[10,190,191],{},"The logging system needs four components working together:",[193,194,195,198,201,204],"ol",{},[53,196,197],{},"PLC input node that collects data at regular intervals",[53,199,200],{},"Function node that adds timestamps and handles daily file rotation",[53,202,203],{},"CSV node that formats data into proper CSV structure",[53,205,206],{},"File node that writes to disk",[75,208,210],{"id":209},"adding-timestamps-and-daily-file-rotation","Adding Timestamps and Daily File Rotation",[10,212,213],{},"Your PLC data needs timestamps and a way to organize files by date.",[193,215,216,219,222],{},[53,217,218],{},"Drag a function node onto your canvas",[53,220,221],{},"Connect it to your PLC input node",[53,223,224],{},"Double-click the function node and add this code:",[226,227,231],"pre",{"className":228,"code":229,"language":230,"meta":36,"style":36},"language-javascript shiki shiki-themes github-light github-dark","const now = new Date();\nconst timestamp = now.toISOString();\n\n\u002F\u002F Create filename with today's date (YYYY-MM-DD format)\nconst dateStr = now.toISOString().split('T')[0];\nconst filename = `.\u002Fplc_data_${dateStr}.csv`;\n\n\u002F\u002F Structure the data\nmsg.payload = {\n    timestamp: timestamp,\n    temperature: msg.payload.temperature,\n    pressure: msg.payload.pressure,\n    flowRate: msg.payload.flowRate\n};\n\n\u002F\u002F Store filename for the file node\nmsg.filename = filename;\n\nreturn msg;\n","javascript",[118,232,233,260,278,285,292,328,350,355,361,373,379,385,391,397,403,408,414,425,430],{"__ignoreMap":36},[234,235,238,242,246,249,252,256],"span",{"class":236,"line":237},"line",1,[234,239,241],{"class":240},"szBVR","const",[234,243,245],{"class":244},"sj4cs"," now",[234,247,248],{"class":240}," =",[234,250,251],{"class":240}," new",[234,253,255],{"class":254},"sScJk"," Date",[234,257,259],{"class":258},"sVt8B","();\n",[234,261,263,265,268,270,273,276],{"class":236,"line":262},2,[234,264,241],{"class":240},[234,266,267],{"class":244}," timestamp",[234,269,248],{"class":240},[234,271,272],{"class":258}," now.",[234,274,275],{"class":254},"toISOString",[234,277,259],{"class":258},[234,279,281],{"class":236,"line":280},3,[234,282,284],{"emptyLinePlaceholder":283},true,"\n",[234,286,288],{"class":236,"line":287},4,[234,289,291],{"class":290},"sJ8bj","\u002F\u002F Create filename with today's date (YYYY-MM-DD format)\n",[234,293,295,297,300,302,304,306,309,312,315,319,322,325],{"class":236,"line":294},5,[234,296,241],{"class":240},[234,298,299],{"class":244}," dateStr",[234,301,248],{"class":240},[234,303,272],{"class":258},[234,305,275],{"class":254},[234,307,308],{"class":258},"().",[234,310,311],{"class":254},"split",[234,313,314],{"class":258},"(",[234,316,318],{"class":317},"sZZnC","'T'",[234,320,321],{"class":258},")[",[234,323,324],{"class":244},"0",[234,326,327],{"class":258},"];\n",[234,329,331,333,336,338,341,344,347],{"class":236,"line":330},6,[234,332,241],{"class":240},[234,334,335],{"class":244}," filename",[234,337,248],{"class":240},[234,339,340],{"class":317}," `.\u002Fplc_data_${",[234,342,343],{"class":258},"dateStr",[234,345,346],{"class":317},"}.csv`",[234,348,349],{"class":258},";\n",[234,351,353],{"class":236,"line":352},7,[234,354,284],{"emptyLinePlaceholder":283},[234,356,358],{"class":236,"line":357},8,[234,359,360],{"class":290},"\u002F\u002F Structure the data\n",[234,362,364,367,370],{"class":236,"line":363},9,[234,365,366],{"class":258},"msg.payload ",[234,368,369],{"class":240},"=",[234,371,372],{"class":258}," {\n",[234,374,376],{"class":236,"line":375},10,[234,377,378],{"class":258},"    timestamp: timestamp,\n",[234,380,382],{"class":236,"line":381},11,[234,383,384],{"class":258},"    temperature: msg.payload.temperature,\n",[234,386,388],{"class":236,"line":387},12,[234,389,390],{"class":258},"    pressure: msg.payload.pressure,\n",[234,392,394],{"class":236,"line":393},13,[234,395,396],{"class":258},"    flowRate: msg.payload.flowRate\n",[234,398,400],{"class":236,"line":399},14,[234,401,402],{"class":258},"};\n",[234,404,406],{"class":236,"line":405},15,[234,407,284],{"emptyLinePlaceholder":283},[234,409,411],{"class":236,"line":410},16,[234,412,413],{"class":290},"\u002F\u002F Store filename for the file node\n",[234,415,417,420,422],{"class":236,"line":416},17,[234,418,419],{"class":258},"msg.filename ",[234,421,369],{"class":240},[234,423,424],{"class":258}," filename;\n",[234,426,428],{"class":236,"line":427},18,[234,429,284],{"emptyLinePlaceholder":283},[234,431,433,436],{"class":236,"line":432},19,[234,434,435],{"class":240},"return",[234,437,438],{"class":258}," msg;\n",[193,440,441],{"start":287},[53,442,443],{},"Click Done",[10,445,446,447,450,451,454],{},"This creates a new file each day automatically. When the date changes, the filename changes, and Node-RED starts writing to a fresh file. Your logs stay organized by date: ",[118,448,449],{},"plc_data_2025-10-16.csv",", ",[118,452,453],{},"plc_data_2025-10-17.csv",", and so on.",[75,456,458],{"id":457},"formatting-data-with-the-csv-node","Formatting Data with the CSV Node",[10,460,461],{},"The CSV node handles all the formatting work—proper escaping, column ordering, and headers.",[193,463,464,467,470,490],{},[53,465,466],{},"Drag a CSV node onto your canvas",[53,468,469],{},"Connect it to your function node",[53,471,472,473],{},"Double-click to configure:\n",[50,474,475,481,484,487],{},[53,476,477,478],{},"Set the columns: ",[118,479,480],{},"timestamp,temperature",[53,482,483],{},"Enable \"first row contains column names\"",[53,485,486],{},"Choose comma as the separator",[53,488,489],{},"Choose RFC 4180 as parser (this handles commas in your data—like alarm messages or status text—by wrapping them in quotes so they don't break the CSV structure)",[53,491,443],{},[10,493,494,498],{},[33,495],{"alt":496,"dataZoomable":36,"src":497},"Image showing CSV node configuration","\u002Fblog\u002F2025\u002F10\u002Fimages\u002Fcsv-config.png",[39,499,496],{},[10,501,502],{},"The CSV node converts your data object into a properly formatted CSV line with headers included automatically when a new file is created.",[75,504,506],{"id":505},"writing-to-file","Writing to File",[10,508,509],{},"The file node writes your formatted CSV data to disk.",[193,511,512,515,518,535,537],{},[53,513,514],{},"Drag a file node onto your canvas",[53,516,517],{},"Connect it to your CSV node",[53,519,472,520],{},[50,521,522,529,532],{},[53,523,524,525,528],{},"Set filename to ",[118,526,527],{},"msg.filename"," (uses the dynamic filename from your function)",[53,530,531],{},"Choose \"append to file\" mode",[53,533,534],{},"Enable \"Create directory if it doesn't exist\"",[53,536,443],{},[53,538,539],{},"Deploy your flow",[10,541,542,546],{},[33,543],{"alt":544,"dataZoomable":36,"src":545},"Image showing Write node configuration","\u002Fblog\u002F2025\u002F10\u002Fimages\u002Fwrite-file-config.png",[39,547,544],{},[10,549,550],{},"Let it run. Each day at midnight, the system automatically starts a new file. Old files stay untouched, new data goes to today's file.",[10,552,553],{},"This daily rotation keeps file sizes manageable and makes it easy to find data from specific dates. But there are still edge cases to handle—what happens when disk space runs low or file writes fail? The next step addresses these reliability issues.",[42,555,557],{"id":556},"step-3-monitoring-disk-usage","Step 3: Monitoring Disk Usage",[10,559,560],{},"Running a logging system continuously means files accumulate. Monitor disk space to prevent unexpected failures when storage runs low.",[10,562,563],{},"Add disk space monitoring to prevent unexpected failures.",[193,565,566,569],{},[53,567,568],{},"Drag an inject node onto your canvas and configure it to trigger every hour",[53,570,571],{},"Add a Function node with the following code. Since the code uses the fs module, make sure to import it within the setup of function node:",[226,573,575],{"className":228,"code":574,"language":230,"meta":36,"style":36},"try {\n    \u002F\u002F Get disk usage information\n    const stats = fs.statfsSync('.\u002F');\n\n    const totalSpace = stats.blocks * stats.bsize;\n    const freeSpace = stats.bfree * stats.bsize;\n    const usedSpace = totalSpace - freeSpace;\n    const percentUsed = (usedSpace \u002F totalSpace) * 100;\n\n    msg.payload = {\n        totalGB: (totalSpace \u002F (1024 ** 3)).toFixed(2),\n        freeGB: (freeSpace \u002F (1024 ** 3)).toFixed(2),\n        usedGB: (usedSpace \u002F (1024 ** 3)).toFixed(2),\n        percentUsed: percentUsed.toFixed(2)\n    };\n\n    \u002F\u002F Warning threshold\n    if (percentUsed > 90) {\n        msg.warning = `Disk space critical: ${percentUsed.toFixed(1)}% used`;\n    }\n\n    return msg;\n\n} catch (err) {\n    msg.payload = { error: err.message };\n    return msg;\n}\n",[118,576,577,584,589,613,617,635,651,669,694,698,707,740,765,790,804,809,813,818,835,865,871,876,884,889,901,911,918],{"__ignoreMap":36},[234,578,579,582],{"class":236,"line":237},[234,580,581],{"class":240},"try",[234,583,372],{"class":258},[234,585,586],{"class":236,"line":262},[234,587,588],{"class":290},"    \u002F\u002F Get disk usage information\n",[234,590,591,594,597,599,602,605,607,610],{"class":236,"line":280},[234,592,593],{"class":240},"    const",[234,595,596],{"class":244}," stats",[234,598,248],{"class":240},[234,600,601],{"class":258}," fs.",[234,603,604],{"class":254},"statfsSync",[234,606,314],{"class":258},[234,608,609],{"class":317},"'.\u002F'",[234,611,612],{"class":258},");\n",[234,614,615],{"class":236,"line":287},[234,616,284],{"emptyLinePlaceholder":283},[234,618,619,621,624,626,629,632],{"class":236,"line":294},[234,620,593],{"class":240},[234,622,623],{"class":244}," totalSpace",[234,625,248],{"class":240},[234,627,628],{"class":258}," stats.blocks ",[234,630,631],{"class":240},"*",[234,633,634],{"class":258}," stats.bsize;\n",[234,636,637,639,642,644,647,649],{"class":236,"line":330},[234,638,593],{"class":240},[234,640,641],{"class":244}," freeSpace",[234,643,248],{"class":240},[234,645,646],{"class":258}," stats.bfree ",[234,648,631],{"class":240},[234,650,634],{"class":258},[234,652,653,655,658,660,663,666],{"class":236,"line":352},[234,654,593],{"class":240},[234,656,657],{"class":244}," usedSpace",[234,659,248],{"class":240},[234,661,662],{"class":258}," totalSpace ",[234,664,665],{"class":240},"-",[234,667,668],{"class":258}," freeSpace;\n",[234,670,671,673,676,678,681,684,687,689,692],{"class":236,"line":357},[234,672,593],{"class":240},[234,674,675],{"class":244}," percentUsed",[234,677,248],{"class":240},[234,679,680],{"class":258}," (usedSpace ",[234,682,683],{"class":240},"\u002F",[234,685,686],{"class":258}," totalSpace) ",[234,688,631],{"class":240},[234,690,691],{"class":244}," 100",[234,693,349],{"class":258},[234,695,696],{"class":236,"line":363},[234,697,284],{"emptyLinePlaceholder":283},[234,699,700,703,705],{"class":236,"line":375},[234,701,702],{"class":258},"    msg.payload ",[234,704,369],{"class":240},[234,706,372],{"class":258},[234,708,709,712,714,717,720,723,726,729,732,734,737],{"class":236,"line":381},[234,710,711],{"class":258},"        totalGB: (totalSpace ",[234,713,683],{"class":240},[234,715,716],{"class":258}," (",[234,718,719],{"class":244},"1024",[234,721,722],{"class":240}," **",[234,724,725],{"class":244}," 3",[234,727,728],{"class":258},")).",[234,730,731],{"class":254},"toFixed",[234,733,314],{"class":258},[234,735,736],{"class":244},"2",[234,738,739],{"class":258},"),\n",[234,741,742,745,747,749,751,753,755,757,759,761,763],{"class":236,"line":387},[234,743,744],{"class":258},"        freeGB: (freeSpace ",[234,746,683],{"class":240},[234,748,716],{"class":258},[234,750,719],{"class":244},[234,752,722],{"class":240},[234,754,725],{"class":244},[234,756,728],{"class":258},[234,758,731],{"class":254},[234,760,314],{"class":258},[234,762,736],{"class":244},[234,764,739],{"class":258},[234,766,767,770,772,774,776,778,780,782,784,786,788],{"class":236,"line":393},[234,768,769],{"class":258},"        usedGB: (usedSpace ",[234,771,683],{"class":240},[234,773,716],{"class":258},[234,775,719],{"class":244},[234,777,722],{"class":240},[234,779,725],{"class":244},[234,781,728],{"class":258},[234,783,731],{"class":254},[234,785,314],{"class":258},[234,787,736],{"class":244},[234,789,739],{"class":258},[234,791,792,795,797,799,801],{"class":236,"line":399},[234,793,794],{"class":258},"        percentUsed: percentUsed.",[234,796,731],{"class":254},[234,798,314],{"class":258},[234,800,736],{"class":244},[234,802,803],{"class":258},")\n",[234,805,806],{"class":236,"line":405},[234,807,808],{"class":258},"    };\n",[234,810,811],{"class":236,"line":410},[234,812,284],{"emptyLinePlaceholder":283},[234,814,815],{"class":236,"line":416},[234,816,817],{"class":290},"    \u002F\u002F Warning threshold\n",[234,819,820,823,826,829,832],{"class":236,"line":427},[234,821,822],{"class":240},"    if",[234,824,825],{"class":258}," (percentUsed ",[234,827,828],{"class":240},">",[234,830,831],{"class":244}," 90",[234,833,834],{"class":258},") {\n",[234,836,837,840,842,845,848,850,852,854,857,860,863],{"class":236,"line":432},[234,838,839],{"class":258},"        msg.warning ",[234,841,369],{"class":240},[234,843,844],{"class":317}," `Disk space critical: ${",[234,846,847],{"class":258},"percentUsed",[234,849,92],{"class":317},[234,851,731],{"class":254},[234,853,314],{"class":317},[234,855,856],{"class":244},"1",[234,858,859],{"class":317},")",[234,861,862],{"class":317},"}% used`",[234,864,349],{"class":258},[234,866,868],{"class":236,"line":867},20,[234,869,870],{"class":258},"    }\n",[234,872,874],{"class":236,"line":873},21,[234,875,284],{"emptyLinePlaceholder":283},[234,877,879,882],{"class":236,"line":878},22,[234,880,881],{"class":240},"    return",[234,883,438],{"class":258},[234,885,887],{"class":236,"line":886},23,[234,888,284],{"emptyLinePlaceholder":283},[234,890,892,895,898],{"class":236,"line":891},24,[234,893,894],{"class":258},"} ",[234,896,897],{"class":240},"catch",[234,899,900],{"class":258}," (err) {\n",[234,902,904,906,908],{"class":236,"line":903},25,[234,905,702],{"class":258},[234,907,369],{"class":240},[234,909,910],{"class":258}," { error: err.message };\n",[234,912,914,916],{"class":236,"line":913},26,[234,915,881],{"class":240},[234,917,438],{"class":258},[234,919,921],{"class":236,"line":920},27,[234,922,923],{"class":258},"}\n",[193,925,926,941],{"start":280},[53,927,928,929,450,933,937,938,92],{},"Connect it to your notification system to alert when space is critical, for notification you can use ",[60,930,932],{"href":931},"\u002Fnode-red\u002Fnotification\u002Femail\u002F","email",[60,934,936],{"href":935},"\u002Fnode-red\u002Fnotification\u002Ftelegram\u002F","telegram",", discord with ",[60,939,28],{"href":940},"\u002Fnode-red\u002Fnotification\u002Fdiscord\u002F",[53,942,943],{},"Deploy the flow",[10,945,946],{},"Now you'll get warnings before disk space becomes critical, giving you time to archive old data or expand storage.",[42,948,950],{"id":949},"step-4-handling-connection-interruptions","Step 4: Handling Connection Interruptions",[10,952,953],{},"Network issues, PLC restarts, or equipment maintenance can cause connection drops. Your logging system should handle these gracefully and automatically resume when the connection is restored.",[10,955,956],{},"Most PLC nodes emit error events when a connection fails. Add error handling to detect and log these events.",[193,958,959,962,965,968],{},[53,960,961],{},"Add a Catch node configured to monitor your PLC input node and Write File node.",[53,963,964],{},"Drag a Function or Change node to format the error messages according to your chosen notification method, and connect it to the Catch node.",[53,966,967],{},"Connect the node that formats the error message to your selected Notification node.",[53,969,970],{},"Deploy the flow.",[10,972,973],{},"Below is the complete flow we have built throughout this article.",[10,975,976],{},[39,977,978],{},"Note: When testing with the Inject node, bypass the OPC UA Client and inject data directly into the logger flow.",[980,981],"render-flow",{":height":982,"flow":983},"300","W3siaWQiOiI2Njc3NjM4NWRiNTc5NGJjIiwidHlwZSI6Imdyb3VwIiwieiI6IkZGRjAwMDAwMDAwMDAwMDEiLCJuYW1lIjoiIiwic3R5bGUiOnsiZmlsbCI6IiNmZmNmM2YiLCJsYWJlbCI6dHJ1ZSwiZmlsbC1vcGFjaXR5IjoiMC41NyJ9LCJub2RlcyI6WyJhYzBkMzVhNjQ2NmNmY2I0IiwiNGFmZjViNTdjYmI2M2I4ZiIsImE1YzU3NDY5MzQ2NzAzMDYiLCJkNzk2ZDNhZWU4ZWEwMzQzIiwiMjNlYmMwZGE0MzE1YWM0NiIsIjE4MWVkODZmOWMxMWQxZjciLCJiMzRkNDQwODk3MTA4MTEwIiwiNTc1ZWQ2NzcxNDA3Mjk3MyIsImQwODM1M2E5YzkwYjAzOTYiLCJlNzE5YWU2ZmVlMjJjODEyIiwiMjUxOGRjOTA5ZDQ0NzY1NSJdLCJ4Ijo5NCwieSI6MjcxLjUsInciOjExMTIsImgiOjI2OS41fSx7ImlkIjoiYWMwZDM1YTY0NjZjZmNiNCIsInR5cGUiOiJjc3YiLCJ6IjoiRkZGMDAwMDAwMDAwMDAwMSIsImciOiI2Njc3NjM4NWRiNTc5NGJjIiwibmFtZSI6IiIsInNwZWMiOiJyZmMiLCJzZXAiOiIsIiwiaGRyaW4iOnRydWUsImhkcm91dCI6Im9uY2UiLCJtdWx0aSI6Im9uZSIsInJldCI6IlxcciIsInRlbXAiOiJ0aW1lc3RhbXAsdGVtcGVyYXR1cmUiLCJza2lwIjoiMCIsInN0cmluZ3MiOnRydWUsImluY2x1ZGVfZW1wdHlfc3RyaW5ncyI6IiIsImluY2x1ZGVfbnVsbF92YWx1ZX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4Ijo2NzAsInkiOjUwMCwid2lyZXMiOltdfSx7ImlkIjoiMjUxOGRjOTA5ZDQ0NzY1NSIsInR5cGUiOiJkZWJ1ZyIsInoiOiJGRkYwMDAwMDAwMDAwMDAxIiwiZyI6IjY2Nzc2Mzg1ZGI1Nzk0YmMiLCJuYW1lIjoiUmVzdWx0IiwiYWN0aXZlIjp0cnVlLCJ0b3NpZGViYXIiOnRydWUsImNvbnNvbGUiOmZhbHNlLCJ0b3N0YXR1cyI6ZmFsc2UsImNvbXBsZXRlIjoicGF5bG9hZCIsInRhcmdldFR5cGUiOiJtc2ciLCJzdGF0dXNWYWwiOiIiLCJzdGF0dXNUeXBlIjoiYXV0byIsIngiOjExMTAsInkiOjMyMCwid2lyZXMiOltdfSx7ImlkIjoiNzEzMWM1NTIzZDg2ZmU4YiIsInR5cGUiOiJnbG9iYWwtY29uZmlnIiwiZW52IjpbXSwibW9kdWxlcyI6eyJub2RlLXJlZC1jb250cmliLW9wY3VhIjoiMC4yLjM0MiJ9fV0=",[42,985,987],{"id":986},"conclusion","Conclusion",[10,989,990],{},"You now have a production-ready PLC data logging system built on FlowFuse. It addresses the key reliability issues that typically cause downtime — connection drops, write failures, disk space limits, and daily file rotation — turning a simple flow into one that can run unattended for months.",[10,992,993],{},"The use of CSV ensures long-term data accessibility. Every analytics platform, database, and spreadsheet can read it, and it will remain usable decades from now — regardless of what tools or systems you adopt in the future.",[10,995,996],{},"Start small: connect one PLC, verify data quality, and deploy your first logging flow. Then gradually add error handling, storage monitoring, and redundancy as needed. Over time, this setup becomes a foundation for scalable, dependable industrial data collection.",[10,998,999],{},"FlowFuse makes this process straightforward by combining Node-RED’s flexibility with enterprise-grade management and monitoring. You can deploy updates remotely, manage devices across multiple sites, and standardize data collection — all from a single platform.",[10,1001,1002],{},"And while CSV is a reliable starting point, FlowFuse also integrates seamlessly with modern databases and historians like InfluxDB, TimescaleDB, and MySQL. Even better, FlowFuse Cloud includes a built-in PostgreSQL service and an AI Query Node that lets you explore your data conversationally — turning raw logs into actionable insights.",[10,1004,1005,1006,92],{},"For more on how FlowFuse connects PLCs across OPC UA, Siemens S7, EtherNet\u002FIP, and Modbus to collect and route industrial data, see the ",[60,1007,1009],{"href":1008},"\u002Flanding\u002Fplc\u002F","FlowFuse PLC integration overview",[1011,1012,1013],"blockquote",{},[10,1014,1015,1016,1020],{},"You can ",[60,1017,1019],{"href":1018},"\u002Fbook-demo\u002F","talk to our team",", they’ll walk you through a live demo showing how FlowFuse helps you connect, collect, transform, and visualize your industrial data reliably and intelligently.",[1022,1023,1024],"style",{},"html pre.shiki code .szBVR, html code.shiki .szBVR{--shiki-default:#D73A49;--shiki-dark:#F97583}html pre.shiki code .sj4cs, html code.shiki .sj4cs{--shiki-default:#005CC5;--shiki-dark:#79B8FF}html pre.shiki code .sScJk, html code.shiki .sScJk{--shiki-default:#6F42C1;--shiki-dark:#B392F0}html pre.shiki code .sVt8B, html code.shiki .sVt8B{--shiki-default:#24292E;--shiki-dark:#E1E4E8}html pre.shiki code .sJ8bj, html code.shiki .sJ8bj{--shiki-default:#6A737D;--shiki-dark:#6A737D}html pre.shiki code .sZZnC, html code.shiki .sZZnC{--shiki-default:#032F62;--shiki-dark:#9ECBFF}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":36,"searchDepth":262,"depth":262,"links":1026},[1027,1028,1034,1040,1041,1042],{"id":44,"depth":262,"text":45},{"id":69,"depth":262,"text":70,"children":1029},[1030,1031,1032,1033],{"id":77,"depth":280,"text":78},{"id":108,"depth":280,"text":109},{"id":157,"depth":280,"text":158},{"id":164,"depth":280,"text":165},{"id":180,"depth":262,"text":181,"children":1035},[1036,1037,1038,1039],{"id":187,"depth":280,"text":188},{"id":209,"depth":280,"text":210},{"id":457,"depth":280,"text":458},{"id":505,"depth":280,"text":506},{"id":556,"depth":262,"text":557},{"id":949,"depth":262,"text":950},{"id":986,"depth":262,"text":987},"md",{"navTitle":5,"excerpt":1045},{"type":7,"value":1046},[1047],[10,1048,12],{},"\u002Fblog\u002F2025\u002F10\u002Fhow-to-log-plc-data-csv-files",{"title":5,"description":12},"blog\u002F2025\u002F10\u002Fhow-to-log-plc-data-csv-files","feliDLH34zl0CzAdmCdgPchoqAfMGzT_2Z6rijhVvVs",1780070553546]