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 » Logging Event Timing Data
Logging Event Timing Data [message #1841011] Fri, 30 April 2021 12:27 Go to next message
Eclipse UserFriend
Hi!

I'm new to 4DIAC and currently writing my undergraduates thesis on timing analysis of event traces/chains.

I was wondering if there is a way to log tracing data of event input/outputs to the console or another output file.

My supervisor suggested that this was possible, so I wanted to ask how I could go about actually doing it.

Many thanks in advance.
Re: Logging Event Timing Data [message #1841018 is a reply to message #1841011] Fri, 30 April 2021 13:30 Go to previous messageGo to next message
Alois Zoitl is currently offline Alois ZoitlFriend
Messages: 1619
Registered: January 2014
Senior Member

Hi,

we have an CMake configuration option that allows you to activate tracing of events to the console. you can find this option in the advanced section. However this tracing is implemented rather badly as it just writes timestamps and event names to the console. I guess if you want to do more accurate analysis you may want to replace that tracing feature. For that you need to main places one is the CFunctionBlock::receiveInputEvent() and the other is CFunctionBlock::sendOutputEvent() both can be found in the file funcbloc.cpp. In both functions you can find the line FORTE_TRACE which is our tracing facility.

If you wold also like to trace sent adapter events you need the method CFunctionBlock::sendAdapterEvent().

I hope this helps.
Re: Logging Event Timing Data [message #1841033 is a reply to message #1841018] Sat, 01 May 2021 04:46 Go to previous messageGo to next message
Barry Dowdeswell is currently offline Barry DowdeswellFriend
Messages: 49
Registered: November 2018
Member
Hi Philipp,
I am working on my doctoral research using 4diac under Linux. I currently track the timing of events inside function blocks I am interested in down to millisecond resolutions

I have some simple commands to write the time of the event to the console. However, it requires you to add some C++ code to the events inside the function block.

If we you feel confident working in C++, the code is not complex. I am happy to attach some examples to this forum topic. Just send me a reply to this message.
Kind regards,
Barry

Re: Logging Event Timing Data [message #1841047 is a reply to message #1841033] Sat, 01 May 2021 19:24 Go to previous messageGo to next message
Alois Zoitl is currently offline Alois ZoitlFriend
Messages: 1619
Registered: January 2014
Senior Member

Ah Barry, brought me to a further idea that I completely missed. Since about 4diac 1.12 we offer two methods: NOW and NOW_MONOTONIC. These methods can be used in ST and deliver you the current time. These values can be used for timestamps or implementing stopwatches for measuring times.
Re: Logging Event Timing Data [message #1841048 is a reply to message #1841047] Sat, 01 May 2021 20:52 Go to previous messageGo to next message
Barry Dowdeswell is currently offline Barry DowdeswellFriend
Messages: 49
Registered: November 2018
Member
Thank you Alois,

That's great. I use a C++ function to extract the Linux epoch time like this:

auto timeStamp = duration_cast<milliseconds>(system_clock::now().time_since_epoch()).count();

Is that similar to what NOW and NOW_MONOTONIC return?

Philipp - what Alois is suggesting works directly from a Structured Text algorithm that executes when the event is fired. That means you do not need to write in C++ (unless you enjoy writing in that beautiful language as I do :) )

I wish you every success with your undergraduate thesis: please let us know if you require any further help.

Regards,
Barry,

[Updated on: Sat, 01 May 2021 20:55]

Report message to a moderator

Re: Logging Event Timing Data [message #1841061 is a reply to message #1841048] Sun, 02 May 2021 18:40 Go to previous messageGo to next message
Alois Zoitl is currently offline Alois ZoitlFriend
Messages: 1619
Registered: January 2014
Senior Member

Barry, in general something like this. However more operating system independent and a transformation to IEC 61131-3 data types so that you can use the results easier in ST.
Re: Logging Event Timing Data [message #1841089 is a reply to message #1841011] Mon, 03 May 2021 14:59 Go to previous message
Eclipse UserFriend
Thank you both for your help!

I will try the ST functions, and if I that doesn't work for me I will take a look at the funcbloc.cpp file.

Cheers
Philipp
Previous Topic:eclipse and cmake
Next Topic:Sharing example forte on stm32f7
Goto Forum:
  


Current Time: Thu Sep 26 07:37:20 GMT 2024

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

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

Back to the top