<?xml version="1.0" encoding="utf-8"?>
<feed xml:lang="en" xmlns="http://www.w3.org/2005/Atom"><title>Recent posts to Running SQLite through Terminal Command Line Stability - Linux Based Systems</title><link href="https://forge.codesys.com/forge/talk/Runtime/thread/a838ac993a/" rel="alternate"/><link href="https://forge.codesys.com/forge/talk/Runtime/thread/a838ac993a/feed.atom" rel="self"/><id>https://forge.codesys.com/forge/talk/Runtime/thread/a838ac993a/</id><updated>2021-05-05T08:44:21.777000Z</updated><subtitle>Recent posts to Running SQLite through Terminal Command Line Stability - Linux Based Systems</subtitle><entry><title>Running SQLite through Terminal Command Line Stability - Linux Based Systems</title><link href="https://forge.codesys.com/forge/talk/Runtime/thread/a838ac993a/?limit=25#c79d/026c/6aff/a2c0/3b18" rel="alternate"/><published>2021-05-05T08:44:21.777000Z</published><updated>2021-05-05T08:44:21.777000Z</updated><author><name>kebek007</name><uri>https://forge.codesys.com/u/kebek007/</uri></author><id>https://forge.codesys.come35c8f50c43a11e587ed9edd40fab22f1f181f3e</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Well that is a very refreshing insight. I had no idea that it could have been on the output. I will definitely give that a whirl. Thanks a lot for your answer Ingo.&lt;/p&gt;
&lt;p&gt;Regards,&lt;/p&gt;
&lt;p&gt;Kay&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Running SQLite through Terminal Command Line Stability - Linux Based Systems</title><link href="https://forge.codesys.com/forge/talk/Runtime/thread/a838ac993a/?limit=25#c79d/026c/6aff/33b5/28f8" rel="alternate"/><published>2021-05-05T08:15:04.437000Z</published><updated>2021-05-05T08:15:04.437000Z</updated><author><name>m.prestel</name><uri>https://forge.codesys.com/u/mprestel/</uri></author><id>https://forge.codesys.comd4865bafa3338154cf4e312cc550157b515a625e</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Could you maybe provide a simplified example application to let me debug the issue?&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Running SQLite through Terminal Command Line Stability - Linux Based Systems</title><link href="https://forge.codesys.com/forge/talk/Runtime/thread/a838ac993a/?limit=25#c79d/026c/6aff/33b5" rel="alternate"/><published>2021-05-05T08:09:31.275000Z</published><updated>2021-05-05T08:09:31.275000Z</updated><author><name>kebek007</name><uri>https://forge.codesys.com/u/kebek007/</uri></author><id>https://forge.codesys.com16bb60cf1abd451527dc24e1fc110817d5c6b920</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Yes I am sure because I have a function that checks that. As I said it works, I see the log entries in the SQLite. My problem is the stability of the entire system. it seems to open so many processes and it just crashes.&lt;/p&gt;
&lt;p&gt;Thanks again for your help marcel, much appreciated&lt;/p&gt;
&lt;p&gt;Regards,&lt;br/&gt;
Karim&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Running SQLite through Terminal Command Line Stability - Linux Based Systems</title><link href="https://forge.codesys.com/forge/talk/Runtime/thread/a838ac993a/?limit=25#c79d/026c/6aff" rel="alternate"/><published>2021-05-05T07:21:49.976000Z</published><updated>2021-05-05T07:21:49.976000Z</updated><author><name>m.prestel</name><uri>https://forge.codesys.com/u/mprestel/</uri></author><id>https://forge.codesys.comb8ead430f3db719154204eb774c7624fd28013ee</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Hey&lt;/p&gt;
&lt;p&gt;My bad, I stopped reading the path at PlcLogic/trend.&lt;/p&gt;
&lt;p&gt;You are sure that you don't write outside of the bounds of e.g. the string?&lt;/p&gt;
&lt;p&gt;Best regards,&lt;br/&gt;
Marcel&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Running SQLite through Terminal Command Line Stability - Linux Based Systems</title><link href="https://forge.codesys.com/forge/talk/Runtime/thread/a838ac993a/?limit=25#c79d/026c" rel="alternate"/><published>2021-05-05T06:34:04.992000Z</published><updated>2021-05-05T06:34:04.992000Z</updated><author><name>kebek007</name><uri>https://forge.codesys.com/u/kebek007/</uri></author><id>https://forge.codesys.com5ac6379f9da6e0c143365a1838248eb066348127</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Thanks for your answer Marcel.&lt;/p&gt;
&lt;p&gt;yeah exactly I am talking abt my own database. It seems that when I do a write process as described above, the processes increase with every cycle and the process is killed. I am using my own database and it already worked but the application at the end crashes.&lt;/p&gt;
&lt;p&gt;Best Regards,&lt;/p&gt;
&lt;p&gt;Kay&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Running SQLite through Terminal Command Line Stability - Linux Based Systems</title><link href="https://forge.codesys.com/forge/talk/Runtime/thread/a838ac993a/?limit=25#c79d" rel="alternate"/><published>2021-05-05T05:51:19.477000Z</published><updated>2021-05-05T05:51:19.477000Z</updated><author><name>m.prestel</name><uri>https://forge.codesys.com/u/mprestel/</uri></author><id>https://forge.codesys.comd7e1e19679d22cc839deb932840dbe487b43131d</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;hey,&lt;br/&gt;
you cannot simple reuse a sqlite database which the application uses.&lt;br/&gt;
If you want to do your own queries, create your own sqlite database.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;br/&gt;
Marcel&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Running SQLite through Terminal Command Line Stability - Linux Based Systems</title><link href="https://forge.codesys.com/forge/talk/Runtime/thread/a838ac993a/?limit=25#60df" rel="alternate"/><published>2021-05-04T06:45:05.242000Z</published><updated>2021-05-04T06:45:05.242000Z</updated><author><name>kebek007</name><uri>https://forge.codesys.com/u/kebek007/</uri></author><id>https://forge.codesys.comb94bda7f39e77531dc080c70a5872cd102218933</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Hello community,&lt;/p&gt;
&lt;p&gt;I have been tinkering a little bit with a raspberry pi and Sqlite through codesys. I have noticed an instability when it comes to logging at high frequency and calling the function. I am not able to close the Database after writing but that shouldn't be an issue. What I have noticed when I monitor my processes on the pi is an unusual large number of processes that are open from the codesys runtime. After a few cycles, the Visualization hangs and the whole codesys process is killed by the Debian OS, i.e fatal crash of the application. The Sqlite was also successfully written, so the commands were performed as expected.&lt;/p&gt;
&lt;p&gt;The code I ran is as follows almost every 1 second:&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class="o"&gt;//&lt;/span&gt; &lt;span class="nv"&gt;Header&lt;/span&gt;
&lt;span class="nv"&gt;METHOD&lt;/span&gt; &lt;span class="nv"&gt;mSqliteWrite&lt;/span&gt; : &lt;span class="nv"&gt;BOOL&lt;/span&gt;
&lt;span class="nv"&gt;VAR_INPUT&lt;/span&gt;
    &lt;span class="nv"&gt;sCmd&lt;/span&gt;:               &lt;span class="nv"&gt;STRING&lt;/span&gt;&lt;span class="ss"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;255&lt;/span&gt;&lt;span class="ss"&gt;)&lt;/span&gt;&lt;span class="c1"&gt;;        // an sqlite write command&lt;/span&gt;
                                            &lt;span class="o"&gt;//&lt;/span&gt; &lt;span class="s1"&gt;'&lt;/span&gt;&lt;span class="s"&gt;INSERT INTO fooLog(foo1,foo2)&lt;/span&gt;
                                            &lt;span class="nv"&gt;Values&lt;/span&gt;&lt;span class="ss"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'&lt;/span&gt;&lt;span class="s"&gt;10&lt;/span&gt;&lt;span class="s1"&gt;'&lt;/span&gt;,&lt;span class="s1"&gt;'&lt;/span&gt;&lt;span class="s"&gt;20&lt;/span&gt;&lt;span class="s1"&gt;'&lt;/span&gt;&lt;span class="ss"&gt;)&lt;/span&gt;&lt;span class="s1"&gt;'&lt;/span&gt;&lt;span class="s"&gt; (example not real command)&lt;/span&gt;
