title: Node-Red Log data to CSV
body: <p>I am trying to log data from multiple Modbus TCP connections into a CSV file on my local hard drive. </p>
  
  <p>My set up currently is as follows:</p>
  
  <p><a href="https://i.stack.imgur.com/8RBWm.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/8RBWm.png" alt="enter image description here"></a></p>
  
  <p>I am struggling with the modify payload part!</p>
  
  <p>I am unsure what to write in the function.... I would like a format like this, with values corresponding with each variable:</p>
  
  <pre><code>Time,STBD Bus Volts,Var2,Var3......VarX
  yyyymmddHHMMSS,1.5,y,z,q,.......,r
  </code></pre>
  
  <p>etc. I hope that is clear enough.  </p>
  
  <p>NB: I know I have only shown one Modbus input thus far, I will add more, I would like to understand how to write the functions.</p>