WKla Posted March 31, 2006 Report Posted March 31, 2006 Hi to all. I need to determine the amount of input-pulses in a certain time limit. For achieving this I used the SPD instruction. The problem is that the pulses are rare, a pulse on every 3 seconds and the SPD instruction can measure the speed on the interval of time of maximum 32.767 seconds (maximum 10 pulses). So the precision is less then satisfactory: 1/10 from total speed. I’m wondering if there is another way to measure the speed or the time between two pulses using interrupts or another technique. I'm using IL programing language in GX IEC Developer v 6.00 enviroment. Thanks in advance! Quote
panic mode Posted March 31, 2006 Report Posted March 31, 2006 you could try something like this: ld x0 plc m0 ; create one shot of the pulse ld m0 mov t0 d0 ; when one shot is on, copy accumulated time to register ani m0 out t0 k9999 ; when one shot is off, measure time to next pulse x0 - pulse input m0 - rising edge of the x0 input (one shot) t0 - timer (you could also use high speed timer) d0 - time between pulses all you need to do now is scale d0 to get speed. note that bigger value in d0 means lower speed. Quote
waynes Posted April 3, 2006 Report Posted April 3, 2006 An alternative method to measure time between pulses is to use the following. There is a function TTMR (Teaching Timer). It was in the FX2N and in the System Q. TTMR D0 K1 Quote
WKla Posted April 14, 2006 Author Report Posted April 14, 2006 Thank you for your answers. I've solved the problem using TTMR instruction. LDI X1 TTMR D2 K1 Thank you again. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.