&lt;span class="nv"&gt;END_VAR&lt;/span&gt;
&lt;span class="nv"&gt;VAR&lt;/span&gt;
        &lt;span class="nv"&gt;command0&lt;/span&gt; : &lt;span class="nv"&gt;STRING&lt;/span&gt; :&lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;'&lt;/span&gt;&lt;span class="s"&gt;sqlite3 &lt;/span&gt;&lt;span class="s1"&gt;'&lt;/span&gt;&lt;span class="c1"&gt;;&lt;/span&gt;
        &lt;span class="nv"&gt;command1&lt;/span&gt; : &lt;span class="nv"&gt;STRING&lt;/span&gt; :&lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;'&lt;/span&gt;&lt;span class="s"&gt;/var/opt/codesys/PlcLogic/trend/LogBook.sql &lt;/span&gt;&lt;span class="s1"&gt;'&lt;/span&gt;&lt;span class="c1"&gt;;&lt;/span&gt;
        &lt;span class="nv"&gt;commandout&lt;/span&gt; : &lt;span class="nv"&gt;STRING&lt;/span&gt;&lt;span class="ss"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1000&lt;/span&gt;&lt;span class="ss"&gt;)&lt;/span&gt;&lt;span class="c1"&gt;;&lt;/span&gt;

        &lt;span class="nv"&gt;stdout&lt;/span&gt; : &lt;span class="nv"&gt;STRING&lt;/span&gt;&lt;span class="ss"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1000&lt;/span&gt;&lt;span class="ss"&gt;)&lt;/span&gt; :&lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;''&lt;/span&gt;&lt;span class="c1"&gt;;    &lt;/span&gt;
        &lt;span class="nb"&gt;Result&lt;/span&gt; : &lt;span class="nv"&gt;RTS_IEC_RESULT&lt;/span&gt;&lt;span class="c1"&gt;;&lt;/span&gt;

        &lt;span class="nv"&gt;iSize&lt;/span&gt; : &lt;span class="nv"&gt;UDINT&lt;/span&gt; &lt;span class="c1"&gt;;&lt;/span&gt;

