Determine RPM or rate using Quadrature Counter

I am just getting started with Opto Control and need a little nudge.

I want to use the quad counter to determine rate(RPM ETC) as will as total counts that will be converted to engineering units for length.

The documentation is not clear on how to do that. Do I “get counter” and compare to a previous one at a predetermined time interval for rate?

What exactly does the output of the IDC5 Q? frequency or counts?

Hi rmdavies101,

Welcome to the forums! You’re right, form 1784 does not address quad counters. However, form 1823 does. There’s a little on them in [URL=“http://www.opto22.com/documents/1465_OptoMMP_Protocol_Guide.pdf”]1465 as well.

But to answer your question, for a simple quad counter, you would just use these commands in PAC Control (should be very similar in OptoControl).

Clear Counter
Get & Clear Counter
Get Counter
Start Counter
Stop Counter

I hope that helps!
-OptoMary

Ok OptoMary, thanks for the reply. I had read those before and I was looking for more clearity and examples.

Does the IDC5 Q simply store counts? Or do I need to store the counts someother way?

From what I can tell the total is read by the “Get Counter” which would be the total since the last “clear counter”. Is this right? If for example if I wanted my rate (RPM) I would compare the change in counts over a specific time slice and then adjust for PPR. This is a coating applications were rate is a process variable. I also want total length coated which would be zeroed as each spool is complete (variable lenght package)

Would it be better to do this in an Optoscript or would this be a good candidate for a subrutine?

Bob

Hi Bob,
Yes, generally the counter is the total since the last “Clear Counter” command was sent.
As far as OptoScript vs. a Subroutine, why not both? (A subroutine with mostly OptoScript?) Actually, I usually start by writing some OptoScript code, then turn it into a subroutine later if I find that I want to use it in multiple places.
-OptoMary