<?xml version="1.0" encoding="utf-8"?>
<feed xml:lang="en" xmlns="http://www.w3.org/2005/Atom"><title>Recent posts to multiply gives negatives</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/ecaba4e2ac/" rel="alternate"/><link href="https://forge.codesys.com/forge/talk/Engineering/thread/ecaba4e2ac/feed.atom" rel="self"/><id>https://forge.codesys.com/forge/talk/Engineering/thread/ecaba4e2ac/</id><updated>2024-01-04T13:56:33.981000Z</updated><subtitle>Recent posts to multiply gives negatives</subtitle><entry><title>multiply gives negatives</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/ecaba4e2ac/?limit=50#3ed3" rel="alternate"/><published>2024-01-04T13:56:33.981000Z</published><updated>2024-01-04T13:56:33.981000Z</updated><author><name>tvm</name><uri>https://forge.codesys.com/u/tvm/</uri></author><id>https://forge.codesys.com73ef37959d35822755447790162d6ab4efaa9282</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;you might have some slight inaccuracies with using a REAL.  See here for an explanation:  &lt;a href="https://knowledge.ni.com/KnowledgeArticleDetails?id=kA00Z0000019ZSMSA2&amp;amp;l=en-US" rel="nofollow"&gt;https://knowledge.ni.com/KnowledgeArticleDetails?id=kA00Z0000019ZSMSA2&amp;amp;l=en-US&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;It might not matter, depends on how accurate you need it.  I usually stick with integer types for something like this&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>multiply gives negatives</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/ecaba4e2ac/?limit=25#aca9" rel="alternate"/><published>2024-01-04T13:29:58.818000Z</published><updated>2024-01-04T13:29:58.818000Z</updated><author><name>domoticom</name><uri>https://forge.codesys.com/u/domoticom/</uri></author><id>https://forge.codesys.comca0b51e161be00f9138082da2d7c1c7a63cb6c21</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;thnx, meanwhile I added a INT_TO_REAL, now it works.&lt;br/&gt;
Can I leave it like this or better DINT ?&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>multiply gives negatives</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/ecaba4e2ac/?limit=50#2cc3" rel="alternate"/><published>2024-01-04T13:12:15.611000Z</published><updated>2024-01-04T13:12:15.611000Z</updated><author><name>tvm</name><uri>https://forge.codesys.com/u/tvm/</uri></author><id>https://forge.codesys.comba44d80349d7f8b7da34875950f84130b59e6cbb</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;It's probably because you have an INT in the input to the MUL function, which will then try to output an INT as well.  INT variables can only handle values of -32768 to 32767.  Your value of 523000 won't fit in an INT, so it turns into an invalid number.&lt;/p&gt;
&lt;p&gt;Use a DINT.  This is usually better for working with time values anyway, because time values are all 32 bit.  Or if you can't, use INT_TO_DINT(gvlp.detectie_nalooptijd_s) in the input to the MUL function.&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>multiply gives negatives</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/ecaba4e2ac/?limit=25#8e64" rel="alternate"/><published>2024-01-04T13:00:09.121000Z</published><updated>2024-01-04T13:00:09.121000Z</updated><author><name>domoticom</name><uri>https://forge.codesys.com/u/domoticom/</uri></author><id>https://forge.codesys.comdcc367edbd053763b861cf4720c795cc3dff4858</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Attached net gives sometimes negatives, what am I doing wrong ?&lt;/p&gt;&lt;/div&gt;</summary></entry></feed>