&lt;span class="nv"&gt;END_VAR&lt;/span&gt;


&lt;span class="o"&gt;//&lt;/span&gt; &lt;span class="nv"&gt;concat&lt;/span&gt; &lt;span class="nv"&gt;the&lt;/span&gt; &lt;span class="nv"&gt;strings&lt;/span&gt; &lt;span class="nv"&gt;to&lt;/span&gt; &lt;span class="nv"&gt;form&lt;/span&gt; &lt;span class="nv"&gt;the&lt;/span&gt; &lt;span class="nv"&gt;right&lt;/span&gt; &lt;span class="nv"&gt;command&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;sqlite3 path/filename sqlite3 command&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;
&lt;span class="nv"&gt;commandout&lt;/span&gt; :&lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nv"&gt;CONCAT&lt;/span&gt;&lt;span class="ss"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;command0&lt;/span&gt;,&lt;span class="nv"&gt;command1&lt;/span&gt;&lt;span class="ss"&gt;)&lt;/span&gt;&lt;span class="c1"&gt;;&lt;/span&gt;
&lt;span class="nv"&gt;commandout&lt;/span&gt; :&lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nv"&gt;concat&lt;/span&gt;&lt;span class="ss"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;commandout&lt;/span&gt;, &lt;span class="nv"&gt;sCmd&lt;/span&gt;&lt;span class="ss"&gt;)&lt;/span&gt;&lt;span class="c1"&gt;;&lt;/span&gt;
&lt;span class="o"&gt;//&lt;/span&gt; &lt;span class="o"&gt;//&lt;/span&gt; &lt;span class="nv"&gt;Check&lt;/span&gt; &lt;span class="nv"&gt;size&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="nv"&gt;testing&lt;/span&gt; &lt;span class="nv"&gt;purposes&lt;/span&gt;
 &lt;span class="nv"&gt;iSize&lt;/span&gt; :&lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nv"&gt;SIZEOF&lt;/span&gt;&lt;span class="ss"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;CommandOut&lt;/span&gt;&lt;span class="ss"&gt;)&lt;/span&gt;&lt;span class="c1"&gt;;&lt;/span&gt;
