Measuring the cycletime is done in three parts :
1. Create a pulse that switches from 1 to 0 every cycle (zb a closed contact in series with its own output) (M1 = Not M1)
2. Count 500 of these pulses (counter with preset value 500). Take care !! 500 counts give you 1000 scantimes !!!
3. Each time this counter reaches the preset value (1000) , reset a timer, and reset the counter. This timer gives you the time of 1000 scans, so if the timebase is in seconds this timer gives you the scantime in ms....Before resetting the timer, you need to copy the value of it to a memorylocation (move function) in order to keep the value visible.