SillyBoy Posted April 20, 2021 Report Posted April 20, 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) Quote
BobLfoot Posted April 20, 2021 Report Posted April 20, 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. Quote
photovoltaic Posted April 20, 2021 Report Posted April 20, 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 April 20, 2021 by photovoltaic Not enough coffe to comprehend Bob's post 1 Quote
SillyBoy Posted April 28, 2021 Author Report Posted April 28, 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. Quote
Sergei Troizky Posted April 30, 2021 Report Posted April 30, 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 April 30, 2021 by Sergei Troizky Quote
Sergei Troizky Posted April 30, 2021 Report Posted April 30, 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? Quote
SillyBoy Posted May 3, 2021 Author Report Posted May 3, 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. Quote
SillyBoy Posted May 13, 2021 Author Report Posted May 13, 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. Quote
Recommended Posts
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.