<?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[Extracting MODBUS values from function registers]]></title><description><![CDATA[<p dir="auto">Hey Guys, we have a bunch of Midnite Solar regulators we pull voltages etc from, they are all straight forward registers. However now we want to pull out the status of some aux relay terminals and this is the table the manufacturer has documented..<br />
<img src="https://camo.nodebb.org/4700874cf68886a7f80a0c174a5059ee130c9e3f?url=https%3A%2F%2Fi.imgur.com%2FNTVbEum.png" alt="0_1468877280827_upload-526f3050-34c8-423a-aba1-759aba7807cd" class=" img-fluid img-markdown" /><br />
Is there a simple way to get Mango to extract and store each of the Aux status's in two separate data points, 1 for aux1, 1 for aux2?<br />
If I read the 4165 (4164) register now I get a value of '66'.</p>
<p dir="auto">Any help would be much appreciated, thanks.</p>
<p dir="auto">Cheers<br />
Dan</p>
]]></description><link>https://forum.mango-os.com/topic/2352/extracting-modbus-values-from-function-registers</link><generator>RSS for Node</generator><lastBuildDate>Tue, 21 Apr 2026 07:47:58 GMT</lastBuildDate><atom:link href="https://forum.mango-os.com/topic/2352.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 18 Jul 2016 21:31:54 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Extracting MODBUS values from function registers on Wed, 20 Jul 2016 12:12:10 GMT]]></title><description><![CDATA[<p dir="auto">OK I have fair idea what you're getting at, I'll try it with the meta data source and see if I can pick out the required values.<br />
Thanks for that.</p>
<p dir="auto">Cheers<br />
Dan</p>
]]></description><link>https://forum.mango-os.com/post/12110</link><guid isPermaLink="true">https://forum.mango-os.com/post/12110</guid><dc:creator><![CDATA[dan]]></dc:creator><pubDate>Wed, 20 Jul 2016 12:12:10 GMT</pubDate></item><item><title><![CDATA[Reply to Extracting MODBUS values from function registers on Tue, 19 Jul 2016 21:23:38 GMT]]></title><description><![CDATA[<p dir="auto">I just made an edit, don't know what I was thinking saying you need to read 4 bytes, 2 should be fine, and you'll have to think of that in your range renderer for the second point reading the same register, all those bitshifts will be +8 which make may a range renderer impossible for the lower order byte</p>
<p dir="auto">I would go with the meta strategy, because then the 'set' command will be on the meta, and a pointlink that undoes the bitshifting will set the modbus value.</p>
]]></description><link>https://forum.mango-os.com/post/12099</link><guid isPermaLink="true">https://forum.mango-os.com/post/12099</guid><dc:creator><![CDATA[phildunlap]]></dc:creator><pubDate>Tue, 19 Jul 2016 21:23:38 GMT</pubDate></item><item><title><![CDATA[Reply to Extracting MODBUS values from function registers on Tue, 19 Jul 2016 21:07:50 GMT]]></title><description><![CDATA[<p dir="auto">Thanks guys I'll try those options and let you know how we go.</p>
<p dir="auto">Cheers<br />
Dan</p>
]]></description><link>https://forum.mango-os.com/post/12098</link><guid isPermaLink="true">https://forum.mango-os.com/post/12098</guid><dc:creator><![CDATA[dan]]></dc:creator><pubDate>Tue, 19 Jul 2016 21:07:50 GMT</pubDate></item><item><title><![CDATA[Reply to Extracting MODBUS values from function registers on Tue, 19 Jul 2016 21:11:13 GMT]]></title><description><![CDATA[<p dir="auto">Hi Dan,</p>
<p dir="auto">Possibility 1)<br />
I would think a meta point would be up to the task. You could make it a 2 byte data type (edit: whoops, dunno why i thought 0x66 described 16 bits...), then two meta points like:</p>
<p dir="auto">return (modbusPoint.value &amp; 0xc0) &gt;&gt; 6</p>
<p dir="auto">Possibility 2)<br />
You could read the registers as 2byte data types (read only one register) and use range renders to handle all this for you, since,<br />
#pseudocode<br />
if registerValue &lt; (1 &lt;&lt; 6)<br />
rendering = "Aux Off"<br />
else if registerValue &lt; (2 &lt;&lt; 6)<br />
rendering = "Aux Auto"<br />
else if registerValue &lt; (3 &lt;&lt; 6)<br />
rendering = "Aux On"<br />
else<br />
rendering - "Aux Unimplemented"</p>
<p dir="auto">But this would be very difficult to work with when it came to setting these point values, if settable. You'd probably want some other point / script as a layer of indirection to set the bit correctly. You can handle the 'else' part in the range rendered by using a very large value (I would steal the value from the 'discard extreme values' box for the positive side, which is the largest finite double).</p>
]]></description><link>https://forum.mango-os.com/post/12096</link><guid isPermaLink="true">https://forum.mango-os.com/post/12096</guid><dc:creator><![CDATA[phildunlap]]></dc:creator><pubDate>Tue, 19 Jul 2016 21:11:13 GMT</pubDate></item><item><title><![CDATA[Reply to Extracting MODBUS values from function registers on Tue, 19 Jul 2016 08:23:42 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/v8dave" aria-label="Profile: v8dave">@<bdi>v8dave</bdi></a> said in <a href="/post/12089">Extracting MODBUS values from function registers</a>:</p>
<blockquote>
<p dir="auto">66 doesn't make sense as that would be bit 1 and bit 6 is set. Are the other bits used for anything else or do you just have to mask with &amp;0xC0 and shift right 6 bits?</p>
<p dir="auto">If you mask the 66 you get bit 6 set and if then shifted right 7 bits would be a value of 1 indicating Aux 1 AUTO and Aux 2 OFF</p>
<p dir="auto">Would this be correct?</p>
</blockquote>
<p dir="auto">That makes a lot of sense, cause the first AUX is controlling a genset it will have been in Auto at the time.<br />
How would I get the Mango system to represent each of the 3 possible values per AUX terminal, per each data point?</p>
<p dir="auto">Cheers<br />
Dan</p>
]]></description><link>https://forum.mango-os.com/post/12090</link><guid isPermaLink="true">https://forum.mango-os.com/post/12090</guid><dc:creator><![CDATA[dan]]></dc:creator><pubDate>Tue, 19 Jul 2016 08:23:42 GMT</pubDate></item><item><title><![CDATA[Reply to Extracting MODBUS values from function registers on Tue, 19 Jul 2016 04:32:11 GMT]]></title><description><![CDATA[<p dir="auto">66 doesn't make sense as that would be bit 1 and bit 6 is set. Are the other bits used for anything else or do you just have to mask with &amp;0xC0 and shift right 6 bits?</p>
<p dir="auto">If you mask the 66 you get bit 6 set and if then shifted right 7 bits would be a value of 1 indicating Aux 1 AUTO and Aux 2 OFF</p>
<p dir="auto">Would this be correct?</p>
]]></description><link>https://forum.mango-os.com/post/12089</link><guid isPermaLink="true">https://forum.mango-os.com/post/12089</guid><dc:creator><![CDATA[v8dave]]></dc:creator><pubDate>Tue, 19 Jul 2016 04:32:11 GMT</pubDate></item><item><title><![CDATA[Reply to Extracting MODBUS values from function registers on Mon, 18 Jul 2016 21:55:26 GMT]]></title><description><![CDATA[<p dir="auto">That's a bit of a odd one and I'm not sure I follow 100%.  These look like multi state data points to me and there would be two of them.  Are they saying that the store the values for both values in a single Modbus register (2 bytes)?</p>
<p dir="auto">You could probably use a meta data point to extract the correct value but maybe someone else will have a better idea.</p>
]]></description><link>https://forum.mango-os.com/post/12087</link><guid isPermaLink="true">https://forum.mango-os.com/post/12087</guid><dc:creator><![CDATA[JoelHaggar]]></dc:creator><pubDate>Mon, 18 Jul 2016 21:55:26 GMT</pubDate></item></channel></rss>