<?xml version="1.0" encoding="utf-8"?>
<feed xml:lang="en" xmlns="http://www.w3.org/2005/Atom"><title>Recent posts to WORD to TIME (DWORD)</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/3ad8985f95/" rel="alternate"/><link href="https://forge.codesys.com/forge/talk/Engineering/thread/3ad8985f95/feed.atom" rel="self"/><id>https://forge.codesys.com/forge/talk/Engineering/thread/3ad8985f95/</id><updated>2020-02-27T14:02:56.878000Z</updated><subtitle>Recent posts to WORD to TIME (DWORD)</subtitle><entry><title>WORD to TIME (DWORD)</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/3ad8985f95/?limit=25#c30b" rel="alternate"/><published>2020-02-27T14:02:56.878000Z</published><updated>2020-02-27T14:02:56.878000Z</updated><author><name>Anonymous</name><uri>https://forge.codesys.com/u/*anonymous/</uri></author><id>https://forge.codesys.com1aedf7f5239c26afc3638abaf300c3ad69557dd3</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;&lt;em&gt;Originally created by:&lt;/em&gt; ph0010421&lt;/p&gt;
&lt;p&gt;Yup&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>WORD to TIME (DWORD)</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/3ad8985f95/?limit=25#e879" rel="alternate"/><published>2020-02-27T14:02:56.604000Z</published><updated>2020-02-27T14:02:56.604000Z</updated><author><name>Rob</name><uri>https://forge.codesys.com/u/rob/</uri></author><id>https://forge.codesys.com6d875896e1baa4629dcbfa6163a2a5eb151dc148</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;ph0010421 hat geschrieben:&lt;/strong&gt;&lt;br/&gt;
The TIME datatype is actually in ms, so if you multiply the minutes CV by 60000, and the hours CV by 360000 and add them together, you'll have the total ms.&lt;br/&gt;
You'll end up with some big numbers, so change from a WORD to a UDINT.&lt;br/&gt;
Add these values together, then use UDINT_TO_TIME function.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Thanks for the hint ph0010421!&lt;br/&gt;
Tomorrow I will test something like this...&lt;/p&gt;
&lt;p&gt;pFB_CurrentRunTime:= UDINT_TO_TIME ((1000&lt;em&gt;60&lt;/em&gt;WORD_TO_UDINT(FB_Minute_Pulses.CV))) + ((1000&lt;em&gt;60&lt;/em&gt;60*WORD_TO_UDINT(FB_Hour_Pulses.CV)));&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>WORD to TIME (DWORD)</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/3ad8985f95/?limit=25#f7e3" rel="alternate"/><published>2020-02-27T14:02:56.320000Z</published><updated>2020-02-27T14:02:56.320000Z</updated><author><name>Anonymous</name><uri>https://forge.codesys.com/u/*anonymous/</uri></author><id>https://forge.codesys.comc3feffda91d040fb3731e6029c09120ff2f43451</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;&lt;em&gt;Originally created by:&lt;/em&gt; ph0010421&lt;/p&gt;
&lt;p&gt;The TIME datatype is actually in ms, so if you multiply the minutes CV by 60000, and the hours CV by 360000 and add them together, you'll have the total ms.&lt;br/&gt;
You'll end up with some big numbers, so change from a WORD to a UDINT.&lt;/p&gt;
&lt;p&gt;Add these values together, then use UDINT_TO_TIME function.&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>WORD to TIME (DWORD)</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/3ad8985f95/?limit=25#4d9a" rel="alternate"/><published>2020-02-27T14:02:56.040000Z</published><updated>2020-02-27T14:02:56.040000Z</updated><author><name>Rob</name><uri>https://forge.codesys.com/u/rob/</uri></author><id>https://forge.codesys.com4fbc9a881c193af7423eabfa3b167b5d1d8fed87</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Hi there,&lt;br/&gt;
I'm struggling with a beginner-issue here...&lt;br/&gt;
I'm creating an FB to log running times of actuator devices.&lt;br/&gt;
My approach is to place instances of these FB's (PulseToTime FB) in a task to be executed on a time basis of one minute. Every input signal's pulse goes to one CTU for totalizing minutes. A second CTU totalize hours.&lt;br/&gt;
The output for this "PulseToTime" FB should return a TIME type variable for the totalized device's running time.&lt;br/&gt;
I'd like to add the .CV values (WORD types) from both CTUs (the CTU for minutes and the CTU for hours) and then convert the result to a TIME type variable showing only hours and minutes, for example, T#1h20m...&lt;br/&gt;
How can I perform this add and convert operation?&lt;/p&gt;&lt;/div&gt;</summary></entry></feed>