Moran Posted October 31, 2012 Report Share Posted October 31, 2012 hellow, i need to measure the width of 1 squre pulse . this pulse is 50ms and about 20V amplitude ( which i have to measure ). i am using V570 and V200, i thought using the V200 digital input and start timer , and when the pulse is at low state stop the timer. can i do that? how? if someone has a better idea i will be happy to hear. thanks, Moran Quote Link to comment Share on other sites More sharing options...
HigHTech Posted November 1, 2012 Report Share Posted November 1, 2012 I think you can use a HSC and use the frequency option. Then you can calculate the width. Quote Link to comment Share on other sites More sharing options...
MVP 2022 Joe Tauser Posted November 1, 2012 MVP 2022 Report Share Posted November 1, 2012 If it's only one pulse you won't be able to measure the frequency - the HSC input averages the pulse counts over a period settable from 100 ms to 1s. As soon as your pulse is gone the frequency register will reset itself back to zero. A timer won't work well for this; the best resolution you can get is +/- 10 ms plus the scan time which is typically 3 -10 milliseconds (depending on your program size). Read the Help on the 1.25 ms interrupt routine and set it up to to use an immediate input to increment a counter as long as the pulse is high. The routine solves every 1.25 ms, so you move the count value to another MI when the input goes low. Then it's a matter of multiplying this count by 1.25 to get the pulse width in milliseconds. Joe T. 1 Quote Link to comment Share on other sites More sharing options...
Moran Posted November 1, 2012 Author Report Share Posted November 1, 2012 hi, thanks for ypur reply, i did use the interrupt routine, the 2.5ms routine and it is working, i am incrementing a counter and multiplying by 2.5. thank you.. Moran Quote Link to comment Share on other sites More sharing options...
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.