&lt;span class="o"&gt;//&lt;/span&gt; 
&lt;span class="o"&gt;//&lt;/span&gt; &lt;span class="o"&gt;//&lt;/span&gt; &lt;span class="k"&gt;send&lt;/span&gt; &lt;span class="nv"&gt;the&lt;/span&gt; &lt;span class="nv"&gt;command&lt;/span&gt; 
&lt;span class="nv"&gt;SysProcess&lt;/span&gt;.&lt;span class="nv"&gt;SysProcessExecuteCommand2&lt;/span&gt;&lt;span class="ss"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;pszCommand&lt;/span&gt;:&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nv"&gt;commandout&lt;/span&gt;, &lt;span class="nv"&gt;pszStdOut&lt;/span&gt;:&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nv"&gt;stdout&lt;/span&gt;, &lt;span class="nv"&gt;udiStdOutLen&lt;/span&gt;:&lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nv"&gt;SIZEOF&lt;/span&gt;&lt;span class="ss"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;stdout&lt;/span&gt;&lt;span class="ss"&gt;)&lt;/span&gt;,&lt;span class="nv"&gt;pResult&lt;/span&gt; :&lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nv"&gt;ADR&lt;/span&gt;&lt;span class="ss"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;Result&lt;/span&gt;&lt;span class="ss"&gt;))&lt;/span&gt;&lt;span class="c1"&gt;;&lt;/span&gt;

&lt;span class="o"&gt;//&lt;/span&gt; &lt;span class="o"&gt;//&lt;/span&gt; &lt;span class="nv"&gt;Error&lt;/span&gt; &lt;span class="nv"&gt;handling&lt;/span&gt;
&lt;span class="o"&gt;//&lt;/span&gt; &lt;span class="k"&gt;IF&lt;/span&gt; &lt;span class="nb"&gt;Result&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt; &lt;span class="k"&gt;THEN&lt;/span&gt;
        &lt;span class="o"&gt;//&lt;/span&gt; &lt;span class="k"&gt;Do&lt;/span&gt; &lt;span class="nv"&gt;something&lt;/span&gt;
&lt;span class="o"&gt;//&lt;/span&gt; &lt;span class="k"&gt;ELSE&lt;/span&gt;
&lt;span class="o"&gt;//&lt;/span&gt;  &lt;span class="nv"&gt;mSqliteWrite&lt;/span&gt; :&lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nv"&gt;TRUE&lt;/span&gt;&lt;span class="c1"&gt;;&lt;/span&gt;
&lt;span class="o"&gt;//&lt;/span&gt; &lt;span class="nv"&gt;END_IF&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;Has anyone come across this problem ? Is there a way around it that doesn't need any kind of third party tools or libs? Is this something relevant to the runtime of the pi or general runtime on other linux based systems ? &lt;/p&gt;
&lt;p&gt;Thanks&lt;/p&gt;&lt;/div&gt;</summary></entry></feed>