How to save timer's value

Anu Amne

Member
Join Date
Mar 2018
Location
Athens
Posts
4
Hello,


First of all i have an OMRON CJ1M. I want to start a timer and cut it off when i want. After that i want to start something else for the same time as the previous timer, so i have to save the timer's value somehow. Can someone help me with that?


Thanks a lot!
 
two timers ("the_first" and "the_second"):

  • the_first is and incrementing timer
  • the_first has .SV of 65536
  • the_second is decrementing timer
  • the_first and the_second have same time base (e.g. 1ms)
  • as long as the_first is running (input rung is true)
    • the_second not be running (input rung is false)
    • copy the_first.PV to the_second.SV
  • when the_first is cut off (input rung is false), the_second.SV will have the correct timing value
  • the_second is then ready to start (input rung true), and it will count down for the same time that the_first counted up until cutoff
  • need logic to ensure only one of these timer runs at any time
one timer ("the_only"):

  • same idea as two timers but use UINT instead of second timer to save duration
  • the_only.SV is set to 65536 before timing to cutoff (e.g. on a rising edge of some "timing_to_cutoff" bit)
  • Move only.PV to a UINT as long as the_only is timing until cutoff (e.g. as long as timing_to_cutoff is 0).
  • at cutoff (timing_to_cutoff falling edge)
    • reset the timer (make input rung false)
    • move that UINT into the_only.SV
  • the_only is now ready to time for the same duration it did the last time that timing_to_cutoff was 1
  • Need to keep track of state e.g.
    • bit timing_to_cutoff,
    • bit timing_to_SV
    • only_timer runs when only one of those bits is 1, and the other is 0
    • use rising edges for state changes
Caveat


This assumes OMRON programs can write to .SV on the fly.
 
Does omron have retentive timers? If so, use a retentive timer on the first one. When you start the second timer move the accumulated time into the preset for the second timer and then reset the first timer so it's ready for the next cycle.
 

Similar Topics

Hi; First of all, I am sorry that my post is not relevant with this forum. I have recently purchased Samsung cell phone. I have alreay saved...
Replies
1
Views
73
Hello! I have a datablock in a PLC witch contains about 700 variables. I must save this data once a day on a Windows PC in a XML or CSV file. Eg...
Replies
1
Views
471
Hello Folks! I have an issue and its very often but in this case i applied all the tricks and tips that i always do in similiar issues but in this...
Replies
2
Views
772
I'm a bit stuck again... See the redacted picture. At the moment, pressing F7 saves the "live" laser measurement into the boxes indicated by the...
Replies
9
Views
1,070
On my HMI-1200, I'm trying to assign the image of a floppy disk ("save" icon) to a function key. I couldn't find one in the default drop-down...
Replies
5
Views
577
Back
Top Bottom