# Weidmüller AC PLC. How to log data directly to PC

**URL:** https://discourse.nodered.org/t/weidmuller-ac-plc-how-to-log-data-directly-to-pc/86454
**Category:** General
**Created:** [15 March 2024 09:40 UTC](https://discourse.nodered.org/t/weidmuller-ac-plc-how-to-log-data-directly-to-pc/86454 "2024-03-15T09:40:19Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![AleksDeco](https://avatars.discourse-cdn.com/v4/letter/a/e9bcb4/32.png) [@AleksDeco](https://discourse.nodered.org/u/AleksDeco)
#### Post date: [15 March 2024 09:40 UTC](https://discourse.nodered.org/t/weidmuller-ac-plc-how-to-log-data-directly-to-pc/86454/1 "2024-03-15T09:40:19Z")

</div>

Hello everyone who reads this. This week I've got Weidmüller PLC for testing. This thing has got Node-RED preinstalled which I'm not familiar with, just heard a lot of times that people use this environment to do a lot of things. The goal is to use this PLC for Building management system/automation. The problem that I got right now is with the logs. Please can anyone tell me how to log files directly into PC hard drive? For example .csv file with time+temperature parameters.

PLC is connected directly trough ethernet cable to a laptop.

I've tried my first ever flow to build up a .csv log file and getting this error - "failed to append to file: Error: EACCES: permission denied, open 'C:\RED\_Logs\Temperature.csv"

Please can anyone give me a bit of guidance how to solve this?  
Thank you

Heres my flow:

[{"id":"1718610e.2d76bf","type":"tab","label":"Flow 1","disabled":false,"info":""},{"id":"2880f1bb.86fabe","type":"uc-iodataIn","z":"1718610e.2d76bf","mode":"wi\_single\_variable","variable":"REALTEMP","name":"Temperature","pollInterval":"5000","pollIntervalBase":"s","x":110,"y":100,"wires":[["167eb89e.92da3f"],["98ab012a.deb66"]]},{"id":"98ab012a.deb66","type":"function","z":"1718610e.2d76bf","name":"","func":"var Time = msg.payload.timestamp;\nvar Temperature = msg.payload.temperature;\nm = {'Time': Time, 'Temperature':Temperature};\nreturn {payload:m};","outputs":1,"noerr":0,"initialize":"","finalize":"","x":300,"y":140,"wires":[["a5005540.4ece78"]]},{"id":"a5005540.4ece78","type":"csv","z":"1718610e.2d76bf","name":"","sep":",","hdrin":true,"hdrout":"none","multi":"one","ret":"\r\n","temp":"Time, Temperature","skip":"0","strings":true,"include\_empty\_strings":"","include\_null\_values":"","x":480,"y":140,"wires":[["efc1bef8.f383f8"]]},{"id":"efc1bef8.f383f8","type":"file","z":"1718610e.2d76bf","name":"","filename":"C:\RED\_Logs\Temperature.csv","appendNewline":true,"createDir":true,"overwriteFile":"false","encoding":"utf8","x":710,"y":140,"wires":[]},{"id":"167eb89e.92da3f","type":"debug","z":"1718610e.2d76bf","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":310,"y":100,"wires":}]

---

<div class="post-metadata">

### Author: ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)
#### Post date: [15 March 2024 10:11 UTC](https://discourse.nodered.org/t/weidmuller-ac-plc-how-to-log-data-directly-to-pc/86454/2 "2024-03-15T10:11:00Z")

</div>

> [@AleksDeco](#):
>
> EACCES: permission denied, open 'C:\RED\_Logs\Temperature.csv"

Since Node-RED runs on the PLC device, it is unlikely to have a `c:\` (I could be wrong)

Just in case it isnt obvious to you, Node-RED may appear on your computer (in the browser) but the runtime actually runs on the server (in your case a Weidmuller PLC) so any nodes that access files will be accessing files on the server/device.

---

<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: [13 June 2024 10:11 UTC](https://discourse.nodered.org/t/weidmuller-ac-plc-how-to-log-data-directly-to-pc/86454/3 "2024-06-13T10:11:20Z")

</div>

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