AdamEMC Posted October 4, 2012 Report Share Posted October 4, 2012 Hi I need to read a pulsed output with my vision V130-33-TR6. The pulsed output consists of 100mS pulses and I need to measure the frequency of these pulses. Pulse frequency is between 100ms and 10s (it's the pulsed output from an electricity meter to give the number of kW directly proportional to the pulse frequency) At the minute I am connecting the pulse to a digital input and using the 1.25mS interrupt to measure the time between the rising edge of the input but the output value jumps around a bit due to the error margins i.e. measuring once every 1.25mS. To measure the time between rising edges I am simply incrementing a MI during each 1.25mS interrupt and multiplying it by 1.25 to get the time in mS. I know there are timers that count down from a preset value but is there a way of more accurately measuring the time between rising edges i.e. starting a timer that increases until I reset it. I could use a large timer a subtract the value it reaches from the preset value but this is a bit untidy and leaves room for error if the timer reaches zero before I read it and timers only read down to deciseconds. I looked at the HSC frequency measurement but I am unsure how to exactly use these. I could also average a few values but more accurate measurement in the first place would be preferred. My other small issue is how do I specify the number of decimal places a MF is displayed to on screen as I only need 2, not the full number. Thanks in advance Adam Quote Link to comment Share on other sites More sharing options...
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.