Hello,
I would like to use the SPS to write data to a file every 12ms.
The test code I wrote is continuously printing $ROBOT_TIMER to a txt file.
Here is the output :
Code
22844154
22844158
22844161
22844164
22844167
22844171
22844174
22844177
22844180
22844184
22844187
22844190
22844194
Display More
We see that a value is printed every 3-4ms.
From what I understand, the SPS is called every 12ms, but it seems the loop containing the code can run several time in every cycle. (see https://www.robot-forum.com/robotforum/kuk…-sps-cycletime/)
The thing is I would like to have fewer values, or at least a regular interval between them.
I tried to put my code outside of the LOOP (in the SPS) : my code wasn't running anymore.
What would be the best option so that my code is executed only once per SPS cycle, or executed at a predefined interval ?
Thanks !