Jump to content

Reset URD-0200E counter

Recommended Posts

How can the counter be reset on a URD-0200E?

I would like to use a V700 with a URB-TCP and a URD-0200E to read a shaft encoder. I assumed I could write to the registers that contain the count and set the value to 0. Is this correct? If not, how do I reset the counter when the encoder type is 4x? If it's not possible to reset the counter, how could the encoder value be equated to zero in ladder logic?

Link to comment
Share on other sites

I'm posting what I've found here in case it is of future use to others

After much time and effort, I've found a couple solutions. Take them with a grain of salt, I'm somewhat of a novice.

First, it doesn't appear to be possible to write to the register that contains the encoder value so it can't be reset that way.

Second, this may be obvious to experienced folks, but it took me a bit to figure it out. This can be used to get a value that follows the encoder but can be reset to zero;

  • The current encoder value should be stored as a signed 32bit value. Probably an XL or an ML.
  • Create an offset value by writing one time the current encoder value to another singed operand.
  • Create a replacement encoder value in another singed operand.
  • Always subtract the offset from the current encoder value to get the replacement encoder value.

This will give you a value that always follows the encoder value but at a calculated offset. Anytime the offset is recalculated the result will be zero in the replacement encoder value. Hence a value that follows the encoder but can be reset to zero in logic. No it's not perfect, but it works pretty well.

Third, another way that the encoder value can be reset is by changing it's config. Yes this is probably far from ideal, but could be useful by quickly changing config and changing back. I didn't fully explore which configs will result in a reset value, but it was repeatable.

Good luck.



Link to comment
Share on other sites

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.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...