<?xml version="1.0" encoding="utf-8"?>
<feed xml:lang="en" xmlns="http://www.w3.org/2005/Atom"><title>Recent posts to LIN_TRAFO Scaling function</title><link href="https://forge.codesys.com/forge/talk/CODESYS-V2/thread/09afdf5848/" rel="alternate"/><link href="https://forge.codesys.com/forge/talk/CODESYS-V2/thread/09afdf5848/feed.atom" rel="self"/><id>https://forge.codesys.com/forge/talk/CODESYS-V2/thread/09afdf5848/</id><updated>2020-02-27T22:03:05.799000Z</updated><subtitle>Recent posts to LIN_TRAFO Scaling function</subtitle><entry><title>LIN_TRAFO Scaling function</title><link href="https://forge.codesys.com/forge/talk/Codesys%2520V2.3/thread/09afdf5848/?limit=25#ff67" rel="alternate"/><published>2020-02-27T22:03:05.799000Z</published><updated>2020-02-27T22:03:05.799000Z</updated><author><name>shooter</name><uri>https://forge.codesys.com/u/shooter/</uri></author><id>https://forge.codesys.com439c4cb9ad6fc43fe060efac52be8e9e6ddbfd0c</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;this answer is wrong&lt;/p&gt;
&lt;p&gt;the bits are in different place.&lt;/p&gt;
&lt;p&gt;check your analog card for this, mine begin at 7 (bits are shifted) and stop at 4095-7.&lt;/p&gt;
&lt;p&gt;to scale use simple math like y=a+bx&lt;/p&gt;
&lt;p&gt;b = 250/ 4081 &lt;/p&gt;
&lt;p&gt;and a=0 for a normal 4/20 mA card.&lt;/p&gt;
&lt;p&gt;stay as long as possible in INTeger for speed calcs.&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>LIN_TRAFO Scaling function</title><link href="https://forge.codesys.com/forge/talk/Codesys%2520V2.3/thread/09afdf5848/?limit=25#d364" rel="alternate"/><published>2020-02-27T22:03:01.422000Z</published><updated>2020-02-27T22:03:01.422000Z</updated><author><name>timvh</name><uri>https://forge.codesys.com/u/timvh/</uri></author><id>https://forge.codesys.comf71f3357cd015d23a762e05bc6739a70b4dbf532</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;In ST you could do it like this:&lt;/p&gt;
&lt;p&gt;Pressure := analogValue * 250 / 4095;&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>LIN_TRAFO Scaling function</title><link href="https://forge.codesys.com/forge/talk/Codesys%2520V2.3/thread/09afdf5848/?limit=25#0441" rel="alternate"/><published>2020-02-27T22:02:59.891000Z</published><updated>2020-02-27T22:02:59.891000Z</updated><author><name>Shohadawy</name><uri>https://forge.codesys.com/u/shohadawy/</uri></author><id>https://forge.codesys.com7df68ffc55d368e9dc19846bd12e6b8413bfee07</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;I'm using a pressure sensor that outputs 4-20mA related to a pressure of 0-250 bar. There is an example for a sensor in the manual which states that I should put the sensor range "4-20 mA" in the IN_MIN and IN_MAX respectively.I tried this but I got great errors in the reading&lt;/p&gt;
&lt;p&gt;The resolution of the A/D of the DUO PLC is 12 bits, shall I put 0 in the IN_MIN and 4095 in the IN_MAX&lt;/p&gt;
&lt;p&gt;Waiting for your reply.&lt;/p&gt;&lt;/div&gt;</summary></entry></feed>