<?xml version="1.0" encoding="utf-8"?>
<feed xml:lang="en" xmlns="http://www.w3.org/2005/Atom"><title>Recent posts to How do I convert an INT variable to a TIME variable?</title><link href="https://forge.codesys.com/forge/talk/CODESYS-V2/thread/938db06407/" rel="alternate"/><link href="https://forge.codesys.com/forge/talk/CODESYS-V2/thread/938db06407/feed.atom" rel="self"/><id>https://forge.codesys.com/forge/talk/CODESYS-V2/thread/938db06407/</id><updated>2020-02-27T21:42:41.269000Z</updated><subtitle>Recent posts to How do I convert an INT variable to a TIME variable?</subtitle><entry><title>How do I convert an INT variable to a TIME variable?</title><link href="https://forge.codesys.com/forge/talk/Codesys%2520V2.3/thread/938db06407/?limit=25#ce68" rel="alternate"/><published>2020-02-27T21:42:41.269000Z</published><updated>2020-02-27T21:42:41.269000Z</updated><author><name>Rolf-Geisler</name><uri>https://forge.codesys.com/u/rolf-geisler/</uri></author><id>https://forge.codesys.come3e29ddf0efc3ed31fe7863de33327b3f4ed9adb</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;One more hint: DINT_TO_TIME converts a double integer into the time format.&lt;br/&gt;
As in INT_TO_TIME, "100" will be converted into 100 ms. However, the DINT range is much wider. 2,147,483,647 milliseconds are equal to 596 and a half hours. Is that enough?&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>How do I convert an INT variable to a TIME variable?</title><link href="https://forge.codesys.com/forge/talk/Codesys%2520V2.3/thread/938db06407/?limit=25#41a5" rel="alternate"/><published>2020-02-27T21:42:39.781000Z</published><updated>2020-02-27T21:42:39.781000Z</updated><author><name>davidspall</name><uri>https://forge.codesys.com/u/davidspall/</uri></author><id>https://forge.codesys.comd664358d4011d6a18523101c9f22cf67ac0c6dfc</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Thanks Guys. &lt;br/&gt;
I did find a way of making the conversion via pointers just after I posted. However the INT_TO.. conversion is much neater.&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>How do I convert an INT variable to a TIME variable?</title><link href="https://forge.codesys.com/forge/talk/Codesys%2520V2.3/thread/938db06407/?limit=25#7301" rel="alternate"/><published>2020-02-27T21:42:35.497000Z</published><updated>2020-02-27T21:42:35.497000Z</updated><author><name>shooter</name><uri>https://forge.codesys.com/u/shooter/</uri></author><id>https://forge.codesys.com3180a5b93b93a01502c26959dc82cdde70de0ab2</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;or have a look at  w &lt;a class="" href="http://www.oscat.de" rel="nofollow"&gt;www.oscat.de&lt;/a&gt; w &lt;/p&gt;
&lt;p&gt;and yes i know if you do INT_TO_TIME is good.&lt;br/&gt;
keep in mind the max.&lt;br/&gt;
if needed more use a INT_TO_REAL then multiply it and make a convert to time by REAL_TO_TIME&lt;br/&gt;
dependiong of version the rounding is false. but it works&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>How do I convert an INT variable to a TIME variable?</title><link href="https://forge.codesys.com/forge/talk/Codesys%2520V2.3/thread/938db06407/?limit=25#4eff" rel="alternate"/><published>2020-02-27T21:42:34.015000Z</published><updated>2020-02-27T21:42:34.015000Z</updated><author><name>JAPIB</name><uri>https://forge.codesys.com/u/japib/</uri></author><id>https://forge.codesys.com79bb731f09462604c513ec7de702c8681265a49e</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Hello&lt;br/&gt;
There are a lot of conversion operators if you press F2.&lt;/p&gt;
&lt;h2 id="just-a-small-example-in-st"&gt;Just a small example, in ST :&lt;/h2&gt;
&lt;p&gt;VAR&lt;br/&gt;
     Val:INT;&lt;br/&gt;
     Mytime:TIME;&lt;br/&gt;
END_VAR&lt;/p&gt;
&lt;hr/&gt;
&lt;p&gt;Program :&lt;br/&gt;
MyTime:=INT_TO_TIME(Val);&lt;/p&gt;
&lt;hr/&gt;
&lt;p&gt;After running the program :&lt;br/&gt;
For Val=100 ==&amp;gt; MyTime=T#100ms&lt;br/&gt;
For Val=1000 ==&amp;gt;MyTime=T#1s 0ms&lt;/p&gt;
&lt;p&gt;Hoping to be helpful  &lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>How do I convert an INT variable to a TIME variable?</title><link href="https://forge.codesys.com/forge/talk/Codesys%2520V2.3/thread/938db06407/?limit=25#517b" rel="alternate"/><published>2020-02-27T21:42:32.535000Z</published><updated>2020-02-27T21:42:32.535000Z</updated><author><name>davidspall</name><uri>https://forge.codesys.com/u/davidspall/</uri></author><id>https://forge.codesys.comb0455f33d62c5fe9394fdedc72b5795f404a76b4</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Is there a CoDeSys function to convert an integer value to a time value? i.e. I need to set a timer interval in seconds to a specific integer value  received over CAN&lt;/p&gt;&lt;/div&gt;</summary></entry></feed>