Sample30: Timing Measurement
This article describes how to implement a TC3 C++ module which contains time measurement functionalities.
Download
Here you can access the source code for this sample.
- 1. Unpack the downloaded ZIP file.
- 2. Using a Visual Studio with TwinCAT installed, open the project via Open Project ....
- 3. Configure signing for this project by switching on TwinCAT signing with a right-click on Project->Properties->Tc Sign and configure your certificate and password if necessary.
For more information on signing C++ projects, click here. - 4. Select your target system.
- 5. Build the sample (e.g. Build->Build Solution).
- 6. Activate the configuration by clicking on .
- The sample is ready for operation.
Description
This sample exclusively deals with time measurement such as
- Querying the task cycle time in nanoseconds
- Querying the task priority
- Querying the time when the task cycle starts at intervals of 100 nanoseconds since January 1, 1601 (UTC)
- Querying the distributed clock time when the task cycle starts in nanoseconds since January 1, 2000
- Querying the time when the method is called at intervals of 100 nanoseconds since January 1, 1601 (UTC)