Moran Posted October 31, 2012 Report 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
HigHTech Posted November 1, 2012 Report Posted November 1, 2012 I think you can use a HSC and use the frequency option. Then you can calculate the width.
MVP 2023 Joe Tauser Posted November 1, 2012 MVP 2023 Report 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
Moran Posted November 1, 2012 Author Report 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
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now