I can not seem to get the damn high-speed counter working on my Omron CP1L. I have read the manual several times now and can not see what I am missing!
I want to count encoder pulses using the high-speed counter input 0.
I have the encoder phase A wired into input 0.00 and am registering the pulse inputs when I turn the encoder.
I have to resort to using the built-in high-speed counter function of the CP1L because the scheduled interrupt task (2ms cycle time) I wrote to count the encoder starts to miss pulses when I turn the encoder wheel fast.
I need to be able to pick up 2000 pulse/s. I am only using 1 phase (phase A) of the encoder.
From my understanding of the high-speed counter, you need to do the following:
- Enable the high-speed counter in the PLC settings
- Select a mode (I have tried both linear and circular)
- Select a reset (I used software reset)
- Select input settings (I use increment pulse input)
Once that is done, download the settings and you should get the PV count for high-speed counter 0 at A270 & A271.
I have done all of the above and I am getting nothing at all!
I have checked that the Reset flag A531.00 and the Gate flag A531.08 are both FALSE.
I have even tried the PRV(881) instruction:
PRV(881)
#10
#0
W100
This doesn't produce any results either.
Does anyone know if I am missing something. Maybe I need to call an instruction or set some system bit?
Any help would be appreciated.
I want to count encoder pulses using the high-speed counter input 0.
I have the encoder phase A wired into input 0.00 and am registering the pulse inputs when I turn the encoder.
I have to resort to using the built-in high-speed counter function of the CP1L because the scheduled interrupt task (2ms cycle time) I wrote to count the encoder starts to miss pulses when I turn the encoder wheel fast.
I need to be able to pick up 2000 pulse/s. I am only using 1 phase (phase A) of the encoder.
From my understanding of the high-speed counter, you need to do the following:
- Enable the high-speed counter in the PLC settings
- Select a mode (I have tried both linear and circular)
- Select a reset (I used software reset)
- Select input settings (I use increment pulse input)
Once that is done, download the settings and you should get the PV count for high-speed counter 0 at A270 & A271.
I have done all of the above and I am getting nothing at all!
I have checked that the Reset flag A531.00 and the Gate flag A531.08 are both FALSE.
I have even tried the PRV(881) instruction:
PRV(881)
#10
#0
W100
This doesn't produce any results either.
Does anyone know if I am missing something. Maybe I need to call an instruction or set some system bit?
Any help would be appreciated.
Last edited: