Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » 4DIAC - Framework for Distributed Industrial Automation and Control » Calculate Time difference in 4diac
Calculate Time difference in 4diac [message #1815642] Mon, 07 October 2019 17:18 Go to next message
ardianto vn is currently offline ardianto vnFriend
Messages: 31
Registered: May 2019
Member
Excuse me...
I want to calculate the time difference like in the picture.

Ta = the time when the message was sent
Tb = the time when the message was received
T = Ta-Tb.

I think this can be done by recording the CNF event as the sending time and the REQ event as the receiving time. Is this measurement possible in forte 10? If so, how to do that?

Thank you very much

[Updated on: Mon, 07 October 2019 17:22]

Report message to a moderator

Re: Calculate Time difference in 4diac [message #1815645 is a reply to message #1815642] Mon, 07 October 2019 18:58 Go to previous messageGo to next message
Alois Zoitl is currently offline Alois ZoitlFriend
Messages: 1585
Registered: January 2014
Senior Member

If I understand you correctly then yes this can be done easily. With the new 1.11.0 release, which we just uploaded a few minutes ago [1] we introduced the method NOW_MONOTONIC and NOW which gives you timestamps which you can diff using the IEC 61131-3 functions. This you can use in a basic FB. E.g., the alg before CNF logs the send time and the alg triggered by REQ logs the receive time.

[1] https://www.eclipse.org/4diac/en_news.php#en_news_20191007
Re: Calculate Time difference in 4diac [message #1815646 is a reply to message #1815645] Mon, 07 October 2019 19:10 Go to previous messageGo to next message
ardianto vn is currently offline ardianto vnFriend
Messages: 31
Registered: May 2019
Member
Thank you very much for the answer...

Then, when should I use NOW_MONOTONIC and when should I use NOW?
Re: Calculate Time difference in 4diac [message #1815648 is a reply to message #1815646] Mon, 07 October 2019 19:57 Go to previous messageGo to next message
Alois Zoitl is currently offline Alois ZoitlFriend
Messages: 1585
Registered: January 2014
Senior Member

NOW is to give you the current time. This may be affect to step changes (e.g., adjusting winter/summer time).

NOW_MONOTONIC gives you a clear monotonic time. In your case I don't think it will make much difference but I think NOW_MONOTONIC may be simpler to use.
Re: Calculate Time difference in 4diac [message #1817998 is a reply to message #1815648] Wed, 04 December 2019 05:48 Go to previous message
ardianto vn is currently offline ardianto vnFriend
Messages: 31
Registered: May 2019
Member
Thank you for the answer
Previous Topic:winsock2.h error when build FORTE
Next Topic:Install mqtt paho in windows
Goto Forum:
  


Current Time: Thu Apr 25 02:04:54 GMT 2024

Powered by FUDForum. Page generated in 0.03250 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top