starting a timer when plc is powered on, RSLogix

Keen

Member
Join Date
Nov 2023
Location
Washington
Posts
2
Hi,

I am attempting to turn on an output for one second, every thirty seconds, but am having some trouble.

I have a XIC with S:1/15 (first pass) as the first condition, with the first TON timer on the other side of the rung. It counts to 30, then on the next rung a XIC DN condition triggers the next timer (a one second timer), which is followed on the next rung by a TT bit and the output I am firing. There is a branch on that timer to reset the first timer. Then going back up to rung 0 there is a branch under the XIC S:1/15 condition with a XIC DN bit for the second timer, so that once the second timer is done it starts the first timer.

Hopefully that is not too confusing. Again, essentially all I am trying to do is cylce an output for one second, every thirty seconds, while the plc (micrologix 1000) is powered on.
 
You could use the internal running clock with a masked read for the 30seconds value to turn on an output, use a separate timer to keep the output on for 1 second.
 
I don't think you need the S:1/15 as it only comes on once the first scan.


The first rung only needs and XIO of the second timers .DN bit.


Also if you want it to come on exactly every 30 seconds, then the first timer need to be 29 seconds.
 
You could use the internal running clock with a masked read for the 30seconds value to turn on an output, use a separate timer to keep the output on for 1 second.

The Micrologix 1000 doesn't have a real time clock. The free running clock doesn't have a bit that toggles at that interval. They're multiples of 128ms if I recall correctly.

JaxGTO said:
I don't think you need the S:1/15 as it only comes on once the first scan.


The first rung only needs and XIO of the second timers .DN bit.


Also if you want it to come on exactly every 30 seconds, then the first timer need to be 29 seconds.

Since you used the word exact, the logic shown will be as close as you'll get with that controller.

30 secnd intervals.png
 
Last edited:
Rung 0 should have XIO of T4:0/DN

There is no need to use 2 timers, 1 is sufficient

have it set to 31 sec, then GEQ>30sec then run output
 
The Micrologix 1000 doesn't have a real time clock. The free running clock doesn't have a bit that toggles at that interval. They're multiples of 128ms if I recall correctly.


Yes, and I found out the hard way that the free running clock is WAY faster than a SLC.


I converted a SLC program to ML that used a few bits in the free running clock to flash bits and trigger things, but as soon as I put the ML in run it was going wild.


Where S:4/6 in a SLC gives a nice flash for a warning light it flashes 20 times a second on a ML. I think I ended up going up to S:4/13 or /14 on the ML to get the same rate, and the use of S:4/10 in the SLC could not be matched at all in the ML so I had to add my own timers.
 
Canonical flashing pattern and image:
Flasher-Two-Timer-Variant.png

Characterizing timer noise (MicroLogix 1100; not entirely applicable to MicroLogix 1000):@OkiePC's solution, code golf version:
ml1kclock.png
P.S. I am aware @JaxGTO already solved OP's issue; this is only for background for anyone else who comes here.
 
Last edited:
... (if the ML1000 supports it) ...

It does: see here.

STI period is limited to 2550ms, but that is good enough:

  • Assign 100 to S:30 value (≡1000ms)
  • Increment counter each interrupt
  • Assign 1 to flash bit value on interrupt when counter is incremented to 29
  • Clear counter when it is incremented to 30.
 

Similar Topics

Rather new to structured text. I'm trying to edit a machine so that it will reinitialize with some push buttons held in for 10 seconds. Pushing...
Replies
13
Views
2,749
Hello everyone, Is it possible to stop a TON timer using the same input that you used to start the timer with? PLC used s7 1200 Software TIA v13
Replies
16
Views
6,184
The below is the code and I am not able to understand why the timer T1 is not starting?? The code is from siemens site as an example for detection...
Replies
5
Views
2,423
Hi Guys, I'm using an ABL33ER with Panelview 600. I have datalogging running on the HMI using the view studio datalog model on startup of the...
Replies
4
Views
1,142
Hello guys, I have windows 10 on virtualbox guests and not on the host. On a windows 10 guest I have TIA Selection tool V2022.06. When I...
Replies
1
Views
1,513
Back
Top Bottom