<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Is there a limit on # points in context memory]]></title><description><![CDATA[<p dir="auto">Is there some limit on the # on points I can reference in a script. My script works fine with 10, 20 or 30 points but does not seem to run with 200 points?  Is there some limit to cause a problem?</p>
]]></description><link>https://forum.mango-os.com/topic/2924/is-there-a-limit-on-points-in-context-memory</link><generator>RSS for Node</generator><lastBuildDate>Tue, 15 Sep 2026 06:46:37 GMT</lastBuildDate><atom:link href="https://forum.mango-os.com/topic/2924.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 07 Sep 2017 15:32:39 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Is there a limit on # points in context memory on Thu, 07 Sep 2017 16:13:18 GMT]]></title><description><![CDATA[<p dir="auto">Okay. You may want to hit the /rest/v1/threads?stackDepth=30&amp;asFile=true endpoint if you think it is stuck, then email it to me and I'll let you know.</p>
]]></description><link>https://forum.mango-os.com/post/15382</link><guid isPermaLink="true">https://forum.mango-os.com/post/15382</guid><dc:creator><![CDATA[phildunlap]]></dc:creator><pubDate>Thu, 07 Sep 2017 16:13:18 GMT</pubDate></item><item><title><![CDATA[Reply to Is there a limit on # points in context memory on Thu, 07 Sep 2017 16:07:18 GMT]]></title><description><![CDATA[<p dir="auto">Yes Historic is enabled and I did increase the backdate posting.. so far no change..<br />
I will take another look at this later Phil but I have got it to work correctly with a lesser number of points so its something..  Thanks  Ill post my results.</p>
]]></description><link>https://forum.mango-os.com/post/15381</link><guid isPermaLink="true">https://forum.mango-os.com/post/15381</guid><dc:creator><![CDATA[Phillip Weeks]]></dc:creator><pubDate>Thu, 07 Sep 2017 16:07:18 GMT</pubDate></item><item><title><![CDATA[Reply to Is there a limit on # points in context memory on Thu, 07 Sep 2017 15:54:26 GMT]]></title><description><![CDATA[<p dir="auto">Unless Mango crashed, it probably is working. You may want to have something like <code>RuntimeManager.disableDataSource("this-data-source-xid");</code> at the end of the script and instead of doing prints, set that string to an alphanumeric point and watch it change.</p>
<p dir="auto">Is your script set to "Saves historic"?</p>
<p dir="auto">My expectation would be that it's doing a lot of backdate posting, and that's taking time. You could try increasing the "Delay for writing backate batches (ms)" in the NoSQL settings on the /system_settings.shtm page.</p>
]]></description><link>https://forum.mango-os.com/post/15380</link><guid isPermaLink="true">https://forum.mango-os.com/post/15380</guid><dc:creator><![CDATA[phildunlap]]></dc:creator><pubDate>Thu, 07 Sep 2017 15:54:26 GMT</pubDate></item><item><title><![CDATA[Reply to Is there a limit on # points in context memory on Thu, 07 Sep 2017 15:44:31 GMT]]></title><description><![CDATA[<p dir="auto">It is a long script true.. The verify works and is sluggish in the execution but goes through the all points in simulation.  When for real it does not seem to run because it should disable a flag to turn it off and this never gets disabled when the point count is 200.  This is the script.<br />
if (RunScripting.value){<br />
RunScripting.set(false);<br />
print("Run Started");<br />
var minimumDataInterval = 300000; //5* 60 seconds</p>
<pre><code>var periodBegin = new Date(2017, 7, 14);
periodBegin.setHours(0);
periodBegin.setMinutes(0);
periodBegin.setSeconds(0);
periodBegin.setMilliseconds(0);

var periodEnd = new Date(2017, 7, 15);
periodEnd.setHours(12);
periodEnd.setMinutes(0);
periodEnd.setSeconds(0);
periodEnd.setMilliseconds(0);

for (var i = 1; i &lt; 217; i+=1) {
   var pointcount =0;
    var values = eval('P' + i + '.pointValuesBetween( periodBegin, periodEnd );');
    print("found values between "+ periodBegin.toString() + " " + periodEnd.toString() + "  : "+ values.length);
    for(var k = 0; k &lt; values.length-2; k+=1) {
        
        var val1 = values[k];
        var val2 = values[k+1];
        var diff = val2.time - val1.time;
      // print("Point time: " + diff.toString()) ;
       var newDataTime = val1.time + minimumDataInterval;
       
    	while( newDataTime &lt; val2.time) {
    		
    		    var newVal = parseInt(val1.value) + (parseInt(val2.value) - parseInt(val1.value)) * (newDataTime - val1.time) / (val2.time - val1.time);
    		    newVal = parseInt(newVal);
    		    
    			eval('P' + i + '.set( newVal, newDataTime );');
    			newDataTime += minimumDataInterval;
    		    pointcount +=1;
    			 
    		}
    		
    	}
    print("Points Added" + pointcount);	
    }
    
}
</code></pre>
<p dir="auto">and its output in simulation<br />
Setting point Script_Flag to false @07/09/2017 12:35:44<br />
Run Started<br />
found values between Mon Aug 14 2017 00:00:00 GMT-0300 (ADT) Tue Aug 15 2017 12:00:00 GMT-0300 (ADT) : 272<br />
Setting point UNIT-101-CW to 3004.0 @14/08/2017 10:25:00<br />
Setting point UNIT-101-CW to 3004.0 @14/08/2017 10:30:00<br />
Setting point UNIT-101-CW to 3004.0 @14/08/2017 10:35:00<br />
.....</p>
]]></description><link>https://forum.mango-os.com/post/15379</link><guid isPermaLink="true">https://forum.mango-os.com/post/15379</guid><dc:creator><![CDATA[Phillip Weeks]]></dc:creator><pubDate>Thu, 07 Sep 2017 15:44:31 GMT</pubDate></item><item><title><![CDATA[Reply to Is there a limit on # points in context memory on Thu, 07 Sep 2017 15:35:05 GMT]]></title><description><![CDATA[<p dir="auto">Hi Phillip,</p>
<p dir="auto">No, there's no arbitrary limit. There may be a practical limit depending on what you're doing. Also, it may require some patience. If you've got a long running loop, you can set the loop counter out to a point and see where you're at.</p>
<p dir="auto">You didn't really describe its failure. Can you post the script and describe the issue?</p>
]]></description><link>https://forum.mango-os.com/post/15377</link><guid isPermaLink="true">https://forum.mango-os.com/post/15377</guid><dc:creator><![CDATA[phildunlap]]></dc:creator><pubDate>Thu, 07 Sep 2017 15:35:05 GMT</pubDate></item></channel></rss>