Author Topic: Pulse Counting  (Read 10251 times)

benb2000

  • Jr. Member
  • Posts: 56
  • I love YaBB 1G - SP1!
    • View Profile
Pulse Counting
« on: April 15, 2004, 11:24:37 AM »
I have a requirement to count the total number of pulses produced by an optical encoder connected to the T100MD-888+.

I have the A and B signals on Inputs 5 and 6 with HSC[2] and are using PMON 1 Input 3 to measure the frequency.

I have connected the A phase to both Input 3 and Input 4 thinking that I may be able to count the pulses through Input 4, measure the frequency through Input 3 ( PMON 1 ), but It does not work.

Is there a way of being able to count the total number of pulses created by the encoder? As it is now the variable will come back to zero when the encoder rotates in the reverse direct back to home base.

What I want to measure is the total round trip, i.e total pulses, both forward and reverse.

Any suggestions without having to disable the frequency measurement?

Your assistance is appreciated.

support

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3174
    • View Profile
    • Internet Programmable PLCs
Re:Pulse Counting
« Reply #1 on: April 16, 2004, 12:03:39 PM »
If you don't need up/down counting, then connect only phase A to input 5 and leave input 6 unconnected . That way, the HSCPV[2] become a single phase counter which counts only the pulse transition coming in on input 5. You may have an error of 1 count depending on when the direction is switched.

You can parallel input 3 and 5 so that input 3 measure the frequency while input 5 perform the count.

Alternatively, you may be able to get an average frequency without using input 3 if you can measure the elapse time between two sets of counts and take the net counts divide by the elapse time to obtain the frequency.
Email: support@triplc.com
Tel: 1-877-TRI-PLCS