<?xml version="1.0" encoding="utf-8"?>
<feed xml:lang="en" xmlns="http://www.w3.org/2005/Atom"><title>Recent posts to Time Measurement between two events with V2.3 using Wago750-890</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/fb9e373903/" rel="alternate"/><link href="https://forge.codesys.com/forge/talk/Engineering/thread/fb9e373903/feed.atom" rel="self"/><id>https://forge.codesys.com/forge/talk/Engineering/thread/fb9e373903/</id><updated>2020-12-26T17:46:22.827000Z</updated><subtitle>Recent posts to Time Measurement between two events with V2.3 using Wago750-890</subtitle><entry><title>Time Measurement between two events with V2.3 using Wago750-890</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/fb9e373903/?limit=100#a3b5" rel="alternate"/><published>2020-12-26T17:46:22.827000Z</published><updated>2020-12-26T17:46:22.827000Z</updated><author><name>dFx</name><uri>https://forge.codesys.com/u/dfx/</uri></author><id>https://forge.codesys.comb63b28e9b3d69ce161749fd12eb5f0efc2525a2b</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Hum, regular way to do this is using systime library. You need to add it to your project in the library manager.&lt;br/&gt;
Then use SysTimeGetMs to get actual CPU time in milliseconds ( ! This time is UTC time, not localized).&lt;br/&gt;
Then, just substract values to get the delta time.&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Time Measurement between two events with V2.3 using Wago750-890</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/fb9e373903/?limit=25#ee12" rel="alternate"/><published>2020-12-23T08:28:42.413000Z</published><updated>2020-12-23T08:28:42.413000Z</updated><author><name>ojz0r</name><uri>https://forge.codesys.com/u/ojz0r/</uri></author><id>https://forge.codesys.com45887529f8796ebc182d14b40a81911595e3b2d1</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;If you know the scan time you can simply implement a counter in ST and count the cycles between the events.&lt;br/&gt;
Say you have a scan time of 100ms then do:&lt;br/&gt;
IF event1 THEN&lt;br/&gt;
   Count := Count + 0.1;  // Increment by 0.1s&lt;br/&gt;
END_IF;&lt;br/&gt;
IF event2 THEN&lt;br/&gt;
   Time := Count; // Set time value to Count&lt;br/&gt;
   Count := 0; // Rsset counter value for next run&lt;br/&gt;
END_IF;&lt;/p&gt;
&lt;p&gt;This is just a simple example to give you inspiration.&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Time Measurement between two events with V2.3 using Wago750-890</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/fb9e373903/?limit=25#60a8" rel="alternate"/><published>2020-12-22T12:20:24.538000Z</published><updated>2020-12-22T12:20:24.538000Z</updated><author><name>jared</name><uri>https://forge.codesys.com/u/jared/</uri></author><id>https://forge.codesys.com62a14d879a35ee7312993a76c3360d6adf551047</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Hello,&lt;br/&gt;
Excuse me I don't speak english very well. I am discovering Codesys and I am trying to measure the time between two events. My main program is in LD but I can create function blocks with ST.&lt;br/&gt;
I already saw some programs using the function SYS_TIME but Codesys doesn't recognize this function when I use it. &lt;br/&gt;
Do you have any idea that could help me ?&lt;br/&gt;
Thank you &lt;/p&gt;&lt;/div&gt;</summary></entry></feed>