SillyBoy

Hold the value of High Speed Counter in CP1L-EM

8 posts in this topic

Hello There,

Hope you are safe and Healthy.

I am using Omon "CP1L-EM40DT1D" PLC controller for a cut-to-length type of application.

for the measurement of length, I am using an inbuilt high-speed counter 0.

 

Now the problem, when the status of PLC changes from Power off to Power On the high-speed counter starts from 0.

How to hold the pulse value of HSC0 at power restart ? 

 

(I am using Differential Rotary Encoder, not absolute)

Share this post


Link to post
Share on other sites

Been ages since I used Omron, so I am sure there is a better answer out there than this one. 

I would suggest that at the end of each program scan you copy the High Speed Counter value to a Holding Register.

The at the start of program scan and on the first scan only copy the Holding Register to the High Speed Counter Accumulator.

Just my quick first thought.

Share this post


Link to post
Share on other sites
1 hour ago, BobLfoot said:

Been ages since I used Omron, so I am sure there is a better answer out there than this one. 

I would suggest that at the end of each program scan you copy the High Speed Counter value to a Holding Register.

The at the start of program scan and on the first scan only copy the Holding Register to the High Speed Counter Accumulator.

Just my quick first thought.

This is how I would do it too

Edited by photovoltaic
Not enough coffe to comprehend Bob's post
1 person likes this

Share this post


Link to post
Share on other sites
On 20/04/2021 at 5:52 PM, BobLfoot said:

Been ages since I used Omron, so I am sure there is a better answer out there than this one. 

I would suggest that at the end of each program scan you copy the High Speed Counter value to a Holding Register.

The at the start of program scan and on the first scan only copy the Holding Register to the High Speed Counter Accumulator.

Just my quick first thought.

Okay, I will try it and let you know the results.

Thank You.

Share this post


Link to post
Share on other sites

The precision of such registration will be limited to the value at the end of the last scan.
Whatever count since- will be lost.
I would do this in an interrupt.

Edited by Sergei Troizky

Share this post


Link to post
Share on other sites

CP1L7Performance SpecificationsCP1L CPU Unit (EM/EL Type)
Memory backup

Flash memory: User programs, parameters (such as the PLC Setup), comment data, and the entire DM Area can be saved to flash memory as initial values.
Battery backup: The Holding Area, DM Area, and counter values (flags, PV) are backed up by a battery.
Battery service life: Service life expectancy is 5 years at 25C, less at higher temperatures. (From 0.75 to 5 years depending on model, power supply rate, and ambient temperature.)

According to the above, the counters are battery-retained.
Do you have "Clear all memory on power up" or something similar activated in the PLC settings?

Share this post


Link to post
Share on other sites
On 30/04/2021 at 1:55 AM, Sergei Troizky said:

CP1L7Performance SpecificationsCP1L CPU Unit (EM/EL Type)
Memory backup

Flash memory: User programs, parameters (such as the PLC Setup), comment data, and the entire DM Area can be saved to flash memory as initial values.
Battery backup: The Holding Area, DM Area, and counter values (flags, PV) are backed up by a battery.
Battery service life: Service life expectancy is 5 years at 25C, less at higher temperatures. (From 0.75 to 5 years depending on model, power supply rate, and ambient temperature.)

According to the above, the counters are battery-retained.
Do you have "Clear all memory on power up" or something similar activated in the PLC settings?

I will check and let you know.

Share this post


Link to post
Share on other sites

PV of High Speed Counters are not retentive for this PLC Controller.

Got this done as discribed by @BobLfoot.

 

Just move the HSC PV to the Holding Area and move back that value to the PV again at the first scan cycle using INI instruction.

 

keep it mind - Use Double Word Everywhere.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now