4/14/2012 5:40 PM | |
Joined: 12/22/2006 Last visit: 1/25/2022 Posts: 1742 Rating:
|
Hello, I would read the system clock each time you have a pulse. And take the diffrence. In annex an (incomplete) example explaining what I mean. To be tuned/adaptedto your problem (also initialisation of the PreviousDT must be added) The accuracy depends on the cycle time of the CPU if you just call this FB2 in OB1. For better accuracy, may be a HW interupt must be involved. AttachmentFB2.pdf (559 Downloads) |
Last edited by: jklm at: 4/14/2012 5:44 PMAccuracy Last edited by: jklm at: 4/14/2012 5:41 PMBest regards |
|
This contribution was helpful to
2 thankful Users |
4/23/2012 8:28 PM | |
Joined: 2/16/2011 Last visit: 1/13/2025 Posts: 229 Rating:
|
Thanks, I will need it too. |
Gabriel de Oliveira |
|
Follow us on