TBASIC instruction execute from 100 to 500 us. It is not viable to use 10KHz interrupt to create your own timer.
The digital inputs are scanned automatically at every scan of the ladder logic scan and these are typically completed within 1ms to 5ms, depending on the length of your ladder program. You can determine whether an input has changed edge (off to ON or ON to OFF) by using the bit-wise exclusive OR operator ~ to test the INPUT[n] variable against a previously read variable at every scan of the program:
e.g. ?
?DM[10] = INPUT[1] ~ DM[20]
? ? ? ? ?IF DM[10] <> 0 ? ? ?' one of the inputs has changed.
? ? ? ? ? ? ? ? ....
? ? ? ? ?ELSE ? ? ? ? ? ? ? ? ? ? ? ' nothing has changed.
? ? ? ? ? ? ? ?.....
? ? ? ? ENDIF
? ? ? ? DM[20] = INPUT[1] ?' ?store current inputs for comparison in the next scan.