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
Nugroho AV is currently offline Nugroho AVFriend
Messages: 15
Registered: May 2019
Junior 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: 908
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
Nugroho AV is currently offline Nugroho AVFriend
Messages: 15
Registered: May 2019
Junior 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 message
Alois Zoitl is currently offline Alois ZoitlFriend
Messages: 908
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.
Previous Topic:How to report correction in the 4diac website?
Next Topic:PROJECT WITH ECLIPSE 4DIAC
Goto Forum:
  


Current Time: Thu Nov 21 10:54:50 GMT 2019

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

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

Back to the top