<?xml version="1.0" encoding="utf-8"?>
<feed xml:lang="en" xmlns="http://www.w3.org/2005/Atom"><title>Recent posts to Byte count to degrees</title><link href="https://forge.codesys.com/forge/talk/CODESYS-V2/thread/39d48f2245/" rel="alternate"/><link href="https://forge.codesys.com/forge/talk/CODESYS-V2/thread/39d48f2245/feed.atom" rel="self"/><id>https://forge.codesys.com/forge/talk/CODESYS-V2/thread/39d48f2245/</id><updated>2020-02-27T21:32:15.486000Z</updated><subtitle>Recent posts to Byte count to degrees</subtitle><entry><title>Byte count to degrees</title><link href="https://forge.codesys.com/forge/talk/Codesys%2520V2.3/thread/39d48f2245/?limit=25#4504" rel="alternate"/><published>2020-02-27T21:32:15.486000Z</published><updated>2020-02-27T21:32:15.486000Z</updated><author><name>shooter</name><uri>https://forge.codesys.com/u/shooter/</uri></author><id>https://forge.codesys.com5575aed2c94e79146323ba2e5d5e3220eda4d8dd</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;You are receiving a value from a decoder giving you for example 11 pulses /degree&lt;br/&gt;
you have a setpoint for example 12.5 degrees&lt;br/&gt;
this is simple math giving you 137 pulses.&lt;br/&gt;
Just test if decoder &amp;gt; 137 then reached else notyet.&lt;br/&gt;
This way you do not have to do your math very fast but only when the setpoint changes.&lt;br/&gt;
and if the decoder is higher as 360*11=3600+360=3960 then subtract 3960.&lt;br/&gt;
if lower then zero add 3960 obvious.&lt;/p&gt;
&lt;p&gt;This you can also do with a multiturn but then make the limits higher.&lt;br/&gt;
be aware that the counter keeps on counting even when you subtract, so get new values and keep on getting.&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Byte count to degrees</title><link href="https://forge.codesys.com/forge/talk/Codesys%2520V2.3/thread/39d48f2245/?limit=25#6b6e" rel="alternate"/><published>2020-02-27T21:32:14.003000Z</published><updated>2020-02-27T21:32:14.003000Z</updated><author><name>martino</name><uri>https://forge.codesys.com/u/martino/</uri></author><id>https://forge.codesys.combf20de236d92af49a3b0acf142365571d371efd5</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;shooter hat geschrieben:&lt;/strong&gt;&lt;br/&gt;
why do you convert and test it.&lt;br/&gt;
just test in digital (word wise )&lt;br/&gt;
and only the display use a conversion.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;not sure what you mean by just test in digital&lt;/p&gt;
&lt;p&gt;If there is a function block to just keep the value between 0-360 degrees without converting it to radians then back to degrees, that would be perfect&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Byte count to degrees</title><link href="https://forge.codesys.com/forge/talk/Codesys%2520V2.3/thread/39d48f2245/?limit=25#b6fd" rel="alternate"/><published>2020-02-27T21:32:09.915000Z</published><updated>2020-02-27T21:32:09.915000Z</updated><author><name>shooter</name><uri>https://forge.codesys.com/u/shooter/</uri></author><id>https://forge.codesys.comfea49214ab6097bf562e55910173e83e2092e7f9</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;why do you convert and test it.&lt;br/&gt;
just test in digital (word wise )&lt;br/&gt;
and only the display use a conversion.&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Byte count to degrees</title><link href="https://forge.codesys.com/forge/talk/Codesys%2520V2.3/thread/39d48f2245/?limit=25#abc5" rel="alternate"/><published>2020-02-27T21:32:08.463000Z</published><updated>2020-02-27T21:32:08.463000Z</updated><author><name>martino</name><uri>https://forge.codesys.com/u/martino/</uri></author><id>https://forge.codesys.comff822d6a1b14cf49f3c4e1a2f052091db2d46b83</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Found a solution.&lt;br/&gt;
May not be the most efficient, but if you have any other ideas i'd like to know&lt;br/&gt;
I just converted the degrees to radians using RAD, which will correct the angle so that it is between 360, then converted back to degrees with the DEG function&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Byte count to degrees</title><link href="https://forge.codesys.com/forge/talk/Codesys%2520V2.3/thread/39d48f2245/?limit=25#4b37" rel="alternate"/><published>2020-02-27T21:32:04.405000Z</published><updated>2020-02-27T21:32:04.405000Z</updated><author><name>martino</name><uri>https://forge.codesys.com/u/martino/</uri></author><id>https://forge.codesys.com442cb2524a6abd4b60ae3d98d9b56de4244646d8</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Currently I have an encoder wired to a high-speed wago card, which counts the number of pulses (low and high bytes)&lt;/p&gt;
&lt;p&gt;currently i have the block word_of_byte which is calculating the total value of the high and low bytes that have passed. I then have it converted to degrees.&lt;/p&gt;
&lt;p&gt;The problem is that I want to limit this to stop at 0 and 360. The limit function won't work for this because sometimes it may skip over 0 and go to an extremely high degree and think that it's at it's max (360) &lt;/p&gt;
&lt;p&gt;any ideas?&lt;/p&gt;
&lt;p&gt;thanks&lt;br/&gt;
Martino&lt;/p&gt;&lt;/div&gt;</summary></entry></feed>