<?xml version="1.0" encoding="utf-8"?>
<feed xml:lang="en" xmlns="http://www.w3.org/2005/Atom"><title>Recent posts to Storing results in external memory (USB Drive)</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/170d42dfde/" rel="alternate"/><link href="https://forge.codesys.com/forge/talk/Engineering/thread/170d42dfde/feed.atom" rel="self"/><id>https://forge.codesys.com/forge/talk/Engineering/thread/170d42dfde/</id><updated>2022-06-08T13:35:11.744000Z</updated><subtitle>Recent posts to Storing results in external memory (USB Drive)</subtitle><entry><title>Storing results in external memory (USB Drive)</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/170d42dfde/?limit=25#1c13/b554" rel="alternate"/><published>2022-06-08T13:35:11.744000Z</published><updated>2022-06-08T13:35:11.744000Z</updated><author><name>princessdvlk</name><uri>https://forge.codesys.com/u/princessdvlk/</uri></author><id>https://forge.codesys.comc206c9b1ba2432f91d3361de3c799554f4d23835</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;by the way, could you please helpe through this issue. i am suddenly unable to download the code into my plc. and i have no clue what is going on. i have pasted the link that elaborates the problem here.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://forge.codesys.com/forge/talk/Engineering/thread/7053c43207/#7c33"&gt;https://forge.codesys.com/forge/talk/Engineering/thread/7053c43207/#7c33&lt;/a&gt;&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Storing results in external memory (USB Drive)</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/170d42dfde/?limit=25#1c13/b311" rel="alternate"/><published>2022-06-08T11:14:16.469000Z</published><updated>2022-06-08T11:14:16.469000Z</updated><author><name>princessdvlk</name><uri>https://forge.codesys.com/u/princessdvlk/</uri></author><id>https://forge.codesys.com16abf45fa033d1bb19b619b02233494a0bfbec29</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Hello, Thank you so much. I will check this and get back to you.&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Storing results in external memory (USB Drive)</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/170d42dfde/?limit=25#1c13" rel="alternate"/><published>2022-05-13T14:32:42.262000Z</published><updated>2022-05-13T14:32:42.262000Z</updated><author><name>paulpotat</name><uri>https://forge.codesys.com/u/paulpotat/</uri></author><id>https://forge.codesys.com98901e4781f1f63d150a5947d4c8d3f3a1b9b081</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Hello,&lt;br/&gt;
You can use the SysProcess library to run commands from CodeSys. You can use the &lt;em&gt;SysProcessExecuteCommand2&lt;/em&gt; to run a command and get its output in a string. &lt;br/&gt;
For example if you wanted to wrap this function in your programm you could do the following :&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class="k"&gt;FUNCTION&lt;/span&gt; &lt;span class="n"&gt;Run_Command&lt;/span&gt;
&lt;span class="n"&gt;VAR_OUTPUT&lt;/span&gt;
    &lt;span class="n"&gt;Command_Output&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;STRING&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="n"&gt;END_VAR&lt;/span&gt;
&lt;span class="n"&gt;VAR&lt;/span&gt;
    &lt;span class="n"&gt;command&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;STRING&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;'ls -al /media/pi'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="n"&gt;res&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;RTS_IEC_RESULT&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="n"&gt;END_VAR&lt;/span&gt;

&lt;span class="n"&gt;SysProcessExecuteCommand2&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="n"&gt;pszCommand&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;command&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;pszStdOut&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;Command_Output&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;udiStdOutLen&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;SIZEOF&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;Command_Output&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
    &lt;span class="n"&gt;pResult&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;res&lt;/span&gt;
&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;Then You can manage errors with the value returned in the "res" variable as you want.&lt;br/&gt;
Hope this helps,&lt;br/&gt;
BR&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Storing results in external memory (USB Drive)</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/170d42dfde/?limit=25#3bed" rel="alternate"/><published>2022-05-12T06:53:34.757000Z</published><updated>2022-05-12T06:53:34.757000Z</updated><author><name>princessdvlk</name><uri>https://forge.codesys.com/u/princessdvlk/</uri></author><id>https://forge.codesys.com04fcc1a01292560088d7399f7315395d44c590af</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Hello All,&lt;/p&gt;
&lt;p&gt;I am using a PLC based on raspberry Pi and the Codesys version I am working on is Codesys SP17 Patch 3. I have connected an USB drive to the Rasp Pi and I am given a file patch 'ls -al /media/pi' that I have to type somewhere in Codesys so that I can store results in this path. I am new to both Rasp Pi and Codesys. I am figuring out where to write this command. Can anyone help me?&lt;/p&gt;
&lt;p&gt;Or is there any other way I can access the USB drive connected to Rasp Pi using Codesys?&lt;/p&gt;
&lt;p&gt;Best Regards!&lt;/p&gt;&lt;/div&gt;</summary></entry></feed>