Encoder project

tlvaun

Member
Join Date
May 2002
Location
Tennessee
Posts
38
Hello,
I'm sure there's something I'm missing. I have to do a encoder project on an old Mitsubishi fx-64MR plc. I have A phase to X0 and B phase to X1 and am using high speed counter c251. The counter does work, but when I try to use the CMP (compare) instruction it doesn't work as I expect it to. I have done similar projects on newer plc's with success using the inline compare fuction, but this model does not support it. Here's a simple sample of the program


m8000
---11----------------------------------------(c251 k32367)
1
1----------------------------(cmp k100 c251 m100)




For those that don't know C251 automatically counts the A and B phase from x0 and x1. Like I said that part works, the problem is regardless of the count m100, m101, or m102 never turn on. I have used the CMP function before with no difficulties, but have never used it with a high speed counter. I even tried moving the value of c251 to d10 then do my comparisons, but d10 would never read the value of c251. Any help would be greatly appreciated.
 
I've always used the DHSCS and DHSCR instructions for C251.
M8000
---1 1-----------------------[DHSCS K100 C251 M100]
 
Last edited:
I don't know about Mitsy, but in most PLC a high-speed counter will run faster than the scan time, so you would be Extremely lucky to EQUAL the count, unless there was a interrupt driven comparison, like Omron's ZCMP.

Try using a range comparison instead i.e. 100<=target value <=110
 
Mitsi Encoder

The answer is in the D! as in DHSZC or Dcmp , as the counter is a
32bit counter. when you use CMP , you're only comparing the 1st 16 bits.
 

Similar Topics

I have an application using an incremental encoder and then I convert it to degree (0-360) using calculation program. For a while, the calculation...
Replies
7
Views
224
Hi everyone, This is my first time posting, so please forgive any omissions or mistakes. I am attempting to control the velocity of a stepper...
Replies
18
Views
922
Dears, i am trying to change the series of encoder from A to B, but the program do not has this option (Rslogix5000, 20.06 the old encoder was...
Replies
2
Views
192
Hi all, I am working with an incremental encoder (ABZ signals, 360 ppr (so 1440 counts per rev)) to replace the existing "manual" encoder wheel I...
Replies
51
Views
2,353
Hi all, I am implementing an incremental encoder sensor (ABZ) to replace the existing "manual" encoder wheel I have in my device. This is a 360...
Replies
0
Views
154
Back
Top Bottom