Author Topic: PulseFrequency and Counter  (Read 11114 times)

lyndon

  • Newbie
  • Posts: 10
  • I love YaBB 1G - SP1!
    • View Profile
PulseFrequency and Counter
« on: April 21, 2003, 04:07:47 PM »
On the same special input #3, can use the npn optic-sensor as a pulsefrequency (1) and trigger a counter in the plc ladder?  The counter would calculate the distance travelled and pulsefrequency to calculate the speed.

How can I simulate the pulsefrequency function similar to ADC?
« Last Edit: December 31, 1969, 04:00:00 PM by 1076562000 »

support

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3174
    • View Profile
    • Internet Programmable PLCs
Re: PulseFrequency and Counter
« Reply #1 on: April 21, 2003, 04:28:42 PM »
Counter implemented in ladder logic will not be able to handle pulses faster than a few hundred Hz and is not a practical way for measuring encoder pulses.

You will have to use another High speed counter channel for counting the pulses in order not to have any missed count. If second HSC is not available, then you have to use another PLC to count the pulses and the master PLC can obtain the data via RS485.

Unfortunately you can't simulate the pulsefrequency function.  You have to load the code into the PLC to test it.
« Last Edit: December 31, 1969, 04:00:00 PM by 1076562000 »
Email: support@triplc.com
Tel: 1-877-TRI-PLCS

Ken

  • Newbie
  • Posts: 16
    • View Profile
Re: PulseFrequency and Counter
« Reply #2 on: April 23, 2003, 07:10:33 AM »
Lyndon,

I had to accomplish the same goal in my project. ?The way that I did it was use your sensor to tell the plc how fast you are going. ?To get your distance traveled used a custom function triggered say every tenth of a second and calculate how far you have gone, ie 5 mph in one thenth of a second = whatever, don't forget to scale up so you don't loose decimal data. ?In the same custom function add that value to a DM or if larger storage is needed use an A-Z to store the value. ?If you look at the code for the asphalt distributor in applications, I think the stuff I wrote would probably work for you. ?I had to do exactly what you are talking about on two inputs. ?Hope this helps.

Ken
« Last Edit: December 31, 1969, 04:00:04 PM by -1 »

Lyndon Realubit

  • Guest
Re: PulseFrequency and Counter
« Reply #3 on: April 24, 2003, 12:17:36 AM »
Ken,

Thanks. I found that I really need two inputs and the HSC is the best way.  Though I only forsee that not more than 15 pulses/sec. which an ordinary input can handle, it is wise to you HSC Ch #2.  I can get the pulses by HSCPV[2] function similarly.  DM and A-Z variables are helpful also on the storage and calculation. And by multiplication of 100s or 1000s would not lose the decimal points.

Thanks alot.

Lyndon
« Last Edit: December 31, 1969, 04:00:00 PM by 1076562000 »