News:

  • May 18, 2024, 06:06:32 AM

Login with username, password and session length

Author Topic: D0-06, CTRIO-2 and Capture of Quad Counter  (Read 5310 times)

Mike Nash

  • Hero Member
  • *****
  • Posts: 636
D0-06, CTRIO-2 and Capture of Quad Counter
« on: July 11, 2016, 10:26:07 PM »
I need to capture a quadrature encoder count at a repeat rate of around 1 second. I expect to be seeing a max of 25kHz with a 4x input on a repetitive material feed.

When the feed pauses, I will get a capture input. My need is to capture the accumulating position at each pause (which could be slightly more than a 1 Hz rate.) The D0-06 PLC needs to grab this captured count and do the subtraction of the previous capture and store the incremental move distance in a memory location via incrementing pointer.

An HMI will be used to access and display this collection of feed distances for the purpose of detecting any variances in the feed lengths. Does anyone see anything here to be concerned with as far as collecting the count and doing the limited math? There will not be a lot else going on in the PLC as this is it's sole function.

Greg

  • HostTech
  • Host Moderator
  • Hero Member
  • *****
  • Posts: 685
  • Hmmm...
    • Host Engineering, Inc.
Re: D0-06, CTRIO-2 and Capture of Quad Counter
« Reply #1 on: July 12, 2016, 03:34:17 PM »
Mike Nash, I don't see a problem with this. You realize that you have to re-enable the capture each time, yes? You set the EnableCapture bit and then the CTRIO will detect the "capture input." When it does, it will set the CaptureComplete bit and set the CapturedValue = CurrentCount. As soon as you see the CaptureComplete bit you will have to reset the EnableCapture bit back OFF and then ON to get ready for the next capture.
There are two types of people in the world; those that can extrapolate from incomplete data sets.

Mike Nash

  • Hero Member
  • *****
  • Posts: 636
Re: D0-06, CTRIO-2 and Capture of Quad Counter
« Reply #2 on: July 12, 2016, 04:03:24 PM »
Thanks Greg!

And no, I had not caught the need to re-enable (even though I have probably done it before.) I will most likely wish I had the Do-more's ease and speed, but I should be OK with the D0-06 if I don't get crazy with processor loading.

BobO

  • Host Moderator
  • Hero Member
  • *****
  • Posts: 5996
  • Yes Pinky, Do-more will control the world!
Re: D0-06, CTRIO-2 and Capture of Quad Counter
« Reply #3 on: July 12, 2016, 04:16:33 PM »
Thanks Greg!

And no, I had not caught the need to re-enable (even though I have probably done it before.) I will most likely wish I had the Do-more's ease and speed, but I should be OK with the D0-06 if I don't get crazy with processor loading.

This would be stupid easy with the new hardware...and all built in...no module required. In fact, I could come up with several ways to do it...not even sure which great way is the best way.  ;D
"It has recently come to our attention that users spend 95% of their time using 5% of the available features. That might be relevant." -BobO

Mike Nash

  • Hero Member
  • *****
  • Posts: 636
Re: D0-06, CTRIO-2 and Capture of Quad Counter
« Reply #4 on: July 12, 2016, 08:26:01 PM »
This would be stupid easy with the new hardware...and all built in...no module required. In fact, I could come up with several ways to do it...not even sure which great way is the best way.  ;D

Well sure, but I have a bird in hand and only a vague idea of when those bush birds are going to be available.

The capture is really simple, even in the DL-06. It's the filling a large table with those captured values and making them available 30 at a time on the HMI that is fraught with hexa-octal horrors.

BobO

  • Host Moderator
  • Hero Member
  • *****
  • Posts: 5996
  • Yes Pinky, Do-more will control the world!
Re: D0-06, CTRIO-2 and Capture of Quad Counter
« Reply #5 on: July 12, 2016, 08:29:54 PM »
I was absolutely not trying to steer you to it, just celebrating that yet again we see am example of an app that would be a slam dunk with it.
"It has recently come to our attention that users spend 95% of their time using 5% of the available features. That might be relevant." -BobO