Posted 20 Apr 2021 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
Posted 20 Apr 2021 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
Posted 20 Apr 2021 (edited) 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 20 Apr 2021 by photovoltaic Not enough coffe to comprehend Bob's post 1 person likes this Share this post Link to post Share on other sites
Posted 28 Apr 2021 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
Posted 30 Apr 2021 (edited) 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 30 Apr 2021 by Sergei Troizky Share this post Link to post Share on other sites
Posted 30 Apr 2021 CP1L7Performance Specifications●CP1L CPU Unit (EM/EL Type) Memory backupFlash 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
Posted 3 May 2021 On 30/04/2021 at 1:55 AM, Sergei Troizky said: CP1L7Performance Specifications●CP1L CPU Unit (EM/EL Type) Memory backupFlash 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
Posted 13 May 2021 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