<?xml version="1.0" encoding="utf-8"?>
<feed xml:lang="en" xmlns="http://www.w3.org/2005/Atom"><title>Recent posts to Saving a file to USB stick</title><link href="https://forge.codesys.com/forge/talk/CODESYS-V2/thread/e87f0a12dd/" rel="alternate"/><link href="https://forge.codesys.com/forge/talk/CODESYS-V2/thread/e87f0a12dd/feed.atom" rel="self"/><id>https://forge.codesys.com/forge/talk/CODESYS-V2/thread/e87f0a12dd/</id><updated>2020-02-27T22:58:47.302000Z</updated><subtitle>Recent posts to Saving a file to USB stick</subtitle><entry><title>Saving a file to USB stick</title><link href="https://forge.codesys.com/forge/talk/Codesys%2520V2.3/thread/e87f0a12dd/?limit=25#240c" rel="alternate"/><published>2020-02-27T22:58:47.302000Z</published><updated>2020-02-27T22:58:47.302000Z</updated><author><name>swtroelofs</name><uri>https://forge.codesys.com/u/swtroelofs/</uri></author><id>https://forge.codesys.com8e2cb166612c52ead99312baa2d4f279eb01b104</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Thanks for your tips, I found the problem!&lt;/p&gt;
&lt;p&gt;I was using uppercase letters (like: /Media/USB0 )&lt;/p&gt;
&lt;p&gt;When I tried lowercase text the problem was fixed.&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Saving a file to USB stick</title><link href="https://forge.codesys.com/forge/talk/Codesys%2520V2.3/thread/e87f0a12dd/?limit=25#7e2f" rel="alternate"/><published>2020-02-27T22:58:42.809000Z</published><updated>2020-02-27T22:58:42.809000Z</updated><author><name>kberlin</name><uri>https://forge.codesys.com/u/kberlin/</uri></author><id>https://forge.codesys.com8a8ac195f5085a19555538ffa91140ae605ddcc4</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;Do you get any error code?&lt;/p&gt;
&lt;p&gt;I've done a project on a Berghof Dialog Controller where I saved to a USB-memory.&lt;/p&gt;
&lt;p&gt;The line:&lt;/p&gt;
&lt;p&gt;dwFileNumber:=SysFileOpen(sFileName,'w');&lt;/p&gt;
&lt;p&gt;where sFileName was /media/usb0/filename.csv worked fine for me. It could be possible that the path to the file had a ending /&lt;/p&gt;
&lt;p&gt;If you telnet to the device can you access /media/usb0 then?&lt;/p&gt;
&lt;p&gt;Another tip is to use something like&lt;/p&gt;
&lt;p&gt;xUSBPlugged:=INT_TO_BOOL(BGH_USB_GETPLUGSTATUS(0));&lt;/p&gt;
&lt;p&gt;to make sure that the USB-key is plugged in. The function is available in the BghSysInfo_Vxx.lib library (xx=the version number).&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Saving a file to USB stick</title><link href="https://forge.codesys.com/forge/talk/Codesys%2520V2.3/thread/e87f0a12dd/?limit=25#bf9b" rel="alternate"/><published>2020-02-27T22:58:41.191000Z</published><updated>2020-02-27T22:58:41.191000Z</updated><author><name>swtroelofs</name><uri>https://forge.codesys.com/u/swtroelofs/</uri></author><id>https://forge.codesys.comf55cb6678324d69f2e3167744ff00ff60ea8eaea</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Hi all,&lt;/p&gt;
&lt;p&gt;Here's another programming question. I am using a linux based PLC (Berghof) and I want to save a file to an attached USB stick. &lt;/p&gt;
&lt;p&gt;I can save a file to the program directory ( /flash/plc/applications/ ) but I need to save the file to /media/usb0/&lt;/p&gt;
&lt;p&gt;How can I change the location of the file?&lt;/p&gt;
&lt;p&gt;This does not work:&lt;/p&gt;
&lt;p&gt;StLogFile := '/media/usb0/LogFile.txt'&lt;/p&gt;
&lt;p&gt;SysFileOpen(StLogFile, 'w');&lt;/p&gt;
&lt;p&gt;Thanks!&lt;/p&gt;&lt;/div&gt;</summary></entry></feed>