|
Re: Measurement of time interval with KOP? [message #1751397 is a reply to message #1751392] |
Mon, 09 January 2017 17:14 |
|
We have a function called TIME() this function returns you the time since FORTE was started. With the following code snippet you could get your Elapsed time.
VAR
newTime : TIME;
elapsedTime: TIME;
END_VAR;
newTime := TIME();
elapsedTime := newTime - oldTime;
oldTime := newTime
Assuming that oldTime is a internal variable of your basic FB.
I hope this helps.
|
|
|
|
Re: Measurement of time interval with KOP? [message #1751815 is a reply to message #1751434] |
Sat, 14 January 2017 20:26 |
|
Currently there is no such list of functions we support. Would be a good point for a new page in our documentation.
Furthermore IEC 61499 itself does not define any functions. It hands this over to the languages that are used for algorithms. in 4diac's case this would be IEC 61131-3 Structured Text (ST). For that 4diac supports all functions defined in IEC 61131-3. In FORTE these functions are in the files core/iec61131_functions.h and core/convert_functions.h. If you don't want to dig around in the FORTE source code you can also have a look into the IEC 61131-3 directory. There the IEC 61131-3 functions and function blocks have been ported from IEC 61131-3 to IEC 61499. All FBs there prefixed with 'F_' can be used in ST algorithm with out the 'F_' prefix.
The TIME function I've mentioned above was added as prototype for an experiment when we experimented with porting some of the FBs from the open source IEC 61131-3 library OSCAT. As we found this function very helpfull we kept it. In FORTE it is implemented in the file forte_time.h
I hope this helps.
|
|
|
|
Re: Measurement of time interval with KOP? [message #1779940 is a reply to message #1779864] |
Mon, 15 January 2018 22:10 |
|
Hi,
currently TIME(), E_CYCLE, E_DELAY are using the time base configured in cmake for forte. In windows or linux based systems with the current implementation I would expact the best resolution you get is roughly in the ms range. If you want to get higher accuracy measurements you need to use system specific time units. E.g., clock_get_time and calculate the difference in c code.
|
|
|
Powered by
FUDForum. Page generated in 0.03540 seconds