# Creating of Path and csv files on SD Card

**URL:** <https://www.wago.community/t/creating-of-path-and-csv-files-on-sd-card/1404>\
**Category:** CODESYS\
**Tags:** pfc200, how-to, codesys\
**Created:** [December 5, 2024, 10:59pm UTC](https://www.wago.community/t/creating-of-path-and-csv-files-on-sd-card/1404 "2024-12-05T22:59:54Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![aymenlns](https://avatars.discourse-cdn.com/v4/letter/a/9fc348/32.png) [@aymenlns](https://www.wago.community/u/aymenlns)\
**Post date:** [December 5, 2024, 10:59pm UTC](https://www.wago.community/t/creating-of-path-and-csv-files-on-sd-card/1404/1 "2024-12-05T22:59:54Z")

</div>

Hello,  
I am using PFC200 8217, I was using ecockpit software, I had a program that work and create csv files without problem, ( it create csv files in the path /media/sd/CSV\_FILES then it create every month a path /2024-11 exp and inside it I have my datalogs) after doing the migration from ecockpit FMW 22 to FMW26 and moving to codesys, the program doesn’t work, it create a csv file but doesn’t create the path 2024-11, which mean it doesn’t create the csv file too because the path doesn’t exist, I am using the library given by wago WagoAppDir, how can I solve this problem ? Thank you

---

<div class="post-metadata">

**Author:** ![WagoDamRud](https://sea2.discourse-cdn.com/flex016/user_avatar/www.wago.community/wagodamrud/32/258_2.png) [@WagoDamRud](https://www.wago.community/u/WagoDamRud)\
**Post date:** [December 6, 2024, 8:42am UTC](https://www.wago.community/t/creating-of-path-and-csv-files-on-sd-card/1404/2 "2024-12-06T08:42:48Z")

</div>

In most function blocks from WAGO you can find oStatus output. Please check text status inside while it is trying to write to the file

---

<div class="post-metadata">

**Author:** ![WagoMark](https://avatars.discourse-cdn.com/v4/letter/w/d07c76/32.png) [@WagoMark](https://www.wago.community/u/WagoMark)\
**Post date:** [December 6, 2024, 3:31pm UTC](https://www.wago.community/t/creating-of-path-and-csv-files-on-sd-card/1404/3 "2024-12-06T15:31:49Z")

</div>

I’ve tried to recreate your problem, but it is working well for me. If the ‘2024-11’ folder does not exist, it is created and the file is written correctly. If the ‘CSV\_FILES’ folder does not exist, both folders are created and the file is written correctly.

I’m defining my file name like this:  
sName := ‘/media/mySD/CSV\_FILES/2024-11/MyDataFile.csv’;

Note that you need to use the correct volume name of the SD card. In my case, I named it ‘mySD’. You can format your SD card and give it a volume name (label) using the controller’s WBM:

 ![image](https://us1.discourse-cdn.com/flex016/uploads/wago/original/2X/a/a23c353b99fbab1cfcf4d6cf3c0a5d94e0fd6ced.png)

---

<div class="post-metadata">

**Author:** ![JohnDitter](https://sea2.discourse-cdn.com/flex016/user_avatar/www.wago.community/johnditter/32/68_2.png) [@JohnDitter](https://www.wago.community/u/JohnDitter)\
**Post date:** [December 6, 2024, 9:44pm UTC](https://www.wago.community/t/creating-of-path-and-csv-files-on-sd-card/1404/4 "2024-12-06T21:44:03Z")

</div>

According to the release notes for FW27, there was a bug fix in FW26 related to creating a directory on the SD card. Maybe this is related to your issue.

 ![image](https://us1.discourse-cdn.com/flex016/uploads/wago/original/2X/0/010a05ee61661d68cbeaab06a35f24400d51da76.jpeg)  
Also, starting with FW26, CODESYS can only access the following folders: “/home/codesys”, “media/sd”, & “/tmp” for security reasons. But I assume you can access subfolders below these.

 ![image](https://us1.discourse-cdn.com/flex016/uploads/wago/original/2X/9/90726b5f2f6b882a99c56d3e6f9bb773364e7c90.jpeg)

---

<div class="post-metadata">

**Author:** ![aymenlns](https://avatars.discourse-cdn.com/v4/letter/a/9fc348/32.png) [@aymenlns](https://www.wago.community/u/aymenlns)\
**Post date:** [December 12, 2024, 10:12am UTC](https://www.wago.community/t/creating-of-path-and-csv-files-on-sd-card/1404/5 "2024-12-12T10:12:33Z")

</div>

Thank you so much, I update the FW to 28 and now the problem is solved
